本文介绍了ImportError:DLL加载失败:%1不是_imaging模块的有效Win32应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Python 2.7.9中的灰度共生矩阵从图像中提取特征我在其他答案中找到了下面给出的代码.当我运行此代码时,我得到:

I am trying to extract features from an image using Grey Level Co-occurrence Matrix in Python 2.7.9I found the code given below in some other answer. When I run this code I get:

然后我安装了PIL模块,当我尝试导入其_imaging程序包时,它又出现了另一个错误:

Then I installed PIL module and when I try to import its _imaging package, it gives another piece of error:

我已经在互联网上进行了很多研究,但是没有给出真正可行的解决方案,例如卸载PIL和安装PILLOW以及检查python版本和模块的兼容性.

I have already researched a lot on the internet but no solution given really seems to work, like uninstalling PIL and installing PILLOW and checking the compatibility of the version of python and the modules.

import skimage.io
import skimage.feature

im = skimage.io.imread('python.jpg', as_grey=True)

im = skimage.img_as_ubyte(im)
im /= 32

g = skimage.feature.greycomatrix(im, [1], [0], levels=8, symmetric=False, normed=True)

print skimage.feature.greycoprops(g, 'contrast')[0][0]
print skimage.feature.greycoprops(g, 'energy')[0][0]
print skimage.feature.greycoprops(g, 'homogeneity')[0][0]
print skimage.feature.greycoprops(g, 'correlation')[0][0]

推荐答案

问题通过安装来自此处

这篇关于ImportError:DLL加载失败:%1不是_imaging模块的有效Win32应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 16:00