Very Small Coefficients in Ellipse Curve Fitting Problem with Image Indices

1 Ansicht (letzte 30 Tage)
I was trying to use the the concept with general equation of ellipse but it yields very small values for coefficients. Can someone explain? These coefficients should be larger than the results found by the lsqnonlin function. I tried to normalize them. Nevertheless, the coefficients are very small. How can I make them larger so that, semi-major axis of the ellipse can be found correctly?
load('mat_xy.mat');
x = mat_xy(:,1); y = mat_xy(:,2);
a0 = [2 2 2 2 2 2];
options = optimset('Display','iter');
% Due to the image coordinates, x and y indices are swapped
f = @(a) a(1).*y.^2 + a(2).*x.*y + a(3).*x.^2+ a(4).*y +a(5).*x + a(6);
af = lsqnonlin(f, a0, [], [], options);
here af vector is the list of coefficients. It yields,
af = [-1.6825e-08 -3.9741e-08 -2.4193e-08 1.2096e-05 1.4502e-05 -0.0022];
N.B. ezplot of the above coefficients yields an ellipse.

Antworten (0)

Kategorien

Mehr zu Get Started with Curve Fitting Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by