VehicleAnalysis.h
1.53 KB
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
60
61
62
63
64
65
66
#ifndef __AI_ENGINE_MODULE_VEHICLE_ANALYSIS_H__
#define __AI_ENGINE_MODULE_VEHICLE_ANALYSIS_H__
#include "include.h"
#include "vehicle_analysis.h"
#include "../village_inc.h"
struct DriverInfo {
sy_rect driver_rect;
float driver_prob;
int driver_color;
};
struct VehicleAnalysisParam {
int devId;
std::string sdk_root;
int max_batch_size;
};
struct VehicleAnalysisResult{
int shot_type;
sy_rect vehicle_rect;
string vehicle_type;
sy_rect plate_rect;//车牌检测坐标
float plate_det_score;//车牌检测置信度
string plate_num;
string character_prob;
float plate_num_score;//识别置信度
int plate_type; //车牌类型:0-单排蓝色 1-单排黄色 2-单排白色 3-单排黑色 4-双排黄色 5-双排白色 6-新能源黄绿色 7-新能源白绿色
int special_type; //常规车牌、临时车牌、低速车牌。0-common,1-temporary_license_plate,2-low_speed_license_plate.
vector<DriverInfo> vec_drivers; // 副驾也被认为是司机
int motor_helmeted;
int motor_manned{0};
};
class VehicleAnalysis
{
private:
/* data */
public:
VehicleAnalysis(/* args */);
~VehicleAnalysis();
int init(VehicleAnalysisParam tParam);
vector<AnalysisResult> detect(vector<sy_img> vec_img);
private:
void release();
vector<AnalysisResult> va_result2AnalysisResult(va_result* result, int batchsize);
private:
void* m_handle{nullptr};
float m_threshold;
int m_max_batchsize{1};
};
#endif // __AI_ENGINE_MODULE_VEHICLE_ANALYSIS_H__