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

2 ビュー (過去 30 日間)
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,
Vasilii
  5 件のコメント
Vasya Mika
Vasya Mika 2020 年 4 月 22 日
If I'd ask something like: "How can I count all stars in universe in MATLAB?" and get an answer "You cannot", would it be worth staying?..
Regarding your approach: is there a way to centroid every object without cropping these objects from the image first?
Vasya Mika
Vasya Mika 2020 年 4 月 22 日
UPD: Sorry, Image Analyst have just answered that, thanks!

サインインしてコメントする。

採用された回答

Image Analyst
Image Analyst 2020 年 4 月 4 日
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.
  3 件のコメント
Image Analyst
Image Analyst 2020 年 4 月 22 日
If you want, you can use regionprops() to identfy the centroids of the existing circles. Then round them to the nearest integer. Next create a new, blank image and paste onto it a small template of the desired circle shape. I'm attaching a copy and paste demo.
Vasya Mika
Vasya Mika 2020 年 4 月 22 日
Thank you for this nice solution!

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by