I have been trying to identify the centroids or positions of the small yellow dots (not the large regions) in the image below. I have adopted the following strategy (please see the code), however, i wonder if the results can be improved. In my attempt, I could not identify all spots and rather some extraneous spots are also selected. Thanks !
The original picture:
The picture with the centroids of the spots highlighted, is as follows:
The code can be found below:
segmented = ColorSeparate[img][[2]] // MorphologicalPerimeter[#, 0.2] & // MorphologicalComponents //
SelectComponents[#, {"Count", "AdjacentBorderCount","Holes"}, #1 < 50 && #2 == 0 && #3 >= 0 &] &
// Colorize
centroids = ComponentMeasurements[segmented, "Centroid"];
HighlightImage[img, ListPlot[centroids // Values]]
Also do you recommend the use of Binarize[img]
in the very beginning?