我安装了Imagemagic(尝试了32位和64位版本)然后使用pip来安装魔杖,我还设置了Magick_Home环境.变量到imagemagic地址,但是当我跑
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "c:\Anaconda2\lib\site-packages\wand\image.py", line 20, in <module> from .api import MagickPixelPacket, libc, libmagick, library File "c:\Anaconda2\lib\site-packages\wand\api.py", line 205, in <module> 'Try to install:\n ' + msg) ImportError: MagickWand shared library not found. You probably had not installed ImageMagick library. Try to install: http://docs.wand-py.org/en/latest/guide/install.html#install-imagemagick-on-windows
我使用以下代码导入了魔杖
from wand.image import Image as WandImage
from wand.color import Color
with WandImage(filename=source_file, resolution=(RESOLUTION,RESOLUTION)) as img:
img.background_color = Color('white')
img.format = 'tif'
img.alpha_channel = False
Run Code Online (Sandbox Code Playgroud)
如何在python中将img对象转换为打开cv(cv2)图像对象?