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
답변 (0개)
참고 항목
카테고리
Help Center 및 File 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!