vpd.h 3.22 KB
/*******************************************************************************************
* 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