-
Notifications
You must be signed in to change notification settings - Fork 2
/
CameraCalib.h
95 lines (74 loc) · 2.16 KB
/
CameraCalib.h
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#ifndef CAMERACALIB_H_H
#define CAMERACALIB_H_H
#include <QFrame>
#include <QLineEdit>
#include <QPushButton>
#include <QCheckBox>
#include <biotracker/TrackingAlgorithm.h>
#include <opencv2/highgui/highgui.hpp>
class CameraCalib : public BioTracker::Core::TrackingAlgorithm {
Q_OBJECT
public:
//constructor
CameraCalib(BioTracker::Core::Settings & settings);
//destructor
~CameraCalib();
//implementations of pure virtual functions:
void track(size_t frameNumber, const cv::Mat & frame) override;
void paint(size_t frameNumber, BioTracker::Core::ProxyMat &m, View const &view = OriginalView) override;
void postConnect() override;
void inputChanged() override;
private:
// GUI-Elements
QLineEdit *m_squareSizeEdit;
QLineEdit *m_boardWidthEdit;
QLineEdit *m_boardHeightEdit;
QPushButton *m_addFrameBut;
QPushButton *m_resetSelectedFramesBut;
QPushButton *m_calibrateBut;
QPushButton *m_saveCalibrationBut;
QPushButton *m_addAllFramesBut;
QCheckBox *m_zeroTangentDistCB;
QCheckBox *m_rationalModelCB;
QCheckBox *m_fixPrincipalPointCB;
QCheckBox *m_highPolynomeDegree;
void initToolsFrame();
std::string m_curView;
cv::Mat m_curFrame;
cv::Mat m_modifiedFrame;
size_t m_frameNumber;
cv::Mat m_cameraMatrix;
cv::Mat m_distCoeffs;
// Chessboard corners, that should be shown live
std::vector<cv::Point2f> shownChessboardCorners;
// Corner positions in several frames
std::vector<std::vector <cv::Point2f> > boardCorners;
/**
* Returns a vector with the positions of chessboard corners within the current frame.
*
* @return vector of positions of chessboard corners
*/
std::vector<cv::Point2f> getChessboardCorners() throw (int);
public Q_SLOTS:
/**
* Adds more chessboard corners to the calibration
*/
void addFrame();
/**
* Adds all frames where a chessboad corner could be detected
*/
void addAllFrames();
/**
* Resets alls chosen points.
*/
void resetSelectedFrames();
/**
* Performs calibration
*/
void calibrate();
/**
* Saves camera calibration
*/
void saveCalibration();
};
#endif // CAMERACALIB_H