I had an image, in which I was asked to count the number of circles. I was able to reduce it down to this image:
Now I can use the number of connected components to get the answer. That's okay. But is it possible to do this using only morphological operations? (like somehow getting the "center" of these "circles" and then simply counting the pixels)
There's an operation called thinning, which iteratively erodes the image but retains a specific set of points (it's a conditional erosion). Depending on the set of structuring elements used in the conditional erosion, the operation can reduce objects to a single point (or a circle for objects with a hole in them). You could apply with a thinning and then count pixels.
As Alex Alex mentioned in a comment, in MATLAB bwmorph(Image, 'shrink', Inf)
performs this operation.