prob9_12.m

来自「these m files contain the solution of so」· M 代码 · 共 35 行

M
35
字号
%	Author: Xiaofeng Xu, Polytechnic University  4/21/2002


%Predict Motion Vectors 
[Target_Img,Anchor_Img,Predict_Img,ox,oy,px,py,PSNR]=Motion_Estimation_2D('foreman66.Y','foreman69.Y',352,288,[16,16],[-32,-32],[32,32],1);

%(a) a frame directly
%DCT
EImg_dct=blkproc(Anchor_Img,[8 8],'dct2');
%Quantization
QImg_dct0=blkproc(EImg_dct,[8 8],'quan_dct',1);
%caculate the number of DCT nonzero coefficients
I0=find(QImg_dct0);
size(I0)

%(b) the direct difference
Error_Img1=Anchor_Img-Target_Img;
%DCT
EImg_dct=blkproc(Error_Img1,[8 8],'dct2');
%Quantization
QImg_dct1=blkproc(EImg_dct,[8 8],'quan_dct',1);
%caculate the number of DCT nonzero coefficients
I2=find(QImg_dct1);
size(I2)

%(c) the MC error image
Error_Img=Anchor_Img-Predict_Img;
%DCT
EImg_dct=blkproc(Error_Img,[8 8],'dct2');
%Quantization
QImg_dct=blkproc(EImg_dct,[8 8],'quan_dct',1);
%caculate the number of DCT nonzero coefficients
I1=find(QImg_dct);
size(I1)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?