GLCM with scikit-image

Stéfan van der Walt stefan at sun.ac.za
Mon Jul 8 05:55:35 EDT 2013


On Mon, Jul 8, 2013 at 9:56 AM, Neil <yager.neil at gmail.com> wrote:
> 1. There may be a slight difference between the RGB to grayscale conversion
> formulas used by matlab and skimage. It you want identical results, you'll
> have to confirm this.

That's true.  The Matlab conversion is probably done as follows:

image = np.uint8(0.2989 * python[..., 0] + 0.5870 * python[..., 1] +
0.1140 * python[..., 2])

I'm not sure whether they round or discard the fraction.

> 3. It looks like matlab normalizes the GLCM matrix (although the docs don't
> say).

This should probably raise a warning in graycoprops--it doesn't make
much sense to calculate these without normalization.

Stéfan



More information about the scikit-image mailing list