光照归一化算法——DCT

%  This function does the following processing on each block: DCT, quantize DCT,
% inverse DCT
% This function is called by dct_exp
% Yao Wang 4/10/2003
function qimblock=blkdct_quant(imblock,QP)
Qmatrix=[16,11,10,16,26,40,51,61;
12,12,14,19,26,58,60,55;
14,13,16,24,40,57,69,56;
14,17,22,29,51,87,80,62;
18,22,37,56,68,109,103,77;
24,35,55,64,81,104,113,92;
49,64,78,87,103,121,120,101;
72,92,95,98,112,100,103,99];
dctblock=dct2(imblock);
QM=Qmatrix*QP;
qdct=floor((dctblock+QM/2)./QM);
iqdct=qdct.*QM;
qimblock=round(idct2(iqdct));

function qimg=dct_exp(img,QP)
% img=imread(fname);
qimg=blkproc(img,[8 8],'blkdct_quant',QP);
% figure;
% imagesc(qimg),axis image, truesize, axis off; colormap(gray);
% title('DCT Domain Quantized Image');
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值