1
我試圖使用Python 2.7.9中的灰度級共現矩陣從圖像中提取特徵我發現下面給出的代碼在一些其他答案。當我運行這段代碼,我得到:ImportError:DLL加載失敗:%1不適用於_imaging模塊的有效Win32應用程序
ImportError: The _imaging C module is not installed.
然後我安裝PIL模塊,當我嘗試導入其_imaging
包,它提供了另一條錯誤的:
ImportError: DLL load failed: %1 is not a valid Win32 application.
我已經研究了很多在互聯網上,但沒有解決方案給予真的似乎工作,如卸載PIL和安裝PILLOW並檢查python版本和模塊的兼容性。
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]
我的猜測是,你已經混了64位Python解釋器與一個32位Python模塊。 – Sneftel
Thanku @Sneftel。我得到了錯誤的模塊。現在,當我安裝一個新的,它的工作。 – RachJain
您可以發表一個答案來表明問題已解決。 – BartoszKP