Is someone experienced with Application Nr. 3 shown in the ComponentMeasurements documentation: "Select complete and non-overlapping cells"?
That's the code (you can find the picture "i" in the documentation):
b = Binarize[i, {0, .7}]
cells = ComponentMeasurements[
b, {"Centroid",
"EquivalentDiskRadius"}, #AdjacentBorderCount == 0 &&
50 < #Area < 1200 &]
HighlightImage[i, Circle @@@ cells[[All, 2]]]
I want to use this code to find round objects in a picture, but it has not been working that well in some cases. I am attaching an example:
i
in your case. $\endgroup$b = GeodesicClosing[Binarize[i, {0, .8}], 30]; cells = ComponentMeasurements[b, {"Centroid", "EquivalentDiskRadius"}]
It correctly identifies the non-overlapping circles (but it also finds the overlapping clusters). $\endgroup$