30 float u2,
float v2,
float up2,
float vp2,
31 float u3,
float v3,
float up3,
float vp3)
40 void affinity::initialize(
void)
42 AA = cvCreateMat(6, 6, CV_32FC1);
43 X = cvCreateMat(6, 1, CV_32FC1);
44 B = cvCreateMat(6, 1, CV_32FC1);
47 type = CV_MAT_MAGIC_VAL | CV_MAT_CONT_FLAG | CV_MAT_TYPE(type);
50 step = cols * CV_ELEM_SIZE(type);
51 data.ptr = (uchar*)
new float[cols * rows];
76 float u2,
float v2,
float up2,
float vp2,
77 float u3,
float v3,
float up3,
float vp3)
79 ::cvmSet(AA, 0, 0, u1);
::cvmSet(AA, 0, 1, v1);
::cvmSet(AA, 0, 2, 1.);
::cvmSet(AA, 0, 3, 0.);
::cvmSet(AA, 0, 4, 0.);
::cvmSet(AA, 0, 5, 0.);
80 ::cvmSet(AA, 1, 0, 0.);
::cvmSet(AA, 1, 1, 0.);
::cvmSet(AA, 1, 2, 0.);
::cvmSet(AA, 1, 3, u1);
::cvmSet(AA, 1, 4, v1);
::cvmSet(AA, 1, 5, 1.);
82 ::cvmSet(AA, 2, 0, u2);
::cvmSet(AA, 2, 1, v2);
::cvmSet(AA, 2, 2, 1.);
::cvmSet(AA, 2, 3, 0.);
::cvmSet(AA, 2, 4, 0.);
::cvmSet(AA, 2, 5, 0.);
83 ::cvmSet(AA, 3, 0, 0.);
::cvmSet(AA, 3, 1, 0.);
::cvmSet(AA, 3, 2, 0.);
::cvmSet(AA, 3, 3, u2);
::cvmSet(AA, 3, 4, v2);
::cvmSet(AA, 3, 5, 1.);
85 ::cvmSet(AA, 4, 0, u3);
::cvmSet(AA, 4, 1, v3);
::cvmSet(AA, 4, 2, 1.);
::cvmSet(AA, 4, 3, 0.);
::cvmSet(AA, 4, 4, 0.);
::cvmSet(AA, 4, 5, 0.);
86 ::cvmSet(AA, 5, 0, 0.);
::cvmSet(AA, 5, 1, 0.);
::cvmSet(AA, 5, 2, 0.);
::cvmSet(AA, 5, 3, u3);
::cvmSet(AA, 5, 4, v3);
::cvmSet(AA, 5, 5, 1.);
97 int ok = cvSolve(AA, B, X, CV_SVD);
101 cerr <<
"affinity::estimate: cvSolve failure" << endl;
145 cvGetQuadrangleSubPix(src, dest, A);