如何在iOS中使用Tesseract OCR获取准确的文本? [英] How do I get accurate text using Tesseract OCR in iOS?

查看:158
本文介绍了如何在iOS中使用Tesseract OCR获取准确的文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理iPhone应用程序。我需要从图像中获取文本,经过谷歌搜索后我发现Tesseract可以做到这一点。它工作正常但没有得到准确的结果。我使用这个并处理了图片,但仍未取得好成绩。

I am working on iPhone application.Here I need to get text from the images, after googling I found Tesseract can do that.Its working fine but not getting accurate results.I used this and processed the image but still not getting good results.

Tesseract* tesseract = [[Tesseract alloc] initWithDataPath:@"tessdata" language:@"eng"];
UIImage *selectedImage=[UIImage imageNamed:@"download.jpg"];
[tesseract setImage:selectedImage];

ImageWrapper *greyScale=Image::createImage(selectedImage, selectedImage.size.width+100, selectedImage.size.height+100);
ImageWrapper *edges = greyScale.image->autoLocalThreshold();
[tesseract setImage:edges.image->toUIImage()];
[tesseract recognize];
NSLog(@"%@", [tesseract recognizedText]);

我使用下面的图片进行测试。但我得到的结果如 .- | llIAT& T JG H109 PM ED
''»rr~'
ma»mania-J'E,
'M,4。, - $
\〜 \下载图片53.0 KB \
_11.04 PM
|嘿|我现在在布宜诺斯艾利斯右边
'。看看这个mm ph fl lu 111:5 PM
|' lam在布达佩斯的WiF.n是\
maePMu 001d here。;
l 1.
,'
l,。
11.05 PM u,.--; _
|很棒的图片。让我发给你
一个音频核武器._11 08PM

I used below image for testing.But I am getting results like .-|llIAT&T JG H109 PM ED ' '» "rr ~ ‘ ma» mania-J ‘E, ‘M, 4 ., -_ \ ~ \ Download Image 53.0 KB \ _11.04 PM | Hey | am in buenos aires right ‘now. Check out this mm phfllu 111:5 PM |' lam in Budapest on WiF. n is \ maePMu 001d here. ; l 1 . , ‘ l, . 11.05 PM u, .——; _ | Nice picture. Let me send you an audio nuke. _11 08PM

如何解决上述问题如果有人在工作,请指导我。谢谢。

How to solve the above issue.If any one worked on it please guide me.Thanks in advance.

推荐答案

我尝试使用ABBYY Cloud OCR SDK识别我的图像。

I tried it to recognise my image with ABBYY Cloud OCR SDK.

这里要解决这个问题,我尝试提取文本并以XML格式导出。这种格式包含了recog带有结构和参数的nized文本,这些结构和参数是在XML的帮助下描述的。 par标签对应于已识别文本的一个段落。从XML获取文本后,您可以根据需要使用它。

Here to solved like this , I tried to extract text and export it in XML format. This format contains recognized text, with structure and parameters which are described with the help of XML. The par tag corresponces to one paragraph of a recognized text. After getting the text from XML you could work with it as you want.

我使用以下设置处理聊天屏幕截图:

I processed chat screen shots with the following settings:

"…/processImage?language=English&profile=documentConversion&exportFormat=xml"

并获得附加的XML文件。这些图像处理正确,每个对话框块被检测为单独的段落。

and got the attached XML files. These images are processed correctly, each dialog block is detected as separate paragraph.

希望信息有用。

感谢Abbyy OCR SDK团队提供解决方案。

Thanks to Abbyy OCR SDK team for providing solution.

这篇关于如何在iOS中使用Tesseract OCR获取准确的文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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