-
Notifications
You must be signed in to change notification settings - Fork 0
/
imageview.h
166 lines (119 loc) · 2.95 KB
/
imageview.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#ifndef IMAGEVIEW_H
#define IMAGEVIEW_H
#include <QMainWindow>
#include <QLabel>
#include <QScrollArea>
#include <QAction>
#include <QScrollBar>
#include <QRubberBand>
#include <QPoint>
#include <QMouseEvent>
#include <QShortcut>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
namespace Ui {
class ImageView;
}
class ImageView : public QMainWindow
{
Q_OBJECT
public:
explicit ImageView(QWidget *parent = 0);
~ImageView();
void load(QString name);
QShortcut* shortcut;
QShortcut* shortcut2;
bool gc;
double gamma;
QSize s;
QRubberBand *sphere1;
QRubberBand *sphere2;
QRubberBand *sphere3;
QRubberBand *sphere4;
QRubberBand *white1;
QRubberBand *white2;
QRubberBand *white3;
QRubberBand *white4;
QRubberBand *cropArea;
QLabel* ls[4];
QPixmap* pixs[4];
QPainter* paints[4];
int pointsCounter;
int maxval;
int depth;
cv::Mat cameraMatrix = cv::Mat::eye(3, 3, CV_64F);
cv::Mat distCoeffs = cv::Mat::zeros(4, 1, CV_64F);
double cx[4];
double cy[4];
double radius[4];
double rx[4];
double ry[4];
double angle[4];
cv::RotatedRect boxE[4];
int active;
bool force8bit;
QPoint originw[4];
QPoint endw[4];
QPoint origins[4];
QPoint ends[4];
cv::RotatedRect box[4];
QPoint originc;
QPoint cpoints[20];
QPoint endc;
double baseFactor;
double scaleFactor;
double zoomFactor;
double ratio;
std::vector<double*> lights[4];
std::vector<double> coeffs[10];
std::vector<double> coilix[3];
std::vector<double> coiliy[3];
std::vector<double> coiliz[3];
QLabel *imageLabel;
QScrollArea *scrollArea;
QAction *zoomInAct;
QAction *zoomOutAct;
QAction *loadAct;
private slots:
//void open();
void zoomIn();
void zoomOut();
// void fitToWindow();
// void about();
void normalSize();
void load();
void on_frame1Act_triggered();
void on_frame2Act_triggered();
void on_frame3Act_triggered();
void on_frame4Act_triggered();
void on_actionOff_triggered();
void on_sphere1Act_triggered();
void on_sphere2Act_triggered();
void on_sphere3Act_triggered();
void on_sphere4Act_triggered();
void on_actionClear_triggered();
private:
Ui::ImageView *ui;
QAction *normalSizeAct;
// QAction *aboutAct;
QRubberBand *rub1;
void updateActions();
void scaleImage(double factor);
void resetImage(double factor);
void adjustScrollBar(QScrollBar *scrollBar, double factor);
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
signals:
void sph1Sig();
void sph2Sig();
void sph3Sig();
void sph4Sig();
void w1Sig();
void w2Sig();
void w3Sig();
void w4Sig();
void cropSig();
};
#endif // IMAGEVIEW_H