Skip to content
Snippets Groups Projects
Commit 46eaef92 authored by Jean-Yves TINEVEZ's avatar Jean-Yves TINEVEZ
Browse files

Also center points before fitting the 2D ellipse.

parent de5fe857
No related branches found
No related tags found
1 merge request!9Rework the whole code for the upcoming publication.
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment