Learn R Programming

ForestTools (version 0.2.5)

.calcGLCM: Calculate GLCM

Description

Some notes about this function: 1. Input should be a matrix 2. Shouldn't receive negative values 3. Shouldn't receive all NA values 4. Shouldn't be an empty matrix (i.e.: nrow = 0, ncol = 0) 5. 'n_grey' shouldn't be larger than the number of unique values

Usage

.calcGLCM(data, n_grey, angle, d = 1, normalize = TRUE)

Arguments

data

matrix. Input image

n_grey

integer. Number of grey levels used to discretize image

angle

integer. Angle at which GLCM will be calculated. Valid inputs are 0, 45, 90, or 135

d

numeric. Distance for calculating GLCM

normalize

boolean. Normalize output if TRUE