Flora,
you are not posting the full code, but only an image of only part of the code. One problem seems to be that you are trying to detect the spots using ColorsNear[Black]
- but having a black background.
Here comes another approach - basically as an one-liner:
img0 = Import["https://community.wolfram.com/c/message_boards/get_message_attachment?messageId=3396992&attachment=Screen+Shot+2025-02-19+at+6.40.56+PM.png"]
HighlightImage[img0, ComponentMeasurements[Binarize[ColorDetect[img0, ColorsNear[RGBColor[.2, .25, .25]]], .6], Centroid", 10 < #Count < 2000 &]]