logo资料库

利用DCT和DWT对图像进行压缩的MATLAB实现方法.doc

第1页 / 共17页
第2页 / 共17页
第3页 / 共17页
第4页 / 共17页
第5页 / 共17页
第6页 / 共17页
第7页 / 共17页
第8页 / 共17页
资料共17页,剩余部分请下载后查看
数字视频图像处理 实验报告 专业:通信与信息系统 学号: 1101210052 姓名: 于 燕 飞 2012-4-24
一、实验内容:(用 Lena,Cameraman 等 3-5 幅图像做测试。) (一) 实现图像的 DCT 和 DWT 变换,并输出‘系数图’; 1.DCT 变换 程序如下: x=imread('F:\于燕飞\图片收藏\图像名称.jpg'); y=rgb2gray(x); z=dct2(y); subplot(2,2,1);imshow(x);title('原始图像'); subplot(2,2,2);imshow(y);title('灰度图像'); subplot(2,2,3);imshow(log(abs(z)));colorbar s=idct2(z); subplot(2,2,4);imshow(s,[]);title('重构图像'); 运行结果如下: (1)lena
(2) cameraman (3)pencil
(4)奥黛丽赫本 (5)风景 2.DWT 变换 程序如下: clear all clc i = imread('F:\于燕飞\图片收藏\图像名称.jpg');
X=rgb2gray(i); [C,S] = wavedec2(X,2,'db2'); ca2 = appcoef2(C, S, 'db2', 2); ca1 = appcoef2(C, S, 'db2', 1); %h1 尺度 1 上的水平高频系数 %v1 尺度 1 上的垂直高频系数 %d1 尺度 1 上的对角线高频系数 [h2, v2, d2] = detcoef2('all', C, S, 2); [h1, v1, d1] = detcoef2('all', C, S, 1); cah1=[ca1,v1;h1,d1]; cah2 = [ca2, h2; v2, d2]; %显示原图像 figure; imshow(X); title('原图像') %显示一级小波分解图 figure; subplot(1,2,1) imshow(cah1,[]); title('一级小波分解图') %显示二级小波分解图 subplot(1,2,2) imshow(cah2,[]); title('二级小波分解图') 运行结果如下:
(1)lena
(2)cameraman
(3)pencil
分享到:
收藏