Login  Register

Re: FitCircle circle-fitting class

Posted by Michael Doube on Sep 11, 2009; 9:17am
URL: http://imagej.273.s1.nabble.com/FitCircle-circle-fitting-class-tp3691194p3691196.html

Hi Johan

 From the practical standpoint rather than than the mathematical
perspective:

the Hough transform finds shapes within data; e.g. you supply an image
and the Hough transform finds the shape (line, circle...) in it - there
is an ImageJ plugin for this here:
http://rsbweb.nih.gov/ij/plugins/hough-circles.html

My FitCircle class finds the single best-fit circle for a set of (x, y)
points.  So if you have n coordinates in a 2D array (double[n][2]; I
have displacement from a mean axis vs axis distance) you can call e.g.
FitCircle.hyperStable(coordinates), which returns the centre and radius
of the best fitting circle.

Chernov has written a huge, detailed manual on the methods which you can
read here: http://www.math.uab.edu/~chernov/cl/book.pdf .  I'm still
suspicious that my Taubin fits are buggy as they break when supplied
with samples from an arc of less than 2*PI radians. So far, the Hyper
fits are doing well in terms of stability and speed.

Mike

Johan Henriksson wrote:

> I see that you have one that searches all of (a,b,R). how do these
> compare to the classic algorithms based on hough transform?
>
> /Johan
>
> Michael Doube wrote:
>> Hi all
>>
>> I've been working on a Java port of some MATLAB scripts that fit
>> circles to data.  I originally started it to find a good method to
>> work out radii of curvature, and it's grown (since Monday) to be
>> something that might be useful to other people.
>>
>> The algorithms are described in detail by Nikolai Chernov on his page,
>> http://www.math.uab.edu/~chernov/cl/MATLABcircle.html
>>
>> It includes Chernov's Hyper non-biased algebraic (non iterative, fast
>> and accurate) circle fitting method and a couple of the geometric
>> methods.
>>
>> The class is designed to be generic, and I've written an example
>> testing plugin, here: http://doube.org/files/Test_Circle.java
>>
>> If you'd like to check it out, I've posted an initial, mostly-working
>> version at http://doube.org/files/FitCircle.java
>>
>> It's also in my git repo, http://github.com/mdoube/BoneJ/tree/master.
>>
>> Cheers,
>>
>> Mike
>
>