windows10
jdk1.8.0_144
1.以管理员身份打开命令行
2.生成box文件常规命令行如下:
tesseract.exe num.font.exp0.tif num.font.exp0 batch.nochop makebox
但是命令行中会出现很多empty page,查阅文档,发现tesseract 是可以设置psm参数的,如下参数引用于https://blog.csdn.net/weixin_30323631/article/details/96397131:
Usage:tesseract imagename outputbase [-l lang] [-psm pagesegmode] [configfile...]
pagesegmode values are:
0 = Orientation and script detection (OSD) only.
1 = Automatic page segmentation with OSD.
2 = Automatic page segmentation, but no OSD, or OCR
3 = Fully automatic page segmentation, but no OSD. (Default)
4 = Assume a single column of text of variable sizes.
5 = Assume a single uniform block of vertically aligned text.
6 = Assume a single uniform block of text.
7 = Treat the image as a single text line.
8 = Treat the image as a single word.
9 = Treat the image as a single word in a circle.
10 = Treat the image as a single character.
-l lang and/or -psm pagesegmode must occur before anyconfigfile.
tesseract imagename outputbase [-l lang] [-psm pagesegmode] [configfile...]
tesseract 图片名 输出文件名 -l 字库文件 -psm pagesegmode 配置文件
于是采用了tesseract.exe num.font.exp0.tif num.font.exp0 --psm 7 batch.nochop makebox生成box文件,没有报错了