我正在尝试创建一个机器人,它可以识别屏幕上的图像,并能够点击该图像。但是,当提示机器人单击图像时,系统会提示我TypeError: cannot unpack - am object。
import pyautogui as pg
import keyboard
import time
import pytesseract as tess
from PIL import Image
if pg.locateOnScreen('follow1.png', confidence=0.5) != None:
pg.click('follow1.png')
然
我使用了下面的 of EAST (高效、准确的场景文本检测器)来识别和绘制多幅图像中文本周围的包围框,它工作得非常好!
然而,OCR的下一个步骤(我正在使用pytesseract来提取这些图像的文本并将它们转换为字符串)是可怕的失败。使用--oem和--psm的所有可能配置,我无法让pytesseract检测到看起来非常清晰的文本,例如:
识别的文本在图像下面。虽然我已经应用了对比度增强,也尝试了膨胀和侵蚀,但我无法让识别文本。这只是许多图片中的一个例子,其中的文本更大、更清晰。任何关于转换、信任或其他库的建议都是有帮助的!
更新:在尝试了高斯模糊+ Otso阈值处理之后,我能够在白
我使用pytesseract来识别文本,如下所示
td = pytesseract.image_to_data(img, output_type=Output.DICT)
tn_boxes = len(td['level'])
for o in range(0, tn_boxes):
text = td['text'][o]
print(text)
我只是使用一个简单的逻辑Examples来建立一个detect keyword 'Example no.' find it's end point keyword 'S
我试图从图像中识别文本,但是在运行脚本时,会弹出一个错误
raise TesseractNotFoundError()
pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it's not in your PATH. See README file for more information.
代码:
import cv2
import pytesseract
img = cv2.imread('1.png')
img = cv2.cvtColor(img, cv2.