title: Calculating entropy from GLCM of an image
body: <p>I am using <code>skimage</code> library for most of image analysis work. </p>
  
  <p>I have an RGB image and I intend to extract <code>texture</code> features like <code>entropy</code>, <code>energy</code>, <code>homogeneity</code> and <code>contrast</code> from the image. </p>
  
  <p>Below are the steps that I am performing:</p>
  
  <pre><code>from skimage import io, color, feature
  from skimage.filters import rank
  rgbImg = io.imread(imgFlNm)
  grayImg = color.rgb2gray(rgbImg)
  print(grayImg.shape)  # (667,1000), a 2 dimensional grayscale image
  
  glcm = feature.greycomatrix(grayImg, [1], [0, np.pi/4, np.pi/2, 3*np.pi/4])
  print(glcm.shape) # (256, 256, 1, 4)
  
  rank.entropy(glcm, disk(5)) # throws an error since entropy expects a 2-D array in its arguments
  
  rank.entropy(grayImg, disk(5)) # given an output.
  </code></pre>
  
  <p>My question is, is the calculated entropy from the gray-scale image(directly) same as the entropy feature extracted from the GLCM (a texture feature)?</p>
  
  <p>If not, what is the right way to extract all the texture features from an image?</p>
  
  <p>Notes: I have already referred to:</p>
  
  <p><a href="http://scikit-image.org/docs/dev/api/skimage.filters.rank.html#entropy" rel="noreferrer">Entropy - skimage</a></p>
  
  <p><a href="http://scikit-image.org/docs/dev/auto_examples/plot_glcm.html" rel="noreferrer">GLCM - Texture features</a></p>