資源簡介
Matlab下用最小二乘法實現橢圓擬合,適合初學者,希望對大家有幫助!
代碼片段和文件信息
function?[varargout]=ellipsefit(xy)
%ELLIPSEFIT?Stable?Direct?Least?Squares?Ellipse?Fit?to?Data.
%?[XcYcABPhiP]=ELLIPSEFIT(XY)?finds?the?least?squares?ellipse?that
%?best?fits?the?data?in?X?and?Y.?X?and?Y?must?have?at?least?5?data?points.
%?Xc?and?Yc?are?the?x-?and?y-axis?center?of?the?ellipse?respectively.
%?A?and?B?are?the?major?and?minor?axis?of?the?ellipse?respectively.
%?Phi?is?the?radian?angle?of?the?major?axis?with?respect?to?the?x-axis.
%?P?is?a?vector?containing?the?general?conic?parameters?of?the?ellipse.
%?The?conic?representation?of?the?ellipse?is?given?by:
%
%?P(1)*x^2?+?P(2)*x*y?+?P(3)*y^2?+?P(4)*x?+?P(5)*y?+?P(6)?=?0
%
%?S=ELLIPSEFIT(XY)?returns?the?output?data?in?a?structure?with?field?names
%?equal?to?the?variable?names?given?above?e.g.?S.Xc?S.Yc?S
- 上一篇:Matlab數據增強
- 下一篇:matlab gui 讀取圖片的小例程
評論
共有 條評論