fit_ellipse

バージョン 1.0.0.0 (4.19 KB) 作成者: Ohad Gal
Find the best fit for an ellipse using a given set of points (a closed contour).
ダウンロード: 35.6K
更新 2003/10/2

ライセンスの表示

This function uses the Least-Squares criterion for estimation of the best fit to an ellipse from a given set of points (x,y). The LS estimation is done for the conic representation of an ellipse (with a possible tilt).

Conic Ellipse representation = a*x^2+b*x*y+c*y^2+d*x+e*y+f=0
(Tilt/orientation for the ellipse occurs when the term x*y exists (i.e. b ~= 0))

Later, after the estimation, the tilt is removed from the ellipse (using a rotation matrix) and then, the rest of the parameters which describes an ellipse are extracted from the conic representation.

For debug purposes, the estimation can be drawn on top of a given axis handle.

Note:
1) This function does not work on a three-dimensional axis system. (only 2D)
2) At least 5 points are needed in order to estimate the 5 parameters of the ellipse.
3) If the data is a hyperbola or parabula, the function return empty fields and a status indication

引用

Ohad Gal (2024). fit_ellipse (https://www.mathworks.com/matlabcentral/fileexchange/3215-fit_ellipse), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R12.1
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersLeast Squares についてさらに検索

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0

1. added a test to identify if the data is a hyperbola or parabola - returned in the "status" field
2. the routine finds now the center point of the original (tilted) ellipse as well (fields "X0_in","Y0_in")