Blame view

src/ai_engine_module/vpd.h 3.22 KB
6fdcb6a5   Hu Chunming   初次提交,代码大体完成编写,完善中
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
  /*******************************************************************************************

  * Version: VehiclePendantDetection_v0.1.0.180903.试用版本

  * CopyRight: 中科院自动化研究所模式识别实验室图像视频组

  * UpdateDate: 20180903

  * Content: 车属性检测

  ********************************************************************************************/

  #ifndef VPD_H_

  #define VPD_H_

  #if _MSC_VER

  #ifdef VPD_EXPORTS

  #define VPD_API __declspec(dllexport)

  #else

  #define VPD_API __declspec(dllimport)

  #endif

  #else

  #define VPD_API __attribute__ ((visibility ("default")))

  #endif

  

  

  #include "sy_common.h"		                        //通用数据结构体定义

  

  #define DEVICE_GPU 10

  #define DEVICE_CPU 11

  #define OBJ_MAX_COUNT 100		//最多支持检测目标数量 多余会被舍弃

  

  #ifndef NULL

  #ifdef __cplusplus

  #define NULL 0

  #else

  #define NULL ((void *)0)

  #endif

  #endif

  

  //车属性结果

  #ifndef VPD_RESULT_

  #define VPD_RESULT_

  typedef struct vpd_info

  {

  	sy_rect rect;

  	int index;		                     //类型

  	float confidence;	                 //置信度

  }vpd_info;

  

  typedef struct vpd_result

  {

  	vpd_info* vpd_res;

  	int count;

  }vpd_result;

  #endif

  

  

  typedef struct vehicle_pendant_det_param	

  {

  	//int mode;		//运行模式 CPU_MODE 或者 GPU_MODE

  	//int gpuid;		//显卡号

  	//int process_min_l = 360;	//短边缩放尺寸

  	//int process_max_l = 640;	//长边缩放尺寸

  	float dthresld;			 //检测阈值

  	float dlogo_thresld;     //logo检测阈值

  	int devId;               //ָ指定显卡id

  	char* dmodelNames;       //检测模型路径

  	// char* dmodelNames_b10;   //检测模型路径

  	

  	//int log=0;//日志 0:关闭 1:开启

  }vehicle_pendant_det_param;

  

  /*************************************************************************

  * FUNCTION: VPD_Init

  * PURPOSE: 载入模型

  * PARAM:

  [in] handle		 句柄

  [in] param		 初始化参数

  * RETURN:	成功(0)或返回错误代码

  * NOTES:

  *************************************************************************/

  VPD_API int vpd_init(void **handle, vehicle_pendant_det_param params);

  

  /*************************************************************************

  * FUNCTION: VPD_Detection

  * PURPOSE: 车挂件检测

  * PARAM:

  [in] handle		- 检测句柄

  [in] imgdata	- 图像数据

  [in] batchsize	- 图像batchsize

  [in] vpd_result	- 检测结果

  * NOTES:

  *************************************************************************/

  VPD_API int vpd_process(void * handle, sy_img *imgdata, int batchsize, vpd_result *vpd_result_);

  

  // VPD_API int vpd_process10(void * handle, sy_img *imgdata, int batchsize, vpd_result *vpd_result_);

  /*************************************************************************

  * FUNCTION: VPD_Release

  * PURPOSE: 释放

  * PARAM:

  [in] handle			- handle

  * RETURN:	NULL

  * NOTES:

  *************************************************************************/

  VPD_API void vpd_release(void **handle);

  

  /*************************************************************************

  * FUNCTION: VPD_GetVersion

  * PURPOSE:

  * PARAM:	NULL

  * RETURN:	版本号

  * NOTES:

  *************************************************************************/

  VPD_API const char * vpd_get_version();

  

  #endif