2

I am running a Image texture measures from grey-level co-occurrence matrices (GLCM) on Landsat bands using the glcm package in R and I would like to know what is the difference between mean' and 'mean_ENVI' / 'variance' and 'variance_ENVI'.

It seems to be a basic question but I couldn't find a good explanation for that.

library(glcm)

Feb2014_B2 <-raster ("Feb2014_band2x.tif")

Feb2014.B2.textures3x3 <- glcm(Feb2014_B2, window = c(3, 3), shift = c(1, 1),   
statistics = c("mean", "mean_ENVI", "variance", "variance_ENVI",  
"homogeneity", "contrast", "dissimilarity", "entropy", "second_moment", 
"correlation"), na_opt="any", na_val=NA) 
Tonechas
  • 13,398
  • 16
  • 46
  • 80
Nery
  • 21
  • 4

1 Answers1

7

I am the author of the R glcm package. The difference between mean and mean_ENVI and between variance and variance_ENVI has to do with how the mean is calculated. The mean and variance in the glcm package are implemented as in the original Haralick publication. The mean and variance in ENVI are implemented differently. ENVI calculates the mean as a simple mean of the pixel values within the given window size – so the ENVI mean is not a texture measure at all, but simply a smoothed version of your original image. I implemented it in my package to make it possible to reproduce ENVI results in R.

The formulas I use are as in Haralick. Right now the only way to see them is in the C++ code (https://github.com/azvoleff/glcm/blob/master/src/calc_texture.cpp). I will get these into the R docs eventually, but haven't yet had time to throw them into the docs.

Alex Zvoleff
  • 442
  • 2
  • 13
  • Thank you very much. Now the difference between both is clear. It would be really useful if this information is written in the R docs. – Nery Apr 25 '16 at 03:31
  • Does this also refer to the other co-occurence measures in ENVI? I found significant differences between ENVI results and GLCM properties (calculated from https://scikit-image.org/docs/dev/api/skimage.feature.html#skimage.feature.greycomatrix – s6hebern May 09 '19 at 07:30
  • My results (using the formulas as in the references given in the R GLCM package) match the results from ENVI for the other texture measures - just not for the mean. Not sure how they compare with scikit though - would be curious to know which measures vary. – Alex Zvoleff May 17 '19 at 14:36