meptransf2d {EPT}R Documentation

Multiscale Two-dimensional Ensemble Patch Transforms of an Image

Description

This function performs multiscale two-dimensional ensemble patch transforms of an image for a sequence of size parameters.

Usage

meptransf2d(x = NULL, y = NULL, z, type = "rectangle", taus, theta = 0, 
    process = c("average", "average"), pquantile = c(0, 1), equantile = c(0, 1),
    gamma = 1, boundary = "reflexive") 

Arguments

x, y

locations of regular grid at which the values in image z are measured. When those are NULL, the image is supposed to be equally spaced.

z

matrix of an image observed at location (x, y).

type

patch type of "rectangle" or "oval".

taus

a matrix or vector of size parameters for two-dimensional ensemble patch transform. When it is a matrix, the first and second columns specify the horizontal and vertical sizes of a two-dimensional patch, respectively. When it is a vector, the horizontal and vertical size of a two-dimensional patch are the same.

theta

a degree of clockwise rotation of a patch.

process

specifies transform types for patch and ensemble processes: process[1] for patch process and process[2] for ensemble process. Each process has options of "average", "median", or "envelope". Note that when process[1] is "average" or "median", process[2] must be "average" or "median". When process[1] is "envelope", lower and upper envelopes are obtained by \code{pquantile[1]} \times 100 \%-quantile and \code{pquantile[2]} \times 100 \%-quantile of patches, respectively. When process[2] is "envelope", ensemble lower and upper envelopes are obtained as \code{equantile[1]} \times 100 \%-quantile and \code{equantile[2]} \times 100 \%-quantile of lower and upper envelopes of shifted patches, respectively.

pquantile

quantiles for lower and upper envelopes of patch transform. When it is c(0, 1), minimum and maximum of a patch are used for lower and upper envelopes, respectively.

equantile

quantiles for lower and upper envelopes of ensemble patch transform.

gamma

controls the amount of envelope magnitude.

boundary

specifies boundary condition from "reflexive", "periodic" or "none".

Details

This function performs multiscale two-dimensional ensemble patch transforms of an image for a sequence of size parameters taus, and produces statistics and envelopes for two-dimensional ensemble patch transform. When process[1] is "average" or "median", outputs related to envelopes are defined as NULL. When process[2] is "envelope", outputs, pstat and Epstat, are defined as NULL.

Value

x, y

locations of regular grid at which the values in z are measured. When those are NULL, image is supposed to be equally spaced.

z

matrix of an image observed at (x, y).

pstat

list of centrality of patch transform for a sequence of size parameters taus.

Epstat

list of centrality of ensemble patch transform for a sequence of size parameters taus.

psd

list of standard deviation of patch transform for a sequence of size parameters taus.

Epsd

list of standard deviation of ensemble patch transform for a sequence of size parameters taus.

pL

list of lower envelope of patch transform for a sequence of size parameters taus.

pU

list of upper envelope of patch transform for a sequence of size parameters taus.

pM

list of mean envelope, (pL + pU) / 2, of patch transform for a sequence of size parameters taus.

pR

list of distance between lower and upper envelopes, (pU - pL), of patch transform for a sequence of size parameters taus.

EpL

list of lower envelope of ensemble patch transform for a sequence of size parameters taus.

EpU

list of upper envelope of ensemble patch transform for a sequence of size parameters taus.

EpM

list of mean envelope, (EpL + EpU) / 2, of ensemble patch transform for a sequence of size parameters taus.

EpR

list of distance between lower and upper envelopes, (EpU - EpL), of ensemble patch transform for a sequence of size parameters taus.

rho

vector of correlations between (z - ept) component and ept component for a sequence of size parameters taus. The ept component is component obtained by ensemble patch transform.

parameters

a list of input parameters of type, taus, theta, process, pquantile, equantile, gamma, and boundary.

nlevel

the number of size parameters taus.

See Also

eptransf2d, eptdecomp2d.

Examples

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


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

par(op)

[Package EPT version 0.7.6 Index]