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]