为什么Tesseract OCR库(iOS)根本无法识别文本? [英] Why Tesseract OCR library (iOS) cannot recognize text at all?

查看:250
本文介绍了为什么Tesseract OCR库(iOS)根本无法识别文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在iOS应用程序中使用Tesseract OCR库.我从github下载了tesseract-ios库,当我试图识别一个简单的文本图像时,我得到了垃圾.这是我尝试识别的图像:

I'm trying to use Tesseract OCR library in my iOS application. I downloaded tesseract-ios library from github and when I tried to recognize a simple text image I got garbage instead. Here is an image of what I tried to recognize:

我收到了不可读的文字:

I got unreadable text:

T0I1101T0W KIR1 H1I1101T0W KIR1 H1I1101T0W CIBEPS H1 ES PBHY P306 EHH11 133I R1 11335 11I1H1 19 13S SYIL 3B19 M H300H1911 H1113 AIR1 J1 OIII 3I9SH5H133IS 13V9 I1 Q1H211 E015 19 W331 H1 111SW

T0I1101T0W KIR1 H1I1101T0W KIR1 H1I1101T0W CIBEPS H1 ES PBHY P306 EHH11 133I R1 11335 11I1H1 19 13S SYIL 3B19 M H300H1911 H1113 AIR1 J1 OIII 3I9SH5H133IS 13V9 I1 Q1H211 E015 19 W331 H1 111SW

为什么Tesseract无法识别简单的图像?这是我用来实例化Tesseract的代码:

Why Tesseract can't recognise even simple image? Here is code which I used to instantiate Tesseract:

Tesseract* tesseractObject = [[Tesseract alloc] initWithDataPath:@"tessdata" language:@"eng"];
[tesseractObject setVariableValue:@"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" forKey:@"tessedit_char_whitelist"];
[tesseractObject setImage:image];
[tesseractObject recognize];
NSLog(@"RECOGNISED= %@" , [tesseractObject recognizedText]);

这是我的项目结构:

我通过引用添加了英语testdata文件夹.那我在做什么错?我该如何解决?

I added English testdata folder by reference. So what am I doing wrong? How can I fix this?

推荐答案

确保您拥有Google代码中最新的tessdata文件

Make sure you have the latest tessdata file from Google code

http://code.google.com/p/tesseract-ocr/downloads/list

这将为您提供tessdata文件列表,您需要下载这些文件并包含在应用程序中(如果尚未安装的话).在您寻找英语文件时,您需要使用tesseract-ocr-3.02.eng.tar.gz

This will provide you with a list of tessdata files that you need to download and include in your app if you haven't already. In your case you will need tesseract-ocr-3.02.eng.tar.gz as you are looking for the English language files

以下文章将向您展示您需要在哪里安装它.当我构建第一个Tesseract项目时,我通读了本教程,并发现它确实非常有用

The following article will show you where you need to install it. I read through this tutorial when I built my first Tesseract project and found it really useful

http://lois.di- qual.net/blog/在iOS上使用tesseract-ios安装/使用tesseract/

这篇关于为什么Tesseract OCR库(iOS)根本无法识别文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆