惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Help Net Security
博客园 - Franky
GbyAI
GbyAI
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
爱范儿
爱范儿
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
aimingoo的专栏
aimingoo的专栏
博客园_首页
MongoDB | Blog
MongoDB | Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Recent Announcements
Recent Announcements
Scott Helme
Scott Helme
有赞技术团队
有赞技术团队
M
MIT News - Artificial intelligence
C
CERT Recently Published Vulnerability Notes
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Jina AI
Jina AI
F
Fortinet All Blogs
N
Netflix TechBlog - Medium
L
LangChain Blog
L
LINUX DO - 最新话题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
H
Hacker News: Front Page
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
AI
AI
T
Troy Hunt's Blog
Microsoft Azure Blog
Microsoft Azure Blog
阮一峰的网络日志
阮一峰的网络日志
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
罗磊的独立博客
S
Secure Thoughts
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
人人都是产品经理
人人都是产品经理
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
S
Security @ Cisco Blogs
Cloudbric
Cloudbric
E
Exploit-DB.com RSS Feed
Attack and Defense Labs
Attack and Defense Labs

博客园 - 一 缕 阳 光

macOS 安装cocoapods记录 Flowable笔记 VUE项目中同时使用API代理与MockJs Ruoyi-Cloud-服务间的调用 Ruoyi-Cloud-增加单元测试和Mybatis-plus 使用Typro+dotnet-cnblog在博客园写博客 T4模板插件 使用Open Live Writer在博客园中写博文 Windows与CentOS8虚拟机网络共享与互通 因数据库连接串导致的netcore发布到IIS后报500错误 【转】使用ASP.NET Web API构建Restful API 表单设计器的探索 解决C#中dynamic类型作为泛型参数的反射问题 【原创】AltiumDesigner 6 的自定义菜单 估计项目的重要几点 从Project 2007导出WBS图表到Visio 2007 CMS: DNN And Umbraco ORA-01489: result of string concatenation is too long 【原创】长尾关键词的挖掘与使用方法
【原创】Tesseract-OCR 3.02 训练笔记
一 缕 阳 光 · 2013-04-15 · via 博客园 - 一 缕 阳 光

目的:识别http://www.computrabajo.com.mx/bt-ofrd-human1985-207292.htm中的Email地址

官方文档:https://code.google.com/p/tesseract-ocr/wiki/TrainingTesseract3

官方的英文文档很长,这里记录几个关键步骤。

特别注意:训练时用的版本与运行时用的版本一定要保持一致。

  • 准备:

1、安装Tesseract

2、下载图片,保存到本地,并转换成Tif格式。

  • Make Box Files

1、tesseract eng.timesitalic.exp0.tif eng.timesitalic.exp0 batch.nochop makebox

2、把生成的box文件用文本编辑器编辑,使之与图片中的文字一致

PS:此步骤亦可以使用jTessBoxEditor工具代替

  • Run Tesseract for Training

tesseract [lang].[fontname].exp[num].tif [lang].[fontname].exp[num] nobatch box.train

此步骤生成一个.tr的文件

  • Compute the Character Set

unicharset_extractor lang.fontname.exp0.box

此步骤生成一个unicharset文件

  • font_properties (new in 3.01)

用记事本新建一个名为font_properties的文件,内容格式为:<fontname> <italic> <bold> <fixed> <serif> <fraktur>

如:timesitalic 1 0 0 1 0

这个步骤要注意:<fontname>应与步骤"Run Tesseract for Training”命令中指定的[fontname]一致,如果没有指定,则为UnknownFont

如:UnknownFont 0 0 0 0 0

  • Clustering

三个命令:

shapeclustering -F font_properties -U unicharset lang.fontname.exp0.tr

mftraining -F font_properties -U unicharset -O lang.unicharset lang.fontname.exp0.tr

cntraining lang.fontname.exp0.tr lang.fontname.exp1.tr

  • Putting it all together

combine_tessdata lang.

注意:一定要把Clustering生成的文件重命名,我在开始训练时,没仔细看官方的最关键的一段话:

That is all there is to it! All you need to do now is collect together all (shapetable, normproto, inttemp, pffmtable) the files and rename them with a lang. prefix, where lang is the 3-letter code for your language taken from http://en.wikipedia.org/wiki/List_of_ISO_639-2_codes

后来在CSDN上看到边城骆驼的博文http://blog.csdn.net/marvinhong/article/details/8459591,才恍然大悟。

  • 测试

tesseract image.tif output -l lang

  • 最后附上几个有用的链接:

tesseract-ocr - An OCR Engine that was developed at HP Labs between 1985 and 1995... and now at Google. - Google Project Hosting

VietOCR | Free Graphics software downloads at SourceForge.net

tesseractdotnet - tesseract-ocr .net - Google Project Hosting