简体   繁体   English

如何使用iOS中的Tesseract OCR库从图像中识别准确的文本?

[英]How to recognise the accurate text from an image using Tesseract OCR Library in iOS?

I am creating an iPhone application in Objective C. I am trying to recognise the text from an image (taken from camera). 我正在目标C中创建一个iPhone应用程序。我试图从图像(从相机中获取)识别文本。 For this, I use in my app Tesseract OCR Library. 为此,我在我的应用程序Tesseract OCR库中使用。 Its working fine for some of the text but not getting accurate results from the captured image. 它对于某些文本可以正常工作,但无法从捕获的图像中获得准确的结果。 Also have the latest tessdata file from Google code. 还可以从Google代码获取最新的tessdata文件。

I added tesseract library from this link . 我从此链接添加了tesseract库。

Below is my image that I tried to recognise : 以下是我尝试识别的图像:

在此处输入图片说明

My code is as follows: 我的代码如下:

    G8Tesseract *tesseract = [[G8Tesseract alloc] initWithLanguage:@"eng+fra" engineMode:G8OCREngineModeTesseractCubeCombined];
    [tesseract setVariableValue:@"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:;,.!-()#&÷" forKey:@"tessedit_char_whitelist"];
    tesseract.pageSegmentationMode = G8PageSegmentationModeAuto;
    tesseract.maximumRecognitionTime = 60.0;
    tesseract.image = [selectedImage g8_blackAndWhite];
    [tesseract recognize];

    NSLog(@"%@", [tesseract recognizedText]);

But I am getting results like this : 但是我得到这样的结果:

BAZAAR

mm; l Savees l smmamm l mm; l Accessories

commemw Street ' _ . «mm. me o snwapnagay

www minabazaav.cum

I already go through from this links: 我已经从以下链接中进行了了解:

Do any one else experience the same problem? 还有其他人遇到同样的问题吗?

For my case Tesseract Library was not accurate most of the time. 就我而言,Tesseract库大多数时候都不准确。 instead Abby was kind of ok. 相反, 艾比还好。 but abby is not offline 但Abby不离线

Abby Stackoverflow Channel Abby Stackoverflow频道

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM