- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试在 python 中运行一个基本且非常简单的代码。
from PIL import Image
import pytesseract
im = Image.open("sample1.jpg")
text = pytesseract.image_to_string(im, lang = 'eng')
print(text)
这就是它的样子,我实际上已经通过安装程序安装了 tesseract for windows。我是 Python 的新手,我不确定如何继续?
此处的任何指导都会非常有帮助。我试过重新启动我的 Spyder 应用程序但无济于事。
最佳答案
我看到步骤分散在不同的答案中。根据我最近在 Windows 上遇到此 pytesseract 错误的经验,按顺序编写不同的步骤以更容易地解决错误:
1。使用 Windows 安装程序安装 tesseract,网址为:https://github.com/UB-Mannheim/tesseract/wiki
2。注意安装中的 tesseract 路径。此编辑时的默认安装路径为:C:\Users\USER\AppData\Local\Tesseract-OCR
。它可能会改变,所以请检查安装路径。
3。 pip 安装 pytesseract
4。在调用 image_to_string
之前在脚本中设置 tesseract 路径:
pytesseract.pytesseract.tesseract_cmd = r'C:\Users\USER\AppData\Local\Tesseract-OCR\tesseract.exe'
关于python - Pytesseract : "TesseractNotFound Error: tesseract is not installed or it' s not in your path", 我该如何解决这个问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50951955/
尝试将简单的测试图像打印到文本时出现以下错误。 我已经验证我具有Pillow(PIL 1.1.7),并尝试卸载并重新安装pytesseract。文件路径是正确的,因为如果更改它们,则会收到另一个错误消
我正在尝试阅读此图像中还包含小数点和小数的文本 这样: img = cv2.imread(path_to_image) print(pytesseract.image_to_string(img))
我想识别这样的图像: 我正在使用以下配置: config="--psm 6 --oem 3 -c tessedit_char_whitelist=0123456789ABCDEFGHIJKLMNOPQ
我正在尝试通过 opencv 和 pytesseract 运行一个简单的车牌图像来获取文本,但我无法从中获取任何内容。按照这里的教程: https://circuitdigest.com/microc
我有使用 pytesseract 的代码并且工作完美,只有当我尝试识别的图像是 0 到 9 时才不起作用。如果图像只有一位数字,则不会给出任何结果。 这是我正在工作的图像样本 https://driv
我有这张 table 的图片 我正在尝试使用 PyTesseract 解析它。我已经非常接近使用此代码: from PIL import Image, ImageOps import pytesser
我有这个图像是从另一个图像裁剪而来的,我想将此图像作为image_to_string方法的输入: import pytesseract import cv2 num_plate = cv2.imrea
我正在尝试从图像中提取文本,但是pytesseract提供了完全不同的输出,输出下方附加的图像是“Werle”(完整的单词和字符),我尝试了许多不同的处理方法,例如图像增强,rgb2gray,rgb2
这是噪声图像扫描的经典PyTesseract问题。但是,在这种情况下,点矩阵打印机正在文本中打印一些水平的白线。随附一些样本。我不确定哪种预处理将改善文本的扫描。 使用以下命令,以下示例将输出以下内容
我在使用 Pytesser 使用此代码进行测试时遇到了一些问题: from PIL import Image import pytesseract img = Image.open('pic.png'
尝试在 python 上运行 tesseract,这是我的代码: import cv2 import os import numpy as np import matplotlib.pyplot as
我的代码: pytesseract.pytesseract.tesseract_cmd = 'C:/Programs/tesseract' print(pytesseract.image_to_str
我将 MSS 与 pytesseract 结合使用,尝试在屏幕上阅读以确定来自被监视区域的字符串。我的代码如下: import Image import pytesseract import cv2
以下代码在我 friend 的 windows 笔记本电脑上运行完美,但在我的笔记本电脑上,它吐出完全垃圾。我认为这可能与图书馆有关,但我不能肯定地说?你们能告诉我它是否适合您,或者您以前是否遇到过这
我在 Python 中使用以下代码从图像中提取文本, import cv2 import numpy as np import pytesseract from PIL import Image #
我是 pyhton 的新手,我正在使用 haar 级联制作车牌识别系统。我的代码可以很好地检测车牌并制作轮廓,但 pytesseract ocr 无法识别字符并给出奇怪的结果。请帮忙。 The det
我目前遇到 pytesseract 的问题,软件无法在此图像中检测到数字: /image/kmH2R.png 这是从应用了阈值过滤器的更大图像中获取的。 出于某种原因,pytesseract 不想识别
Pytesseract 无法识别数字 6 和 8。它识别 6 作为5 和 5 作为 5, 3 作为 8 和 8 作为 8, Oct 为 0c: 或 0:: 和 Wed 作为 Men。 使用的脚本: c
我有非常高分辨率的工程图/电路图,其中包含许多不同区域的文本。目的是从此类图像中提取文本。 我正在使用 pytesseract 来完成此任务。直接应用 pytesseract 是不可能的,因为在这种情
我目前面临 pytesseract 的问题,该软件无法检测到此图像中的数字: 出于某种原因,pytesseract 不想识别该图像中的数字。有什么建议么?这是我的代码: import pytesser
我是一名优秀的程序员,十分优秀!