-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalibrationmodule.hpp
59 lines (39 loc) · 1.03 KB
/
calibrationmodule.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef CALIBRATIONMODULE_HPP
#define CALIBRATIONMODULE_HPP
#include <cv.h>
#include <vector>
#include <QDialog>
#include <QObject>
#include "settings.hpp"
#include "cameracalibration.hpp"
#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/imgproc/imgproc.hpp>
class CalibrationModule: public QObject{
Q_OBJECT
public:
CalibrationModule();
~CalibrationModule();
void init(Settings * sets, QDialog * dial, cv::Size theBoardSize, int pairs = 15);
bool addImages(IplImage * frame1, IplImage * frame2);
private slots:
void startCalibration();
void loadCalibration();
private:
bool calibrate();
void clearCalibrationData();
void initWindow();
QDialog * dialog;
QPushButton * calibrateButton;
QPushButton * loadCalibrationButton;
Settings * settings;
int maxPairs;
std::vector<cv::Mat> camImages;
cv::Size boardSize;
cv::Mat M1, M2, D1, D2;
cv::Mat R, T, R1, R2, P1, P2, Q;
cv::Mat rmap[2][2];
cv::Mat blackOne;
int counter;
int samplesTime;
};
#endif