号码和位置识别

问题描述 投票:0回答:1

帮忙处理这张图片:

Help with this image

我想从这张图像中提取数字(以及数字的相对位置)。 我在 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')

使用此代码,我可以找到除个位数之外的所有数字及其位置。

python opencv ocr python-tesseract
1个回答
0
投票

我使用 GIMP 将您的图像大小调整为 150%。您可以使用以下命令:

tesseract.exe -l eng map_2.jpg out tsv

获取 Libre Impress 或 Excel 的 csv,如下所示: 在表中,您可以在文本列中找到位置,例如 17、90435 等。

© www.soinside.com 2019 - 2024. All rights reserved.