text2image是一款将文字转换成图片的工具
官网:http://www.text2image.com/pit_t2i/saver
在做tesseract图片识别时需要基础数据采样
文档参考:
https://github.com/tesseract-ocr/tesseract/wiki/Training-Tesseract-3.03%E2%80%933.05#automated-method
语法:
text2image --text=training_text.txt --outputbase=[lang].[fontname].exp0 --font='Font Name' --fonts_dir=/path/to/your/fonts
示例:
training/text2image --text=training_text.txt --outputbase=eng.TimesNewRomanBold.exp0 --font='Times New Roman Bold' --fonts_dir=/usr/share/fonts
注:Times New Roman Bolds是系统的字体
查询系统中所有的font字体
text2image --text=training_text.txt --outputbase=eng --fonts_dir=/usr/share/fonts --find_fonts --min_coverage=1.0 --render_per_font=false