1

I am trying to find the GLCM of an image using greycomatrix from skimage library. I am having issues with the selection of levels. Since it's an 8-bit image, the obvious selection should be 256; however, if I select values such as 8 (for the purpose of binning and to prevent sparse matrices from forming), I am getting errors.

QUESTIONS:

  • Does anyone know why?
  • Can anyone suggest any ideas of binning these values into a 8x8 matrix instead of a 256x256 one?
Tonechas
  • 13,398
  • 16
  • 46
  • 80
troymyname00
  • 670
  • 1
  • 14
  • 32

1 Answers1

2

The simplest way for binning 8-bits images is to divide each value by 32. Then each pixel value is going to be in [0,8[.

Btw, more than avoiding sparse matrices (which are not really an issue), binning makes the GLCM more robust to noise.

FiReTiTi
  • 5,597
  • 12
  • 30
  • 58
  • No, it's difficult to say with the information you gave. It looks like that the image dimensions (image.max(), I supposed it the cooccurrence matrix) is smaller than the level you gave. I would check the matrix dimensions. Else, share the code and the complete error. – FiReTiTi Jul 13 '16 at 23:53