http://www.mathworks.com/matlabcentral/newsreader/view_thread/240408
MATLAB Central Newsreader  Ellipse Fitting
Feed for thread: Ellipse Fitting
enus
©19942014 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Thu, 04 Dec 2008 04:30:58 +0000
Ellipse Fitting
http://www.mathworks.com/matlabcentral/newsreader/view_thread/240408#614952
djordjep@gmail.com
Hello all, i have a problem with ellipse fitting experiment i'm trying<br>
to do for my class:<br>
<br>
In an experiment of image processing, we have collected the scattered<br>
data of an ellipse, which is contained in the data file and figure<br>
attached in zip file.<br>
Question asked is to estimate the location, size and orientation of<br>
the ellipse from the scattered data and to draw the ellipse which best<br>
fits the scattered data based on the estimation results.<br>
<br>
<a href="http://www.pcprooncall.com/ellipse.zip">http://www.pcprooncall.com/ellipse.zip</a><br>
<br>
How would i go about using that set of data into my function? I tried<br>
to open a file with data, but all i get<br>
>> load('C:\Users\George\Documents\ellipse_v7.mat')<br>
>><br>
<br>
And nothing happens after that.<br>
<br>
Any help or pointers would be greatly appriciated. I'm not great with<br>
Matlab, but i'm trying to learn

Thu, 04 Dec 2008 06:50:20 +0000
Re: Ellipse Fitting
http://www.mathworks.com/matlabcentral/newsreader/view_thread/240408#614959
Roger Stafford
djordjep@gmail.com wrote in message <984e419bb5fd4acbbf80bcb09dffcce6@v15g2000yqn.googlegroups.com>...<br>
> Hello all, i have a problem with ellipse fitting experiment i'm trying<br>
> to do for my class:<br>
> ........<br>
<br>
Here's one approach you might consider. Assuming you are in two dimensional space, any ellipse can be described by the equation<br>
<br>
A*x^2 + B*x*y + C*y^2 + D*x + E*y + F = 0<br>
<br>
with appropriate values of A, B, C, D, E, and F. If x, y, and z are column vectors of the three corresponding coordinate of your data points, form the matrix M:<br>
<br>
M = [x.^2,x.*y,y.^2,x,y,ones(size(x))];<br>
<br>
Then use the singular value decomposition function:<br>
<br>
[U,S,V] = svd(M,0);<br>
<br>
The sixth (last) column of V will contain the least squares values of [A;B;C;D;E;F] subject to the restriction that the sum of their squares is one. (This latter is necessary because the ellipse's equation is homogeneous in the six coefficients.)<br>
<br>
For many (but not all) point sets this can be considered a "best" fit to an ellipse. One drawback it possesses is that this solution does not remain strictly invariant with respect to translations of the coordinate system.<br>
<br>
Roger Stafford

Thu, 04 Dec 2008 18:31:02 +0000
Re: Ellipse Fitting
http://www.mathworks.com/matlabcentral/newsreader/view_thread/240408#615103
Rafael Herrejon
djordjep@gmail.com wrote in message <984e419bb5fd4acbbf80bcb09dffcce6@v15g2000yqn.googlegroups.com>...<br>
> Hello all, i have a problem with ellipse fitting experiment i'm trying<br>
> to do for my class:<br>
> <br>
> In an experiment of image processing, we have collected the scattered<br>
> data of an ellipse, which is contained in the data file and figure<br>
> attached in zip file.<br>
> Question asked is to estimate the location, size and orientation of<br>
> the ellipse from the scattered data and to draw the ellipse which best<br>
> fits the scattered data based on the estimation results.<br>
> <br>
> <a href="http://www.pcprooncall.com/ellipse.zip">http://www.pcprooncall.com/ellipse.zip</a><br>
> <br>
> How would i go about using that set of data into my function? I tried<br>
> to open a file with data, but all i get<br>
> >> load('C:\Users\George\Documents\ellipse_v7.mat')<br>
> >><br>
> <br>
> And nothing happens after that.<br>
> <br>
> Any help or pointers would be greatly appriciated. I'm not great with<br>
> Matlab, but i'm trying to learn<br>
<br>
to be able to see the data, you have assign it to something,for example<br>
data=load('C:\Users\George\Documents\ellipse_v7.mat')<br>
x = data(:,1)';<br>
y = data(:,2)';<br>
<br>
etc<br>
<br>
btw, there are some fitellipse functions in FileExchange