Grey-Level Co-Occurrence Matrix
Generate textural metrics for a segmented raster using Grey-Level Co-Occurrence Matrices (GLCM). It will return a series of GLCM statistics
for each segment (segs
) based on an underlying single-band raster image (image
) in the form of a data.frame.
glcm( segs, image, n_grey = 32, angle = 0, clusters = 1, showprog = FALSE, roundCoords = 4 )
segs |
RasterLayer. A segmented raster. Cell values should be equal to segment numbers |
image |
RasterLayer. A single-band raster layer from which texture is measured |
n_grey |
integer. Number of grey levels the image should be quantized into |
angle |
integer. Angle at which GLCM will be calculated. Valid inputs are 0, 45, 90, or 135 |
clusters |
integer. Number of clusters to use during parallel processing |
showprog |
logical. Display progress in terminal |
roundCoords |
integer. Errors in coordinate precision can trigger errors in this function. Internally, the coordinates are rounded to this decimal place. Default value of 4 decimals. |
The underlying C++ code for computing GLCMs and their statistics was originally written by Joel Carlson for the defunct [radiomics](https://github.com/cran/radiomics) library. It has been reused here with permission from the author.
data.frame
Parmar, C., Velazquez, E.R., Leijenaar, R., Jermoumi, M., Carvalho, S., Mak, R.H., Mitra, S., Shankar, B.U., Kikinis, R., Haibe-Kains, B. and Lambin, P. (2014). Robust radiomics feature quantification using semiautomatic volumetric segmentation. PloS one, 9(7)
## Not run: # Generate raster segments segs <- mcws(kootenayTrees, kootenayCHM, minHeight = 0.2, format = "raster") # Get textural metrics for ortho's red band tex <- glcm(segs, kootenayOrtho[[1]]) ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.