-
Notifications
You must be signed in to change notification settings - Fork 7
/
VideoPlayer.h
37 lines (34 loc) · 888 Bytes
/
VideoPlayer.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
#ifndef VIDEOPLAYER_H
#define VIDEOPLAYER_H
#include <QMutex>
#include <QThread>
#include <QImage>
#include <QWaitCondition>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <FaceDetector.h>
class PoseEstimation;
class VideoPlayer : public QThread
{
Q_OBJECT
public:
explicit VideoPlayer(QObject *parent = nullptr, unsigned int camIdx = 0);
~VideoPlayer();
void play();
protected:
void run();
signals:
void processedImage(const QImage &image, cv::Mat rmat, cv::Mat tvec);
private:
void poseEstimate(cv::Mat &frame, QImage::Format format);
QImage _image;
unsigned int _camIdx;
FaceDetector *_detector;
cv::VideoCapture _capture;
QWaitCondition _condition;
QMutex _mutex;
PoseEstimation *_poseEstimator;
};
Q_DECLARE_METATYPE(cv::Mat);
#endif // VIDEOPLAYER_H