-
Notifications
You must be signed in to change notification settings - Fork 0
/
matframearea.h
60 lines (43 loc) · 1.18 KB
/
matframearea.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
/*
* File: VideoArea.h
* Author: viniciusas
*
* Created on 2 de Dezembro de 2016, 18:15
*/
#ifndef VIDEOAREA_H
#define VIDEOAREA_H
#include <vector>
#include <mutex>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/imgcodecs.hpp>
#include <gtkmm-3.0/gtkmm/drawingarea.h>
#include <gdkmm-3.0/gdkmm/general.h>
#include <gdkmm-3.0/gdkmm/pixbuf.h>
#include <glibmm-2.4/glibmm/refptr.h>
#include <glibmm-2.4/glibmm/main.h>
#include <cairomm-1.0/cairomm/surface.h>
class MatFrameArea : public Gtk::DrawingArea {
public:
MatFrameArea();
void setFrame(const cv::Mat &img);
cv::Mat getFrame();
void setFaces(const std::vector<cv::Rect> &faces);
void setShowEigenFaceImage(bool t);
bool getShowEigenFaceImage();
void toggleShowEigenFaceImage();
bool repaint();
protected:
virtual bool on_draw (const Cairo::RefPtr<Cairo::Context> &cr);
private:
bool showEigenFaceImage = false;
struct Rectangle {
double x, y;
double widht, height;
};
std::mutex frameMutex;
cv::Mat frame;
std::vector<Rectangle> facesRects;
double mHorizontal = 0, mVertical = 0;
};
#endif /* VIDEOAREA_H */