Learn R Programming

fields (version 1.2)

Wtransform.image: Quadratic W wavelet transform for an image

Description

Finds the forward or inverse discrete wavelet transform using the quadratic W basis.

Usage

Wtransform.image(x, inv=FALSE, transpose=FALSE, cut.min=8)

Arguments

x
Matrix to be transformed
inv
If true will compute the inverse transform default is false
transpose
If true will compute the transpose of transform default is false
cut.min
Minimum level of transformation. cut.min=8 means that the coarsest level will consist of 64=8X8 scale functions centered on an 8X8 grid.

Value

  • A matrix the same size as x.

References

Nychka,D. Wikle,C. , Royle, J.A. (1999) Large spatial prediction problems and nonstationary random fields

Details

The wavelet transform can be thought as matrix multiplication A %*% vec(x) where vec(x) is the matrix x stacked by columns. The inverse transform is inv(A) %*% vec(x) and transpose is t(A) %*% vec( x)

See Also

plot.coef, WQS, WQSi, Wtransform.D

Examples

Run this code
# Wtransform of John Lennon image
data(lennon)
look<- Wtransform.image( lennon)
# 
### take a look: 
# image.plot( look)
#threshhold 
thr<-  quantile( abs( look), .95)
temp<- look
temp[abs(look)< thr] <- 0
look2<- Wtransform.image( temp, inv=TRUE)
# 
### take a look: 
# image( look2) # 95 \% compressed image

 
# a diagonal detail basis function 
temp<- matrix(0, nrow=32, ncol=32) 
temp[12,12]<- 1 
look<- Wtransform.image( temp , inv=TRUE)
persp( look) 
image( look)
title("diagonal detail W-wavlet")

Run the code above in your browser using DataLab