-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathcalibratewidget.h
67 lines (50 loc) · 1.39 KB
/
calibratewidget.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
#ifndef CALIBRATEWIDGET_H
#define CALIBRATEWIDGET_H
#include <QDialog>
#include <QDebug>
#include <QTimer>
#include <QThread>
#include "cameraparameter.h"
#include "cameraCalibrator.h"
#include <opencv2/opencv.hpp>
namespace Ui {
class CalibrateWidget;
}
class CalibrateWidget : public QDialog
{
Q_OBJECT
public:
explicit CalibrateWidget(CameraParameter &p, QWidget *parent = 0);
~CalibrateWidget();
static void matToQimage(const Mat &matImage, QImage &qImage) {
qImage = QImage((const unsigned char*)(matImage.data), matImage.cols,
matImage.rows, matImage.step, QImage::Format_RGB888);
}
signals:
void sendSrcImage(cv::Mat *);
void startCalibration();
protected:
void mouseDoubleClickEvent(QMouseEvent *event);
public slots:
void foundChessboard(bool f);
private slots:
void on_captureButton_clicked();
void on_srcSaveButton_clicked();
void on_dstSaveButton_clicked();
void on_saveParaButton_clicked();
void on_resetButton_clicked();
void cameraTimeout();
void receiveCalibResults(bool ok);
private:
inline void updateFrameNums();
Ui::CalibrateWidget *ui;
CameraCalibrator *camCalib;
QThread calibThread;
CameraParameter &camPara;
cv::VideoCapture capture;
QTimer *captureTimer;
cv::Mat srcImage, dstImage;
int frames;
bool showUndistort;
};
#endif // CALIBRATEWIDGET_H