# NOT RUN {
## build the in-control model
img <- sarGen(m = 100, n = 100, border = 50) # training image
model <- surfacemodel(img,1)
## diagnose a Phase II image
img2 <- sarGen(m = 100, n = 100, border = 50)
img2 <- imposeDefect(img2)
image(as.matrix(t(apply(img2$img , 2, rev))),col=gray(c(0:32)/32))
ls <- localStat(img2$img, model, "bp", 5)
bimg <- diagnoseLD(ls, dth = 1.4) # use climit() to find dth
# }
Run the code above in your browser using DataLab