-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmainwindow.h
More file actions
82 lines (69 loc) · 1.85 KB
/
mainwindow.h
File metadata and controls
82 lines (69 loc) · 1.85 KB
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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QtWidgets/QMainWindow>
#include <QString>
#include <opencv2/opencv.hpp>
#include <opencv2/tracking.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/bgsegm.hpp>
#include <EmergentCamera.h>
#include <emergentframe.h>
#include <EmergentAVIFile.h>
#include <camerasettings.h>
#include <gigevisiondeviceinfo.h>
#include <unistd.h>
#include <sys/time.h>
#include <camera.h>
#include <opencv2/core/cvstd_wrapper.hpp>
using namespace cv;
using namespace Emergent;
#define MAX_WORKERS 8
#define MAX_FRAMES 1000
#define FRAMES_BUFFERS 30
#define AVI_FRAME_COUNT 200 //Number of frames to save to AVI.
struct worker {
pthread_t thread_id;
int worker_id;
};
typedef struct worker worker_t;
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
void ParseOptionsFile();
QString GenerateGStreamerPipeline();
private slots:
void on_loadOptions_clicked();
void on_saveLocation_clicked();
void on_saveOptions_clicked();
void on_recordButton_clicked();
void on_previewButton_clicked();
void on_frameGrabButton_clicked();
private:
Ui::MainWindow *ui;
cv::VideoCapture cap;
FILE *pipeout;
unsigned int frame_rate_max, frame_rate_min, frame_rate_inc, frame_rate;
unsigned int height_max, width_max;
QTimer* timer;
CameraSettings* settings;
Ptr<BackgroundSubtractor> backSub;
Camera camera[2];
CEmergentFrame evtFrameRecv, evtFrameConvert;
QString format;
bool recording = false;
bool preview = false;
QString baseDirectory;
QLabel* previewWindow[4];
QLabel* backgroundWindow[4];
QLabel* trackingWindow[4];
int previewCounter = 0;
};
#endif // MAINWINDOW_H