已阅读5页,还剩25页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
基于 dct的图像压缩技术研究与仿真实现 abstract discrete 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 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 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-friendly 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 language 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; catalog abstractv 1 inroduction7 2 basic principles and model of image compression 9 2.1 basic principles of image compression9 2.1.1 the basic idea of image compression 9 2.1.2 image compression method 9 2.1.3 image compression standard 10 2.2 image compression system flow chart.10 2.3 analysis of the main module of image compression.11 2.3.1 color space conversion11 2.3.2 discrete cosine transform 12 2.3.3 quantization .13 2.3.4 “z“ shaped scan.13 2.3.5 encoding and decoding14 2.4 the purpose of image data compression .15 2.5 basic model of image compression 16 3 discrete cosine transform in c language and matlab simulation .18 3.1 discrete cosine transform 18 3.2 the function of matlab .18 3.3 discrete cosine transform in c language and matlab simulation 19 conclusion .24 appendix26 1 inroduction in 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. 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 , 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 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 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 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. 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 compression discrete cosine transform (dct) is the orthogonal transformation method proposed by n. ahmed in 1974 . 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 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 domain 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 of 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 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-friendly environment. the image processing toolboxs in matlab, is the set of packages of many matlab technical 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 principles and model of image compression 2.1 basic principles of image compression 2.1.1 the basic idea of image compression the 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 datas . 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 method at present, many methods of image compression, the method of its classification was also different as a different starting 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 probability 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 appropriate 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 compression. 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 allowed 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 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 standard uniform international standards is the basis of coordinating products of 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 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 chart dct-based image compression algorithm is lossy. saying simply, it inverts a large amount 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 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 half 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. figure 2.1 dct-based encoder system flow chart steps 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 then 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 compression 2.3.1 color space conversion at 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), achevied as the rgb three primary colors by the following relations: color space tranxfomation sampling block processing forward dct quantanitilize scan decode quantization table compressed data stream decoder pre-processing y=0.299r+0.587g+0.114b cb =-0.168 7r-0.331 3g+0.5b+128 cr =0.5r-0.418 7g-0.081 3b+128 similarly, 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-128) 2.3.2 discrete cosine transform discrete 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 data 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 following: (2.2) among them, (2.3) 70 162cos162cos,41,xyvu vyuxfcvuf 70 162cos162cos,41,xyvuvu vyuxyxfccyxf 其 他 情 况当10u2vcvu 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 can 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 quantization quantification of data compression, instead of the 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 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 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 element values greater than, of course, the greater the degree of image distortion. 70 162cos,21,xu uxvgcvuf70162cos,21,yu uxvxgcvug 2.3.4 “z“ shaped scan quantized 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 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 path 2.3.5 encoding and decoding run length encoding, variable length coding and huffman coding is used as the simulation 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 alternating 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 white travel itinerary together unification code, you can separate them, separately encoded. (2) variable-length coding, for each symbol, for example through the quantized image data, each value if they are the same length of binary code that is called a long code or uniform code, etc advantage of using equal length encoding and decoding process is simple encoding process, but this encoding method does not take into account the probability of each symbol is actually the probability of them such as event handling, and therefore its coding efficiency is relatively low. and equal length encoding method is different variable length coding. in this coding method, said the length of the codeword symbols are not fixed, but with the sign change probability, a large probability for those who compiled the information symbols of a shorter code word length, and small probability for those who compiled the information symbols of a longer word length code. huffman coding is proposed in 1952 by the huffman coding method, the basic idea is based on the probability of the source data are consistent with the size of the encoded probability distribution of large symbols shorter code word, the smaller the probability distribution of the longer symbol code word, so as to achieve less exhausted the number of bits to represent data sources, standard huffman coding is as follows: (1) statistical data source symbol probability, the probability to get different information symbols; (2) the probability of the data source symbols by decreasing order; (3) the probability of the two smallest sum probability as a new symbol, and press (2) rearrangement; (4) repeat (1), (2), until the probability is 1; (5) in each source, when combined, will be merged sources were assigned “0“ and “1“; (6) from each source to find the probability of a symbol to the path, the path on the record “0“ and “1“; (7) starting from the root to write each symbol “0“, “1.“ standard huffman coding to encode the image at high efficiency, but need to scan the original image twice, the first pass to precise statistics of the probability of each pixel value, the second time is to build the huffman tree and code, data compression and decompression speed is slow, so there is a modified huffman code, its variable-length code word generated in real time rather than a fixed table, in the process of encoding and decoding symbols do not calculate the probability and sorting, direct look-up table to get, but the list must be a lot of statistical work and carefully designed to achieve higher coding efficiency. international standards in a static image compression (jpeg standard), the group has carried out a large number of natural image statistics, obtained for static huffman coding of natural images table, in the actual coding process, we can directly apply this table encoding and decoding 。 2.4 the purpose of image data compression the purpose of image data compression in image quality is to meet certain conditions, with as little as possible the number of bits to represent th
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024年公司裁员合同模板3篇
- 铁塔公司用电合同范例
- 工矿产品采购合同(金属交易所用)
- 酒店全息投影转让合同
- 2024年度地下车库车位产权置换合同3篇
- 2024年度三子女债务处理离婚协议书参考范本2篇
- 2024年度石场原材料采购合同2篇
- 2024年度供应链管理合同:关于供应商为某企业提供原材料及配件的协议3篇
- 2024年奶牛场施工合同8篇
- 销售合同模板版
- 学校工程验收报告单
- 线路工程灌注桩施工作业指导书施工方案
- 重力坝的分缝与止水
- 三重管高压旋喷桩施工工艺规程与施工方案
- 云南白药公司近三年财报分析
- 卫浴产品世界各国认证介绍
- 个体诊所药品清单
- 深度学习数学案例(课堂PPT)
- 中国地图含省份信息可编辑矢量图
- 卧式钻床液压系统设计课件
- 水库维修养护工程施工合同协议书范本
评论
0/150
提交评论