jpeg in matlab

所属分类:图形图像处理
开发工具:matlab
文件大小:56KB
下载次数:3
上传日期:2017-07-28 10:10:32
上 传 者liunianji
说明:  JPEG 是Joint Photographic Experts Group(联合图像专家小组)的缩写,是第一个国际图像压缩标准。JPEG图像压缩算法能够在提供良好的压缩性能的同时,具有比较好的重建质量,被广泛应用于图像、视频处理领域。本代码是JPEG图像压缩算法在MATLAB上实现
(the method of image compression with JPEG implemented on MATLAB)

文件列表:
TEMP\DownLoad\University\Image Processing\0.tif (16720, 2003-01-14)
TEMP\DownLoad\University\Image Processing\1.tif (16570, 2003-01-09)
TEMP\DownLoad\University\Image Processing\2.tif (3878, 2003-01-09)
TEMP\DownLoad\University\Image Processing\3.tif (2863, 2003-01-09)
TEMP\DownLoad\University\Image Processing\4.tif (3547, 2003-01-09)
TEMP\DownLoad\University\Image Processing\5.tif (1996, 2003-01-09)
TEMP\DownLoad\University\Image Processing\6.tif (1974, 2003-01-09)
TEMP\DownLoad\University\Image Processing\7.tif (3863, 2003-01-09)
TEMP\DownLoad\University\Image Processing\8.tif (4200, 2003-01-09)
TEMP\DownLoad\University\Image Processing\9.TIF (3936, 2003-01-09)
TEMP\DownLoad\University\Image Processing\jpeg.m (12450, 2004-01-05)
license.txt (1308, 2014-02-12)

the attached utility is a work I've submitted to the university It shows what a jpeg compression is all about. the function implements the DCT transform, using a matrix operator. note that matlab has a function for the DCT and iDCT transforms that might be more efficient. some details of the algorithm: a basic jpeg compression (graylevel image): 1) take an image (2D matrix) and devide it to 8x8 matrices 2) for each matrix (8x8) use the DCT conversion (from the signal processing toolbox). you will get an (8x8) matrix as an answer 3) build an 8x8 matrix, which is the sum off all the matrices, such that sum_matrix = A + B + C + ... 4) sort elements of the 8x8 matrix from the highest to the smallest and get the indices list. 5) sum the last matrix with part of the elements which have the higher coefficients, until you have a sufficient ratio (lets say 80%). for example : idx = sort( sum_matrix (:) ); part_of_energy = sum_matrix(idx(1:20)); all_energy = sum_matrix(:); ratio = part_of_energy/all_energy; 6) save the partial list of indices, number of matrices (rows,lines) and from each matrix from step (2) save ONLY these coefficients (remember the order you save them) now this is the compressed data. to reconstract 1) build matrices of step (2) by the zero command: A = zero(8,8); B = zero(8,8); ... (better to use a for loop...) 2) in each matrix, store the coefficients in the right places, such that the new A matrix is equal to the A matrix from step (2) of the encoding, except for the zeros where you don't know the coefficients. 3) for each matrix do the inverse transform (IDCT) 4) compose these inverse-transformed matrices back into a big matrix. this is the reconstracted image usually, you will have most of the energy inside the upper-left coefficient (1,1) which corresponds to the DC (or average value) of the whole picture. enjoy, Ohad Gal.

近期下载者

相关文件


收藏者