Very Small Coefficients in Ellipse Curve Fitting Problem with Image Indices

1 次查看(过去 30 天)
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.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with Curve Fitting Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by