glcm v1.6.3


Monthly downloads



Calculate Textures from Grey-Level Co-Occurrence Matrices (GLCMs)

Enables calculation of image textures (Haralick 1973) <doi:10.1109/TSMC.1973.4309314> from grey-level co-occurrence matrices (GLCMs). Supports processing images that cannot fit in memory.



Build Status


The glcm package enables calculating image textures derived from grey-level co-occurrence matrics (GLCMs) in R. The texture calculation is coded in C++ to optimize computation time. The glcm function in the package can compute the following texture statistics: mean (using either of two definitions), variance (using either of two definitions), homogeneity, contrast, dissimilarity, entropy, second_moment, and, correlation. The window size, shift, and grey-level quantization are user determined. See the help file for glcm (included in the package) for details.

Package Installation

To install the latest stable version of glcm from CRAN, fire up R and run:


Installing glcm Development Version

If you want the very latest version of glcm, you can install the development version. Be aware this version might not install as it is not as well tested as the stable version.

NOTE: If you are installing on Windows, you will need to install the appropriate version of Rtools for your version of R (as glcm contains C++ code) before you follow the below steps.

The easiest way to install the development version of the glcm package is using the devtools package by Hadley Wickham. After installing devtools from CRAN, type:


Author Contact Information

Alex Zvoleff
Postdoctoral Associate
Tropical Ecology Assessment and Monitoring (TEAM) Network
Conservation International
2011 Crystal Dr. Suite 500
Arlington, VA 22202

Functions in glcm

Name Description
test_raster Randomly generated 100x100 test image
expected_textures_3x3_1x1 GLCM textures calculated in EXELIS ENVI (for testing purposes)
expected_textures_5x7_2x3 GLCM textures calculated in EXELIS ENVI (for testing purposes)
expected_textures_5x3_n1xn2 GLCM textures calculated in EXELIS ENVI (for testing purposes)
L5TSR_1986 Landsat 5 Surface Reflectance Image from February 6, 1986 (path 15, row 53)
calc_texture Calculates a glcm texture for use in the glcm.R script
glcm-package Calculate textures from grey-level co-occurrence matrices (GLCMs) in R
glcm Image texture measures from grey-level co-occurrence matrices (GLCM)
No Results!

Last month downloads


Date 2019-04-15
LinkingTo Rcpp, RcppArmadillo
License GPL (>= 3)
LazyData true
Encoding UTF-8
RoxygenNote 6.1.1
NeedsCompilation yes
Packaged 2019-04-15 15:40:58 UTC; azvol
Repository CRAN
Date/Publication 2019-04-15 18:12:44 UTC

Include our badge in your README