Subversion Repositories seema-scanner

Rev

Rev 141 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 141 Rev 205
1
#include <QTime>
1
#include <QTime>
2
#include <iostream>
2
#include <iostream>
3
 
3
 
4
#include <cvtools.h>
4
#include <cvtools.h>
5
 
5
 
6
int main(int argc, char *argv[]){
6
int main(int argc, char *argv[]){
7
 
7
 
8
    QTime time;
8
    QTime time;
9
    time.start();
9
    time.start();
10
 
10
 
11
//    // TEST rotation axis determination
11
//    // TEST rotation axis determination
12
//    float checkerSize = 4.0;
12
//    float checkerSize = 4.0;
13
 
13
 
14
//    std::vector<cv::Point3f> Qobj;
14
//    std::vector<cv::Point3f> Qobj;
15
//    for (int h=-3; h<=3; h+=2)
15
//    for (int h=-3; h<=3; h+=2)
16
//        for (int w=-3; w<=3; w+=2)
16
//        for (int w=-3; w<=3; w+=2)
17
//            Qobj.push_back(cv::Point3f(checkerSize * w, checkerSize* h, 0.0));
17
//            Qobj.push_back(cv::Point3f(checkerSize * w, checkerSize* h, 0.0));
18
 
18
 
19
 
19
 
20
//    std::vector< std::vector<cv::Point3f> > Qcam(20);
20
//    std::vector< std::vector<cv::Point3f> > Qcam(20);
21
 
21
 
22
//    for(int i=0; i<20; i++){
22
//    for(int i=0; i<20; i++){
23
 
23
 
24
//        float angleRadians = (i * 5)/180.0*M_PI;
24
//        float angleRadians = (i * 5)/180.0*M_PI;
25
//        cv::Vec3f rvec(0.0, 0.0, angleRadians);
25
//        cv::Vec3f rvec(0.0, 0.0, angleRadians);
26
//        cv::Matx33f R;
26
//        cv::Matx33f R;
27
//        cv::Rodrigues(rvec, R);
27
//        cv::Rodrigues(rvec, R);
28
 
28
 
29
//        Qcam[i].resize(Qobj.size());
29
//        Qcam[i].resize(Qobj.size());
30
 
30
 
31
//        for(int j=0; j<Qobj.size(); j++)
31
//        for(int j=0; j<Qobj.size(); j++)
32
//            Qcam[i][j] = R*(Qobj[j]-cv::Point3f(-2,-0,-0)) + cv::Point3f(-2,-0,-0);
32
//            Qcam[i][j] = R*(Qobj[j]-cv::Point3f(-2,-0,-0)) + cv::Point3f(-2,-0,-0);
33
//    }
33
//    }
34
 
34
 
35
//    cv::Vec3f axis, point;
35
//    cv::Vec3f axis, point;
36
 
36
 
37
//    cvtools::rotationAxisCalibration(Qcam, Qobj, axis, point);
37
//    cvtools::rotationAxisCalibration(Qcam, Qobj, axis, point);
38
 
38
 
39
//    std::cout << "axis: " << axis << std::endl;
39
//    std::cout << "axis: " << axis << std::endl;
40
//    std::cout << "point: " << point << std::endl;
40
//    std::cout << "point: " << point << std::endl;
41
 
41
 
42
    cv::Mat frame = cv::imread("frame.png");
42
    cv::Mat frame = cv::imread("frame.png");
43
 
43
 
44
    std::cout << time.restart() << "ms" << std::endl;
44
    std::cout << time.restart() << "ms" << std::endl;
45
 
45
 
46
    cvtools::imwritePNG("frame2.png", frame);
46
    cvtools::imwritePNG("frame2.png", frame);
47
//    cv::imwrite("frame2.tiff", frame, compression_params);
47
//    cv::imwrite("frame2.tiff", frame, compression_params);
48
 
48
 
49
    std::cout << time.restart() << "ms" << std::endl;
49
    std::cout << time.restart() << "ms" << std::endl;
50
 
50
 
51
    return 0;
51
    return 0;
52
}
52
}
53
 
53