《基于DCT的图像压缩技术研究与仿真实现计算机专业英语毕业论文.doc》由会员分享,可在线阅读,更多相关《基于DCT的图像压缩技术研究与仿真实现计算机专业英语毕业论文.doc(30页珍藏版)》请在三一办公上搜索。
1、基于DCT的图像压缩技术研究与仿真实现AbstractDiscrete Cosine Transform (Discrete Cosine Transform, referred to as DCT) is often considered to be the voice and image signals as the best way of transforming. In order to achieve the required engineering, many scholars at home and abroad to spend a lot of energy to find
2、or improve fast DCT algorithms. with the development of DSP in recent years, coupling with the advantages of ASIC design, DCT firmly established an important position in the current image coding algorithm,as to be an important part of the coding of H.261, JPEG, MPEG and other international standards
3、 on the public . MATLAB is by the American Math-Works introduced for the numerical computation and graphics processing for scientific computing software, which combines numerical analysis, matrix computation, signal processing and graphics display functions in one and constitutes a convenient user-f
4、riendly environment. The Image Processing Toolboxs in MATLAB, is the set of packages of many MATLAB technical computing environment . This paper discusses the DCT transform methods, and discusses applied functions of the image processing toolbox in MATLAB and implement related to the use of C langua
5、ge to implement the discrete cosine transform image compression algorithm simulation.KEYWORD:Discrete Cosine Transform(DCT);MATLAB;VC6.0,DCT Transformation method;Image Processing;Image Compression;CATALOGABSTRACTV1 INRODUCTION72 BASIC PRINCIPLES AND MODELOF IMAGE COMPRESSION92.1 Basic principles of
6、 image compression92.1.1 The basic idea of image compression92.1.2 Image compression method92.1.3 Image compression standard102.2 Image compression system flow chart102.3 Analysis of the main module of image compression112.3.1 Color space conversion112.3.2 Discrete Cosine Transform122.3.3 Quantizati
7、on132.3.4 Z shaped scan132.3.5 Encoding and decoding142.4 The purpose of image data compression152.5 Basic model of image compression163 DISCRETE COSINE TRANSFORM IN C LANGUAGE AND MATLAB SIMULATION183.1 Discrete Cosine Transform183.2 The Function of Matlab183.3 Discrete Cosine Transform in C langua
8、ge and Matlab simulation19CONCLUSION24APPENDIX261 INRODUCTIONIn the 21st century, mankind has entered the information society, and new information technology revolution to the growing human being surrounded by multimedia information, also happens to cater to the humans demand of visual information.
9、There are three main forms of multimedia information: text, sound and images. From the history of the development of information transmission (telegraph, telephone, fax, radio, TV ,network until now) ,we can see, people gradually shift the focus from the sound transmission to the image transmission
10、, however, the image data in the form of three types of information is the largest,which gives the image transmission and storage bring with great difficulties. For example, the datas of a 640 480 resolution 24-bit true color image are about 900kb; a 100Mb hard disk can store only about l00 inactive
11、 pictures. For such a huge amount of digital image data, if not compressed,it is not only beyond the computers memory and processing power, but also in the existing communication channel transmission rate, unable to complete a large number of real-time transmission of multimedia information,thus,the
12、 high-speed digital image transmission and the huge storage capacity has become the biggest obstacle to promote the digital image communication . Therefore, in order to store,process and transmit, these datas must be compressed.Image compression has been able to Compressed because the original image
13、 data is highly relevant,with a big data redundancy. Redundant information contained the digital images generally have the several as the following: spatial redundancy, temporal redundancy, entropy redundancy, statistical redundancy, structural redundancy, visual redundancy and knowledge redundancy.
14、 Image compression algorithm in a premise of guaranting a certain image reconstruction quality, try ones best to remove the redundant information in order to achieve the purpose of image compressionDiscrete cosine transform (DCT) is the orthogonal transformation method proposed by N. Ahmed in 1974 .
15、 It is often considered to be the best way to transform the voice and image signals .In recent years,with the development of DSP in recent years, coupling with the advantages of ASIC design, DCT firmly established an important position in the current image coding algorithm,as to be an important part
16、 of the coding of H.261, JPEG, MPEG and other international standards on the public . In video compression, the most commonly used transform is DCT, DCT is considered to be close to the performance-optimal KL transform , the main features of Transform Coding are as the following:(1)The transform dom
17、ain are simpler than space domain In video images.(2)Video image correlation decreased, the signal energy is concentrated in a few transform coefficients,and use the quantization and entropy coding to compress the data effectively.(3)There is a strong anti-interference ability, during transmission o
18、f the image the influence of the bit error to quality is much smaller than predictive coding. Typically, high-quality images, DMCP required low bit error rate, and transform coding only requires low bit error rate.MATLAB is by the American Math-Works introduced for the numerical computation and grap
19、hics processing for scientific computing software, which combines numerical analysis, matrix computation, signal processing and graphics display functions in one and constitutes a convenient user-friendly environment. The Image Processing Toolboxs in MATLAB, is the set of packages of many MATLAB tec
20、hnical computing environment . This paper discusses the principle of image compression and discusses the applied functions in the Image Processing Toolbox and commands in the relevant to achieve the discrete cosine transform image compression algorithm simulation of MATLAB2007 published.2 Basic prin
21、ciples and modelof image compression 2.1 Basic principles of image compression2.1.1 The basic idea of image compressionThe basic idea of any compression mechanism is to remove existing correlation of data. The so-called correlation, is to get the adjacent parts of the datas according to the given da
22、tas . The fundamental idea is to remove the correlation exists, which is also to remove the image datas that be deduced from according to the other datas .2.1.2 Image compression methodAt present, many methods of image compression, the method of its classification was also different as a different s
23、tarting point. Common classifications are:(1)Redundancy compression.The core of the method is to reduce or completely remove the redundancy of the source of data , while maintaining the same information,which is based on statistical models. For example, in the image data, the gray-scale of large pro
24、bability is expressed with relatively short codes and the gray-scale of small probability is expressed with relatively long codes ,therefore,the average length of codes with encoding compression is shorter than the average length of codes with unencoding . In the decoding process, according to the a
25、ppropriate rules or algorithms, we insert the amount of redundancy into the image data, to restore strictly the original image, achieving the reciprocal of encoding and decoding. Therefore, the redundant encoding is also known as lossless compression , which is typically used for text file compressi
26、on. Well-known Huffman (Huffman) coding and Shannon (Shannon) coding fall into this category.(2)Entropy compression.This is an encoding compression method as the cost of sacrificing some of the information to reduce the average code length . Because its loss of the part of the informations are allow
27、ed in the compression process. so the image uncompressed and the image restored will be not completely the same, so people will called the compression as lossy compression.The advantage of the compression mechanism is that have much higher the compression ratio than the lossless compression, but it
28、can only be used to be the approximate data instead of the original data. In practice, lossy compression is more popular, mainly duing to its is relatively large compression ratios, and works well.2.1.3 Image compression standardUniform international standards is the basis of coordinating products o
29、f different countries and manufacturers . The existing international image codi ng standard (or recommended), such as Recommendation of H.261, JPEG standard, MPEG-1, MPEG-2 standard and H.263 standards, relating to binary image compression facsimile, still image transmission, video telephony, video
30、conferencing, VCD, DVD, regular digital television, high definition television, multimedia, visual communications, multimedia, video on demand and transmission applications.2.2 Image compression system flow chartDCT-based image compression algorithm is lossy. Saying simply, it inverts a large amount
31、 into small datas and the real meaningful datas, deletes the datas with only minimal visual information, and express the datas as different codes according to the probability of datas . Because the human eyes are more sensitive to luminance information, while the color of the reaction is relatively
32、weak, so you can convert the image of the three primary colors (RGB) color representation to the image of a luminance (YCbCr) representation according to color space conversion, then sample secondly color information of little effect on the visual effection, make the input of the encoder reduce a ha
33、lf of the amount of information at first, then each component is divided into 8 8 pixel blocks.These blocks input into the encoder in a specific order, such as the system flow chart shown in Figure 2.1.Block processingSamplingColor Space TranxfomationPre-ProcessingDecode ScanQuantanitilizeForward DC
34、TQuantization tableDecoderCompressed data streamFigure 2.1 DCT-based encoder system flow chartSteps of specific work of Image encoder : firstly,datas are passed by the forward cosine transformer, so that really useful information of each block centrates into the upper left corner of the block, and t
35、hen quantified as the numerical accuracy and to make the smaller value be zero, Z-scan can increase the length of the zero-length, Huffman coding will become to be more effective.And at last ,it be encoded by Huffman coding data stream.2.3 Analysis of the main module of image compression2.3.1 Color
36、space conversionAt present, many of the original image are expressed by RGB three primary colors . Through the color space conversion ,RGB three-color image is converted to CCIR601 recommended color space. This color space consists of three components Y (luminance), Cb (blue degrees), Cr (redness),
37、achevied as the RGB three primary colors by the following relations:Y=0.299R+0.587G+0.114BCb =-0.168 7R-0.331 3G+0.5B+128Cr =0.5R-0.418 7G-0.081 3B+128Similarly, the decoder can recover the RGB values by the following relationship:R=Y+1.402(Cr-128)G=Y-0.344 14(Cb-128)-0.714 14(Cr-128)B=Y+1.772(Cb-12
38、8)2.3.2 Discrete Cosine TransformDiscrete cosine transform (DCT) is closely related with the discrete Fourier transform of the orthogonal transformation, 8 8 discrete cosine transform two-dimensional image space expression can be converted to the frequency domain, only requring a small number of dat
39、a points used to express the image , Using the expression f (x, y) to express the values of the 8 8 pixel image block ,the expression F (u, v) express the values after two-dimensional discrete cosine transforming , the specific expression is as follows:(2.1)The inverse transformation equation as the
40、 following:(2.2)Among them,(2.3)Two-dimensional discrete cosine transform core has a detachable feature ,alse that each line can be one-dimensional discrete cosine transform, and then each column be the one-dimensional discrete cosine transform, therefore, two-dimensional discrete cosine transform c
41、an be expressed as:(2.4)(2.5) according to the Upper function, it computes largely.So the practical application in general is that using fast Fourier transform (FFT) algorithm to achieve fast computation of discrete cosine transform.2.3.3 QuantizationQuantification of data compression, instead of th
42、e A / D converter quantization, is about the orthogonal transformed data quantification, quantifying large dynamic range of input values, and the output datas can only express with a finite number of integer quantized values with fewer bits. Quantification always bring a group of input quantization
43、to an output level, which reducing the value of precision, but reducing the amount of data. The DCT coefficients of Output data in the upper left corner express the low-frequency component, about which the human eye is sensitive, So it should be expressed with high accuracy, and the DCT coefficients
44、 at the lower right corner can be expressed with lower accuracy , so we can define a quantization table on different data using different quantization levels, the quantization table according to the desired compression ratio can be adjusted, in general, the greater the compression quantization table
45、 element values greater than, of course, the greater the degree of image distortion.2.3.4 Z shaped scanQuantized data can already be Encoded with RLE, but in order to improve the efficiency of run-length encoding, we must try to increase the length of the zero-length. Quantized coefficients based on
46、 the arrangement of features, the use of Z shaped scan can effectively increase the length of the zero-length. Z shaped scan trajectory shown in Figure 2.2:Figure 2.2 Z shaped scan path2.3.5 Encoding and decoding Run length encoding, variable length coding and Huffman coding is used as the simulatio
47、n study. 1. run length encoding, also known as run-length coding (RLC), the basic idea is that when the binary image from left to right in accordance with the order to observe each scan line, a certain number of continuous white point and black point of a certain number of consecutive always alterna
48、ting as shown. Usually have the same gray value of neighboring pixels as a sequence-length, run-length in the number of pixels is called run-length, short travel long; to continuous white point and black point numbers are called white stroke and black stroke. If the stroke length for different probability distribution assigned according to their corresponding code word, you can get better compression. Encoding during the trip can be black and whi