Commit 0caec66d authored by actb's avatar actb

threshold changes for phase

parent 9556d93b
function bw=segReduce(bw,bwLog,min_area_pixels,min_radius_pixels) function bw=segReduce(bw,bwLog,segParams,min_area_pixels,min_radius_pixels)
[origL,num]=bwlabeln(bw); [origL,num]=bwlabeln(bw);
......
...@@ -36,18 +36,16 @@ if segParams.isPhase ...@@ -36,18 +36,16 @@ if segParams.isPhase
if segParams.isPhase>0 if segParams.isPhase>0
bw=imcomplement(bw); bw=imcomplement(bw);
end end
bw=imopen(bw,se);
bw=imclose(bw,se2); bw=imclose(bw,se2);
bw=imfill(bw,'holes');
bw=imopen(bw,se2);
if true==segParams.wellRadius if true==segParams.wellRadius
bwMask=imbinarize(medianMask,adaptthresh(medianMask,'statistic','gaussian')); bwMask=imbinarize(medianMask,adaptthresh(medianMask,'statistic','gaussian'));
bwMask=imdilate(bwMask,se2); seMask=strel('disk',ceil(2*min_radius_pixels));
bwMask=imdilate(bwMask,seMask);
bw=bw&~bwMask; bw=bw&~bwMask;
bwLog=bwLog&~bwMask; bwLog=bwLog&~bwMask;
end end
bw=imfill(bw,'holes');
else else
% use 2x the default nhood size % use 2x the default nhood size
T=adaptthresh(im,0.5,'NeighborhoodSize',4*floor(size(im)/16)+1,'statistic','gaussian'); T=adaptthresh(im,0.5,'NeighborhoodSize',4*floor(size(im)/16)+1,'statistic','gaussian');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment