【发布时间】:2017-06-23 05:45:06
【问题描述】:
我在目录中有多个图像,并希望将其从图像转换为文本文件。我必须在终端中一一手动完成。这是头痛的过程。所以,我的问题是如何在包含图像的文件夹上运行我的代码。
这是将其转换为文本的终端命令:
convert captcha.png -resize 200% -type Grayscale input.tif #instead of input.tif i want same file name so, i can recognise easily
tesseract -l eng input.tif output #output name as same as file name
【问题讨论】:
-
使用 pytesseract & glob
-
我试过了,但是图像到文本的结果非常糟糕,这对我来说非常完美。有什么办法吗?
-
使用
subprocess.call对各种文件调用shell命令,并使用glob查找文件名。 -
还是不知道怎么做。但仍然感谢您的帮助。
-
你的操作系统是什么?视窗?操作系统? Linux?
标签: python imagemagick ocr tesseract