資源簡介
橢圓擬合-EllipseDirectFit.m
這是一個快速和非迭代橢圓擬合算法
. 用法:
? ?A = EllipseDirectFit
輸入: XY 數組是n個點的坐標
? ?? ?? ?? ?x=XY, y=XY
輸出: A = [a b c d e f]' 時橢圓擬合的系數向量其方程方程為::
? ?ax^2 bxy cy^2 dx ey f = 0,其中A是被歸一化的 ||A||=1
可以轉換輸出的幾何參數,比如(半軸,中心等),具體的理論公式在http://www.mathworks.com/matlabcentral/fx_files/2
這是一個快速和非迭代橢圓擬合算法
. 用法:
? ?A = EllipseDirectFit
輸入: XY 數組是n個點的坐標
? ?? ?? ?? ?x=XY, y=XY
輸出: A = [a b c d e f]' 時橢圓擬合的系數向量其方程方程為::
? ?ax^2 bxy cy^2 dx ey f = 0,其中A是被歸一化的 ||A||=1
可以轉換輸出的幾何參數,比如(半軸,中心等),具體的理論公式在http://www.mathworks.com/matlabcentral/fx_files/2
代碼片段和文件信息
function?A?=?EllipseDirectFit(XY);
%
%??Direct?ellipse?fit?proposed?in?article
%????A.?W.?Fitzgibbon?M.?Pilu?R.?B.?Fisher
%?????“Direct?Least?Squares?Fitting?of?Ellipses“
%?????IEEE?Trans.?PAMI?Vol.?21?pages?476-480?(1999)
%
%??Our?code?is?based?on?a?numerically?stable?version
%??of?this?fit?published?by?R.?Halir?and?J.?Flusser
%
%?????Input:??XY(n2)?is?the?array?of?coordinates?of?n?points?x(i)=XY(i1)?y(i)=XY(i2)
%
%?????Output:?A?=?[a?b?c?d?e?f]‘?is?the?vector?of?algebraic?
%?????????????parameters?of?the?fitting?ellipse:
%?????????????ax^2?+?bxy?+?cy^2?+dx?+?ey?+?f?=?0
%?????????????the?vector?A?is?normed?so?that?||A||=1
%
%??This?is?a?fast?non-iterative?ellipse?fit.
%
%??It?returns?ellipses?only?even?if?points?are
%??better?approximated?by?a?hyperbola.
%?
評論
共有 條評論