# NOT RUN {
#### example : composite of two components having different frequencies
nr <- nc <- 128; x <- seq(0, 1, length=nr); y <- seq(0, 1, length=nc)
coscomp1 <- outer(cos(20 * pi * x), cos(20 * pi * y))
coscomp2 <- outer(cos(5* pi * x), cos(5 * pi * y))
cosmeanf <- coscomp1 + coscomp2
op <- par(mfcol=c(3,1), mar=c(0,0.5,2,0.5))
image(cosmeanf, xlab="", ylab="", col=gray(0:100/100), axes=FALSE, main="a composite image")
image(coscomp1, xlab="", ylab="", col=gray(0:100/100), axes=FALSE, main="high-frequency component")
image(coscomp2, xlab="", ylab="", col=gray(0:100/100), axes=FALSE, main="low-frequency component")
# }
# NOT RUN {
#### Multiscale Ensemble Patch Transform according to tau's
taus1 <- seq(6, 12, by=2)
outcosmulti <- meptransf2d(z=cosmeanf, taus=taus1)
par(mfrow=c(length(taus1), 2), mar=c(2,2,2,1))
for (i in 1:length(taus1)) {
estlowfreq <- outcosmulti$Epstat[[i]]
image(estlowfreq, xlab="", ylab="", col=gray(0:100/100), axes=FALSE,
main=paste0("ensemble average of patch mean, tau=", taus1[i]))
persp(estlowfreq, theta = -30, phi = 45, col = "white", xlab="X", ylab="Y",
main=paste0("ensemble average of patch mean, tau=", taus1[i]))
}
# }
# NOT RUN {
par(op)
# }
Run the code above in your browser using DataLab