MATLAB: How to “size-normalize” objects in a binary image? (e.g. make sizes of all non-zero objects to be the same)

binaryimage processingImage Processing ToolboxMATLAB

Dear Community,
I have a binary image (attached in .jpg and .fig) with circles, pixel values inside circles =1 and outside =0. These circles look very similar, although they differ in size a little bit. For instance, the difference between two random circles in diameter can be about approx. 10 pixels. Is there a way to make all these circles to become of EXACTLY the same size? Size itself is not important btw, it can range from biggest possible (before circles start to overlap) to 1 pixel. Also a more general answer on how to make objects (not only circles) in a binary image equally sized will satisfy my needs.
I will appreciate any sugestions.
Thank you,

Best Answer

  • Not if x and y can be anything (floating point) since you will have quantization error.
    If you want to specify that the center or upper left corner is exactly on an integer coordinate, you can.
    Just see the FAQ.