tesseract 字体训练资料篇

本文档详细介绍了使用Tesseract OCR进行字体训练的过程,包括如何制作.box文件、设置字体属性、进行形状聚类等步骤,并提供了多个训练数据文件的说明。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

tesseract 字体训练资料篇

 1.制作.box档案文件.

tesseract [lang].[fontname].exp[num].tif [lang].[fontname].exp[num] -l yournewlanguage batch.nochop makebox

 

2.开始培训

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

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

 

set_unicharset_properties 

不知道什么来的

training/set_unicharset_properties -U input_unicharset -O output_unicharset --script_dir=training/langdata

 

font_properties 

字体属性文件

<fontname> <italic> <bold> <fixed> <serif> <fraktur>

在<字体>是一个字符串命名的字体 ; <斜体>,<加粗>,<固定>,<衬线>和<哥特体>都是简单的0或1标志指示字体是与否的属性。

Example:

timesitalic 1 0 0 1 0

 

----在3.03,有一个默认的font_properties文件,涵盖3000字体(不一定准确)培训/langdata / font_properties。

 

Clustering

shapeclustering 创建主控形状表的聚类形状并将其写入一个文件shapetable。

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

----如果你得到错误信息,像这样的 "index >= 0 && index < size_used_:Error:Assert failed in genericvector.h, line 512" 添加shapetable文件到您的语言数据文件。

 

 

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

你的文件是通过unicharset_extractor以上产生的unicharset,和lang.unicharset是输出unicharset将给予combine_tessdata。mftraining将输出两个数据文件:inttemp(形状的原型)和pffmtable(每个字符的预期功能)。

 

输出normproto数据文件 

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

 

 

数据字典(可选)

 

NameTypeDescription
word-dawgdawgA dawg made from dictionary words from the language.
freq-dawgdawgA dawg made from the most frequent words which would have gone into word-dawg.
punc-dawgdawgA dawg made from punctuation patterns found around words. The "word" part is replaced by a single space.
number-dawgdawgA dawg made from tokens which originally contained digits. Each digit is replaced by a space character.
fixed-length-dawgsdawgSeveral dawgs of different fixed lengths —— useful for languages like Chinese.
bigram-dawgdawgA dawg of word bigrams where the words are separated by a space and each digit is replaced by a ?.
unambig-dawgdawgTODO: Describe.
user-wordstextA list of extra words to add to the dictionary. Usually left empty to be added by users if they require it; see tesseract(1).
wordlist2dawg frequent_words_list lang.freq-dawg lang.unicharset
wordlist2dawg words_list lang.word-dawg lang.unicharset

 

参考资料:

WIKI

https://code.google.com/p/tesseract-ocr/wiki/FAQ

 

Introduction

https://code.google.com/p/tesseract-ocr/wiki/TrainingTesseract3#font_properties_(new_in_3.01)

 

WORDLIST2DAWG(1) Manual Page

http://tesseract-ocr.googlecode.com/svn-history/trunk/doc/wordlist2dawg.1.html

 

COMBINE_TESSDATA(1) Manual Page

 http://tesseract-ocr.googlecode.com/svn-history/r800/trunk/doc/combine_tessdata.1.html

 

 

 

转载于:https://www.cnblogs.com/mjorcen/p/3818687.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值