Subversion Repositories seema-scanner

Rev

Rev 87 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
85 jakw 1
#include <iostream>
2
 
3
#include <cvtools.h>
4
 
5
int main(int argc, char *argv[]){
6
 
7
    // TEST rotation axis determination
8
    float checkerSize = 1.0;
9
 
10
    std::vector<cv::Point3f> Qobj;
11
    for (int h=-4; h<5; h+=1)
12
        for (int w=-4; w<5; w+=1)
13
            Qobj.push_back(cv::Point3f(checkerSize * w, checkerSize* h, -1.0));
14
 
15
 
16
    std::vector< std::vector<cv::Point3f> > Qcam(3);
17
 
18
    for(int i=0; i<3; i++){
19
 
20
        float angleRadians = (i * 1)/180.0*M_PI;
21
        cv::Vec3f rvec(0.0, 0.0, angleRadians);
22
        cv::Matx33f R;
23
        cv::Rodrigues(rvec, R);
24
 
25
        Qcam[i].resize(Qobj.size());
26
 
27
        for(int j=0; j<Qobj.size(); j++)
28
            Qcam[i][j] = R*Qobj[j] + cv::Point3f(-1,5,0);
29
    }
30
 
31
    cv::Vec3f axis, point;
32
 
33
    cvtools::rotationAxisCalibration(Qcam, Qobj, axis, point);
34
 
35
    std::cout << "axis: " << axis << std::endl;
36
    std::cout << "point: " << point << std::endl;
37
 
38
    return 0;
39
}