powered by
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.
normalize_glcm(mat)
numeric matrix (same dimensions as input GLCM)
gray-level co-occurrence matrix
# 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