imposeDefect: Superimpose A Local Defect

View source: R/imposeDefect.R

imposeDefectR Documentation

Superimpose A Local Defect

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.

Details

The defect is generated using sarGen.

Value

A list of the following:

img

the generated image in the matrix format.

defect.info

the information of the defects.

Author(s)

Anh Bui

References

Bui, A.T. and Apley., D.W. (2018a) "A Monitoring and Diagnostic Approach for Stochastic Textured Surfaces", Technometrics, 60, 1-13.

Examples

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

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