This project is read-only.
1
Vote

Very poor recognition results

description

Code does not generate any error but the resulting string contains only garbage. I am running on Windows 10 x64 using a development environment known as WinDev (version 20). Any suggestion?

FUNCTION OCR(sNomFichier is a string, sLangue is a string="French")

//PumaLanguage
//English(PumaLanguage) = 0
//French(PumaLanguage) = 2

sRes is a string
sMess is a string
sUConversion is a UNICODE string
nErrCode is an integer
pclOCRException is an object "RecognitionEngineException" dynamic = new "RecognitionEngineException"
pclPumaPage is an object "PumaPage" dynamic = new "PumaPage"(sNomFichier)

pclPumaPage.FileFormat = PumaFileFormat.TxtAnsi
pclPumaPage.EnableSpeller = True
pclPumaPage.Language = LanguageStrings.GetSupportedLanguage(pclPumaPage,sLangue)
//pclPumaPage.set_AutoRotateImage(vrai)
//pclPumaPage.ImproveFax100=vrai
//pclPumaPage.LoadImage(sNomFichier)
//pclPumaPage.RecognizePictures=faux
//pclPumaPage.RecognizeTables=faux
//pclPumaPage.UseTextFormating=faux

WHEN EXCEPTION IN
sUConversion = pclPumaPage.RecognizeToString()
DO
nErrCode=pclOCRException.get_ErrorCode()
sMess=pclOCRException.get_Message()
Error(sMess,nErrCode)
    sRes=""
ELSE
sRes = UnicodeVersAnsi(sUConversion,charsetAnsi)
END

pclPumaPage.Dispose()

Delete pclPumaPage

pclPumaPage = Null

RETURN sRes

comments