如何更快地在iOS上进行tesseract? [英] How can I make tesseract on iOS faster?
问题描述
我正在与ios上的tesseract ocr挣扎。一切都很好,但它真的很慢。
2 - 单行数字的3秒识别时间。
I am struggling with tesseract ocr on ios. Everything works fine but it is really slow. 2 - 3 seconds recogintion time for a single line of digits.
我正在从视频流中读取。
I am reading from a Video Stream.
我使用tesseract 3.01和我的字体的自定义培训文件。
I am using tesseract 3.01 with a custom training file for my font.
这是我的工作:
设置tesseract仅查找数字(0-9)
Setting up tesseract only to find numbers (0-9)
- 收缩,歪斜和二值化图像
- 使用
GetLines
查找我想要文本的行 -
setRectangle
只识别我想要的行 -
getUTF8Text
获取我的文字< - 仅此一项2-3秒
- Shrink, Deskew and Binarize Image
- use
GetLines
to find the line I want the text of setRectangle
to only recognize the line i wantgetUTF8Text
to get my text <- this alone takes 2-3 seconds
有没有建议加快这个过程?
Are there any suggestions to speed up the process?
推荐答案
我切换到tesseract 3.02的SVN
I switched to the SVN of tesseract 3.02
在遇到交叉编译问题后,
After having some problems with crosscompiling,
对于getUTF8Text
我来说约为1.2 - 0.8秒,对于图像预处理我是0.3 - 0.2秒。
I am down to about 1.2 - 0.8 Seconds for getUTF8Text and 0.3 - 0.2 seconds for image preprocessing.
我做了一些测试
- 二进制化和收缩0.7增加0.3秒但是费用为0.1
- chop_enable = 0对平均速度增益为0.1的速度几乎没有影响,如果有资格,它会占50%的cpu使用量
可用性的主要好处是使用setRectangle优化代码,如果我怀疑边界不正确,则不调用getUTF8Text
。并通过检查
收到的字符串进行一些字符串后处理,并应用一些算法来消除tesseract中最常见的错误解释
。
The main gain in usability was to optimize the code with setRectangle not calling getUTF8Text if I suspect the bounds to be incorrect. And some String postprocessing by checking the received string and apply some algorithm to eliminate the most common misinterpretations from tesseract.
这可能对别人。
这篇关于如何更快地在iOS上进行tesseract?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!