资源简介
用MATLAB实现JPEG图像压缩算法,包括DCT变换,霍夫曼变换
代码片段和文件信息
function jpeg
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% THIS WORK IS SUBMITTED BY:
%%
%% OHAD GAL
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
close all;
% ==================
% section 1.2 + 1.3
% ==================
% the following use of the function:
%
% plot_bases( base_sizeresolutionplot_type )
%
% will plot the 64 wanted bases. I will use “zero-padding“ for increased resolution
% NOTE THAT THESE ARE THE SAME baseS !
% for reference I plot the following 3 graphs:
% a) 3D plot with basic resolution (64 plots of 8x8 pixels) using “surf“ function
% b) 3D plot with x20 resolution (64 plots of 160x160 pixels) using “mesh“ function
% c) 2D plot with x10 resolution (64 plots of 80x80 pixels) using “mesh“ function
% d) 2D plot with x10 resolution (64 plots of 80x80 pixels) using “imshow“ function
%
% NOTE: matrix size of pictures (b)(c) and (d) can support higher frequency = higher bases
% but I am not asked to draw these (higher bases) in this section !
% the zero padding is used ONLY for resolution increase !
%
% get all base pictures (3D surface figure)
plot_bases( 81‘surf3d‘ );
% get all base pictures (3D surface figure) x20 resolution
plot_bases( 820‘mesh3d‘ );
% get all base pictures (2D mesh figure) x10 resolution
plot_bases( 810‘mesh2d‘ );
% get all base pictures (2D mesh figure) x10 resolution
plot_bases( 810‘gray2d‘ );
% ==================
% section 1.4 + 1.5
% ==================
% for each picture {‘0‘..‘9‘} perform a 2 dimensional dct on 8x8 blocks.
% save the dct inside a cell of the size: 10 cells of 128x128 matrix
% show for each picture it‘s dct 8x8 block transform.
for idx = 0:9
% load a picture
switch idx
case {01} input_image_128x128 = im2double( imread( sprintf( ‘%d.tif‘idx )‘tiff‘ ) );
otherwise input_image_128x128 = im2double( imread( sprintf( ‘%d.tif‘idx)‘jpeg‘ ) );
end
% perform DCT in 2 dimension over blocks of 8x8 in the given picture
dct_8x8_image_of_128x128{idx+1} = image_8x8_block_dct( input_image_128x128 );
if (mod(idx2)==0)
figure;
end
subplot(22mod(idx2)*2+1);
imshow(input_image_128x128);
title( sprintf(‘image #%d‘idx) );
subplot(22mod(idx2)*2+2);
imshow(dct_8x8_image_of_128x128{idx+1});
title( sprintf(‘8x8 DCT of image #%d‘idx) );
end
% ==================
% section 1.6
% ==================
% do statistics on the cell array of the dct transforms
% create a matrix of 8x8 that will describe the value of each “dct-base“
% over the transform of
相关资源
- matlab_OFDM调制解调(来自剑桥大学)
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
评论
共有 条评论