Fitting a circle of known radius to a binary image

4 visualizaciones (últimos 30 días)
Paolo Olson
Paolo Olson el 15 de Mzo. de 2020
Comentada: Paolo Olson el 15 de Mzo. de 2020
I have some binary images to which I would like fit the largest possible circle.
The method I am currently thinking of using is finding the maximum radius using regionprops and fitting that max radius circle to the boundary pixels of the blobs (bwboundaries) (see picture below). I cannot use Hough as the circle all have different radius and often leads to a very noisy output. I have also tried using a least squares algorithm with no radial constraint, but the radius outputted is often to small.
Could someone help me implement something like this, but for matlab, point me to a suitable algorithm or give any better suggestions?
Many thanks :)

Respuesta aceptada

Image Analyst
Image Analyst el 15 de Mzo. de 2020
You can simply measure all the areas and equivalent circular diameters and you're pretty much done.
props = regionprops(mask, 'Area', 'EquivDiameter');
allAreas = [props.Area]
allDiameters = [props.EquivDiameter]
[largestArea, indexOfLargestArea] = max(allAreas)
largestDiameter = allDiameters(indexOfLargestArea)
The equivalent circular diameter is the diameter your blob would have as if all the pixels were rearranged into a perfectly circular shapte.
  4 comentarios
Image Analyst
Image Analyst el 15 de Mzo. de 2020
You might want to look at this:
Pass all the points from your blob into that function to get the outermost circle that will contain everything. But what if you have just some irregularly shaped blob, not like a perfect hemicircle or full circle? What if is just looks like an amorphous blob or splat? What outline would you want to use? Why not use the fitted circle? Or the convex hull? Do you know for a fact that your original objects are circles that have had a chord clipped off of them?
Paolo Olson
Paolo Olson el 15 de Mzo. de 2020
Thats exactly what I was looking for thank you so much :).
For anyone else this is the function i ended up using:

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Image Segmentation and Analysis en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by