disMat: Pairwise Dissimilarity Matrix of Stochastic Textured Surfaces

View source: R/disMat.R

disMatR Documentation

Pairwise Dissimilarity Matrix of Stochastic Textured Surfaces

Description

Compute KL and ALK dissimiarlity matrices for the given stochastic textured surface images.

Usage

disMat(imgs, nb, cp=1e-3, subsample = c(1, .5),
                   standardize = TRUE, keep.fits = FALSE, verbose=FALSE)

Arguments

imgs

a 3-dimensional array containing all images.

nb

the size of the neighborhood. It must be a 1-length or 3-length vector of positive integer(s). If the former, it is the same with a 3-length vector with the same elements.

cp

the minimal value for the rpart complexity models. The smaller cp is, the more complex the rpart models are fit.

subsample

the portion of pixels in the given image img to be used when fitting models (the first component) and computing dissimilarities (the second component). It takes values in (0, 1] (e.g., subsample = c(1, .5) means that the whole image is used when fitting models, and roughly a half of that is used when compute dissimilarities).

standardize

if TRUE, standardize the given image img <- (img - mean(img))/sd(img). This reduces the effect of different lighting conditions when images are taken.

keep.fits

if TRUE, save all the fitted models in the "fits.Rdata" under the wokring directory.

verbose

if set to TRUE, output some computational time information.

Value

the KL and AKL dissimilarity matrices.

Author(s)

Anh Bui

References

Bui, A.T. and Apley, D.W. (2019b) "An exploratory analysis approach for understanding variation in stochastic textured surfaces", Computational Statistics & Data Analysis, 137, 33-50.

Examples

## generate images: the first two are similar, the third is different with the other two
phi1 <- c(.6, .6, .5)
phi2 <- c(.35, .35, .3)
imgs <- array(0, c(100,100,3))
for (j in 1:dim(imgs)[3])
  imgs[,,j] <- sarGen(phi1 = phi1[j], phi2 = phi2[j], m = 100, n = 100, border = 50)
## compute KL and AKL dissimilarity matrices
disMat(imgs = imgs, nb = 1)

spc4sts documentation built on May 24, 2022, 5:07 p.m.