Learn R Programming

spc4sts (version 0.2.1)

imposeDefect: Superimpose Local Defects

Description

Superimposes a local defect (a 2D stochastic AR(1) image from sarGen) on a given image.

Usage

imposeDefect(img, loc = NULL, a = 4, b = 10, eps = 0.05, phi1 = 0, phi2 = 0, sigma = 0.01)

Arguments

img

the image to be superimposed a defect.

loc

the location of the defect in the generated image.

a

2*a + 1 is the vertical axis length of the ellipsoidal defect.

b

2*b + 1 is the vertical axis length of the ellipsoidal defect.

eps

controls the curvature of the ellipsoidal defect.

phi1

the parameter phi1 of the defect.

phi2

the parameter phi2 of the defect.

sigma

the parameter sigma of the defect.

Value

A list of the following:

img

the generated image in the matrix format.

defect.info

the information of the defects.

Details

The defect is generated using sarGen.

References

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

Examples

Run this code
# NOT RUN {
## generate an image without defects
img <- sarGen(m = 100, n = 100, border = 50)
image(img,col=gray(c(0:32)/32))

## superimpose a defect
img2 <- imposeDefect(img)
image(img2$img,col=gray(c(0:32)/32))
# }

Run the code above in your browser using DataLab