基于matlab下DCT编解码程序

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

±àÂëѹËõ²¿·ÖI=imread('cameraman.tif');%´ò¿ªÍ¼ÏñÎļþI=im2double(I);%ת»»³ÉË«¾«¶ÈT=dctmtx(8);%¹¹ÔìÀëÉ¢ÓàÏұ任¾ØÕóB=blkproc(I,[88],'P1*x*P2',T,T');%¶ÔͼÏñ½øÐÐDCT±ä»»mask=[1111000011100000110000001000000000000000000000000000000000000000];B2=blkproc(B,[88],'P1.*x',mask);%±£Áô¹Ø¼üϵÊýI2=blkproc(B2,[88],'P1*x*P2',T',T);%×öDCTÄæ±ä»»subplot(121);imshow(I);title(¡®Ô­Ê¼Í¼Ïñ¡¯);subplot(122);imshow(I2);title(¡®DCT±ä»»ºóͼÏñ)£»/*½«Í¼Ïñ±£´æÔÚCC2Êý×éÖУ¬ÎļþÃûΪcameraman.mat*/CC2=0;%CC2=double(CC2);[row,col]=size(B2);row_count=row/8;col_count=col/8;po=1;forr=0;row_count-1forc=0;col_count-1CC2(po)=B2(r*8+1,c*8+1);CC2(po+1)=B2(r*8+1,c*8+2);CC2(po+2)=B2(r*8+1,c*8+3);CC2(po+3)=B2(r*8+1,c*8+4);CC2(po+4)=B2(r*8+2,c*8+1);CC2(po+5)=B2(r*8+2,c*8+2);CC2(po+6)=B2(r*8+2,c*8+3);CC2(po+7)=B2(r*8+3,c*8+1);CC2(po+8)=B2(r*8+3,c*8+2);CC2(po+9)=B2(r*8+4,c*8+1);po=po+10;end;end;CC2=CC2*10;CC2=int8(CC2);savecameraman.matCC2;½âÂ벿·ÖI=imread('cameraman.tif');B2=double(zeros(256,256));loadcameraman.mat;T=dctmtx(8);[row,col]=size(B2);row_count=row/8;col_count=col/8;po=1;CC2=double(CC2);CC2=CC2/10;forr=0:row_count-1forc=0:col_count-1B2(r*8+1,c*8+1)=CC2(po);B2(r*8+1,c*8+2)=CC2(po+1);B2(r*8+1,c*8+3)=CC2(po+2);B2(r*8+1,c*8+4)=CC2(po+3);B2(r*8+2,c*8+1)=CC2(po+4);B2(r*8+2,c*8+2)=CC2(po+5);B2(r*8+2,c*8+3)=CC2(po+6);B2(r*8+3,c*8+1)=CC2(po+7);B2(r*8+3,c*8+2)=CC2(po+8);B2(r*8+4,c*8+1)=CC2(po+9);po=po+10;end;end;I2=blkproc(B2,[88],'P1*x*P2',T',T);subplot(121);imshow(I);title('ԭͼÏñ');subplot(122);imshow(I2);title('½âÂëºóµÄͼÏñ');

1 / 2
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功