【问题标题】:Tesseract installation in windows在 windows 中安装 Tesseract
【发布时间】:2017-09-10 12:00:43
【问题描述】:

我目前正在使用python 2.7进行最佳字符识别项目,在windows中打开计算机视觉。为了完成这项任务,我知道可以使用tesseract(软件)来完成。但是,它不能安装在windows上.我搜索了很多,但我找不到解决方案。谁能告诉我有没有办法在windows上安装它?或者可以不使用它来完成吗?

【问题讨论】:

标签: python opencv python-tesseract


【解决方案1】:

在 windows 中安装 tesseract 的简单步骤。

  1. https://github.com/UB-Mannheim/tesseract/wiki下载tesseract exe。

  2. C:\Program Files (x86)\Tesseract-OCR中安装这个exe

  3. 在 windows 或 anaconda 提示符下打开虚拟机命令提示符。

  4. 运行pip install pytesseract

  5. 要测试是否安装了 tesseract,请在 python 提示符中输入:

    导入 pytesseract

    打印(pytesseract)

【讨论】:

  • 我不得不安装 pytesseract
  • @Aashish Raina 请将pip install tesseract 更改为pip install pytesseracttesseract 是其他一些不相关的包。
【解决方案2】:

要在 Windows 上使用 Python 完成 OCR,您将需要已有的 Python 和 OpenCV,以及 Tesseract 和 Pytesseract Python 包。

为 Windows 安装 Tesseract OCR:

  1. 从 UB Mannheim 运行 installer(查找 2021)
  2. 配置您的安装(选择安装路径和要包含的语言数据)
  3. 将 Tesseract OCR 添加到您的环境变量中

在 Windows 上安装和使用 Pytesseract:

  1. 只需运行pip install pytesseract
  2. 您还需要安装Pillowpip install Pillow 才能使用Pytesseract。像 from PIL import Image 那样将其导入到 Python 文档中。
  3. 您需要在代码中添加以下行,以便能够在您的计算机上调用 pytesseract:pytesseract.pytesseract.tesseract_cmd = 'C:\\Program Files\\Tesseract-OCR\\tesseract.exe'

如果您需要进一步的指导,我已经详细介绍了如何为 Windows here 安装 Tesseract OCR。

【讨论】:

    【解决方案3】:

    UB Mannheim 为tesseract 的最新版本提供预构建的二进制文件。

    来自tesseract Github wiki

    窗口

    Tesseract 3.05-dev 和 Windows 的非官方安装程序 Tesseract 4.00-dev 可从Tesseract at UB Mannheim 获得。这 包括培训工具。

    ...

    要从任何位置访问 tesseract-OCR,您可能需要添加 tesseract-OCR 二进制文件所在的目录到 Path 变量,可能是C:\Program Files\Tesseract-OCR

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多