Find a point that does not fit to ellipse from a set of (x,y) co-ordinates
3 views (last 30 days)
Show older comments
Hello,
I have a set of (x,y) points which I am trying to fit to an ellipse. I used the Ellipse fit function by Tal Hendel ( http://www.mathworks.com/matlabcentral/fileexchange/22423-ellipse-fit). Some times I get imaginary semimajor/minor axis. When I plotted these set of data using plot() function, I see that I get imaginary values because one of the points in the set does not fit to the ellipse while the other points form almost an ellipse. How can I eliminate this one point? Hope I made it clear.
2 Comments
Paulo Silva
on 3 Mar 2011
That method doesn't always give reliable values, try other method or just remove the point, use the datacursor to find the coordinates of that point.
One option that allows you to remove the point:
x(x=value)=[];
y(y=value)=[];
Answers (1)
David Young
on 3 Mar 2011
If there is only ever one incorrect point, you could simply omit each point in turn until you get a good fit to an ellipse. (You need some way to check the residual errors to test for goodness of fit, beyond just looking for imaginary values in the result. You might need to modify the function you are using to provide that.)
A more general possibility is the RANSAC algorithm, described here: http://en.wikipedia.org/wiki/Ransac. This allows for there to be many incorrect points.
See Also
Categories
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!