unify the interface with detector
[trackerpp.git] / src / Detector.h
1 #ifndef _DETECTOR_H_
2 #define _DETECTOR_H_
3
4 #include "VideoReader.h"
5 #include "SharedPtr.h"
6
7 namespace suanzi {
8
9     struct Detection;
10
11     TK_DECLARE_PTR(Detector);
12     class Detector
13     {
14     public:
15         Detector();
16         virtual ~Detector();
17         unsigned int detect(cv::Mat& frame, Detection* detections){return 1;}
18     };
19
20     struct Detection
21     {
22         // 检测目标的类型,目前只有一个类human,默认等于0。为以后可以检测的更多类别预留
23         unsigned int object_type;
24         // 检测目标的分数,可以不填
25         float score;
26         // 检测目标的坐标,包括物体中心的x、y坐标,物体的高和宽
27         unsigned int center_x;
28         unsigned int center_y;
29         unsigned int height;
30         unsigned int width;
31         // 检测目标的特征向量
32         unsigned int feature_size;
33         float * feature;
34     };
35
36 }
37
38
39 #endif /* _DETECTOR_H_ */
40
41