How can i make sure that using imfindcircles will result in non-overlap circles?

8 views (last 30 days)
Hi, Im trying to calculate an irregular shape area. However the pattern is not perfect circle from a converted BW image. shape to be calculated is the white area using regionprops. Im using imfindcircle to find the possible circle and use the radius given to calculate the approximate area. however, for certain irregular patterns there will be few circles detected and they are overlapping each other. Is there any way to make sure the circles detected are not overlapping so that i can use them all (within the boundary) to approximate the area?

Answers (2)

yonatan gerufi
yonatan gerufi on 24 Aug 2014
Hi Asnida, Use "Circles overlap remover" function (see on file exchange here )
I also recommend reading this example
good luck!

Image Analyst
Image Analyst on 24 Aug 2014
You can go through the circles and remove one (you decide which one) if any two centers are closer to each other than the sum of their radii. Of course that leaves one or two blobs that do not have the proper area. You might look into watershed to separate them without removing either one. http://blogs.mathworks.com/steve/2013/11/19/watershed-transform-question-from-tech-support/
  3 Comments
Erik Schiferle
Erik Schiferle on 6 Jan 2022
Edited: Erik Schiferle on 6 Jan 2022
Very nice idea!
Do you have any suggestions for bounding box?
Basically, I'm binerizing images, using regionprops to get the long and short axis lengths, then storing those values in 2 different vectors to be plotted in a historgram.
However, as you can see in the attached picture, there are bounding boxes inside of bigger boxes... I can't figure out how to exclude the small within big ones. Also, I'm not sure if I want to totally exclude the minor overlap cases...
I will likely also try your solution above tomorrow too.
Thanks!
Image Analyst
Image Analyst on 6 Jan 2022
You can make a list of the (x,y) coordinates of all the box corners for all blobs. Then loop over them all finding out which one is inside another one using the inpolygon() function. Then compare the areas of the two and delete the smaller one.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!