Learn R Programming

gtexture (version 1.0.0)

normalize_glcm: Normalize a GLCM

Description

Function that normalizes a gray-level co-occurrence matrix (GLCM) so that the sum of all the elements equals unity. This has the added benefit of converting the GLCM to a probability distribution.

Usage

normalize_glcm(mat)

Value

numeric matrix (same dimensions as input GLCM)

Arguments

mat

gray-level co-occurrence matrix

Examples

Run this code
# normalize an arbitrary matrix
a <- matrix(1:9, nrow = 3)
n_a <- normalize_glcm(a)

print(a)
print(n_a)

Run the code above in your browser using DataLab