tesseract-ocr
tesseract-ocr 第一课
1.下载地址:
tess-two的构建:
git clone git://github.com/rmtheis/tess-two tess
cd tess
cd tess-two
ndk-build
android update project --path .
ant release
eys-two的构建:
cd ..
cd eyes-two
ndk-build
android update project --path .
ant release

- tessdata/eng.config
- tessdata/eng.unicharset
- tessdata/eng.unicharambigs
- tessdata/eng.inttemp
- tessdata/eng.pffmtable
- tessdata/eng.normproto
- tessdata/eng.punc-dawg
- tessdata/eng.word-dawg
- tessdata/eng.number-dawg
- tessdata/eng.freq-dawg
- ASCII 或者 utf8 编码,没有BOM
- uinx行结尾符('\n')
- 文件尾空行(否则:将得到错误信息:last_char == '\n':Error:Assert failed..)
- 确保每个字符的最小数目的样本。10很好,但5只对少数字符有效。
- 常用字符的样本应更多:至少20个。
- 不要将所有非字母组合在一起。让文件更实际化。例如,“The quick brown fox jumps over the lazy dog. 0123456789 !@#$%^&(),.{}<>/?”,这个就很糟糕。而这个则更好:“The (quick) brown {fox} jumps! over the $3,456.78<lazy> #90 dog & duck/goose, as 12.5% of E-mail from aspammer@website.com is spam?” ,这个给出了文本行查找码,来获取特定字符的基标语义。
- 当打印时,文本空格绝对安全。。。。。。
- 训练数据应该按字体分组。。。。。
- 没必要训练多个size的文本。。。。。
- 不要在一个image文件混合多种字体(确切的说:在单个.tr文件中),它将造成丢弃一些特征,导致识别错误
- 下载页的boxtiff文件将帮助你如何格式化你的训练数据。
tesseract [lang].[fontname].exp[num].tif [lang].[fontname].exp[num] batch.nochop makebox
tesseract eng.timesitalic.exp0.tif eng.timesitalic.exp0 batch.nochop makebox
s 734 494 751 519 0
p 753 486 776 518 0
r 779 494 796 518 0
i 799 494 810 527 0
n 814 494 837 518 0
g 839 485 862 518 0
t 865 492 878 521 0
u 101 453 122 484 0
b 126 453 146 486 0
e 149 452 168 477 0
r 172 453 187 476 0
d 211 451 232 484 0
e 236 451 255 475 0
n 259 452 281 475 0
D 101 504 131 535 0
e 135 502 154 528 0
r 158 503 173 526 0
, 197 498 206 510 0
, 206 497 214 509 0
s 220 501 236 526 0
c 239 501 258 525 0
h 262 502 284 534 0
n 288 501 310 525 0
e 313 500 332 524 0
l 336 501 347 534 0
l 352 500 363 532 0
e 367 499 386 524 0
” 389 520 407 532 0
- 第一个数(左)采用两行中最小的(197)
- 第二个数(下)采用两行中最小的(496)
- 第三个数(右)采用两行中最大的(214)
- 第四个数(上)采用两行中最大的(508)
D 101 504 131 535 0
e 135 502 154 528 0
r 158 503 173 526 0
? 197 497 214 510 0
s 220 501 236 526 0
c 239 501 258 525 0
h 262 502 284 534 0
n 288 501 310 525 0
e 313 500 332 524 0
l 336 501 347 534 0
l 352 500 363 532 0
e 367 499 386 524 0
” 389 520 407 532 0
tesseract fontfile.tif fontfile -l yournewlanguage batch.nochop makebox
- 过滤box文件,只保持你想要的字符。
- 运行tesseract来训练。
- 对于每种字体,从多个语言中cat出.tr文件,来获取你想要的字符休,并从你有的字体或字符中添加.tr文件
- 以相同的方式cat出已经过滤的box文件到.tr文件中,以便在unicharset_extractor中处理
- 运行训练过程的其它步骤
tesseract fontfile.tif junk nobatch box.train
tesseract fontfile.tif junk nobatch box.train.stderr
Every character in the box file has a corresponding set of entries in
the .tr file (in order) like this
UnknownFont <utf8 code(s)> 2
mf <number of features>
x y length dir 0 0
... (there are a set of these determined by <number of features>
above)
cn 1
ypos length x2ndmoment y2ndmoment The mf features are polygon segments of the outline normalized to the
1st and 2nd moments.
x= x position [-0.5.0.5]
y = y position [-0.25, 0.75]
length is the length of the polygon segment [0,1.0]
dir is the direction of the segment [0,1.0] The cn feature is to correct for the moment normalization to
distinguish position and size (eg c vs C and , vs ')
unicharset_extractor fontfile_1.box fontfile_2.box ...
- ';' 为非字母字符,小写字符,大小字符,而非数字。它的属性通过二进制数 10000表示(16进制的10表示 )
- 'b'是一个字母字符,小写字符。它的属性通过二进制数00011表示(3)
- 'W'是一个字母字符,大写字符。它的属性通过二进制数00101表示(5)
- '7'只是一个数字。它的属性通过二进制数01000表示(8)
- ‘=’非数字或字母字符。它的属性通过二进制数字00000表示(0)
; 10 Common 46
b 3 Latin 59
W 5 Latin 40
7 8 Common 66
= 0 Common 93
<fontname> <italic> <bold> <fixed> <serif> <fraktur>
timesitalic 1 0 0 1 0
shapeclustering -F font_properties -U unicharset eng.timesitalic.exp0.tr
mftraining -F font_properties -U unicharset -O eng.unicharset eng.timesitalic.exp0.tr
shapeclustering -F font_properties -U unicharset lang.fontname.exp0.tr lang.fontname.exp1.tr ...
mftraining -F font_properties -U unicharset -O lang.unicharset lang.fontname.exp0.tr lang.fontname.exp1.tr ...
cntraining lang.fontname.exp0.tr lang.fontname.exp1.tr ...
| Name | Type | Description |
| punc-dawg | dawg | A dawg made from punctuation patterns found around words. The "word" part is replaced by a single space. |
| word-dawg | dawg | A dawg made from dictionary words from the language. |
| number-dawg | dawg | A dawg made from tokens which originally contained digits. Each digit is replaced by a space character. |
| freq-dawg | dawg | A dawg made from the most frequent words which would have gone into word-dawg. |
| fixed-length-dawgs | dawg | Several dawgs of different fixed lengths —— useful for languages like Chinese. |
| bigram-dawg | dawg | A dawg of word bigrams where the words are separated by a space and each digit is replaced by a ?. |
| unambig-dawg | dawg | TODO: Describe. |
wordlist2dawg frequent_words_list lang.freq-dawg lang.unicharset
wordlist2dawg words_list lang.word-dawg lang.unicharset
v1
3 I I 0 2 u o 3
3 I - I 1 H 2
2 ' ' 1 " 1
2 ?? 6 1 ?? 1
1 m 2 r n 0
3 i i i 1 m 0
| Value | Type | Description |
| 0 | NOT_AMBIG | the ngram pair is not ambiguous |
| 1 | REPLACE_AMBIG | ocred ngram should always be substituted with correct |
| 2 | DEFINITE_AMBIG | add correct ngram to the classifier results (1-1) |
| 3 | SIMILAR_AMBIG | use pairwise classifier for ocred/correct pair (1-1) |
| 4 | CASE_AMBIG | this is a case ambiguity (1-1) |
combine_tessdata lang.
tesseract image.tif output -l lang
- ambiguous_words
- cntraining
- combine_tessdata
- dawg2wordlist
- mftraining
- shapeclustering
- tesseract
- unicharset_extractor
- wordlist2dawg
tesseract-ocr的更多相关文章
- tesseract ocr文字识别Android实例程序和训练工具全部源代码
tesseract ocr是一个开源的文字识别引擎,Android系统中也可以使用.可以识别50多种语言,通过自己训练识别库的方式,可以大大提高识别的准确率. 为了节省大家的学习时间,现将自己近期的学 ...
- Tesseract——OCR图像识别 入门篇
Tesseract——OCR图像识别 入门篇 最近给了我一个任务,让我研究图像识别,从我们项目的screenshot中识别文字信息,so我开始了学习,与大家分享下. 我看到目前OCR技术有很多,最主要 ...
- Tesseract Ocr引擎
Tesseract Ocr引擎 1.Tesseract介绍 tesseract 是一个google支持的开源ocr项目,其项目地址:https://github.com/tesseract-ocr/t ...
- 开源图片文字识别引擎——Tesseract OCR
Tessseract为一款开源.免费的OCR引擎,能够支持中文十分难得.虽然其识别效果不是很理想,但是对于要求不高的中小型项目来说,已经足够用了. 文字识别可应用于许多领域,如阅读.翻译.文献资料的检 ...
- Python下Tesseract Ocr引擎及安装介绍
1.Tesseract介绍 tesseract 是一个google支持的开源ocr项目,其项目地址:https://github.com/tesseract-ocr/tesseract,目前最新的源码 ...
- Tesseract OCR使用介绍
#Tesseract OCR使用介绍 ##目录[TOC] ##下载地址及介绍 官网介绍:http://code.google.com/p/tesseract-ocr/wiki/TrainingTess ...
- selenium使用笔记(二)——Tesseract OCR
在自动化测试过程中我们经常会遇到需要输入验证码的情况,而现在一般以图片验证码居多.通常我们处理这种情况应该用最简单的方式,让开发给个万能验证码或者直接将验证码这个环节跳过.之前在技术交流群里也跟朋友讨 ...
- alfresco install in linux, and integrated with tesseract ocr
本文描述在Linux系统上安装Alfresco的步骤: 1. 下载安装文件:alfresco-community-5.0.d-installer-linux-x64.bin 2. 增加执行权限并执行: ...
- 使用Tesseract OCR识别验证码
1.下载Tessrac OCR,默认安装 2.把验证码code.jpg图片放在D盘 3.打开cmd,进入D盘,输入:tesseract code.jpg result 4.进入D盘,生成了resul ...
- Tesseract ocr 3.02学习记录一
光学字符识别(OCR,Optical Character Recognition)是指对文本资料进行扫描,然后对图像文件进行分析处理,获取文字及版面信息的过程.OCR技术非常专业,一般多是印刷.打印行 ...
随机推荐
- IOS 设置导航栏全局样式
// 1.设置导航栏背景 UINavigationBar *bar = [UINavigationBar appearance]; [bar setBackgroundImage:[UIImage r ...
- OpenGL学习笔记2——顶点数组
#pragma comment(lib,"glut32.lib") #pragma comment(lib,"glut.lib") #pragma commen ...
- 【整理】动态加载Web Services
WebClient client = new WebClient(); String url = "http://localhost/MESAPIWebService/MESAPI.asmx ...
- ARToolKit for Unity环境搭建(初步搭建成功)
最近一段时间才开始学习使用Unity3d,AR的学习使用中,先后使用了metaio SDK.vuforia SDK,但由于这两个都属于收费的,今天开始尝试使用ARToolKit.先将ARToolKit ...
- 数据库——JDBC
数据库--JDBC 数据库优点:降低存储数据的冗余度: 更高的数据一致性: 存储的数据可以共享: 可以建立数据库所遵循的标准: 便于维护数据完整性: 能够实现数据的安全性: 建立数据库: 数据库的存储 ...
- 关于MAC
以太LAN网中发送的分组称做帧,包含7个字段 MAC帧格式 前同步码 SFD DA SA 长度或类型 数据域 CRC 7字节,物理层加入 帧首定界符,1字节 目的地址,6字节 源地址,6字节 2字节 ...
- bash profile .bashrc
/etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行. 并从/etc/profile.d目录的配置文件中搜集shell的设置. /etc/bashrc:为每一 ...
- What's going on in background?
Did you know that mobile phone manufacturer collect your info without notifying you? Did you know yo ...
- 好用的內存鏡像工具Belkasoft RAM Capture
来自俄罗斯的取证大厂Belkasoft,旗下的主力产品Belkasoft Evidence Center有不错的评价,除了BEC之外,咱们Yuri老兄也是佛心来着的,提供了一个免费内存镜像工具RamC ...
- MySQL 第十天(视图、存储过程、函数、触发器)
MySql高级-视图.函数.存储过程.触发器 目录 一.视图 1 1.视图的定义 1 2.视图的作用 1 (1)可以简化查询. 1 (2)可以进行权限控制, 3 3.查询 ...