bash - 找不到 Tesseract unicharset_extractor 命令

标签 bash path tesseract osx-elcapitan image-recognition

我的问题

运行unicharset_extractor并接收:

unicharset_extractor: command not found

我的环境

OSX El Capitan Version 10.11.4

Terminal Version 2.6.1 (361.1)

tesseract 3.04.00
 leptonica-1.73
  libgif 4.2.3 : libjpeg 9a : libpng 1.6.21 : libtiff 4.0.6 : zlib 1.2.8 : libwebp 0.5.0 : libopenjp2 2.1.0

类似问题

这个问题已经被问了很多次,但似乎没有解决我的问题。这里列出了一些非工作问题:

unicharset_extractor: command not found

Adding New Fonts to Tesseract 3

Issue 1327 in tesseract-ocr: unicharset_extractor statement doesn´t work

我在做什么

我目前正在尝试训练我的 tesseract-ocr识别自定义号码。

我做了什么

我最初使用 Homebrew 安装了 tesseract ,它安装了 tesseractleptonica 和其他依赖项到 /usr/local/Cellar。我用过this指南帮助我训练数据。按照指南的指示,我首先生成了一组 .tif 文件,格式为 tla.test_font.exp[num].tif。然后我使用以下脚本生成了 .box 文件:

for i in `seq 0 52`;
do
    tesseract tla.test_font.exp$i.tif tla.test_font.exp$i -l eng -psm 10 batch.nochop makebox
done

然后我使用以下方法通过 tesseract 运行 .box 文件:

for i in `seq 0 52`;
do
    tesseract tla.test_font.exp$i.tif tla.test_font.exp$i -l eng -psm 10 nobatch box.train
done

然后我尝试运行 unicharset_extractor *.box 并收到上面的错误消息。

怀疑它与我的 tesseract 安装路径有关,并且不想使用符号链接(symbolic link)使事情变得更加困惑,然后我卸载了 tesseractlibtoolleptonica 来自 usr/local/Cellar,并使用 MacPorts再次安装所有内容。这次在 /opt/local/bin 中。重复上述相同步骤后,我陷入了同样的问题。我什至尝试运行 man unicharset_extractor 并且手册页运行良好。

最佳答案

安装 tesseract 时,您尚未安装训练工具。现在您必须使用以下命令卸载 tesseract brew 卸载 tesseract 然后使用安装工具 brew install --with-training-tools tesseract

此后您应该能够运行 unicharset_extractor 命令。

谢谢

关于bash - 找不到 Tesseract unicharset_extractor 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36536490/

相关文章:

Android - 如何使用绘画连接两点

python - 在 Python 中使用 Tesseract OCR 的 UnicodeDecodeError 'charmap' 编解码器

python - 错误 : tesseract is not installed or it's not in your PATH

linux - 通过 Bash 脚本检索进程网络使用情况(自重启以来,如果需要)

PHP exec() 没有从 bash 命令获取输出

javascript - CSS/SVG 描边动画

xcode - 命令/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lex 失败,退出代码为 1

linux - 如何在 Linux 中重命名文件

java - 对不在控制终端中的进程执行重定向

windows - 跨 Windows 操作系统的命令行提示路径