vehicle_analysis.h 10.1 KB
/************************************************************
* Version: vehicle_analysis_v0.0.0.190311.gpuonly
* CopyRight: �п�����������Ƽ����޹�˾
* UpdateDate: 20190311
* Content: drafting the first edition by 
************************************************************/

#ifndef VEHICLEANALYSIS_H_
#define VEHICLEANALYSIS_H_

#ifdef _MSC_VER
#ifdef VEHICLEANALYSIS_EXPORTS
#define VEHICLEANALYSIS_API __declspec(dllexport)
#else
#define VEHICLEANALYSIS_API __declspec(dllimport)
#endif
#else
#define VEHICLEANALYSIS_API __attribute__ ((visibility ("default")))
#endif

#ifdef __cplusplus
extern "C"
{
#endif

#include "sy_common.h"		                        //ͨ�����ݽṹ�嶨��
#include "vehicle_result.h"		                    //������������ṹ�嶨��


#ifndef __VEHICLE_INFO__
#define __VEHICLE_INFO__
	typedef struct vehicle_info {                   	 //�������������
		vd_result vehicle_detect_res;               	 //��(��ͷ+��β)�����
		vd_result vehicle_win_detect_res;            	//���������
		vd_result vehicle_body_detect_res;           	 //���������
		vc_result vehicle_color_res;                 	//����ɫ
		vr_result vehicle_recg_res;                 //����ʶ��
		vplate_results vehicle_plate_det_recg_res;   	 //���Ƽ��ʶ����
		v_pendant_d_result vehicle_pendant_det_res;      //������
		vid_result vehicle_illegal_det_res;          	//����
		vf_result vehicle_fea_res;                   	//�Գ��ѳ�
		//vs_result vehicle_special_res;               	//����Ʒ�೵�ͣ�ֻ�л�������������
		//mucktruckcover_result vehicle_mucktruckcover_res; //�������Ǹ�״̬(��ͷ��ֻ������Ʒ�೵���е��������ͽ���������������������β��ֻ�л�����������)
		
		mta_result mta_res;                           //Ħ�г��Ƿ�����/Ħ�г���ʻ���Ƿ��ͷ��/ũ�ó��Ƿ�����

		manned_result manned_res;	 //�Ƿ��ǻ������ֳ����� 0-���ǻ���/�������ֳ�/���ֳ�δ����/����δ���ˣ�1-�������ˣ�2-���ֳ�����
				
	    int type;                                    //�������0-��ͷ��1-��β��2-Ħ�г���3-���ֳ�	��4-����	
		int vpt_type;
		int rainshed;		//是否安装雨棚, 0 有雨棚   1 无雨棚
		
		//int obj_quality_idx;//�۵��������ͣ�0-��Ч���ݣ�1-�������ݣ�2-��������
	} vehicle_info;
#endif


#ifndef __VEHICLE_ANALYSIS_RESULT__
#define __VEHICLE_ANALYSIS_RESULT__
	typedef struct va_result {		                 //����������� �ڴ����ⲿ����
		vehicle_info *info;				             //������ȫ���������
		int count;					                 //��������
	} va_result;                                     
#endif


#ifndef __DET_PARAM__
#define __DET_PARAM__
	typedef struct det_param                         //����㷨����
	{
		int process_min_l;
		int process_max_l;
		float thresld;
	}det_param;
#endif


#ifndef __VA_PARAM__
#define __VA_PARAM__
	typedef struct va_param
	{
		//�㷨���ò���
		sy_command vehicle_detect_config;	   	        	 //�Ƿ����������
		sy_command vehicle_recg_config;			      		 //�Ƿ���������ʶ��
		sy_command vehicle_recg_supplement_config;			 //�Ƿ���������ʶ�𲹳�ʶ��(��ͷ��βlogo���ʶ��+����15����)��ǰ�᣺��������ʶ��vehicle_recg_config��
		sy_command vehicle_plate_det_recg_config;	  		 //�Ƿ��������Ƽ��ʶ��
		sy_command vehicle_color_config;			  		 //�Ƿ�����������ɫʶ��
		sy_command vehicle_pendant_det_config;		  		 //�Ƿ�������������ʶ��
		sy_command vehicle_illegal_config;			  		 //�Ƿ�������Υ����Ϊ���
		sy_command vehicle_feature_config;			   		 //�Ƿ���������������ȡ
		//sy_command vehicle_special_config;			   		 //�Ƿ���������Ʒ�೵��ʶ�𡣣�ǰ�᣺��������ʶ��vehicle_recg_config��
		//sy_command vehicle_image_quality_config;	         //�Ƿ���������ͼ��������ʶ��	
		sy_command vehicle_motor_tricycle_analysis_config;	 //�Ƿ�����Ħ�г����ֳ�������Ħ�г��Ƿ�����/Ħ�г���ʻ���Ƿ��ͷ��/ũ�ó��Ƿ����ˣ�	
		//sy_command vehicle_motor_hs_output_config;			 //�Ƿ�����Ħ�г�δ��ͷ�����ͷ�����ꡣ��ǰ�᣺����Ħ�г����ֳ�����vehicle_motor_tricycle_analysis_config��		
		//sy_command vehicle_stain_vp_config;	 				  //�Ƿ������ڵ�����ʶ��	
		//sy_command vehicle_muck_truck_cover_config;			  //�Ƿ������������Ǹ�ʶ��(ǰ�᣺��������Ʒ�೵��ʶ��vehicle_special_config)
		//sy_command vehicle_lorry_manned_config;			      //�Ƿ�������������ʶ�𡣣�ǰ�᣺��������ʶ��vehicle_recg_config��
		sy_command vehicle_manned_config;			      //�Ƿ��������������ֳ�����ʶ�𡣣�ǰ�᣺��������ʶ��vehicle_recg_config��

		
		//�㷨��ʼ������
		int gpuid;                                      //ָ���Կ�id
		float vehicle_det_thresld=0.5;      			     //��������
		int min_obj_size=200;							//��ͷβ���Ŀ����С���ߣ�����ȡֵ��Χ100~200������С�ڸóߴ�Ĺ��˵���
		float vehicle_plate_det_thresld=0.5;              //���Ƽ�����
		float vehicle_attribute_det_thresld=0.5;          //�����Լ�����
		float vehicle_logo_det_thresld=0.1;              //��logo������
		
		float vc_thresld=0.5;							//����ɫ��ֵ
		char* dbPath;                                   //����ʶ��������··�� <��ǰ��֧��Ӣ��·��>		
		char* models_Path;                               //����ģ�͵�·�� <��ǰ��֧��Ӣ��·��>//20210615
				
	}va_param;
#endif


	/*************************************************************************
	* function: va_init
	* purpose: init resources
	* param:
	[in] handle 		- handle
	[in] param 			- init param
	* return: success(0) or error code(<0)
	* notes: null
	*************************************************************************/
	VEHICLEANALYSIS_API int va_init(void ** handle, va_param param);
	VEHICLEANALYSIS_API int va_acl_init();//������һ�Σ��ȵ���va_acl_init���ٵ���va_init

	/*************************************************************************
	* function: va_release
	* purpose: release sources
	* param:
	[in] handle				- handle
	* return: null
	* notes: null
	*************************************************************************/
	VEHICLEANALYSIS_API void va_release(void ** handle);
	VEHICLEANALYSIS_API void va_acl_release();//������һ�Σ������е�va_release���ͷ��ˣ�������va_acl_release
	
	/*************************************************************************
	* function: va_get_version
	* purpose: get sdk version
	* param: null
	* return: null
	* notes: null
	*************************************************************************/
	VEHICLEANALYSIS_API const char * va_get_version();

	/*************************************************************************
	* function: va_batch
	* purpose: vehicle analysis batch
	* param:
	[in] handle				- handle
	[in] img_data_array		- data array
	[in] format				- data format
	[in] batch_size			- batch size
	[in] result				- vehicle analysis result
	* return: success(0) or error code(<0)
	* notes: null
	*************************************************************************/
	VEHICLEANALYSIS_API int va_batch(void * handle, sy_img * img_data_array, int batch_size, va_result *result);	
	//img_data_array��device���ݣ�batch_size==16ʱ���ù̶�16ģ�ͣ�С��16ʱ���ù̶�1ģ�͡�
	VEHICLEANALYSIS_API int va_batch16_device(void * handle, sy_img * img_data_array, int batch_size, va_result *result);		
	


	/*************************************************************************
	* FUNCTION: VA_ComputeSimilarity
	* PURPOSE: �ȶ����ƶȣ�ͨ�ã�
	* PARAM:
	[in] Afea					- ��һ��ͼƬ����
	[in] Bfea					- �ڶ���ͼƬ����
	[in] featuresize			- ��������
	* RETURN:	���ƶ�
	* NOTES:	
	*************************************************************************/
	VEHICLEANALYSIS_API float va_compute_similarity(float *Afea, float *Bfea, int featuresize);

	/*************************************************************************
	* FUNCTION: va_compute_similarity_byvafeature
	* PURPOSE: �ȶ����ƶȣ����va������
	* PARAM:
	[in] Afea					- ��һ��ͼƬva����
	[in] Bfea					- �ڶ���ͼƬva����
	[in] featuresize			- ��������VA_FEATURESIZE
	* RETURN:	���ƶ�
	* NOTES:	
	*************************************************************************/
	VEHICLEANALYSIS_API float va_compute_similarity_byvafeature(void * handle , float *Afea, float *Bfea, int featuresize);

	

#ifdef __cplusplus
};
#endif

#endif