您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 造纸印刷 > 数字图像处理实验六--小波变换
实验报告课程名称信息隐藏技术实验名称小波变换姓名__学号专业班级__)___实验日期成绩_______指导教师____一、实验目的了解小波变换及其变换系数的分布。二、实验环境(1)PC计算机(2)MatLab软件/语言包括图像处理工具箱(ImageProcessingToolbox)(3)实验所需要的图片三、实验内容与步骤利用Matlab提供的函数对图像进行小波分解与重构。以下程序是对图像进行一级小波变换及重构:closeall;clear;I=imread('图像.bmp);[M,N]=size(I);[A,H,V,D]=dwt2(I,'haar');%使用haar小波对二维图像进行一级小波分解%A近似子带;H水平细节子带;V垂直细节子带;D对角细节子带J=I;%---------小波分解图像-----J(1:M/2,1:N/2)=A;J(1:M/2,N/2+1:N)=H;J(M/2+1:M,1:N/2)=V;J(M/2+1:M,N/2+1:N)=D;%-----------重构图像----II=idwt2(A,H,V,D,'haar');figureimshow(uint8(J)),title('haar小波一级分解')figureimshow(uint8(II)),title('haar小波重构')六、实验心得与体会思考:1、使用haar小波对图像进行二级小波分解,并将其重构回原图。closeallclearI=imread('Fig4.11(a).jpg');[M.N]=size(I);[A,H,V,D]=dwt2(I,'haar');J(1:M/2,1:N/2)=A;J(1:M/2,N/2+1:N)=H;J(M/2+1:M,1:N/2)=V;J(M/2+1:M.N/2+1:N)=D;[X,Y]=size(A);[cA,cH,cV,cD]=dwt2(A,'haar');Z=J;Z(1:X/2,1:Y/2)=cA;Z(1:X/2,Y/2+1:Y)=cH;Z(X/2+1:X,1:Y/2)=cV;Z(X/2+1:X,Y/2+1:Y)=cD;II=idwt2(cA,cH,cV,cD,'haar');III=idwt2(II,H,V,D,'haar');figureimshow(uint8(Z)),title('haarС²¨¶þ¼¶·Ö½â')figureimshow(uint8(III)),title('haarС²¨Öع¹')2、利用WAVEDEC2函数对图像进行多尺度分解并重构回原图。s=imread('cameraman.jpg');[C,S]=wavedec2(s,3,'db1');x=waverec2(C,S,'db1');c3=appcoef2(C,S,'db1',3);v3=detcoef2('v',C,S,3);h3=detcoef2('h',C,S,3);d3=detcoef2('D',C,S,3);[C1,S1]=wavedec2(s,1,'db1');c1=appcoef2(C1,S1,'db1',1);v1=detcoef2('v',C1,S1,1);h1=detcoef2('h',C1,S1,1);d1=detcoef2('D',C1,S1,1);subplot(3,3,1);imshow(s);title('ÔʼͼÏñ');subplot(3,3,2);imshow(uint8(c3));title('Èý´Î·Ö½âºóµÄµÍƵ·ÖÁ¿');subplot(3,3,3);imshow(uint8(x));title('Öع¹Í¼Ïñ');subplot(3,3,4);imshow(uint8(h1));title('h1');subplot(3,3,5);imshow(uint8(h3));title('h3');subplot(3,3,6);imshow(uint8(d1));title('d1');subplot(3,3,7);imshow(uint8(v1));title('v1');subplot(3,3,8);imshow(uint8(v3));title('v3');subplot(3,3,9);imshow(uint8(d3));title('d3');
本文标题:数字图像处理实验六--小波变换
链接地址:https://www.777doc.com/doc-7364177 .html