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 (2025). Ellipse Fit (https://jp.mathworks.com/matlabcentral/fileexchange/22423-ellipse-fit), MATLAB Central File Exchange. に取得済み.

MATLAB リリースの互換性
作成: R2006b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersRegion and Image Properties についてさらに検索
謝辞

ヒントを得たファイル: Circle fit

ヒントを与えたファイル: Ellipse Fit (Taubin method), Ellipse Fit (Direct method)

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