Learn R Programming

glcm

Overview

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:

install.packages('glcm')

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:

library(devtools)
install_github('azvoleff/glcm')

Author Contact Information

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

Copy Link

Version

Install

install.packages('glcm')

Monthly Downloads

364

Version

1.6.5

License

GPL (>= 3)

Maintainer

Alex Zvoleff

Last Published

February 26th, 2020

Functions in glcm (1.6.5)

expected_textures_5x3_n1xn2

GLCM textures calculated in EXELIS ENVI (for testing purposes)
glcm

Image texture measures from grey-level co-occurrence matrices (GLCM)
test_raster

Randomly generated 100x100 test image
glcm-package

Calculate textures from grey-level co-occurrence matrices (GLCMs) in R
calc_texture

Calculates a glcm texture for use in the glcm.R script
L5TSR_1986

Landsat 5 Surface Reflectance Image from February 6, 1986 (path 15, row 53)
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)