how to get smooth edge of this image, and how to solve the problem of over segmentation
Show older comments
Hi friends,
i want to separate touching kernels.i have used watershed segmentation for this purpose. But watershed results in over segmentation.Also, border is not smooth.Can anyone help me to solve this problem
% grains = rgb2gray(img);
grainsBW = im2bw(grains,110/255);
G=grainsBW;
revim = imcomplement(grainsBW);
figure,imshow(revim,[])
D = bwdist(revim);
D2 = imcomplement(D);<<http://imageshack.us/photo/my-images/209/jcki.jpg/>>
figure,imshow(D2,[])
% Suppress shallow minima
D3 = imhmin(D2,1);
L = watershed(D3);
grainsBW(L == 0) = 0;
figure,imshow(grainsBW);
mark = imerode(G,se); mark1=im2bw(mark); %%%%%%%%%%% marker se = strel('disk',70); %%%% 30 figure, imshow(mark1); x= grainsBW|mark1; %%%%%%%%%% marker and watershed output figure,imshow(x);%%%%%%%%%%%%%%%%%%%% can stop here n do some alteration &&&& THIS IS SAME AS RESULT 1.f title('watershed output or with marker');
e=edge(x,'sobel'); figure,imshow(e); I4 = bwmorph(e,'spur'); figure,imshow(I4);
Answers (0)
Categories
Find more on Genomics and Next Generation Sequencing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!