Subversion Repositories seema-scanner

Rev

Rev 176 | 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>
225 jakw 7
#include <QTextStream>
27 jakw 8
#include <opencv2/opencv.hpp>
9
 
10
class SMCalibrationParameters{
11
 
12
    public:
13
 
14
        SMCalibrationParameters() : frameHeight(0), frameWidth(0),
15
                                  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),
16
                                  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 17
                                  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),
176 jakw 18
                                  Rr(1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0), Tr(0.0), rot_axis_error(0.0),
75 jakw 19
                                  E(0.0), F(0.0){
27 jakw 20
 
21
        }
22
 
23
        ~SMCalibrationParameters(){}
24
 
25
        unsigned int frameHeight;
26
        unsigned int frameWidth;
27
 
28
        cv::Matx33f K0; // intrinsic camera matrix
29
        cv::Vec<float, 5> k0; // distortion coefficients
30
        double cam0_error; // overall reprojection error
225 jakw 31
        std::vector<double> cam0_errors_per_view; // per view reprojection errors
32
        std::vector<double> cam0_intrinsic_std;
33
        std::vector<double> cam0_extrinsic_std;
27 jakw 34
 
35
        cv::Matx33f K1;
36
        cv::Vec<float, 5> k1;
37
        double cam1_error;
225 jakw 38
        std::vector<double> cam1_errors_per_view; // per view reprojection errors
39
        std::vector<double> cam1_intrinsic_std;
40
        std::vector<double> cam1_extrinsic_std;
27 jakw 41
 
31 jakw 42
        cv::Matx33f R1; // extrinsic rotation matrix camera 1
43
        cv::Vec3f   T1; // extrinsic translation vector camera 1
75 jakw 44
        double stereo_error; // stereo calibration reprojection error
27 jakw 45
 
31 jakw 46
        cv::Matx33f Rr; // extrinsic rotation rotation stage
47
        cv::Vec3f   Tr; // extrinsic translation vector rotation stage
176 jakw 48
        double rot_axis_error; // 3d error of rotation axis fit
31 jakw 49
 
50
        cv::Matx33f E; // essential matrix
51
        cv::Matx33f F; // fundamental matrix
52
 
148 jakw 53
 
225 jakw 54
        void print(std::ostream &stream);
55
        void printCamera(std::ostream &stream);
56
        void printRotationStage(std::ostream &stream);
42 jakw 57
        void exportToXML(QString fileName);
135 jakw 58
        void importFromXML(QString fileName);
27 jakw 59
};
60
 
61
QDataStream& operator>>(QDataStream& in, SMCalibrationParameters& data);
62
QDataStream& operator<<(QDataStream& out, const SMCalibrationParameters& data);
63
 
64
Q_DECLARE_METATYPE(SMCalibrationParameters)
65
 
66
 
67
#endif // SMCALIBRATIONPARAMETERS_H