vehicle_analysis.h
10.1 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
/************************************************************
* Version: vehicle_analysis_v0.0.0.190311.gpuonly
* CopyRight: �п�����������Ƽ�����˾
* UpdateDate: 20190311
* Content: drafting the first edition by
************************************************************/
#ifndef VEHICLEANALYSIS_H_
#define VEHICLEANALYSIS_H_
#ifdef _MSC_VER
#ifdef VEHICLEANALYSIS_EXPORTS
#define VEHICLEANALYSIS_API __declspec(dllexport)
#else
#define VEHICLEANALYSIS_API __declspec(dllimport)
#endif
#else
#define VEHICLEANALYSIS_API __attribute__ ((visibility ("default")))
#endif
#ifdef __cplusplus
extern "C"
{
#endif
#include "sy_common.h" //ͨ�����ݽṹ�嶨��
#include "vehicle_result.h" //������������ṹ�嶨��
#ifndef __VEHICLE_INFO__
#define __VEHICLE_INFO__
typedef struct vehicle_info { //�������������
vd_result vehicle_detect_res; //��(��ͷ+��β)�����
vd_result vehicle_win_detect_res; //���������
vd_result vehicle_body_detect_res; //���������
vc_result vehicle_color_res; //����ɫ
vr_result vehicle_recg_res; //����ʶ��
vplate_results vehicle_plate_det_recg_res; //���Ƽ��ʶ����
v_pendant_d_result vehicle_pendant_det_res; //������
vid_result vehicle_illegal_det_res; //����
vf_result vehicle_fea_res; //�Գ��ѳ�
//vs_result vehicle_special_res; //����Ʒ��ͣ�ֻ�л�������������
//mucktruckcover_result vehicle_mucktruckcover_res; //�������Ǹ�״̬(��ͷ��ֻ������Ʒ����е��������ͽ���������������������β��ֻ�л�����������)
mta_result mta_res; //Ħ�г��Ƿ�����/Ħ�г���ʻ���Ƿ��ͷ��/ũ�ó��Ƿ�����
manned_result manned_res; //�Ƿ��ǻ������ֳ����� 0-���ǻ���/�������ֳ�/���ֳ�δ����/����δ���ˣ�1-�������ˣ�2-���ֳ�����
int type; //�������0-��ͷ��1-��β��2-Ħ�г���3-���ֳ� ��4-����
int vpt_type;
int rainshed; //是否安装雨棚, 0 有雨棚 1 无雨棚
//int obj_quality_idx;//�۵��������ͣ�0-��Ч���ݣ�1-�������ݣ�2-��������
} vehicle_info;
#endif
#ifndef __VEHICLE_ANALYSIS_RESULT__
#define __VEHICLE_ANALYSIS_RESULT__
typedef struct va_result { //����������� �ڴ����ⲿ����
vehicle_info *info; //������ȫ���������
int count; //��������
} va_result;
#endif
#ifndef __DET_PARAM__
#define __DET_PARAM__
typedef struct det_param //����㷨����
{
int process_min_l;
int process_max_l;
float thresld;
}det_param;
#endif
#ifndef __VA_PARAM__
#define __VA_PARAM__
typedef struct va_param
{
//�㷨���ò���
sy_command vehicle_detect_config; //�Ƿ����������
sy_command vehicle_recg_config; //�Ƿ���������ʶ��
sy_command vehicle_recg_supplement_config; //�Ƿ���������ʶ��ʶ��(��ͷ��βlogo���ʶ��+����15����)��ǰ���������ʶ��vehicle_recg_config��
sy_command vehicle_plate_det_recg_config; //�Ƿ��������Ƽ��ʶ��
sy_command vehicle_color_config; //�Ƿ�����������ɫʶ��
sy_command vehicle_pendant_det_config; //�Ƿ�������������ʶ��
sy_command vehicle_illegal_config; //�Ƿ�������Υ����Ϊ���
sy_command vehicle_feature_config; //�Ƿ���������������ȡ
//sy_command vehicle_special_config; //�Ƿ���������Ʒ���ʶ�𡣣�ǰ���������ʶ��vehicle_recg_config��
//sy_command vehicle_image_quality_config; //�Ƿ���������ͼ��������ʶ��
sy_command vehicle_motor_tricycle_analysis_config; //�Ƿ�����Ħ�г����ֳ�������Ħ�г��Ƿ�����/Ħ�г���ʻ���Ƿ��ͷ��/ũ�ó��Ƿ����ˣ�
//sy_command vehicle_motor_hs_output_config; //�Ƿ�����Ħ�г�δ��ͷ�����ͷ�����ꡣ��ǰ�����Ħ�г����ֳ�����vehicle_motor_tricycle_analysis_config��
//sy_command vehicle_stain_vp_config; //�Ƿ������ڵ�����ʶ��
//sy_command vehicle_muck_truck_cover_config; //�Ƿ������������Ǹ�ʶ��(ǰ���������Ʒ���ʶ��vehicle_special_config)
//sy_command vehicle_lorry_manned_config; //�Ƿ�������������ʶ�𡣣�ǰ���������ʶ��vehicle_recg_config��
sy_command vehicle_manned_config; //�Ƿ��������������ֳ�����ʶ�𡣣�ǰ���������ʶ��vehicle_recg_config��
//�㷨��ʼ������
int gpuid; //ָ���Կ�id
float vehicle_det_thresld=0.5; //��������
int min_obj_size=200; //��ͷβ���Ŀ����С���ߣ�����ȡֵ��Χ100~200������С�ڸóߴ�Ĺ��˵���
float vehicle_plate_det_thresld=0.5; //���Ƽ�����
float vehicle_attribute_det_thresld=0.5; //�����Լ�����
float vehicle_logo_det_thresld=0.1; //��logo������
float vc_thresld=0.5; //����ɫ��ֵ
char* dbPath; //����ʶ��������··�� <��ǰ��֧��Ӣ��·��>
char* models_Path; //����ģ�͵�·�� <��ǰ��֧��Ӣ��·��>//20210615
}va_param;
#endif
/*************************************************************************
* function: va_init
* purpose: init resources
* param:
[in] handle - handle
[in] param - init param
* return: success(0) or error code(<0)
* notes: null
*************************************************************************/
VEHICLEANALYSIS_API int va_init(void ** handle, va_param param);
VEHICLEANALYSIS_API int va_acl_init();//������һ�Σ��ȵ���va_acl_init���ٵ���va_init
/*************************************************************************
* function: va_release
* purpose: release sources
* param:
[in] handle - handle
* return: null
* notes: null
*************************************************************************/
VEHICLEANALYSIS_API void va_release(void ** handle);
VEHICLEANALYSIS_API void va_acl_release();//������һ�Σ������е�va_release���ͷ��ˣ�������va_acl_release
/*************************************************************************
* function: va_get_version
* purpose: get sdk version
* param: null
* return: null
* notes: null
*************************************************************************/
VEHICLEANALYSIS_API const char * va_get_version();
/*************************************************************************
* function: va_batch
* purpose: vehicle analysis batch
* param:
[in] handle - handle
[in] img_data_array - data array
[in] format - data format
[in] batch_size - batch size
[in] result - vehicle analysis result
* return: success(0) or error code(<0)
* notes: null
*************************************************************************/
VEHICLEANALYSIS_API int va_batch(void * handle, sy_img * img_data_array, int batch_size, va_result *result);
//img_data_array��device���ݣ�batch_size==16ʱ���ù̶�16ģ�ͣ�С��16ʱ���ù̶�1ģ�͡�
VEHICLEANALYSIS_API int va_batch16_device(void * handle, sy_img * img_data_array, int batch_size, va_result *result);
/*************************************************************************
* FUNCTION: VA_ComputeSimilarity
* PURPOSE: �ȶ����ƶȣ�ͨ�ã�
* PARAM:
[in] Afea - ��һ��ͼƬ����
[in] Bfea - �ڶ���ͼƬ����
[in] featuresize - ��������
* RETURN: ���ƶ�
* NOTES:
*************************************************************************/
VEHICLEANALYSIS_API float va_compute_similarity(float *Afea, float *Bfea, int featuresize);
/*************************************************************************
* FUNCTION: va_compute_similarity_byvafeature
* PURPOSE: �ȶ����ƶȣ����va������
* PARAM:
[in] Afea - ��һ��ͼƬva����
[in] Bfea - �ڶ���ͼƬva����
[in] featuresize - ��������VA_FEATURESIZE
* RETURN: ���ƶ�
* NOTES:
*************************************************************************/
VEHICLEANALYSIS_API float va_compute_similarity_byvafeature(void * handle , float *Afea, float *Bfea, int featuresize);
#ifdef __cplusplus
};
#endif
#endif