fitellipse.m
Fit ellipses to 2D points using linear or nonlinear least squares
Author: Richard Brown

@leon, not directly. It fits ellipses to pairs of points that are assumed to represent the ellipse boundary. So, you need to segment your images first, then extract the boundary points and fit the ellipse to those.

07 Sep 2012

fitcircle.m
Fits circles to 2D data using nonlinear least squares to minimise geometric error
Author: Richard Brown

@Tolga, thanks -- and yes, I know. I deliberately wanted to avoid any toolbox dependencies.

I haven't done any comparisons of efficiency -- if you do you could let us know! But accuracy is simply dependent on the tolerance you specify.

28 Jun 2012

fitellipse.m
Fit ellipses to 2D points using linear or nonlinear least squares
Author: Richard Brown

@Irfan: x and y values!

21 May 2012

fitcircle.m
Fits circles to 2D data using nonlinear least squares to minimise geometric error
Author: Richard Brown

My previous comment got lost -- the 2 norm residual is the sum of the squared perpendicular distance from each data point to the fitted circle

21 May 2012

fitcircle.m
Fits circles to 2D data using nonlinear least squares to minimise geometric error
Author: Richard Brown

Also, @Graeme, the accuracy of the fitted circle depends on the kinds of errors that are in your data. If you assume there is a true underlying set of parameters that you're trying to find, and that your data is normally distributed, then the accuracy will decrease with number of data points as something like s / sqrt(n), where s is the standard deviation of perpendicular distances to the fitted circle, and n the number of data points. The error will then probably follow some kind of t distribution.

Hello Richard, if I want to use the 'a' and 'b' values given by this program to find the area of the ellipse what would be the units of the area? Pixels perhaps?

13 Feb 2014

fitellipse.m
Fit ellipses to 2D points using linear or nonlinear least squares
Author: Richard Brown

This code was exactly what I was looking for to fit ellipses to a set of data points (hysteresis loops). I may have some questions in the future, but for now, thanks!