Fitting a circle of known radius to a binary image
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Paolo Olson
il 15 Mar 2020
Commentato: Paolo Olson
il 15 Mar 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 :)
0 Commenti
Risposta accettata
Image Analyst
il 15 Mar 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 Commenti
Image Analyst
il 15 Mar 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?
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Image Segmentation and Analysis in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!