调整汉王算法

This commit is contained in:
13038267101 2022-07-28 17:04:38 +08:00
parent 6d7488d5d8
commit b7d8fed9f6
1 changed files with 27 additions and 30 deletions

View File

@ -792,7 +792,6 @@ namespace hg_imgproc
mats_.push_back(mats[i]);
}
HWOCR_SDKExit(pHanld);
#else
typedef int (*sdkinit)(void *);
typedef int (*sdkgetfiledirectimage)(unsigned char*pbImage, int nWidth, int nHeight, TColorType nColorType, void *pstHandle, int *pDirect);
@ -805,22 +804,19 @@ namespace hg_imgproc
sdkinit init = (sdkinit)dlsym(hanlde , "HWOCR_SDKInitialize");
sdkgetfiledirectimage d = (sdkgetfiledirectimage)dlsym(hanlde , "HWOCR_GetFileDirectImage");
sdkexit e= (sdkexit)dlsym(hanlde , "HWOCR_SDKExit");
printf("init :%x d:%x e:%x\r\n",init,d,e);
if (init && d && e)
{
ret = init(&pHanld);
if(ret != 0)
{
return SCANNER_ERR_ACCESS_DENIED;
}
for (size_t i = 0; i < mats.size(); i++)
{
ret = d(const_cast<uchar*>(mats[i].data),mats[i].cols,mats[i].rows,mats[i].channels()== 1 ? TColorType::EGray256:TColorType::EColor16M,pHanld,&pDirect);
if(ret != 0)
{
return SCANNER_ERR_NO_DATA;
}
if(pDirect == 1)
pDirect = 3;
@ -832,9 +828,10 @@ namespace hg_imgproc
}
}
e(pHanld) ;
#endif
#endif
dlclose(hanlde);
#endif
#endif
return ret;
}
int size_detection()