Blame view

src/ai_engine_module/road_seg.h 3.29 KB
02e5e637   Zhao Shuaihua   增加行人/非机动车占机动车道(50...
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
  /*************************************************************************
  * Version: road_seg_v0.0.0.20230313
  * CopyRight : 中国科学院自动化所模式识别实验室图像视频组
  * UpdateDate
  * Content : 道路分割
  *************************************************************************/
  #ifndef ROADSEG_H_
  #define ROADSEG_H_
  
  #if _MSC_VER
  #ifdef ROADSEG_EXPORTS
  #define ROADSEG_API __declspec(dllexport)
  #else
  #define ROADSEG_API __declspec(dllimport)
  #endif
  #else
  #define ROADSEG_API __attribute__ ((visibility ("default")))
  #endif
  
  #include "sy_common.h"
  
  #ifdef __cplusplus
  extern "C"
  {
  #endif
  
  #ifndef __RS_LANE__
  #define __RS_LANE__
  typedef struct rs_lane {
      sy_point points[180];    	// 车道线上的点坐标数组
      int num_points;       		// 车道线上点的数量
      float start_x;           	// 起始点x坐标
      float start_y;           	// 起始点y坐标
      float cls;       			// 车道线类别 1-实线 2-虚线
      float conf;        			// 车道线置信度
  }rs_lane;
  #endif 
  
  #ifndef __rs_RESULT__
  #define __rs_RESULT__ 
  	typedef struct rs_result
  	{
  		rs_lane reg_array[20];	 
  		int lane_count;               
  		unsigned char *seg_array;		
  	}rs_result;
  #endif 
  
  #ifndef __rs_PARAM__
  #define __rs_PARAM__
  	typedef struct rs_param
  	{
  		int devId;		//运行卡号 
  		char* modelNames;
  		float thresld;	//检测阈值 默认为0.3
  	}rs_param;
  #endif
  
  	/*************************************************************************
  	* FUNCTION: rs_init
  	* PURPOSE: 载入模型
  	* PARAM:
  	[in] handle			- 句柄
  	[in] params			- 参数
  	* RETURN:	成功(0)或者错误代码
  	* NOTES:
  	*************************************************************************/
  	ROADSEG_API int rs_init(void ** handle, rs_param param);
  
  	/*************************************************************************
  	* FUNCTION: rs_process
  	* PURPOSE: 车颜色识别
  	* PARAM:
  	[in] handle			- 检测句柄
  	[in] img_data		- 图像数据
  	[in] result			- 结果 内存在外部申请
  	* RETURN:	成功(0)  错误代码(< 0
  	* NOTES:
  	*************************************************************************/
  	ROADSEG_API int rs_process(void *handle, sy_img img_data, rs_result result);
  
  	/*************************************************************************
  	* FUNCTION: rs_batch
  	* PURPOSE: 车颜色识别 batch
  	* PARAM:
  	[in] handle			- 检测句柄
  	[in] img_data_array	- 图像数据
  	[in] batch_size		- 图像数目
  	[in] result			- 结果 内存在外部申请
  	* RETURN:	成功(0)  错误代码(< 0
  	* NOTES:
  	*************************************************************************/
  	ROADSEG_API int rs_batch(void *handle, sy_img* img_data_array, int batch_size, rs_result* result);
  
  
  	/*************************************************************************
  	* FUNCTION: rs_release
  	* PURPOSE: 释放
  	* PARAM:
  	[in] handle			- handle
  	* RETURN:	NULL
  	* NOTES:
  	*************************************************************************/
  	ROADSEG_API void rs_release(void ** handle);
  
  
  	/*************************************************************************
  	* FUNCTION: rs_get_version
  	* PURPOSE:
  	* PARAM:	NULL
  	* RETURN:	版本号
  	* NOTES:
  	*************************************************************************/
  	ROADSEG_API const char * rs_get_version();
  
  #ifdef __cplusplus
  };
  #endif
  
  #endif