One of the most useful applications of wavelet analysis is to remove unwanted noise from a dataset. This noise could be due to measurement errors or instrument noise. In image processing the "noise" might be small-scale features or artifacts.
You could try to remove noise from the signal by using a low-pass or band-pass Fourier filter. There are two problems with this approach:
Wavelet analysis, on the other hand, offers a scale-independent and robust method to filter out noise. The basic technique involves computing the wavelet transform of your data and then decreasing or discarding the smallest wavelet coefficients. The inverse transform of these coefficients will then be a filtered version of your data.
We assume that you have computed the wavelet transform Wi of a multi-dimensional data array, Ai, where i=0...N-1 is the index and N is the number of points.
You then compute a threshold level W0. This threshold level can be based on the percent of wavelet power that you wish to retain, the number of coefficients, or some other method. Suggestions for choosing the threshold are given in Donoho and Johnstone (1994). Wavelet coefficients smaller than this threshold are discarded while those above are retained. There are two methods for thresholding:
The hard threshold removes all discarded wavelet coefficients by setting them to zero and computing the inverse wavelet transform. This can be defined as:
where Wi is the wavelet coefficient and W0 is the chosen threshold level.
The soft threshold also sets all discarded wavelet coefficients to zero. However, it also linearly reduces the magnitude of the each retained wavelet coefficient by an amount equal to the largest discarded coefficient, i.e.:
where sgn(Wi) is the sign of Wi.
We will look at a magnetic-resonance image (MRI) of the brain, and use the Denoising widget tool to filter out unwanted speckles and compress the size of the image.
Try the following steps:
examples/datadirectory in the IDL distribution.
mr_brain.dcm. The file should contain a 256 x 256 unsigned integer (UINT) image.
Notice that you have retained 12.5% of the coefficients and have discarded 87.5%. The black regions of the "Wavelet Coeffs" plot shows the discarded coefficients. The percent difference between the original and filtered image is about 6%. Examining the filtered image, you will notice that much of the speckling around the outside is now gone. In addition, some of the small-scale features and low-contrast regions within the image have been diminished. Finally, the dotted line on the Cumulative Power graph indicates that although you are only retaining 12.5% of the information you are preserving almost 100% of the variance, or power.