-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFaceDetector.h
38 lines (31 loc) · 941 Bytes
/
FaceDetector.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
#pragma once
#include <iostream>
#include <Windows.h>
#include <conio.h>
#include "Menu.h"
#include "Header.h"
#ifndef VISUALS_FACEDETECTOR_H
#define VISUALS_FACEDETECTOR_H
#include <opencv2/dnn.hpp>
class FaceDetector {
public:
explicit FaceDetector();
/// Detect faces in an image frame
/// \param frame Image to detect faces in
/// \return Vector of detected faces
std::vector<cv::Rect> detect_face_rectangles(const cv::Mat& frame);
private:
/// Face detection network
cv::dnn::Net network_;
/// Input image width
const int input_image_width_;
/// Input image height
const int input_image_height_;
/// Scale factor when creating image blob
const double scale_factor_;
/// Mean normalization values network was trained with
const cv::Scalar mean_values_;
/// Face detection confidence threshold
const float confidence_threshold_;
};
#endif //VISUALS_FACEDETECTOR_H