2016-06-09 63 views
0

我在Objective C中创建iPhone应用程序。我试图从图像中识别文本(从相机拍摄)。为此,我在我的应用程序Tesseract OCR库中使用。它对一些文本的工作正常,但没有从捕获的图像中获得准确的结果。还有谷歌代码的最新tessdata文件。如何使用iOS中的Tesseract OCR库识别图像中的准确文字?

我从this link添加了tesseract库。

下面是我的形象,我想认识:

enter image description here

我的代码如下:

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

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

但我得到的结果是这样的:

BAZAAR 

mm; l Savees l smmamm l mm; l Accessories 

commemw Street ' _ . «mm. me o snwapnagay 

www minabazaav.cum 

我已经通过这个链接:

其他人遇到同样的问题吗?

回答

0

对我来说Tesseract Library在大多数情况下并不准确。而不是Abby是好的。但艾比不脱机

Abby Stackoverflow Channel

+0

非常感谢您的回复@iDev,使用ABBYY我从我拍摄的图像的准确的文本。你能否请我建议我是否可以使用这个名称,地址,电子邮件,电话号码等单独的每个文本? –

+0

'http:// cloud.ocrsdk.com/processBusinessCard' with this api you will get separate values that you expect – Rajesh

+0

this is proper看看这个http://ocrsdk.com/documentation/apireference/processBusinessCard/ – Rajesh

相关问题