Subversion Repositories seema-scanner

Rev

Rev 75 | Rev 148 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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