帮忙处理这张图片:
我想从这张图像中提取数字(以及数字的相对位置)。 我在 Python 中使用
pytesseract
,但无法获得任何结果。
我不知道如何用OpenCV
对图像进行预处理。
我需要一些有关 pytesseract 和 openCV 的帮助。也许来自
image_to_strin
的方法 pytesseract
g 的一些配置??????
image = cv2.imread("plano5.png")
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
thresh = cv2.threshold(gray, 0, 255, cv2.THRESH_OTSU)[1]
text = pytesseract.image_to_string(thresh,config='--psm 11 --oem 3 -c tessedit_char_whitelist=0123456789')
使用此代码,我可以找到除个位数之外的所有数字及其位置。