基于MATLAB的圖象壓縮程序?qū)崿F(xiàn)
摘要
游程編碼(RLC:Run Length Coding)是圖像壓縮基本算法,它對(duì)于有較多灰度相同的圖像具有較高的壓縮比,RLC的`原理簡(jiǎn)單,計(jì)算效率高。但RLC算法存在的1個(gè)致命弱點(diǎn),即:如果圖像中每?jī)蓚(gè)相鄰點(diǎn)的顏色都不同,用這種算法不但不能壓縮,反而數(shù)據(jù)量會(huì)增加。為了克服游程編碼的這個(gè)弱點(diǎn),本文設(shè)計(jì)了1種算法分塊RLC算法,利用分塊編碼(Block Truncation Coding)的思想對(duì)灰度圖像進(jìn)行處理后,再進(jìn)行游程編碼,實(shí)現(xiàn)了灰度圖像的有損壓縮,圖像分塊越大,所得到的壓縮比越高,但較高的壓縮比是以提高圖像的失真度為代價(jià)的。本文還將分塊RLC算法與DCT(Discrete Cosine Transform)圖像壓縮算法進(jìn)行了比較:分塊RLC算法具有較高的壓縮比,但其保真度卻不如DCT圖像壓縮算法。本文使用MATLAB語(yǔ)言實(shí)現(xiàn)算法,將圖像存儲(chǔ)為矩陣的形式,充分利用了MATLAB語(yǔ)言在矩陣運(yùn)算和圖像處理工具方面的便利性,使得編程簡(jiǎn)單、速度快、誤差小。
關(guān)鍵詞:MATLAB軟件;游程編碼;分塊RLC編碼;DCT變換;圖像壓縮
Abstract
Run length coding (RLC) is a basic algorithm of image compression. When using on the image of many same gray level ,RLC has a higher compression ratio. The principle of RLC is simple and the efficiency of computing is high.But RLC has a fatal disadvantage,it is that the gray level of two pixel together are all different, that will led RLC cannot to compress image and the quantity of the data will increase.In order to overcome this disadvantage ,this paper designed a algorithm ,namely block run length coding,which used the idea of block truncation coding to deal with each block of grayscale image,and then used RLC to each block and realized the damaged compression of grayscale image. The bigger the block is,the higher the compression ratio is,but the higher compression ratio take the increasing of distortion degree as the price.This paper compared algorithm of block run length coding to algorithm of DCT image compression, algorithm of block run length coding has a higher compression ratio,but its lifelike degree is inferior to the algorithm of DCT image compression. In order to fully used the convenience of MATLAB language in the matrix operation and the picture processing tool ,this paper used the MATLAB language to realize this algorithm and saved the picture for the matrix form ,therefore, the programming is easy,the speed is quick and the error is to be little.
Key Words:MATLAB software; Block truncation RLC coding; Run length coding; DCT;Image compression
【基于MATLAB的圖象壓縮程序?qū)崿F(xiàn)】相關(guān)文章:
1.基于ESMTP的電子郵件發(fā)送程序的設(shè)計(jì)與實(shí)現(xiàn)
2.中小型異步電動(dòng)機(jī)計(jì)算程序編程及MATLAB實(shí)現(xiàn)
3.有關(guān)基于Matlab的計(jì)算機(jī)數(shù)據(jù)采集系統(tǒng)
6.基于Vxworks實(shí)時(shí)操作系統(tǒng)的串口通信程序設(shè)計(jì)與實(shí)現(xiàn)
7.實(shí)現(xiàn)鼠標(biāo)畫(huà)圖的Java程序