Ellipse Fit

버전 1.1.0.0 (1.22 KB) 작성자: Tal Hendel
Given a set of points (x, y) this function returns the best fit ellipse.
다운로드 수: 6.8K
업데이트 날짜: 2008/12/13

라이선스 없음

Usage:

[semimajor_axis, semiminor_axis, x0, y0, phi] = ellipse_fit(x, y)

Input:
x - a vector of x measurements
y - a vector of y measurements

Output:

semimajor_axis - Magnitude of ellipse longer axis
semiminor_axis - Magnitude of ellipse shorter axis
x0 - x coordinate of ellipse center
y0- y coordinate of ellipse center
phi - Angle of rotation in radians with respect to
the x-axis

Algorithm used:

Given the quadratic form of an ellipse:
a*x^2 + 2*b*x*y + c*y^2 + 2*d*x + 2*f*y + g = 0 (1)
we need to find the best (in the Least Square sense) parameters a,b,c,d,f,g.
To transform this into the usual way in which such estimation problems are presented,
divide both sides of equation (1) by a and then move x^2 to the other side. This gives us:
2*b'*x*y + c'*y^2 + 2*d'*x + 2*f'*y + g' = -x^2 (2)
where the primed parametes are the original ones divided by a. Now the usual estimation technique is used where the problem is presented as:
M * p = b, where M = [2*x*y y^2 2*x 2*y ones(size(x))],
p = [b c d e f g], and b = -x^2. We seek the vector p, given by:
p = pseudoinverse(M) * b.
From here on I used formulas (19) - (24) in Wolfram Mathworld:
http://mathworld.wolfram.com/Ellipse.html

인용 양식

Tal Hendel (2024). Ellipse Fit (https://www.mathworks.com/matlabcentral/fileexchange/22423-ellipse-fit), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2006b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Region and Image Properties에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.1.0.0

Added input and output explanations to description part.

1.0.0.0