Learn R Programming

spc4sts (version 0.2.1)

localStat: Monitoring Statistic for Local Defects on Stochastic Textured Surfaces

Description

Computes the spatial moving statistics (SMS), and then the monitoring Statistic for local defects on a given stochastic textured surface image.

Usage

localStat(img, model, cl, stat = c("ad", "bp"), w)

Arguments

img

the given image in the matrix format.

model

the returned object from surfacemodel

cl

the returned object from climit or climit2.

stat

the statistic used in the SMS. If cl is given, stat = cl$stat; otherwise, must be either "ad" (default) or "bp".

w

the window size of the SMS. If cl is given, w = cl$w; otherwise, it must be an odd number >= 3.

Value

A list of the following:

sms

a matrix of the SMS values computed for pixels in img

stat

the argument stat

w

the argument w

monitoringStat

the monitoring statistic of img

References

Bui, A.T., and Apley., D.W. (2017), "A Monitoring and Diagnostic Approach for Stochastic Textured Surfaces", Technometrics, In press.

See Also

surfacemodel, sms, dataPrep

Examples

Run this code
# NOT RUN {
## build the in-control model
img <- sarGen(m = 100, n = 100, border = 50) # training image
model <- surfacemodel(img,1)

## generate an image and compute its monitoring statistic
img2 <- sarGen(m = 100, n = 100, border = 50)
ls <- localStat(img2, model, stat = "ad", w = 5)
ls$monitoringStat
# }

Run the code above in your browser using DataLab