Subversion Repositories seema-scanner

Rev

Rev 169 | Rev 195 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 169 Rev 176
Line 289... Line 289...
289
        cvtools::matToPoints3f(Qcami, QcamiPoints);
289
        cvtools::matToPoints3f(Qcami, QcamiPoints);
290
 
290
 
291
        Qcam.push_back(QcamiPoints);
291
        Qcam.push_back(QcamiPoints);
292
    }
292
    }
293
 
293
 
-
 
294
//    cv::Mat QcamMat(Qcam.size(), Qcam[0].size(), CV_32FC3);
-
 
295
//    for(int i=0; i<Qcam.size(); i++)
-
 
296
//        for(int j=0; j<Qcam[0].size(); j++)
-
 
297
//            QcamMat.at<cv::Point3f>(i,j) = Qcam[i][j];
-
 
298
//    cvtools::writeMat(QcamMat, "Qcam.mat", "Qcam");
-
 
299
 
294
    cv::Vec3f axis, point;
300
    cv::Vec3f axis, point;
-
 
301
    float rot_axis_error;
295
    cvtools::rotationAxisCalibration(Qcam, Qi, axis, point);
302
    cvtools::rotationAxisCalibration(Qcam, Qi, axis, point, rot_axis_error);
296
 
303
 
297
    // construct transformation matrix
304
    // construct transformation matrix
298
    cv::Vec3f ex = axis.cross(cv::Vec3f(0,0,1.0));
305
    cv::Vec3f ex = axis.cross(cv::Vec3f(0,0,1.0));
299
    ex = cv::normalize(ex);
306
    ex = cv::normalize(ex);
300
    cv::Vec3f ez = ex.cross(axis);
307
    cv::Vec3f ez = ex.cross(axis);
Line 305... Line 312...
305
    cv::Mat(axis).copyTo(RrMat.col(1));
312
    cv::Mat(axis).copyTo(RrMat.col(1));
306
    cv::Mat(ez).copyTo(RrMat.col(2));
313
    cv::Mat(ez).copyTo(RrMat.col(2));
307
 
314
 
308
    cal.Rr = cv::Matx33f(RrMat).t();
315
    cal.Rr = cv::Matx33f(RrMat).t();
309
    cal.Tr = -cv::Matx33f(RrMat).t()*point;
316
    cal.Tr = -cv::Matx33f(RrMat).t()*point;
-
 
317
    cal.rot_axis_error = rot_axis_error;
310
 
318
 
311
    // Print to std::cout
319
    // Print to std::cout
312
    cal.print();
320
    cal.print();
313
 
321
 
314
    // save to (reentrant qsettings object)
322
    // save to (reentrant qsettings object)