22 |
jakw |
1 |
#ifndef MVCalibrationData_H
|
|
|
2 |
#define MVCalibrationData_H
|
|
|
3 |
|
|
|
4 |
#include <QString>
|
|
|
5 |
#include <QMetaType>
|
|
|
6 |
|
|
|
7 |
#include <opencv2/core/core.hpp>
|
|
|
8 |
|
|
|
9 |
class MVCalibrationData{
|
|
|
10 |
public:
|
|
|
11 |
MVCalibrationData() : 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),
|
|
|
12 |
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),
|
|
|
13 |
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),
|
|
|
14 |
E(1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0),
|
|
|
15 |
F(1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0){}
|
|
|
16 |
|
|
|
17 |
MVCalibrationData(cv::Matx33f _K0, cv::Vec<float, 5> _k0, double _cam0_error, cv::Matx33f _K1, cv::Vec<float, 5> _k1, double _cam1_error, cv::Matx33f _R1, cv::Vec3f _T1, double _stereo_error) :
|
|
|
18 |
K0(_K0), k0(_k0), cam0_error(_cam0_error), K1(_K1), k1(_k1), cam1_error(_cam1_error), R1(_R1), T1(_T1), stereo_error(_stereo_error){}
|
|
|
19 |
|
|
|
20 |
bool load(const QString& filename);
|
|
|
21 |
bool save(const QString& filename);
|
|
|
22 |
void print(std::ostream &stream);
|
|
|
23 |
|
|
|
24 |
friend QDataStream& operator<<(QDataStream& in, MVCalibrationData& data);
|
|
|
25 |
friend QDataStream& operator<<(QDataStream& out, const MVCalibrationData& data);
|
|
|
26 |
|
|
|
27 |
// Members publically accessible
|
|
|
28 |
cv::Matx33f K0; // intrinsic camera matrix
|
|
|
29 |
cv::Vec<float, 5> k0; // Camera distortion coefficients
|
|
|
30 |
double cam0_error;
|
|
|
31 |
|
|
|
32 |
cv::Matx33f K1; // outtroutsic projector matrix
|
|
|
33 |
cv::Vec<float, 5> k1; // Projector distortion coefficients
|
|
|
34 |
double cam1_error;
|
|
|
35 |
|
|
|
36 |
cv::Matx33f R1; // Extrinsic rotation matrix
|
|
|
37 |
cv::Vec3f T1; // Extrinsic translation vector
|
|
|
38 |
|
|
|
39 |
double stereo_error;
|
|
|
40 |
|
|
|
41 |
cv::Matx33f E; // Essential matrix
|
|
|
42 |
cv::Matx33f F; // Fundamental matrix
|
|
|
43 |
|
|
|
44 |
std::string calibrationDateTime;
|
|
|
45 |
};
|
|
|
46 |
|
|
|
47 |
Q_DECLARE_METATYPE(MVCalibrationData)
|
|
|
48 |
|
|
|
49 |
// QDataStream ops for qDebug() and QSettings
|
|
|
50 |
QDataStream& operator<<(QDataStream& in, MVCalibrationData& data);
|
|
|
51 |
QDataStream& operator<<(QDataStream& out, const MVCalibrationData& data);
|
|
|
52 |
|
|
|
53 |
#endif
|