## S3 method for class 'imwd':
plot(x, scaling="by.level", co.type= c("abs", "mabs", "none"),
plot.type = c("mallat", "cols"), arrangement = c(3,3),
plot = exists("image",mode="function"), transform = FALSE,
tfunction = sqrt, col = heat.colors(32), ...)
imwd
containing a wavelet decomposition of
an image."by.level"
which means each image is scaled independently to the whole
dynamic range of the image, otherwise the whole image is scaled as a whco.type=="abs"
, then the absolute values of the coefficients
will be displayed,
if co.type=="mabs"
, then the negative of the aTRUE
, image
is used to
display the result.TRUE
, then the function given by
argument tfunction
is applied.transform
is true.image
.invisible
if plot
is true.plot
is true.If plot.type=="rows", then each sub-image of the decomposition is plotted at the same size so you can see the lower resolution images. By default the arrangement of each of the sub-images is on a 3x3 array, so three levels can fit onto one plot. If you are using a screen device then it may be desirable to turn on the "ask before you plot" option with dev.ask(), since the coefficients plot may run to a few pages with the "rows" plot.type.
It is not always easy to see exactly what's going on, so there are a few arguments that try to manipulate the (sub)image(s). The scaling argument only works when the plot.type=="mallat" is in force. If scaling is by.level then each subimage is scaled independently, if not then the whole image is scaled at once. The co.type works for both plot types and causes absolute values, negative absolute values or just the coefficients to be plotted - this is useful for enhancing various effects. The most flexible transformation is provided when transform==TRUE, then the function tfunction is applied to all the coefficients and can produce some useful contrast enhancing effects.
At each stage of the decomposition we decompose an image into four images, each of which are half the size of the original (see "imwd" for what these are). Three of the images correspond to wavelet coefficients in the horizontal, vertical and diagonal directions and these form the bottom-right, top-left and top-right sections of the displayed image. The fourth image is further decomposed into another four subimages. Three of which get put into the bottom-right, top-left, and top-right sections OF THE BOTTOM-LEFT part of the previous image and so on and so on. It is impossible to explain this properly in a simple fashion, so the only way to really understand what is going on is to do it yourself and see what happens.
This function is a method for the generic function
plot()
for class imwd
.
It can be invoked by calling plot(x)
for an
object x
of the appropriate class, or directly by
calling plot.imwd(x)
regardless of the
class of the object.
imwd, for references and background.
example(imwd)
# See the wavelet coefficient in Mallat's form
c.gray <- gray(127:0 / 128)
plot(imwdL, col = c.gray)
plot(imwdL, col = c.gray, scaling = "none")
plot(imwdL, col = c.gray, scaling = "none", co.type = "none")
plot(imwdL, col = c.gray, plot.type = "cols")
Run the code above in your browser using DataLab