vid_clothes.h 3.27 KB
/*************************************************************************
* Version: vid_clothes_recognition_v0.0.0.20220325
* CopyRight : 
* UpdateDate:20220325
* Content : 司乘人员衣服颜色识别
*************************************************************************/
#ifndef VIDCLOTHES_H_
#define VIDCLOTHES_H_

#if _MSC_VER
#ifdef VIDCLOTHES_EXPORTS
#define VIDCLOTHES_API __declspec(dllexport)
#else
#define VIDCLOTHES_API __declspec(dllimport)
#endif
#else
#define VIDCLOTHES_API __attribute__ ((visibility ("default")))
#endif

#include "sy_common.h"

#ifdef __cplusplus
extern "C"
{
#endif



//2.车颜色结果
#ifndef VIDCLOTHES_RESULT_
#define VIDCLOTHES_RESULT_
typedef struct vidclothes_result
{
	float score{0.0};
	int index {14};  //13类:"棕", "橙", "灰", "白", "粉", "紫", "红", "绿", "蓝", "银", "青", "黄", "黑"
}vidclothes_result;
#endif


#ifndef __VIDCLOTHES_PARAM__
#define __VIDCLOTHES_PARAM__
	typedef struct vidclothes_param
	{
		int devId;						//指定显卡id
		char* modelNames;
		float thresld;    //阈值
		vidclothes_param() :devId(0), thresld(0.6) {};
	}vidclothes_param;
#endif

	/*************************************************************************
	* FUNCTION: vidclothes_init
	* PURPOSE: 载入模型
	* PARAM:
	[in] handle			- 句柄
	[in] params			- 参数
	* RETURN:	成功(0)或者错误代码
	* NOTES:
	*************************************************************************/
	VIDCLOTHES_API int vidclothes_init(void ** handle, vidclothes_param param);

	/*************************************************************************
	* FUNCTION: vidclothes_process
	* PURPOSE: 车颜色识别
	* PARAM:
	[in] handle			- 检测句柄
	[in] img_data		- 图像数据
	[in] result			- 结果 内存在外部申请
	* RETURN:	成功(0) 或 错误代码(< 0)
	* NOTES:
	*************************************************************************/
	VIDCLOTHES_API int vidclothes_process(void *handle, sy_img img_data, vidclothes_result * result);

	/*************************************************************************
	* FUNCTION: vidclothes_batch
	* PURPOSE: 车颜色识别 batch
	* PARAM:
	[in] handle			- 检测句柄
	[in] img_data_array	- 图像数据
	[in] batch_size		- 图像数目
	[in] result			- 结果 内存在外部申请
	* RETURN:	成功(0) 或 错误代码(< 0)
	* NOTES:
	*************************************************************************/
	VIDCLOTHES_API int vidclothes_batch(void *handle, sy_img* img_data_array, int batch_size, vidclothes_result * result);


	/*************************************************************************
	* FUNCTION: vidclothes_release
	* PURPOSE: 释放
	* PARAM:
	[in] handle			- handle
	* RETURN:	NULL
	* NOTES:
	*************************************************************************/
	VIDCLOTHES_API void vidclothes_release(void ** handle);


	/*************************************************************************
	* FUNCTION: vidclothes_get_version
	* PURPOSE:
	* PARAM:	NULL
	* RETURN:	版本号
	* NOTES:
	*************************************************************************/
	VIDCLOTHES_API const char * vidclothes_get_version();

#ifdef __cplusplus
};
#endif

#endif