Counting the individual objects in binary image without built-in functions
Show older comments
I have preprocessed an image to obtain following binary image of overlapping stem cells. How do I count the individual cells on the image WITHOUT using built-in functions but only morphological algorithms?

I tried watershed transform but got weird outputs and still can't figure out the "counting the cells" part.
Here is what I tried:
binary = imread("1A_Binary_Image.png")
% distance transform
D = bwdist(~binary);
imshow(D,[])
title('distance transform')
% complement of distance transform
D = -D;
% watershed transform
L = watershed(D);
L(~binary) = 0;
rgb = label2rgb(L,'jet',[.5 .5 .5]);
imshow(rgb)
title('Watershed Transform')
1 Comment
Dyuman Joshi
on 22 Sep 2023
You don't want to use builtin functions but you have used toolbox functions?
Accepted Answer
More Answers (0)
Categories
Find more on Image Segmentation 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!