#include "VehiclePlate.h" #include //static string type[69] = { "��", "��", "��", "��", "��", "��", "��", "��", "��", "��", "��", "��", "��", "��", "��", "³", "ԥ", "��", "��", "��", "��", "��", "��", "��", "��", "��", "��", "��", "��", "��", "��", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "��", "ѧ", "ʹ", "��" }; int VehiclePlateDetectRecog_Init(void *&handle, int gpuid, char* auth_license) { vpd_param param; param.gpuid = gpuid; param.thresld = 0.3; param.max_batch = 20; param.serialize_file = "./serialize_file/VPD"; param.auth_license = auth_license; vpr_param rparam; rparam.gpuid =gpuid; param.max_batch = 20; param.serialize_file = "./serialize_file/VPR"; int ret = vpdr_init(&handle, param, rparam); if (ret != 0) { cout << "Init platedr Failed!" << endl; return FAILED; } return SUCCESS; } int VehiclePlateDetectRecog_Process(void * handle, sy_img * batch_img, int batchsize, vplate_result *&result) { /*��ʼ������ṹ��*/ vplates_result * all_result = new vplates_result[batchsize] {}; for (int i = 0; i max_score) { max_score = all_result[b].vehicle_plate_infos[j].detect_score; best_index = j; } } memcpy(&result[b], &all_result[b].vehicle_plate_infos[best_index], sizeof(vplate_result)); } for (int i = 0; i < batchsize; i++) { free(cpu_batch_img[i].data_); cpu_batch_img[i].data_ = nullptr; } if (all_result != NULL) delete [] all_result; return SUCCESS; } int VehiclePlateDetectRecog_Release(void *& handle) { if (handle) vpdr_release(&handle); return SUCCESS; }