tesseract-ocr 合并box文件的方法

先对box 进行train, 生成相应的.tr文件。

这里文件名字改为name.num的形式

example:

> tesseract example.1.tif example1 nobatch box.train     
> tesseract example.2.tif example2 nobatch box.train     
> tesseract example.3.tif example3 nobatch box.train

从所有的文件中提取字符

example:

> unicharset_extractor example.1.tif example.2.tif example.3.tif

生成字体特征文件新建的font文件中, 把所有的box文件对应的字体特征都给加进去

example:

example.1 0 0 0 0 0
example.2 0 0 0 0 0
example.3 0 0 0 0 0

进行训练

example:

mftraining -F font -U unicharset example.1.tr example.2.tr example.3.tr

聚集所有的.tr文件

cntraining example.1.tr example2.tr example3.tr

重命名文件(把unicharset, inttemp, normproto, pffmtable,shapetable 这几个文件加上前缀example.

合并所有的文件, 生成一个大的字库文件

combine_tessdata example.

参考:

https://baijiahao.baidu.com/s?id=1610209305721327810&wfr=spider&for=pc
http://www.cnblogs.com/password1/p/9213908.html

下面这种情况缺少了写入字体特征的情况。

猜你喜欢

转载自blog.csdn.net/funnyPython/article/details/82630242