关于Tesseract-OCR生成box文件时报错empty page

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文件,没有报错了

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值