Subversion Repositories seema-scanner

Rev

Rev 89 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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