49 #include <visp/vpBasicFeature.h>
50 #include <visp/vpFeatureEllipse.h>
53 #include <visp/vpException.h>
54 #include <visp/vpMatrixException.h>
55 #include <visp/vpFeatureException.h>
58 #include <visp/vpDebug.h>
61 #include <visp/vpMath.h>
65 #include <visp/vpFeatureDisplay.h>
119 if (
flags[i] ==
false)
123 vpTRACE(
"Warning !!! The interaction matrix is computed but x was not set yet");
126 vpTRACE(
"Warning !!! The interaction matrix is computed but y was not set yet");
129 vpTRACE(
"Warning !!! The interaction matrix is computed but mu20 was not set yet");
132 vpTRACE(
"Warning !!! The interaction matrix is computed but mu11 was not set yet");
135 vpTRACE(
"Warning !!! The interaction matrix is computed but mu02 was not set yet");
138 vpTRACE(
"Warning !!! The interaction matrix is computed but A was not set yet");
141 vpTRACE(
"Warning !!! The interaction matrix is computed but B was not set yet");
144 vpTRACE(
"Warning !!! The interaction matrix is computed but C was not set yet");
147 vpTRACE(
"Problem during the reading of the variable flags");
161 double Z = 1/(A*xc + B*yc + C) ;
172 H[0][2] = xc/Z + A*mu20 + B*mu11;
173 H[0][3] = xc*yc + mu11;
188 H[0][2] = yc/Z + A*mu11 + B*mu02;
190 H[0][4] = -xc*yc - mu11;
200 H[0][0] = -2*(A*mu20+B*mu11);
202 H[0][2] = 2*((1/Z+A*xc)*mu20+B*xc*mu11) ;
203 H[0][3] = 2*(yc*mu20+xc*mu11);
204 H[0][4] = -4*mu20*xc;
214 H[0][0] = -A*mu11-B*mu02;
215 H[0][1] = -A*mu20-B*mu11;
216 H[0][2] = A*yc*mu20+(3/Z-C)*mu11+B*xc*mu02;
217 H[0][3] = 3*yc*mu11+xc*mu02;
218 H[0][4] = -yc*mu20-3*xc*mu11;
229 H[0][1] = -2*(A*mu11+B*mu02);
230 H[0][2] = 2*((1/Z+B*yc)*mu02+A*yc*mu11);
232 H[0][4] = -2*(yc*mu11 +xc*mu02) ;
245 const unsigned int select)
253 ex[0] =
s[0] - s_star[0] ;
261 ey[0] =
s[1] - s_star[1] ;
268 ex[0] =
s[2] - s_star[2] ;
276 ey[0] =
s[3] - s_star[3] ;
283 ey[0] =
s[4] - s_star[4] ;
291 std::cout <<std::endl << me << std::endl ;
297 std::cout <<std::endl << me << std::endl ;
311 std::cout <<
"Ellipse: " << std::endl ;
313 std::cout <<
" x=" <<
s[0] <<std::endl ;;
315 std::cout <<
" y=" <<
s[1] <<std::endl ;
317 std::cout <<
" mu20=" <<
s[2] <<std::endl ;
319 std::cout <<
" mu11=" <<
s[3] <<std::endl ;
321 std::cout <<
" mu02=" <<
s[4] <<std::endl ;
322 std::cout <<
"A = "<<A <<
" B = "<<B <<
" C = "<<C << std::endl ;
328 const double mu20,
const double mu11,
338 for(
int i = 0; i < 5; i++)
flags[i] =
true;
344 const double mu20,
const double mu11,
346 const double A,
const double B,
const double C)
381 for(
int i = 0; i < 2; i++)
flags[i] =
true;
402 for(
int i = 2; i < 5; i++)
flags[i] =
true;
421 unsigned int thickness )
const
432 cam, I, color, thickness) ;
455 unsigned int thickness )
const
466 cam, I, color, thickness) ;