50 #include <visp/vpHomography.h>
51 #include <visp/vpMatrixException.h>
59 double *xn,
double *yn,
60 double &xg,
double &yg,
67 for (i =0 ; i < n ; i++)
91 if(std::fabs(distance) <= std::numeric_limits<double>::epsilon())
94 coef=sqrt(2.0)/distance;
109 double xg1,
double yg1,
double coef1,
110 double xg2,
double yg2,
double coef2 )
124 T1[0][0]=T1[1][1]=coef1;
125 T1[0][2]=-coef1*xg1 ;
126 T1[1][2]=-coef1*yg1 ;
128 T2[0][0]=T2[1][1]=coef2;
129 T2[0][2]=-coef2*xg2 ;
130 T2[1][2]=-coef2*yg2 ;
137 for (
unsigned int i=0 ; i < 3 ; i++)
138 for (
unsigned int j=0 ; j < 3 ; j++) aHb[i][j] = maHb[i][j] ;
160 double *xb,
double *yb,
161 double *xa,
double *ya ,
171 xbn =
new double [n];
172 ybn =
new double [n];
174 double xg1, yg1, coef1 ;
182 xan =
new double [n];
183 yan =
new double [n];
185 double xg2, yg2, coef2 ;
270 double *xb,
double *yb,
271 double *xa,
double *ya ,
278 vpTRACE(
"there must be at least 4 points in the both images\n") ;
306 A[2*i][6]=xb[i]*ya[i] ;
307 A[2*i][7]=yb[i]*ya[i];
317 A[2*i+1][6]=-xb[i]*xa[i];
318 A[2*i+1][7]=-yb[i]*xa[i];
324 for (
int i=0; i < 9; i ++) {
336 for(i = 0; i<9;i++) if(D[i]>1e-7) rank++;
339 vpTRACE(
" Rank is : %d, should be 8", rank);
341 "\n\t\t Matrix rank is deficient")) ;
347 double smallestSv = 1e30 ;
348 unsigned int indexSmallestSv = 0 ;
349 for (i=0 ; i < 9 ; i++)
350 if ((D[i] < smallestSv) ){ smallestSv = D[i] ;indexSmallestSv = i ; }
353 h=V.
column(indexSmallestSv+1);
371 std::cout <<std::endl << me << std::endl ;