Blame view

src/ai_engine_module/hs_det_tricycle.h 3 KB
9c03cbe4   Zhao Shuaihua   增加三轮车/货车载人 二轮车超员/...
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
  /*******************************************************************************************
  * Version: head_shoulder_det_x64_v0.0.1
  * CopyRight: 中科视语(北京)科技有限公司
  * UpdateDate: 20230810
  * Content:头肩检测_三轮车
  ********************************************************************************************/
  #ifndef HSD_TRI_H_
  #define HSD_TRI_H_
  
  #ifdef _MSC_VER
  #ifdef HSD_TRI_EXPORTS
  #define HSD_TRI_API __declspec(dllexport)
  #else
  #define HSD_TRI_API __declspec(dllimport)
  #endif
  #else
  #define HSD_TRI_API __attribute__ ((visibility ("default")))
  #endif
  
  #include "sy_common.h"
  
  #define MAX_OBJ_COUNT 1000
  
  #ifdef __cplusplus
  extern "C"
  {
  #endif
  
  	typedef struct hs_tri_info	//结果结构体
  	{
  		int left;
  		int top;
  		int right;
  		int bottom;
  		double confidence;		//	置信度
  	}hs_tri_info;
  
  	typedef struct hs_tri_result
  	{
  		hs_tri_info objinfo[MAX_OBJ_COUNT];
  		int objcount;
  	};
  
  	typedef struct hs_tri_param
  	{
9c03cbe4   Zhao Shuaihua   增加三轮车/货车载人 二轮车超员/...
46
47
  		int devId;		//运行卡号 GPU模式下有效
  		char* modelNames;
d51ea997   Zhao Shuaihua   升级玩手机、雨棚模型;模型批处理;...
48
  		char* modelNames_b;
9c03cbe4   Zhao Shuaihua   增加三轮车/货车载人 二轮车超员/...
49
  		float thresld;	//检测阈值 默认为0.3
d51ea997   Zhao Shuaihua   升级玩手机、雨棚模型;模型批处理;...
50
51
  		int max_batch;
  		hs_tri_param() :devId(0), max_batch(8), thresld(0.4), modelNames(nullptr), modelNames_b(nullptr) {};
9c03cbe4   Zhao Shuaihua   增加三轮车/货车载人 二轮车超员/...
52
53
54
55
56
57
58
59
60
61
62
63
64
  	}hs_tri_param;
  
  	/*************************************************************************
  	* FUNCTION: hst_init
  	* PURPOSE: 初始化
  	* PARAM:
  	[in] handle		 -处理句柄
  	[in] param		 -初始化参数
  	* RETURN:	handle
  	* NOTES:成功(0)或者错误代码(<0)
  	*************************************************************************/
  	HSD_TRI_API int hs_tri_init(void **handle, hs_tri_param param);
  	HSD_TRI_API int hs_tri_process_batch(void * handle, sy_img *image_data_array, int batchsize, hs_tri_result *result);
d51ea997   Zhao Shuaihua   升级玩手机、雨棚模型;模型批处理;...
65
  	HSD_TRI_API int hs_tri_process_batchV2(void * handle, sy_img *image_data_array, int batchsize, hs_tri_result *result);
9c03cbe4   Zhao Shuaihua   增加三轮车/货车载人 二轮车超员/...
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
  	/*************************************************************************
  	* FUNCTION: hst_release
  	* PURPOSE: 资源释放
  	* PARAM:
  	[in] handle		- 处理句柄
  	* RETURN:	NULL
  	* NOTES:
  	*************************************************************************/
  	HSD_TRI_API void hs_tri_release(void **handle);
  
  
  	/*************************************************************************
  	* FUNCTION: hst_process_gpu
  	* PURPOSE: 
  	* PARAM:
  	[in] handle		- 处理句柄
  	[in] rgb		- 图片数据(3通道BGR数据 cv::Mat格式)
  	[in] width		- 图片宽度
  	[in] height		- 图片高度
  	[in] result		- 搜索结果,在外部申请足够内存
  	* RETURN:	-1:图像错误; 其他:检测到的个数
  	* NOTES:
  	*************************************************************************/
  	HSD_TRI_API int hs_tri_process(void * handle, sy_img image, hs_tri_result *result);
  
  	/*************************************************************************
  	* FUNCTION: hst_getversion
  	* PURPOSE: 释放
  	* PARAM:	NULL
  	* RETURN:	版本号
  	* NOTES:
  	*************************************************************************/
  	HSD_TRI_API const char * hs_tri_getversion();
  
  #ifdef __cplusplus
  };
  #endif
  
  #endif