Subversion Repositories seema-scanner

Rev

Rev 89 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#include <iostream>

#include <cvtools.h>

int main(int argc, char *argv[]){

    // TEST rotation axis determination
    float checkerSize = 1.0;

    std::vector<cv::Point3f> Qobj;
    for (int h=-4; h<5; h+=1)
        for (int w=-4; w<5; w+=1)
            Qobj.push_back(cv::Point3f(checkerSize * w, checkerSize* h, -1.0));


    std::vector< std::vector<cv::Point3f> > Qcam(3);

    for(int i=0; i<3; i++){

        float angleRadians = (i * 1)/180.0*M_PI;
        cv::Vec3f rvec(0.0, 0.0, angleRadians);
        cv::Matx33f R;
        cv::Rodrigues(rvec, R);

        Qcam[i].resize(Qobj.size());

        for(int j=0; j<Qobj.size(); j++)
            Qcam[i][j] = R*Qobj[j] + cv::Point3f(-1,5,0);
    }

    cv::Vec3f axis, point;

    cvtools::rotationAxisCalibration(Qcam, Qobj, axis, point);

    std::cout << "axis: " << axis << std::endl;
    std::cout << "point: " << point << std::endl;

    return 0;
}