Subversion Repositories seema-scanner

Rev

Rev 31 | Rev 75 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 31 Rev 42
1
#ifndef SMCALIBRATIONPARAMETERS_H
1
#ifndef SMCALIBRATIONPARAMETERS_H
2
#define SMCALIBRATIONPARAMETERS_H
2
#define SMCALIBRATIONPARAMETERS_H
3
 
3
 
4
#include <QObject>
4
#include <QObject>
5
#include <QDataStream>
5
#include <QDataStream>
6
#include <QMetaType>
6
#include <QMetaType>
7
#include <opencv2/opencv.hpp>
7
#include <opencv2/opencv.hpp>
8
 
8
 
9
class SMCalibrationParameters{
9
class SMCalibrationParameters{
10
 
10
 
11
    public:
11
    public:
12
 
12
 
13
        SMCalibrationParameters() : frameHeight(0), frameWidth(0),
13
        SMCalibrationParameters() : frameHeight(0), frameWidth(0),
14
                                  K0(1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0), k0(0.0), cam0_error(0.0),
14
                                  K0(1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0), k0(0.0), cam0_error(0.0),
15
                                  K1(1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0), k1(0.0), cam1_error(0.0),
15
                                  K1(1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0), k1(0.0), cam1_error(0.0),
16
                                  R1(1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0), T1(0.0), stereo_error(0.0){
16
                                  R1(1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0), T1(0.0), stereo_error(0.0){
17
 
17
 
18
            qRegisterMetaType<SMCalibrationParameters>("SMCalibrationParameters");
18
            qRegisterMetaType<SMCalibrationParameters>("SMCalibrationParameters");
19
            qRegisterMetaTypeStreamOperators<SMCalibrationParameters>("SMCalibrationParameters");
19
            qRegisterMetaTypeStreamOperators<SMCalibrationParameters>("SMCalibrationParameters");
20
        }
20
        }
21
 
21
 
22
        ~SMCalibrationParameters(){}
22
        ~SMCalibrationParameters(){}
23
 
23
 
24
        unsigned int frameHeight;
24
        unsigned int frameHeight;
25
        unsigned int frameWidth;
25
        unsigned int frameWidth;
26
 
26
 
27
        cv::Matx33f K0; // intrinsic camera matrix
27
        cv::Matx33f K0; // intrinsic camera matrix
28
        cv::Vec<float, 5> k0; // distortion coefficients
28
        cv::Vec<float, 5> k0; // distortion coefficients
29
        double cam0_error; // overall reprojection error
29
        double cam0_error; // overall reprojection error
30
 
30
 
31
        cv::Matx33f K1;
31
        cv::Matx33f K1;
32
        cv::Vec<float, 5> k1;
32
        cv::Vec<float, 5> k1;
33
        double cam1_error;
33
        double cam1_error;
34
 
34
 
35
        double stereo_error; // stereo calibration reprojection error
35
        double stereo_error; // stereo calibration reprojection error
36
 
36
 
37
        cv::Matx33f R1; // extrinsic rotation matrix camera 1
37
        cv::Matx33f R1; // extrinsic rotation matrix camera 1
38
        cv::Vec3f   T1; // extrinsic translation vector camera 1
38
        cv::Vec3f   T1; // extrinsic translation vector camera 1
39
 
39
 
40
        cv::Matx33f Rr; // extrinsic rotation rotation stage
40
        cv::Matx33f Rr; // extrinsic rotation rotation stage
41
        cv::Vec3f   Tr; // extrinsic translation vector rotation stage
41
        cv::Vec3f   Tr; // extrinsic translation vector rotation stage
42
 
42
 
43
        cv::Matx33f E; // essential matrix
43
        cv::Matx33f E; // essential matrix
44
        cv::Matx33f F; // fundamental matrix
44
        cv::Matx33f F; // fundamental matrix
45
 
45
 
46
        void print();
46
        void print();
-
 
47
        void exportToXML(QString fileName);
47
};
48
};
48
 
49
 
49
QDataStream& operator>>(QDataStream& in, SMCalibrationParameters& data);
50
QDataStream& operator>>(QDataStream& in, SMCalibrationParameters& data);
50
QDataStream& operator<<(QDataStream& out, const SMCalibrationParameters& data);
51
QDataStream& operator<<(QDataStream& out, const SMCalibrationParameters& data);
51
 
52
 
52
Q_DECLARE_METATYPE(SMCalibrationParameters)
53
Q_DECLARE_METATYPE(SMCalibrationParameters)
53
 
54
 
54
 
55
 
55
#endif // SMCALIBRATIONPARAMETERS_H
56
#endif // SMCALIBRATIONPARAMETERS_H
56
 
57