《基于MATLAB的图像压缩编码技术23960.pdf》由会员分享,可在线阅读,更多相关《基于MATLAB的图像压缩编码技术23960.pdf(3页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、-.z.图像的压缩比计算:f=imread(peppers.png);imwrite(f,peppers.png);k=imfinfo(peppers.png);ib=k.Width*k.Height*k.BitDepth/8;cb=k.FileSize;cr=ib/cb cr=2.0509 变换编码:计算 DCT 变换的基函数:n=4;c=zeros(n,n);for m=0:1:n-1 for k=0:1:n-1 if k=0 l=sqrt(1/n);else l=sqrt(2/n);end;c(m+1,k+1)=l*cos(2*m+1)*k*pi)/(2*n);end;end;color
2、map(gray);for m=0:1:n-1 for k=0:1:n-1 subplot(n,n,m*n+k+1);y=zeros(m,n);zeros(1,k)1 zeros(1,n-k-1);zeros(n-m-1,n);*=c*y*c;imagesc(*);a*is square;a*is off;end;end;对图像进展 DCT 和 IDCT 变换:rgb=imread(autumn.tif);i=rgb2gray(rgb);i=im2double(i);i1=dct2(i);i2=idct2(i1);subplot(2,2,1);imshow(i);subplot(2,2,2);
3、imshow(i2);subplot(2,2,3);imshow(i1);subplot(2,2,4);imshow(abs(i-i2);-.z.figure;mesh(i1);colorbar(vert);set(gcf,color,w);小波分析对图像进展增强处理:load wbarb;subplot(1,2,1);image(*);colormap(map);a*is square;c,s=wavedec2(*,2,sym4);sizec=size(c);for i=1:sizec(2)if(c(i)350)c(i)=2*c(i);else c(i)=0.5*c(i);end;end;*
4、w=waverec2(c,s,sym4);subplot(1,2,2);image(*w);colormap(map);a*is square;用二维小波分析融合图像:load woman;*1=*;map1=map;subplot(1,3,1);image(*1);colormap(map1);a*is square;load wbarb;*2=*;map2=map;subplot(1,3,2);image(*2);colormap(map2);a*is square;for i=1:256 for j=1:256 if(*2(i,j)100)*2(i,j)=1.25*2(i,j);else
5、 *2(i,j)=0.6*2(i,j);end;end;end;c1,s1=wavedec2(*1,2,sym4);sizec1=size(c1);for i=1:sizec1(2)-.z.c1(i)=1.25*c1(i);end;c2,s2=wavedec2(*2,2,sym4);c=c1+c2;c=0.5*c;*w=waverec2(c,s1,sym4);subplot(1,3,3);image(*w);a*is square;利用图像融合法从模糊图像中恢复图像:load cathe_1;*1=*;load cathe_2;*2=*;*FUS=wfusimg(*1,*2,sym4,5,ma*,ma*);colormap(map);subplot(1,3,1);image(*1);a*is square;subplot(1,3,2);image(*2);a*is square;subplot(1,3,3);image(*FUS);