DFace SDK  1.8.5
dface_detect.h
1 
2 /*****************************************************************************
3 * DFace pro SDK library
4 * Copyright (C) 2018 杭州小孔成像科技有限公司(dface.tech).
5 * @file dface_d.h
6 * @brief DFace人脸检测API抽象类
7 *
8 *
9 * @author Pinhole(dface.tech)
10 * @email customer@dface.tech
11 * @version 1.3.2
12 * @date 2018-05-02
13 * @license no free
14 *
15 *----------------------------------------------------------------------------
16 * Remark : Description
17 *----------------------------------------------------------------------------
18 * Change History :
19 * <Date> | <Version> | <Author> | <Description>
20 *----------------------------------------------------------------------------
21 * 2018/05/02 | 1.3.2 | Pinhole |
22 *----------------------------------------------------------------------------
23 *
24 *****************************************************************************/
25 
26 #ifndef DFACE_D_H
27 #define DFACE_D_H
28 
29 #include <string>
30 #include <dface/common.h>
31 #include <dface/mat.h>
32 
33 namespace dface{
34  using namespace std;
39  class DFACE_EXPORTS DfaceDetect{
40 
41  public:
42  DfaceDetect(){};
43 
44  virtual ~DfaceDetect() { return; };
45 
46  virtual int identify() const = 0;
47 
56  virtual void detection(const dface::Mat &img, std::vector<dface::Bbox> &out_bboxs, bool square=true) const = 0;
57 
58 
59 
68  virtual void detectionMaxFace(const dface::Mat &img, std::vector<dface::Bbox> &out_bboxs, bool square=true) const = 0;
69 
70 
71 
79  virtual void detectionLimited(const dface::Mat &img, std::vector<dface::Bbox> &out_bboxs) = 0;
80 
81 
89  virtual void alignFace(const dface::Mat &face, dface::Mat &out_face) const = 0;
90 
91 
101  virtual void detectionMaxFaceAndCrop(const dface::Mat &img, dface::Mat &out_face, std::vector<dface::Bbox> &out_bboxs) const = 0;
102 
103 
113  virtual void detectionAndCrop(const dface::Mat &img, std::vector<dface::Mat> &out_faces, std::vector<dface::Bbox> &out_bboxs) const = 0;
114 
115 
125  virtual void cropFace(const dface::Mat &img, const dface::Rect &rect, dface::Mat &out_face) const = 0;
126 
127 
137  virtual void cropFace(const dface::Mat &img, const dface::Bbox &bbox, dface::Mat &out_face) const = 0;
138 
139 
149  virtual void predictBlur(const dface::Mat &img, const std::vector<dface::Bbox> &in_bboxs, std::vector<double> &out_blur) = 0;
150 
160  virtual void predictLight(const dface::Mat &img, const std::vector<dface::Bbox> &in_bboxs, std::vector<int> &out_light) = 0;
161 
162 
163 
169  virtual void SetNumThreads(int numThreads) = 0;
170 
174  virtual void SetTimeCount(int timeCount) = 0;
175 
181  virtual void SetMinFace(int minSize) = 0;
182 
183 
188  virtual int GetNumThreads() const = 0;
189 
190  };
191 
192 
197  typedef DfaceDetect* CreateDetect(string model_path);
198 
203  typedef void DestroyDetect(DfaceDetect* dc);
204 
205 }
206 
207 
208 
209 #endif //DFACE_D_H
Definition: common.h:37
Bbox 检测到的人脸边框信息类 图片坐上角坐标为(0,0), x值向右增加,y值向下增加
Definition: common.h:46
Mat dface内置的图像数据 dface的所有接口只支持dface::Mat(RGB格式)
Definition: mat.h:23
DFace人脸检测API抽象层(DFaceDetect)
Definition: dface_detect.h:39