The most accurate and robust fit minimizes geometric (orthogonal) distances from the observed points to the fitting curve. Our goal is to minimize the sum of squares of orthogonal distances. The Levenberg-Marquardt algorithm requires the computation of the distances and their derivatives with respect to the ellipse parameters. So this method is generated by using implicit differentiation for computingJacobian matrix.Usage: [ParG,RSS,iters] = fit_ellipseLMG(XY,ParGini,LambdaIni)Child functions:Residuals_ellipse(from previous submission) , JmatrixLMG (included in the main function)Input:XY:given points i=1 to nParGini = [Center(1:2), Axes(1:2),Angle]'LambdaIni: the initial value of the control parameter LambdaOutput:ParG: parameter vector of the ellipse foundRSS: the Residual Sum of Squares (the sum of squares of the distances)iters:# of iterations
↧