/************************************************************************* * Version: road_seg_v0.0.0.20230313 * CopyRight : 中国科学院自动化所模式识别实验室图像视频组 * UpdateDate: * Content : 道路分割 *************************************************************************/ #ifndef ROADSEG3CLS_H_ #define ROADSEG3CLS_H_ #if _MSC_VER #ifdef ROADSEG3CLS_EXPORTS #define ROADSEG3CLS_API __declspec(dllexport) #else #define ROADSEG3CLS_API __declspec(dllimport) #endif #else #define ROADSEG3CLS_API __attribute__ ((visibility ("default"))) #endif #include "sy_common.h" #ifdef __cplusplus extern "C" { #endif #ifndef __RS3CLS_LANE__ #define __RS3CLS_LANE__ typedef struct rs3cls_lane { sy_point points[180]; // 车道线上的点坐标数组 int num_points; // 车道线上点的数量 float start_x; // 起始点x坐标 float start_y; // 起始点y坐标 float cls; // 车道线类别 1-实线 2-虚线 float conf; // 车道线置信度 }rs3cls_lane; #endif #ifndef __RS3CLS_RESULT__ #define __RS3CLS_RESULT__ typedef struct rs3cls_result { rs3cls_lane reg_array[20]; int lane_count; unsigned char *seg_array; }rs3cls_result; #endif #ifndef __RS3CLS_PARAM__ #define __RS3CLS_PARAM__ typedef struct rs3cls_param { int devId; //运行卡号 char* modelNames; float thresld; //检测阈值 默认为0.3 }rs3cls_param; #endif /************************************************************************* * FUNCTION: rs3cls_init * PURPOSE: 载入模型 * PARAM: [in] handle - 句柄 [in] params - 参数 * RETURN: 成功(0)或者错误代码 * NOTES: *************************************************************************/ ROADSEG3CLS_API int rs3cls_init(void ** handle, rs3cls_param param); /************************************************************************* * FUNCTION: rs3cls_process * PURPOSE: 车颜色识别 * PARAM: [in] handle - 检测句柄 [in] img_data - 图像数据 [in] result - 结果 内存在外部申请 * RETURN: 成功(0) 或 错误代码(< 0) * NOTES: *************************************************************************/ ROADSEG3CLS_API int rs3cls_process(void *handle, sy_img img_data, rs3cls_result result); /************************************************************************* * FUNCTION: rs3cls_batch * PURPOSE: 车颜色识别 batch * PARAM: [in] handle - 检测句柄 [in] img_data_array - 图像数据 [in] batch_size - 图像数目 [in] result - 结果 内存在外部申请 * RETURN: 成功(0) 或 错误代码(< 0) * NOTES: *************************************************************************/ ROADSEG3CLS_API int rs3cls_batch(void *handle, sy_img* img_data_array, int batch_size, rs3cls_result* result); /************************************************************************* * FUNCTION: rs3cls_release * PURPOSE: 释放 * PARAM: [in] handle - handle * RETURN: NULL * NOTES: *************************************************************************/ ROADSEG3CLS_API void rs3cls_release(void ** handle); /************************************************************************* * FUNCTION: rs3cls_get_version * PURPOSE: * PARAM: NULL * RETURN: 版本号 * NOTES: *************************************************************************/ ROADSEG3CLS_API const char * rs3cls_get_version(); #ifdef __cplusplus }; #endif #endif