imwdc
They represent a decomposition of an image with respect to a two-dimensional wavelet basis
type="wavelet"
then the image was decomposed according to the 2D Mallat pyramidal algorithm. If type="station"
then the image was decomposed using the 2D spatially ordered non-decimated wavelet transform.first.last
if you are a masochist.filter.select
function. This component records the filter used in the decomposition. The reconstruction routines use this component to find out what filter to use in reconstruction.Each vector stores its coefficients using an object of class compressed, i.e. the vector is run-length encoded on zeroes.
Note that the levels should be in numerically decreasing order, so if nlevelsWT is 5, then there will be w5L1, w5L2, w5L3 first, then down to w1L1, w1L2, and w1L3. Note that these coefficients store their data according to the first.last
database fl.dbase$first.last.d
, so refer to them using this.
Note that if type="wavelet"
then images at level N are subimages of side length 2^N
pixels. If the type component is "station"
then each coefficient subimage is of the same dimension as the input image used to create this object.
threshold.imwd
function to represent a thresholded two-dimensional wavelet decomposition of a function. Some other functions return an object of class imwdc.draw
, imwr
, nullevels
, plot
, print
, summary
, threshold.imwdc
.To uncompress this class of object back into an object of class imwd.object
use the uncompress.imwdc
function.
imwd
imwd.object
, threshold.imwd
, uncompress.imwdc
.#
# Perform the standard two-dimensional DWT
# on the lennon image.
#
data(lennon)
lwd <- imwd(lennon)
#
# Now let's see how many horizontal detail coefficients there are at
# scale 6
#
length(lwd$w6L1)
# [1] 4096
#
# So the horizontal detail ``image'' at scale contains 64x64=4096 coefficients.
# A lot!
#
# Now, suppose we threshold this
# two-dimensional wavelet decomposition object
#
lwdT <- threshold(lwd)
#
# First of all. What is the class of the detail coefficients now?
#
class(lwdT$w6L1)
# [1] "compressed"
#
# Aha. So this set of coefficients got compressed using the
# compress.default function.
#
# How many coefficients are being stored here?
#
lwdT$w6L1
# $position:
# [1] 173 2829 2832 2846
#
# $values:
# [1] 141.5455 -190.2810 -194.5714 -177.1791
#
# $original.length:
# [1] 4096
#
# attr(, "class"):
# [1] "compressed"
#
# Wow! Only 4 coefficients are not zero. Wicked compression!
Run the code above in your browser using DataLab