View source: R/sparseness_funcs.R
scatter.ratio | R Documentation |
scatter.ratio
returns a measure of image scatteredness represented by
the ratio between the number of connected components and the total number of
non-zero pixels. The number of connected components is calculated from the
binarized image using Otsu's method.
scatter.ratio(im)
im |
2-D numeric matrix representing the image pixel intensities. |
calculated scatter ratio.
Paolo Inglese p.inglese14@imperial.ac.uk
Otsu, N. (1979). A threshold selection method from gray-level histograms. IEEE transactions on systems, man, and cybernetics, 9(1), 62-66.
gini.index spatial.chaos
## Load package
library("SPUTNIK")
## Image
im <- matrix(rnorm(100), 10, 10)
im[im < 0] <- 0
## Spatial chaos
sc <- spatial.chaos(im, levels = 30, morph = TRUE)
stopifnot(sc <= 1)
## Gini index
gi <- gini.index(im, levels = 16)
stopifnot(gi >= -1 && gi <= 1)
## Scatter ratio
sr <- scatter.ratio(im)
stopifnot(sr <= 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.