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技术非常专业,一般多是印刷.打印行 ...
随机推荐
- <网页web工作面试题>
磨刀不误砍柴工,在百忙之余的中午休息时,我录入一下我的面试题,把基础的知识重新温故,稳固! 1.块级元素和行内元素都有哪些? 答:块级元素:div,form,fildset等 行内元素:hr,p,fo ...
- Codeforces 732D [二分 ][贪心]
/* 不要低头,不要放弃,不要气馁,不要慌张 题意: n天进行m科考试,每科考试需要a的复习时间,n天每天最多可以考一科.并且指定哪天考哪科. 注意考试那天不能复习. 问最少需要多少天可全部通过考试. ...
- vs2008主题
http://www.cnblogs.com/xiaoshatian/archive/2009/11/20/1606440.html
- Mware vCenter Server 识别固态硬盘为(非SSD)是什么原因?
人工定义一下: 用root登录进ESXi控制台:esxcli storage nmp device list #列出储存清单esxcli storage nmp satp rule add -s VM ...
- Doxygen给C程序生成注释文档
近段时间,一直在学习华为C语言编程规范(2011版),在“注释”这一章中发现了一种“Doxygen”的注释转文档工具,查看诸多相关资料,并进行编程实践,终于可以利用Doxygen给C程序生成注释文档. ...
- View Controller Relationships
Parent-child relationshipsParent-child relationships are formed when using view controller container ...
- R语言向量
R语言基础:向量 心无咎 2012-04-02 13:37:00 向量(vector)1.seq():产生有规律的数列,间距省略时默认值为1. 例1:seq(10, 20, 0.5) ...
- 读取数据库的表并绑定到Listview
$aResultEventlog = _GetQueryTable($strSQL_Compare_FailRecordEventIDs, $iRowsEventlog, $iColsEventlog ...
- JS 学习(三)DOM
HTML DOM(文档对象模型) 当网页被加载时,浏览器会创建页面的文档对象模型(Document Object Model).HTML DOM 模型被构造为对象的树. HTML DOM树: Java ...
- SQL Server复制情况下的高可用方案(一)镜像+复制
数据库镜像可以与事务复制一起使用实现数据库整体的高可用性和高性能,其中镜像可以提供故障检测和故障转移,复制则用于实现读写分离. 数据库镜像涉及一个数据库的两个副本,这两个副本通常驻留在不同的计算机上. ...