相关疑难解决方法(0)

转换:未授权的`aaaa` @ error/construct.c/ReadImage/453

我想通过convertImageMagick 创建一个验证码pic .

我遵循这个,但有一些问题.

输入在我的linux shell中:

convert -background white -fill black -font FreeSerif-Bold -pointsize 36 label:'adfgh' ./test.png
Run Code Online (Sandbox Code Playgroud)

错误是:

转换:未授权adfgh@ error/construct.c/ReadImage/453.转换:缺少图像文件名./test.png@ error/convert.c/ConvertImageCommand/3015

我的ImageMagick:版本:6.7.2-7,我安装它yum install ImageMagick.

我很无能为力.有什么建议吗?

imagemagick imagemagick-convert

274
推荐指数
8
解决办法
10万
查看次数

将扫描的pdf转换为文本python

我有一个扫描的pdf文件,我尝试从中提取文本。我尝试使用pypdfocr在其上进行ocr,但出现错误:

“在通常的地方找不到ghostscript”

搜索后,我找到了在Windows平台中将Ghostscript链接到pypdfocr的解决方案,我尝试下载GhostScript并将其放入环境变量中,但仍然存在相同的错误。

如何使用python在扫描的pdf文件中查找文本?

谢谢。

编辑:这是我的代码示例:

import os
import sys
import re
import json
import shutil
import glob
from pypdfocr import pypdfocr_gs
from pypdfocr import pypdfocr_tesseract 
from PIL import Image

path = PATH_TO_MY_SCANNED_PDF
mainL = []
kk = {}


def new_init(self, kk):
    self.lang = 'heb'   
    self.binary = "tesseract"
    self.msgs = {
            'TS_MISSING': """ 
                Could not execute %s
                Please make sure you have Tesseract installed correctly
                """ % self.binary,
            'TS_VERSION':'Tesseract version is too old',
            'TS_img_MISSING':'Cannot find specified tiff …
Run Code Online (Sandbox Code Playgroud)

python pdf ocr ghostscript

6
推荐指数
3
解决办法
2万
查看次数