-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvideoThread.hpp
More file actions
116 lines (91 loc) · 2.92 KB
/
videoThread.hpp
File metadata and controls
116 lines (91 loc) · 2.92 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
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
#ifndef _VIDEO_THREAD_HPP_
#define _VIDEO_THREAD_HPP_
#include <alproxies/alvideodeviceproxy.h>
#include <alproxies/alvideorecorderproxy.h>
#include <opencv2/opencv.hpp>
#include "unBoard.hpp"
#include "frednatorData.hpp"
#include <string>
#include <vector>
#include <QThread>
#include <QImage>
#include <QString>
#include <QComboBox>
#include <QFormLayout>
#include <QLabel>
#include <QLineEdit>
#include <yellowDetector.hpp>
#include <ballDetector.hpp>
#include <ballDetector2.hpp>
#include <fieldDetector.hpp>
#include <fieldDetector2.hpp>
#include <ellipseDetector.hpp>
#include <lineDetector.hpp>
#include <goalDetector.hpp>
#include "./Classes-Externas-Ao-CompetionCode/Raphael-NovoBallDetector/balldetectorrapha.h"
class VideoThread : public QObject
{
Q_OBJECT
QThread workerThread;
signals:
void startLoop();
void sendFrame();
void terminateThread();
void statusMessage(QString message);
void connection(bool connected);
public slots:
void connectVideo(bool connect, const QString &naoIP);
void videoLoop();
void savePicture();
private:
bool isAlive;
bool storeVideo;
bool thereIsFile;
bool isConnected;
bool isRecording;
bool savePictureLockFlag;
bool firstScreenshot;
bool isWebcam;
QString functionSelected; // Classe atualmente selecionada
QString lastFunctionName; // Ultima classe a ser selecionada
QComboBox* vectorSelection; //Seleciona qual imagem de debug se quer mostrar
QFormLayout* paramLayout; //Layout que possui os parametros de uma classe para se alterar
bool videoLoopRunning; //VideoLoop tá rodando
int screenshotCounter;
AL::ALVideoDeviceProxy *camProxy;
AL::ALVideoRecorderProxy *record;
cv::Mat imgSafe;
//cv::VideoWriter *record;
std::string clientName;
cv::Mat imgHeader;
cv::Mat imgHead; //img da cabeça do robo
cv::Mat imgBody; //img do corpo do robo
std::string strIP;
std::string copyExec;
std::string cameraID;
unBoard<frednatorData> imagePipe;
frednatorData imgContainer;
cv::VideoCapture *cap;
//selecao dos vetores
cv::Mat vectorSelectionInterface(QComboBox *vectorSelection, PerceptionData *visionData, QString *functionName);
public:
VideoThread();
~VideoThread();
void changeCamera(const int &camera);
void stopThread();
void startRecording(QString fileName);
void stopRecording();
void functionChanged(QString functionToChange, QComboBox* vectorSelection, QFormLayout* paramLayout);
void perception2Frednator(QString functionName, QComboBox* vectorSelection);
BallDetector ballDetector;
BallDetector2 ballDetector2;
EllipseDetector ellipseDetector;
FieldDetector fieldDetector;
FieldDetector2 fieldDetector2;
GoalDetector goalDetector;
LineDetector lineDetector;
YellowDetector yellowDetector;
ballDetectorRapha raphaDetector;
PerceptionData visionData;
};
#endif //_VIDEO_THREAD_HPP_