stl_aiplatform_header.h
3.5 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/*
* @Author: yangzilong
* @Date: 2021-11-24 11:39:57
*/
#pragma once
#include "../../DxDecoder/DxDecoderWrap.h"
#include "header.h"
#include <string.h>
#include <set>
#include <bitset>
using namespace std;
#define VTTYPECOUNT 10 //支持的最大类别数
#define MAX_OBJ_COUNT 100
//设置最小检测框,直接指定sy_rect的宽高即可,各种类目标小于最小检测框大小时不进行快照的保存和后续二次属性分析
//sy_rect m_boxsize[DETECTTYPE] = { sy_rect(0,0,40, 90), sy_rect(0,0,50, 80), sy_rect(0,0,50, 80), sy_rect(0,0,60, 80), sy_rect(0,0,80, 80), sy_rect(0,0,90, 90), sy_rect(0,0,100, 100), sy_rect(0,0,100, 100), sy_rect(0,0,100, 100) }; //行人 自行�?摩托�?三轮�?小型�?大车 卡车 拖拉�?中巴
struct OBJ_INDEX {
int index;
int count; //用于对index的计数
OBJ_INDEX() : count(0), index(0) {}
};
// 0-行人 1-自行车 2-摩托车 3-三轮车 4-小型车 5-大车 6-卡车 7-拖拉机 8-中巴
enum class det_class_label_t
{
HUMAN = 0,
BICYCLE = 1,
MOTOCYCLE = 2,
TRICYCLE = 3,
SMALL_CAR = 4,
LARGE_CAR = 5,
TRUCK = 6,
TRACTOR = 7,
MEDIUM_BUS = 8,
};
typedef struct det_objinfo //结果结构体
{
int left;
int top;
int right;
int bottom;
int center_x;
int center_y;
int index; // 行人/车辆类别,支持10类
long id; // 目标唯一ID,同一ID为同一目标
int num; // 该ID序列下的第num帧
double confidence; // 置信度
int snap_flag;
sy_point landmark_point[25];//人脸关键点位置信息
//-added by zsh 220719 人脸姿态角-
float roll = 0.0;
float yaw = 0.0;
float pitch = 0.0;
//-------------------------------
}det_objinfo;
typedef struct onelevel_det_result
{
int obj_count;
det_objinfo obj[MAX_OBJ_COUNT];
}onelevel_det_result;
struct OBJ_KEY {
string video_id;
int obj_id;
bool operator< (OBJ_KEY const& _A) const
{
if (strcmp(video_id.c_str(), _A.video_id.c_str()) < 0) return true;
if (strcmp(video_id.c_str(), _A.video_id.c_str()) == 0) return obj_id < _A.obj_id;
return false;
}
bool operator== (OBJ_KEY const& _A) const
{
if (strcmp(video_id.c_str(), _A.video_id.c_str())==0 && obj_id == _A.obj_id)
return true;
else
return false;
}
};
#define EDGESIZE 4
#define SCALE_OUT 10 // 外扩信息
const sy_rect m_boxsize[DETECTTYPE] = { sy_rect(0, 0, 40, 90), sy_rect(0, 0, 50, 80), sy_rect(0, 0, 50, 80), sy_rect(0, 0, 60, 80), sy_rect(0, 0, 80, 80),
sy_rect(0, 0, 90, 90), sy_rect(0, 0, 100, 100), sy_rect(0, 0, 100, 100), sy_rect(0, 0, 100, 100) }; //行人 自行车 摩托车 三轮车 小型车 大车 卡车 拖拉机 中巴
const int minDistance[EDGESIZE] = { 35, 50, 35, 50 };
struct OBJ_VALUE {
bool finishTracker; //轨迹结束可以保存了
int frameCount;
bool isupdate;
int lost;
DxGPUFrame snapShot;
DxGPUFrame snapShotLittle;
sy_rect obj_pos;
double confidence; // 置信度
float last_area;
float max_area;
OBJ_INDEX index;
bitset< EDGESIZE > flags; //标志位,标记快照框应该如何判断,left:0 top:1 right:2 bottom:3
sy_point landmark_point[25];//人脸关键点位置信息
sy_rect position; //检测实际目标框
//-added by zsh 220719 人脸姿态角-
float roll = 0.0;
float yaw = 0.0;
float pitch = 0.0;
//-------------------------------
};
struct algor_open_config_param
{
set<algo_type> human_face_algors;
set<algo_type> human_algors;
set<algo_type> nonmotor_vehicle_algors;
set<algo_type> vehicle_algors;
};
enum TaskOperator
{
ADDTASK,
PAUSETASK,
RESTARTTASK,
FINISHTASK
};