-
Notifications
You must be signed in to change notification settings - Fork 0
/
video_test1.h
114 lines (87 loc) · 1.88 KB
/
video_test1.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
#pragma once
#include <QtWidgets/QMainWindow>
#include "ui_video_test1.h"
#include<qtimer.h>
#include <QPainter>
#include <QPixmap>
#include <QLabel>
#include <QImage>
#include<QFileDialog>
#include <cv.h>
#include <highgui.h>
#include <opencv.hpp>
#include<opencv2\opencv.hpp>
#include<cmath>
#include"calib.h"
#include"calibdemo.h"
using namespace cv;
class video_test1 : public QMainWindow
{
Q_OBJECT
public:
video_test1(QWidget *parent = Q_NULLPTR);
~video_test1();
void getCalib(double &calib);
public slots:
void updateImage();
void on_startCount_clicked();
void on_stopCount_clicked();
void on_action_triggered();
void on_clearPainter_clicked();
void on_openCalib_triggered();
void receiveCalib(double data);
void on_cleanPainter_clicked();
void on_chooseROI_clicked();
private:
Ui::video_test1Class ui;
QTimer theTimer;
Mat srcImage;
Mat ROI;
Mat subROI;
Mat imageTemp;
Mat ROI_show;
Mat grayImage;
VideoCapture videoCap;
bool isFileOpen;
bool videoIsOpen;
QLabel *imageLabel;
long countTemp = 0;
long countSeq=0;
long deltaCount=0;
long totalCount=0;
QLabel *ROILabel;
double cur_volume;
double sum_volume=0;
QImage ROI_show_;
QImage * qImage; // qt 中的图片类型指针
IplImage image; // opencv里的图片类型指针
IplImage * tempImage;
QImage *qTempShowImage;
IplImage showImage;
IplImage *tempShowIamge;
string filename_;
QPainter painter;
int mousepress_x;
int mousepress_y;
int mousemove_x;
int mousemove_y;
int mouserelease_x;
int mouserelease_y;
int Rectw;
int Recth;
Calib* pWidget;
CalibDemo *pMianWindow;
double Calib;
int x1;
int y1;
int x2;
int y2;
QLabel* imageShowLabel;
QWidget *imageShowWidget;
QOpenGLWidget *imageShowOpenGL;
protected:
void paintEvent(QPaintEvent *e);
void mouseMoveEvent(QMouseEvent *event);
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
};