Commit 46eaef92 authored by Jean-Yves TINEVEZ's avatar Jean-Yves TINEVEZ
Browse files

Also center points before fitting the 2D ellipse.

parent de5fe857
......@@ -4,6 +4,9 @@ function [ f, Q ] = fit_ellipse_2d( p, method )
if nargin < 2
method = 'direct';
end
c = mean( p );
p = p - repmat( c, size( p, 1 ), 1 );
switch( lower( method ) )
......@@ -14,6 +17,8 @@ function [ f, Q ] = fit_ellipse_2d( p, method )
end
f = quadratic_to_cartesian2( Q );
f( 1 ) = f( 1 ) + c( 1 );
f( 2 ) = f( 2 ) + c( 2 );
%% Subfunctions
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment