Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
leverjs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenSource
leverjs
Commits
c82440fa
Commit
c82440fa
authored
Apr 27, 2020
by
actb
Browse files
Options
Downloads
Patches
Plain Diff
reworked thresholdImages
parent
6d9ba833
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
matlab/+Segment/thresholdImages.m
+41
-32
41 additions, 32 deletions
matlab/+Segment/thresholdImages.m
prebuilt/matlabPollDB.exe
+2
-2
2 additions, 2 deletions
prebuilt/matlabPollDB.exe
with
43 additions
and
34 deletions
matlab/+Segment/thresholdImages.m
+
41
−
32
View file @
c82440fa
...
@@ -12,7 +12,6 @@ else
...
@@ -12,7 +12,6 @@ else
end
end
if
is3D
(
im
)
if
is3D
(
im
)
nsz
=
2
*
floor
(
size
(
im
)/
16
)
+
1
;
nsz
=
2
*
floor
(
size
(
im
)/
16
)
+
1
;
T
=
adaptthresh
(
imLog
,
0.5
,
'NeighborhoodSize'
,
nsz
,
'statistic'
,
'gaussian'
);
T
=
adaptthresh
(
imLog
,
0.5
,
'NeighborhoodSize'
,
nsz
,
'statistic'
,
'gaussian'
);
bwLog
=
imbinarize
(
imLog
,
T
);
bwLog
=
imbinarize
(
imLog
,
T
);
...
@@ -32,6 +31,19 @@ bwLog=imbinarize(imLog,T);
...
@@ -32,6 +31,19 @@ bwLog=imbinarize(imLog,T);
bwLog
=
bwareaopen
(
bwLog
,
4
*
min_area_pixels
);
bwLog
=
bwareaopen
(
bwLog
,
4
*
min_area_pixels
);
if
segParams
.
isPhase
if
segParams
.
isPhase
[
bw
,
bwLog
]
=
phaseThreshold
(
im
,
bwLog
,
min_radius_pixels
,
segParams
,
...
sensitivity
,
medianMask
);
return
;
else
% use 2x the default nhood size
T
=
adaptthresh
(
im
,
sensitivity
,
'NeighborhoodSize'
,
4
*
floor
(
size
(
im
)/
16
)
+
1
,
'statistic'
,
'gaussian'
);
bw
=
imbinarize
(
im
,
T
);
end
bw
=
bwareaopen
(
bw
,
min_area_pixels
);
4
;
function
[
bw
,
bwLog
]
=
phaseThreshold
(
im
,
bwLog
,
min_radius_pixels
,
segParams
,
...
sensitivity
,
medianMask
)
se
=
strel
(
'disk'
,
1
);
se
=
strel
(
'disk'
,
1
);
se2
=
strel
(
'disk'
,
ceil
(
min_radius_pixels
/
2
));
se2
=
strel
(
'disk'
,
ceil
(
min_radius_pixels
/
2
));
if
segParams
.
isPhase
>
0
if
segParams
.
isPhase
>
0
...
@@ -46,6 +58,11 @@ if segParams.isPhase
...
@@ -46,6 +58,11 @@ if segParams.isPhase
bw
=
imclose
(
bw
,
se2
);
bw
=
imclose
(
bw
,
se2
);
bw
=
imfill
(
bw
,
'holes'
);
bw
=
imfill
(
bw
,
'holes'
);
if
true
==
segParams
.
wellRadius
if
true
==
segParams
.
wellRadius
[
bw
,
bwLog
]
=
thesholdMask
(
medianMask
,
bw
,
bwLog
,
se
,
se2
);
end
function
[
bw
,
bwLog
]
=
thesholdMask
(
medianMask
,
bw
,
bwLog
,
se
,
se2
)
bwMask
=
imbinarize
(
medianMask
,
adaptthresh
(
medianMask
,
'statistic'
,
'gaussian'
));
bwMask
=
imbinarize
(
medianMask
,
adaptthresh
(
medianMask
,
'statistic'
,
'gaussian'
));
bw
=
bw
&~
bwMask
;
bw
=
bw
&~
bwMask
;
bwh
=
imfill
(
bw
,
'holes'
);
bwh
=
imfill
(
bw
,
'holes'
);
...
@@ -61,15 +78,7 @@ if segParams.isPhase
...
@@ -61,15 +78,7 @@ if segParams.isPhase
bw
=
imopen
(
bw
,
se
);
bw
=
imopen
(
bw
,
se
);
bwLog
=
bwLog
&~
bwMask
;
bwLog
=
bwLog
&~
bwMask
;
bwLog
=
imclose
(
bwLog
,
se2
);
bwLog
=
imclose
(
bwLog
,
se2
);
end
bw
=
imfill
(
bw
,
'holes'
);
else
% use 2x the default nhood size
T
=
adaptthresh
(
im
,
sensitivity
,
'NeighborhoodSize'
,
4
*
floor
(
size
(
im
)/
16
)
+
1
,
'statistic'
,
'gaussian'
);
bw
=
imbinarize
(
im
,
T
);
end
bw
=
bwareaopen
(
bw
,
min_area_pixels
);
4
;
This diff is collapsed.
Click to expand it.
prebuilt/matlabPollDB.exe
LFS
+
2
−
2
View file @
c82440fa
No preview for this file type
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment