2
votes

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

ImportError: The _imaging C module is not installed.

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

ImportError: DLL load failed: %1 is not a valid Win32 application.

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]
1
My guess is, you've mixed a 64-bit python interpreter with a 32-bit python module.Sneftel
Thanku @Sneftel. I got the wrong module. Now when I installed a new one, it worked.RachJain
One of you can post an answer to indicate that the problem is solved.BartoszKP

1 Answers

1
votes

The problem was solved by installing a 64 bit PILLOW module Pillow‑2.8.2‑cp34‑none‑win_amd64.whl from here