[英]Why is Tesseract unable to detect the single digit in that image?
在使用 Tesseract 时,提高 output 的质量是您的“圣经”。 特别是, 页面分割方法应始终明确设置。 在这里(大多数时候),我会选择--psm 6
:
假设一个统一的文本块。
即使没有对图像进行进一步预处理,您也已经获得了所需的结果:
import cv2
import pytesseract
image = cv2.imread('gBrcd.png')
text = pytesseract.image_to_string(image, config='--psm 6')
print(text.replace('\f', ''))
# 1
# LOW: 56
----------------------------------------
System information
----------------------------------------
Platform: Windows-10-10.0.19041-SP0
Python: 3.9.1
PyCharm: 2021.1.1
OpenCV: 4.5.2
pytesseract: 5.0.0-alpha.20201127
----------------------------------------
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.