imwd
class object.## S3 method for class 'imwd':
threshold(imwd, levels = 3:(nlevelsWT(imwd) - 1), type = "hard", policy =
"universal", by.level = FALSE, value = 0, dev = var, verbose = FALSE,
return.threshold = FALSE, compression = TRUE, Q = 0.05, ...)
imwd
object supplied. This is usually any integer frhard
" or "soft
".universal
", "manual
", "fdr
", "probability
". policy="manual"
then value is the actual threshold value; if policy="probability"
then value
conveys the the user supplied quantile level.var()
function. A poimwdc
. This can be useful as the resulting object will be smaller than if it was not compressed. The compression makes use of the "fdr"
policy.imwdc
if the compression
option above is TRUE, otherwise a imwd
object is returned. In either case the returned object contains the thresholded coefficients. Note that if the return.threshold
option is set to TRUE then the threshold values will be returned rather than the thresholded object.imwd
object and by default returns the coefficients in a modified imwdc
object.
See the seminal papers by Donoho and Johnstone for explanations about thresholding. For a gentle introduction to wavelet thresholding (or shrinkage as it is sometimes called) see Nason and Silverman, 1994. For more details on each technique see the descriptions of each method below
The basic idea of thresholding is very simple. In a signal plus noise model the wavelet transform of an image is very sparse, the wavelet transform of noise is not (in particular, if the noise is iid Gaussian then so if the noise contained in the wavelet coefficients).
Thus, since the image gets concentrated in few wavelet coefficients and the noise remains "spread" out it is "easy" to separate the signal from noise by keeping large coefficients (which correspond to true image) and delete the small ones (which correspond to noise). However, one has to have some idea of the noise level (computed using the dev option in threshold functions). If the noise level is very large then it is possible, as usual, that no image coefficients "stick up" above the noise. There are many components to a successful thresholding procedure. Some components have a larger effect than others but the effect is not the same in all practical data situations. Here we give some rough practical guidance, although you must refer to the papers below when using a particular technique. You cannot expect to get excellent performance on all signals unless you fully understand the rationale and limitations of each method below. I am not in favour of the "black-box" approach. The thresholding functions of WaveThresh3 are not a black box: experience and judgement are required!
Some issues to watch for: [object Object],Note that the fdr policy does its own thing.,[object Object]
imwd
, imwd.object
, imwdc.object
. threshold
.#
# Let's use the lennon test image
#
data(lennon)
image(lennon)
#
# Now let's do the 2D discrete wavelet transform
#
lwd <- imwd(lennon)
#
# Let's look at the coefficients
#
plot(lwd)
#
# Now let's threshold the coefficients
#
lwdT <- threshold(lwd)
#
# And let's plot those the thresholded coefficients
#
plot(lwdT)
#
# Note that the only remaining coefficients are down in the bottom
# left hand corner of the plot. All the others (black) have been set
# to zero (i.e. thresholded).
Run the code above in your browser using DataLab