Converting blobs to circles

I have this binary image with some blobs of random sizes.

I would like to convert the blobs into circles of uniform diameter. it doesn't really matter what diameter but they need to be circles and uniform. Here is what I am looking for.

I am working with tiff sequences in ImageJ. I tried erosion and dilation. I tried Ultimate point to reduce to a point and then dilate up but that creates a square. I tried distance map but didn't get very far. Although i am pretty sure distance map is the way to go. None of my current approaches are satisfactory.

If I could do

   #pseudo-code
if area(blob) > x
then make circle(diameter=y)
else remove blob


would be even better.

If anyone has a solution using ImageJ or Python SciPy or even R, please let me know. I would very much appreciate that. Thanks.

• Simply draw a circle at the center of mass of each Contour! – Balaji R Oct 6 '15 at 12:17

Here is the procedure to follow:

2. Obtain connected components - each distinct blob in the image gives you a component.
3. For each component, find the boundary pixels. Each boundary is represented as a set of points.
4. Fit one circle per each boundary point set. You could use a simple least squares fitting.

This should give you pretty good circles. You could do this in many languages, using the standard image processing libraries.