±àÂëѹËõ²¿·Ö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('½âÂëºóµÄͼÏñ');