Digital Image Processing
- Digital Image Processing---Wavelets
-
- 1. Introduction
- 2. Related Work
- 3. Approach
- 4. Experimental Setup
-
-
- 4.1 Haar filters, scaling, and wavelet functions.
- 4.2 A simple FWT using Haar filters.
- 4.3 Comparing the execution times ofwavefast and wavedec2.
- 4.4 Wavelet Toolbox functions for manipulating transform decomposition vector c.
- 4.5 Manipulating c with wavecut and wavecopy.
- 4.6 Transform coefficient display using wavedisplay.
- 4.7 Comparing the execution times of waveback and waverec2.
- 4.8 Wavelet directionality and edge detection.
- 4.9 Wavelet-based image smoothing or blurring.
- 4.10 Progressive reconstruction.
-
- 5. Conclusion
- 6. Appendix
Digital Image Processing—Wavelets
Abstract
The Fourier transform is a beautiful mathematical description, but the computer implementation is discrete step by step from the time domain and the frequency domain.The Fourier transform only shows the frequency properties of the signal or image, and does not provide any time domain information.Wavelet analysis is the latest time - frequency analysis tool.Compared with Fourier transform, discrete wavelet transform inherits and develops the idea of short-time Fourier transform localization and overcomes the disadvantage that the window size does not change with frequency. In addition to being effective and highly intuitive in describing frames and multi-resolution storage, DWT also helps in gaining insight into the spatial and frequency characteristics of images.This paper discusses the calculation and application of discrete wavelet transform.The wavelet toolbox is first introduced.Secondly, the wavelet decomposition structure and fast inverse wavelet transform are studied.Finally, wavelet transform is applied to edge detection, image smoothing and progressive reconstruction.Experimental results show that wavelet transform is widely used in image processing.
1. Introduction
When digital images are to be viewed or processed at multiple resolutions, the discrete wavelet transform (DWT) is the mathematical tool of choice. In addition to being an efficient, highly intuitive framework for the representation and storage of multiresolution images, the DWT provides powerful insight into an image's spatial and frequency characteristics. The Fourier transform, on the other hand, reveals only an image's frequency attributes.
In simple terms, in the traditional Fourier analysis, the signal is completely spread out in the frequency domain, without any time domain information.And has the characteristics of multi-resolution wavelet transform, both in time domain and frequency domain has the ability to characterize local information, time and frequency window can be adjusted according to the concrete forms of signal dynamic, in the low frequency part adopts lower temporal resolution, which improve the resolution of frequency, under the condition of high frequency and low frequency resolution is used to obtain accurate positioning.
In this paper, we explore both the computation and use of the discrete wavelet transform. We introduce the Wavelet Toolbox, a collection of MathWorks' functions designed for wavelet analysis but not included in MATLAB's Image Processing Toolbox, and develop a compatible set of routines that allow wavelet-based processing using the Image Processing Toolbox alone; that is, without the Wavelet Toolbox. These custom functions, in combination with Image Processing Toolbox functions, provide the necessary tools .They are applied in much the same way-and provide a similar range of capabilities-as toolbox functions fft2 and i fft2.Then we study the structure of wavelet decomposition and fast inverse wavelet transform.Finally, we apply wavelet transform to edge detection, image smoothing and progressive reconstruction.
2. Related Work
2.1 Preliminary knowledge
First let us review what a wavelet is ,real word data or signals frequqently exhibit slowly changing trends or oscillations punctuated with transients, on the other hand ,images have smooth regions interrupted by edges or abrupt changes in contrast.These abrupt changes are often the most interesting parts of the data both perceptually and in terms of the information they provide.The Fourier transform is a powerful tool for data analysis ,however it does not represent abrupt changes efficiently .The reason for that is that the Fourier transform represents data as a sum of sine waves which are not localized in time or space,these sine waves oscillate forever.Therefore to accurately analyze signals and images that have abrupt changes ,we need to use a new class of functions that are well localized in time and frequency,this brings us to the topic of wavelets,a wavelet is a rapidly decaying wave like oscillation that has zero mean,unlike sinusoids which extend to infinity ,a wavelet exists for a finite duration,wavelets come in different sizes and shapes.The availability of a wide range of wavelets is a key strength of wavelet analysis ,to choose the right wavelet,you will need to consider the application you will use it for.For now ,let us focus on two important wavelet transform concepts , scaling and shifting ,let us start with scaling ,say you have a signal Sai of T,scaling refers to the process of stretching or shrinking the signal in time which can be expressed using this equation :
s is a scaling factor which is a positive value and corresponds to how much a signal is scaled in time .The scale factor is inversely proportional to frequency.For example,scaling the sine wave by two results in reducing original frequency by half or by octave .For a wavelet,there is a reciprocal relationship between the scale and the frequency with a constant of proportionality.This constant of proportionality is called the center frequency of wavelet.This is because unlike the sine wave,the wavelet has a band pass characteristic ,in the frequency domain ,mathematically ,the equivalent frequency is defined using this equation :
Where CF is the center frequency of the wavelet ,s is the wavelet scale and dalta T is the sampling interval.
Therefore when you scale a wavelet by a factor of 2 ,it results in reducing the equivalent frequency by an octave .A larger scale factor (s>1) results in a stretched wavelet which corresponds to a lower frequency,a smaller scale factor results in a shrunken wavelet which corresponds to a high frequency.A stretched wavelet helps in capturing the slowly varying changes in the signal while a compressed wavelet helps in capturing the abrupt changes.You can construct different scales that inversely correspond to the equivalent frequencies as mentioned earlier.Next we will discuss shifting ,shifting a wavelet simply means delaying or advancing the onset of the wavelet along the length of the signal.
A shifted wavelet represented using this notation means that the wavelet is shifted and centered at K ,we need to shift the wavelet to align with the feature we are looking for in the signal ,the two major transforms in wavelet analysis are continuous and discrete wavelet transforms ,these transforms differ bases on how the wavelets are scaled and shifted,now we have got the basic concepts behind wavelets.
we will now look at two types of wavelet transforms ,the continuous wavelet transform and the discrete wavelet transform.Key applications of continuous wavelet analysis are time frequency analysis and filtering of time localized frequency components.The key applications for discrete wavelet analysis are dennoising and compression of signals and images as mentioned in the previous.This two transforms differ based on how they discretize the scale and the translation parameters .We will discuss these techniques as they apply in the 1d scenario.Let us take a closer look at the continuous wavelet transform or CWT,you can use this transform to obtain a simultaneous time frequency analysis of a signal.Analytic wavelets are best suited for time frequency analysis as these wavelets do not have negative frequency component.
1. Morse Wavelets
2. Bump Wavelet
3. Analytic Morlet Wavelet
2. Bump Wavelet
3. Analytic Morlet Wavelet
This list includes some of the analytic waveletes that are suitable for continous wavelet analysis ,the output of CWT are coefficients which are function of scale or frequency and time.Let us now discuss the process of constructing different wavelet scales,when you scale a wavelet by a factor of 2,it results in reducing the equivalent frequency by an octave .With th e CWT, you have the added flexibility to analyze the signal at intermediary scales within each octave,this allows for fine scale analysis .
This parameter is referred as the number of scales per octave.The higher the number of scales per octave,the finer the scale discretization.Typical values for this parameter are 10,12,16and 32 .The scales are multiplied with the sampling interval of the signal to obtain a physical significance .Here is an example of scales for a bump wavelet with 32 scales per octave .The signal is sampled every 7 microseconds,this is the corresponding plot with the euivalent frequency for the scales,notice that the actual scale values are exponential.Now each scale wavelet is shifted in time along the entire length of the signal and compared with the original signal.You can repeat this process for all the scales resulting in coefficients that are a function of wavelet scale and shift parameter.To put it in perspective,a signal with 1000 samples analyzed with 20 scales results in 20000 coeddicients ,in this way you can better characterize oscillatory behavior in signals with the continuous wavelet transform,the discrete wavalet ransform or DWT is ideal for denoising and compressing signals and images as it help represent many naturally occurring signals and images with fewer coefficients ,this enables a sparser representation.The base scale in dwt is set to 2,you can obtain different scales by raising this base scale to integers values represented in this way .The translation occurs at integer multiples represented in this equation.This process is often referred to as dyadic scaling and shifting ,this kind of sampling eliminates redundacy in coefficients.The output of the transform yields the same number of coefficients as the length of the input signal.Therefore it requires less memory .The discrete wavelet transfrom process is equivalent to comparing a signal with discrete nulti rate filter banks .
Conceptually here is how it works,given a signal s ,the signal is first filtered with special low-pass and high-pass filters to yield low-pass and high-pass sun bands.
FIGURE 7.1
We can refer to this as a1 and d1 ,half of the samples are discarded after filtering as per the Nyquist criterion .The filters typically have a small number of coefficients and result in good computational performance.These filters also have the led to reconstruct the sub bands while camnceling any aliasing that occurs due to down sampling .For the next level of decomposition,the low-pass sub band a1 is iteratively filtered by the same technique to yield narrower sub bands a2 and d2 and so on,the length of the coefficients in each sub band is half of the number of coefficients in the preceding stage ,the dis technique you can capture the signal of interest with a few large magnitude DWD coefficients while the noise in the signal results in smaller dwt coefficients.This way DWT helps analyze signals at progressively narrower sub bands at different resolution ,it also helps D noise and compress signals .
2.2 Background
Consider an image f(x, y) of size M X N whose forward, discrete transform,T(u,v,...) can be expressed in terms of the general relation:
where x and y are spatial variables and u, v, ... are transform domain variables. Given T(u, v, ... ), f(x, y) can be obtained using the generalized inverse discrete transform :
The g uv.. and h u,v.... in these equations are called forward and inverse tranformation kernels,respectively. They determine the nature, computational complexity, and ultimate usefulness of the transform pair. Transform coefficients T(u, v, ... ) can be viewed as the expansion coefficients of a series expansion of with respect to {h u,v,..} That is, the inverse transformation kernel defines a set of expansion functions for the series expansion of f.
The discrete Fourier transform (DFT) fits this series expansion formulation well. In this case :
where j =√(-1), * is the complex conjugate operator, u = 0, 1, ... , M -1 and v = 0, 1, ... , N -1. Transform domain variables u and v represent horizontal and vertical frequency, respectively. The kernels are separable since:
for
and orthonormal because
where <> is the inner product operator. The separability of the kernels simplifies the computation of the 2-D transform by allowing row-column or columnrow passes of a 1-D transform to be used; orthonormality causes the forward and inverse kernels to be the complex conjugates of one another (they would be identical if the functions were real).
Unlike the discrete Fourier transform, which can be completely defined by two straightforward equations that revolve around a single pair of transformation kernels (given previously), the term discrete wavelet transform refers to a class of transformations that differ not only in the transformation kernels employed (and thus the expansion functions used), but also in the fundamental nature of those functions (e.g., whether they constitute an orthonormal or biorthogonal basis) and in the way in which they are applied (e.g., how many different resolutions are computed). Since the DWT encompasses a variety of unique but related transformations, we cannot write a single equation that completely describes them all. Instead, we characterize each DWT by a transform kernel pair or set of parameters that defines the pair. The various transforms are related by the fact that their expansion functions are "small waves" (hence the name wavelets) of varying frequency and limited duration . In the remainder of the chapter, we introduce a number of these "small wave" kernels. Each possesses the following general properties:
FIGURE 7.2
(a) The familiar Fourier expansion functions are sinusoids of varying frequency and infinite duration. (b) DWT expansion functions are sinusoids of varying frequency and infinite duration.
Property 1: Separability, Scalability, and Translatability. The kernels can be represented as three separable 2-D wavelets :
They are called horizantal, vertical, and diagonal wavelets , respectively, and one separable 2-D scaling function :
Each of these 2-D functions is the product of two 1-D real, square-integrable scaling and wavelet functions :
Translation k determines the position of these 1-D functions along the x-axis, scale j determines their width — how broad or narrow they are along x—and $2^j/2$ controls their height or amplitude.
Property 2: Multiresolution Compatibility. The 1-D scaling function just introduced satisfies the following requirements of multiresolution analysis: