I need a C++ code that can take a set of (x,y) coordinates and fit an
ellipse to them. You can find a JAVA version and a MATLAB version of
the algorithm here: http://www.hpl.hp.com/personal/Maurizio_Pilu/research/ellipsefit/ellipse.htm
There will be 3 items in the input, an array of shorts of x
coodinates, an array of shorts of y coordinates, and the number of
points (ie. length of the x and y coordinate arrays, which should be
the same). The output should return the following parameters of the
fitted ellipse: x and y coordinates of the center, length of major and
minor axis, and angle of the ellipse. The MATLAB version of the code
does this exactly, but the JAVA version will require a little bit of
tweaking. |