scatter.ratio: Pixel scatteredness ratio.

View source: R/sparseness_funcs.R

scatter.ratioR Documentation

Pixel scatteredness ratio.

Description

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.

Usage

scatter.ratio(im)

Arguments

im

2-D numeric matrix representing the image pixel intensities.

Value

calculated scatter ratio.

Author(s)

Paolo Inglese p.inglese14@imperial.ac.uk

References

Otsu, N. (1979). A threshold selection method from gray-level histograms. IEEE transactions on systems, man, and cybernetics, 9(1), 62-66.

See Also

gini.index spatial.chaos

Examples

## 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)

paoloinglese/SPUTNIK documentation built on April 18, 2024, 8:56 p.m.