Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have set of points and want to fit ellipse to this set. I have found only function which fits ellipse in least squares sense. In this set of points there are some noise points which should not be taken to ellipse fitting.

I want some references to algorithms which eliminate noisy points and fit ellipse to set of points.

share|cite|improve this question
up vote 4 down vote accepted

This site has code to fit an ellipse, plus an explanation of the algorithm.

If the data is just "noisy", this should work fine. If there are a relatively few "wild" points in the input, they probably won't influence the result very much. You can filter them out after doing a first trial fitting.

Anyway, try this code, and see if it works for you.

share|cite|improve this answer

Too long to comment:

A quick look around suggests that 'least median of squares' is the route to go, and the preeminent paper on it is by Roth and Levine [G. Roth and M.D. Levine. Extracting geometric primitives. CVGIP: Image Understanding, 58(1):1-22, 1993.]. Unfortunately, I could not find this article. A second reference (which I also could not find) might be [P. Rousseeuw and A. Leroy. Robust Regression and Outlier Detection. Wiley, 1987.]

I think this is the way to go because of a circuitous route. Firstly, page 22 of this presentation does it, and references this paper. This paper by Rosin about ellipse fitting and about the effect of outliers on least squares in particular mentions 'least median of squares' as a good alternative, and references both Roth and Levine, and Rousseeuw and Leroy as well. Unfortunately, Rosin's paper itself seems of limited use.

Other methods are mentioned in Rosin's paper as well. I hope this helps - good luck.

share|cite|improve this answer
So I thought rather about some algorithms in more implementable forms or implemented so far. Reference-request tag was not added by my. Of coure thanks for effort and papers, but I'm looking for something I could check fast if it is working for me. – krzych May 31 '12 at 12:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.