Image Segmentation - Watershed Algorithm
47 views (last 30 days)
Show older comments
Rebecca Schley
on 11 Apr 2021
Edited: Rebecca Schley
on 11 Apr 2021
I have followed the very helpful instructions on Steve Eddin's blog post concerning image segmentation of cells using the watershed algorithm. I have one piece to fine tune in my own image that I am working on. There are small sections in the cluster of cells in the top right corner where the algorithm produces segments for what should be the background. Can anyone suggest any strategies for resolving this? I am providing my code, the input image and my annotated output image showing the sections I would like to relegate to the background region.
Input image (b&w), output image (rgb); arrows point to sections I am trying to address.:
function A = getArea(I)
level = graythresh(I);
bw = imbinarize(I,level);
bw3 = imopen(bw,ones(5,5));
bw4 = bwareaopen(bw3,40);
mask_em = imextendedmax(I,30);
I_c = imcomplement(I);
I_mod = imimposemin(I_c, ~bw4 | mask_em);
L = watershed(I_mod);
imshow(label2rgb(L));
end
0 Comments
Accepted Answer
Image Analyst
on 11 Apr 2021
You could either filter them out by shape or area, or you could check the range (max - min) and get rid of any blobs that do not have the wide enough gray scale range, meaning that the blob has no dark and white regions inside it.
0 Comments
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!