Wavelet Transform & Image Compression

Source: Internet
Author: User

/***********************Wavelet transform appeared background ***********************/

In order to ensure the quality of certain reconstruction, image coding can represent images by removing various redundancy in the image and minimizing the number of bits.

Long-term image coding mainly uses discrete cosine transform (DCT) as the main technology of transformation coding, however, there are some problems: (1) There are obvious block effects using DCT transform, (2) It is not suitable for non-stationary signals, (3) It is difficult to further improve the compression performance.

Wavelet transform is a new transformation method based on short-time Fourier transform, which is a time-frequency analysis method with multi-resolution analysis (MULTIRESOLUTIONANALYSIS), and has the ability to characterize local signals in both time and frequency domain, which is a kind of window size unchanged. , variable shape, time window and Frequency window can change the time-frequency localization analysis method. Because of its good time-frequency characteristics and the ability to match the characteristics of human visual system, wavelet transform has been paid great attention in the field of image compression coding.

first of all, we have a simple look at the two-dimensional wavelet transform tower structure. We know that a dimensional wavelet transformation is actually one-dimensional original signal through low-pass filtering and high-pass filtering, and two-yuan sampling to obtain the low-frequency portion of the signal and H. According to the Mallat algorithm, two-dimensional wavelet transform can be obtained by a series of dimensional wavelet transformations. For an image of M-row N-column, the process of two-dimensional wavelet transform is to make a dimensional wavelet transformation of each line of the image, get L and H two halves, and then make a dimensional wavelet transform for each column of the resulting LH image (still m row n column). So after the first-level wavelet transform image can be divided into ll,hl,lh,hh four parts, as shown, is the first two-dimensional wavelet transform tower structure:
ll
Lh HH
Figure 1
The two-dimensional wavelet transform of level two, level three and even higher is a recursive process, which is a two-dimensional wavelet transform for the upper left part (ll part) of the image after the first-level wavelet transform. is a three-level two-dimensional wavelet transformation of the tower structure diagram:
Klt HL3 HL2 HL1
LH3 HH3
lh2 hh2
LH1 HH1
Figure 2After the wavelet decomposition of an image, a series of sub-images with different resolutions can be obtained, and the corresponding frequencies of the sub-images at different resolutions are different. Most of the points on the high-resolution (i.e. high-frequency) sub-image are close to 0, and the higher the resolution, the more obvious the phenomenon. It is important to note that in N-level two-dimensional wavelet decomposition, the higher the decomposition level of the sub-image, the lower the frequency. Example 2 of the three-stage tower structure, sub-image HL2, LH2, HH2 frequency than the sub-image HL1, LH1, HH1 frequency, the corresponding resolution is also low. According to this hierarchical model of wavelet transform coefficients at different resolutions, we can get the following three simple image compression schemes.
Scheme one: The high frequency, take the low frequencyThe most important part of an image is the low frequency part, so we can only keep the low frequency part of wavelet decomposition in wavelet reconstruction, and the high frequency part coefficient is set 0 processing. This method obtains the image energy loss is big, the image is blurred, seldom uses. In addition, the local area coefficients of the high-frequency part can be set 0, so that the reconstructed image will have local blur, the remaining clear effect. Scenario Two: Threshold Methodafter the multi-level wavelet decomposition of the image, the low frequency coefficient is retained, and a global threshold is chosen to deal with the high frequency coefficients, or the high frequency coefficients of different levels are treated with different thresholds. The high-frequency coefficient of absolute values below the threshold is set to 0, otherwise reserved. The reconstructed non-zero wavelet coefficients are retained. MATLAB uses function ddencmp () to obtain the default threshold value during compression, and the function wdencmp () can be used to compress one-dimensional and two-dimensional signals. Scenario Three: Interception methodall coefficients of wavelet decomposition are sorted by absolute size, and only the maximum factor of x is retained, and the remaining coefficients are 0. However, the compression ratio of this method is not necessarily high. Because of the retention coefficients, the position information is also saved with the coefficient values to reconstruct the image. And, compared with the pixel value of the original image, the variation range of the wavelet coefficients is larger, so it also needs more space to save.

The application of        wavelet analysis in image field should be attributed to Mallat. In the 1987, Mallat skillfully introduced the multi-scale analysis in the field of computer vision to the construction of wavelet function, thus unifying the various methods of wavelet construction. Mallat studies the discrete form of wavelet transform, and applies the corresponding algorithm to the decomposition and reconstruction of images, which lays a foundation for the subsequent wavelets image compression. In the 90 's, the research of image compression using wavelet has received unprecedented attention. This period is the time when the internet is booming, so how to adapt to the characteristics of the network image coding has been paid attention to. In 1993, Shapiro first introduced the concept of 0 trees into wavelet image compression, the method called EZW can encode the image progressively, has high compression performance, and is very suitable for network image transmission and browsing. For images, the image data needs to be compressed if fast or real-time transmission is required and large amounts of storage are needed. Under the same communication capacity, if the image data is compressed and then transmitted, more image information can be transmitted. For example, use a normal telephone line to transmit image information. The research of image compression is to find a method of high compression ratio and compress the image to have the appropriate signal-to-noise ratio, in the compression and transmission to restore the original signals, and in the process of compression, transmission, recovery, but also requires a small image distortion, which is the problem of image compression. The image data often exists redundancy of various information, such as space redundancy, information entropy redundancy, visual redundancy and structure redundancy, etc. The so-called compression is to remove all kinds of redundancy, keep the information useful to us. The process of image compression is often called coding. In contrast, the restoration of images is decoding. The method of image compression can be divided into two kinds: distortion-free coding and distortion-free coding, such as the improved Huffman coding method. There are some errors in the reduction image with the distortion coding method than the original image, but the visual effect is acceptable. The common methods include predictive coding, transform coding, quantization coding, information entropy coding, frequency-band coding and structure coding. There are two important mathematical entities in wavelet Analysis: "Integral wavelet Transform" and "Wavelets series". The integral wavelet transform is the reflection expansion convolution of a function of wavelet, and the Wavelets series is a function known as a small wavelet, which is represented by two simple operations "binary expansion" and "Integer translation". Through this expansion and translation operation, the signal can be expressed in a multi-scale detail. Through this expansion and translation operation, the signal can be analyzed in detail in many scales, which can solve many difficult problems that can not be solved by the Fourier transform. The wavelet transform can transform the whole image at once, not only can achieve high compression ratio, but also the "block" effect in JPEG reconstructed image, but the encoder is complex and has latent image problem.

       the wavelet packet technology can be used to expand the signal or image in a hierarchical basis, Therefore, according to the nature of the image signal and the pre-given image processing requirements to determine exactly which level to expand, thus not only can effectively control the computational capacity, to meet the needs of real-time processing, but also can easily achieve the usual sub-band, Hierarchical coding technology to achieve progressive transmission coding (that is, the gradual emergence of the way to transmit multimedia images). Such a way of working in multimedia data browsing, medical image remote diagnosis is very necessary. In addition, the wavelet transform has the function of magnifying, narrowing and moving the mathematical microscope, can easily produce various resolutions of the image, so as to adapt to different resolutions of the image I/O devices and different transmission rate of the communication system. In contrast, the use of KL transform compression coding, only the entire image, and the use of wavelet transform can be more accurate image stitching, so the larger image can be divided into block processing, and then splicing. Obviously, this approach provides a theoretical basis for parallel processing of images.
 

Wavelet transform, as the base of function expansion, has good local characteristics in time and frequency domain, and can analyze the signal in multi-scale. In the past many years, wavelet transform has been widely accepted in the research of signal processing and image compression. In many applications, wavelet-based methods (also called sub-band coding) outperform other coding methods (such as DCT-based). Because there is no need to block the image and the variable length of the base function, the wavelet coding method has no block effect at high compression rate. Wavelet-based coding is more robust to transmission and decoding errors, and is advantageous for gradual transmission of images (prograssivetransmission). In addition, they are more consistent with the HVS feature. Because of their intrinsic multiscale nature, the wavelet coding approach is well suited for applications that value scalability (scalability) and tolerant degradation (tolerabledegradation). The image compression based on wavelet transform has excellent characteristics. That is, compression ratio, compression speed, compression can maintain the characteristics of the signal and image is basically unchanged, and in the transmission process can be anti-interference and so on. Image compression based on wavelet transform is a fast tower algorithm based on two-dimensional discrete wavelet transform. His decomposition and synthesis process are iterative operations, the basic principle is as follows: The original image in the horizontal and vertical direction with 2 filters (low-pass, high-pass) phase convolution, you can get 4 blocks of the original image 1/4 of the sub-graph, respectively, horizontal low and vertical low frequency (HH), horizontal direction of low frequency and vertical direction ( HG), horizontal high frequency and vertical direction low frequency (GH), horizontal high frequency and vertical direction high frequency (GG). Hg,gh,gg called detail sub-graph, HH is called the original image of the low-resolution sub-image, the above is just the first stage of the image of the wavelet decomposition, the same operation for HH can get the image of the two-level wavelet decomposition, and so on, you can also get three-stage wavelet decomposition, four-stage wavelet decomposition ... Taking the woman image as an example, the wavelet decomposition is performed, and the process is shown in 1. The process of synthesis is in contrast to the decomposition process described above. Let's take an example to get an insight into this superior compression algorithm.


function wt () a=imread (' C:\MATLAB7\work\2.jpg '); A=rgb2gray (a);% display image subplot (2,4,1); Imshow (Uint8 (a)); title (' Original image '); axis squaredisp (' size of image x before compression '); whos (' a ')% Wavelet decomposition of the image is carried out [C,S]=WAVEDEC2 (a,2, ' bior3.7 '); the low frequency coefficient and the high frequency coefficient cal=appcoef2 (c,s, ' bior3.7 ', 1) of the first layer in the wavelet decomposition structure are extracted;% horizontal direction ch1= Detcoef2 (' h ', c,s,1),% vertical Direction cv1=detcoef2 (' V ', c,s,1),% slash direction cd1=detcoef2 (' d ', c,s,1),% of each frequency component reconstructed A1=wrcoef2 (' A ', c,s, ' bior1.3 ', 1); H1=wrcoef2 (' H ', c,s, ' bior1.3 ', 1); V1=wrcoef2 (' V ', c,s, ' bior1.3 ', 1);d 1=wrcoef2 (' d ', c,s, ' bior1.3 ', 1); C1 =[a1,h1;v1,d1];% Display crossover information subplot (2,4,2); Imshow (Uint8 (c1)); Axis Square;title (' Post decomposition low frequency and high frequency information '),% image compression% reserved wavelet decomposition first layer low frequency information% First, the first layer of information is quantified encoded CA1=APPCOEF2 (c,s, ' bior3.7 ', 1); Ca1=wcodemat (ca1,460, ' mat ', 1);% change image height and show Ca1=0.5*ca1;subplot (2,4,3) ; Imshow (Uint8 (CA1)); Axis Square;title (' first compressed image ');d ISP (' First compressed image size: '); whos (' CA1 ')% reserved wavelet decomposition second layer low frequency information to compress Ca2=appcoef2 (C,s, ' bior3.7 ', 2); The second layer of information is first quantified encoded Ca2=wcodemat (ca2,440, ' mat ', 2);% changes the image height and displays ca2=0.25*ca2;subplot (2,4,4); Imshow ( Uint8 (Ca2)); Axis Square;itle (' second compressed image ');d ISP (' The size of the second compressed image is: '); whos (' Ca2 ')

Size of image x before compression

 Name    Size                  BytesClass

 A    +x512             3145728uint8 Array

The size of the first compressed image is:

 Name    Size                  BytesClass

    263 x263   &NBSP,   Span style= "font-size:medium;" >&NBSP,   Span style= "font-size:medium;" >&NBSP,   Span style= "font-size:medium;" >  6392200 

The size of the second compressed image is:

 Name    Size                  BytesClass

    139 x139      &NBSP,   Span style= "font-size:medium;" >&NBSP,   Span style= "font-size:medium;" >  1652680  double array

The application of wavelet transform in the field of image compression can be found to be advantageous by the operation result of the above program. Moreover, the image compression algorithm based on wavelet transform is still needed to be optimized in today's complex image compression algorithm. The ability to debug a more optimized image compression algorithm is very valuable for image transmission and image optimization.

Because the wavelet transform inherits the advantages of Fourier (cosine transform and sine transform can be regarded as the special case of Fourier transform) and overcomes many shortcomings of it, it is widely used in the field of static and dynamic image compression. and has become an important part of some image compression international standards (such as MPEG-4). Of course, like other transformation codes, when the compression ratio is particularly high, the reconstructed image after the wavelet transform compression quantization will also produce geometric distortion. However, with the increasing recognition of wavelet base and wavelet analysis, it is believed that it will be more widely used in image compression.





Wavelet Transform & Image Compression

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.