| | |
| | | |
| | | // 设置Licence Manager运行路径 |
| | | int ret = TH_SetSoPath(soPath); |
| | | |
| | | printf("TH_SetSoPath ret %d\n", ret); |
| | | // 初始化 sdk |
| | | ret = TH_InitPlateIDSDK(&config); |
| | | printf("TH_InitPlateIDSDK ret %d\n", ret); |
| | | |
| | | // 设置车牌类型识别 |
| | | set_enable_plate_format(params); |
| | |
| | | int nResultNum = 1; |
| | | |
| | | ::TH_PlateIDResult result[6]; |
| | | memset(&result, 0, sizeof(result)); |
| | | memset(&result[0], 0, sizeof(result)); |
| | | |
| | | // 设置识别区域 |
| | | ::TH_RECT rcDetect; |
| | |
| | | |
| | | int ret = TH_RecogImage((BYTE*)(img->data), img->width, img->height, result, &nResultNum, &rcDetect, &config); |
| | | // printf("TH_RecogImage ret = %d\n", ret); |
| | | if (ret == 0){ |
| | | ret = TH_EvaluateCarColor((BYTE*)(img->data), img->width, img->height, result, &nResultNum, &rcDetect, &config); |
| | | } |
| | | if (ret == 0 && nResultNum > 0){ |
| | | ppos = (cPlateIDResult*)malloc(nResultNum * sizeof(cPlateIDResult)); |
| | | *plateIDCount = nResultNum; |
| | | memcpy(ppos, result, sizeof(TH_PlateIDResult) * nResultNum); |
| | | } |
| | | |
| | | return ppos; |
| | | } |
| | | |