【发布时间】:2016-10-09 17:16:29
【问题描述】:
我正在 Objective C 中创建一个 iPhone 应用程序。我正在尝试从图像(从相机拍摄)中识别文本。为此,我在我的应用程序 Tesseract OCR Library 中使用。它对某些文本工作正常,但无法从捕获的图像中获得准确的结果。还有来自 Google 代码的最新 tessdata 文件。
我从this link 添加了tesseract 库。
下面是我尝试识别的图像:
我的代码如下:
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]);
但我得到这样的结果:
BAZAAR
mm; l Savees l smmamm l mm; l Accessories
commemw Street ' _ . «mm. me o snwapnagay
www minabazaav.cum
我已经通过这个链接浏览了:
- How do I get accurate text using Tesseract OCR in iOS?
- Why Tesseract OCR library (iOS) cannot recognize text at all?
- http://www.scriptscoop2.com/t/42247286510f/c-3.5-why-i-am-not-able-to-recognize-text-in-image-using-tesseract.html。
有没有人遇到同样的问题?
【问题讨论】:
标签: ios objective-c iphone ocr tesseract