“Adding” new fonts to Tesseract eng.traineddata

蹲街弑〆低调 提交于 2019-12-20 09:06:19

问题


As far as I know, Tesseract 3.x comes with 6 English (correct me if I'm wrong) fonts. I need to train Tesseract for more 5 types of fonts. I need only capital letters and digits (no special characters or symbols).

I followed various processes for example: Adding New Fonts to Tesseract 3 OCR Engine

and also used tools to automate the process like Serak Tesseract Trainer for Tesseract 3.02

For generating box files I used QT Box Editor

After using above tools I get eng.traineddata file. All tutorials tell me to add this eng.traineddata file to the Tesseract-OCR\tessdata folder, but doing so, it will replace the original eng.traineddata file. After doing this will I lose the default fonts that come with Tesseract 3.x ?

How can I Add new fonts? Its still not clear to me. I hope someone can help me here. Thanks.


回答1:


Should use a different name, e.g., eng1.traineddata. That way you can use the new data with the original one by specifying the language option -l eng+eng1.




回答2:


If you have new trained data with different font, I think you don't have dictionary correction for your new font.

To add new trained data you can do this (I'm using PHP code here)

//  as you new trained data, it must be 3 letter prefix 
// what ever 3 letter you want
$languange = "eng+deu";
$settingLanguage = $tesseract -> setLanguage($language) ; 

By seeing the tesseract.php function setLanguage(), you can set the language by that function.



来源:https://stackoverflow.com/questions/16332986/adding-new-fonts-to-tesseract-eng-traineddata

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!