Fix nan issue in features
[trackerpp.git] / include / 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         // TODO
18         unsigned int detect(const cv::Mat& frame, Detection* detections){return 2;}
19     };
20
21     struct Detection
22     {
23         // 检测目标的类型,目前只有一个类human,默认等于0。为以后可以检测的更多类别预留
24         unsigned int object_type;
25         // 检测目标的分数,可以不填
26         float score;
27         // 检测目标的坐标,包括物体中心的x、y坐标,物体的高和宽
28         unsigned int center_x = 100;
29         unsigned int center_y = 100;
30         unsigned int height = 200;
31         unsigned int width = 200;
32         // 检测目标的特征向量
33         unsigned int feature_size;
34         float * feature;
35     };
36
37 }
38
39
40 #endif /* _DETECTOR_H_ */
41
42