www.pudn.com > Lee.rar > bfun.m, change:2011-03-19,size:854b


%% Matlab中文论坛所有资料全部免费下载,包括视频、附件、程序等
% 论坛得到了南京理工大学,上海大学,重庆大学等众多大学老师和学生的支持,
% 已经成为他们教课老师的推荐学习园地!同时获得了中科院众多研究人员的支持!
% 更多学习资料请访问论坛主页:     www.iLoveMatlab.cn
% Matlab中文论坛:杜绝浮躁、追求专业


function b = bfun(LR, labuda, dedaf, G1, G2, G3, M, B, S, C)

numerator = sum(labuda) * dedaf' * sum((G1-G2), 3) + dedaf' * G3;
imf = imfilter(dedaf, C, 'symmetric');
cf = norm(imf, 2);
 
Zn = imfilter(dedaf, B, 'symmetric');

Htemp = zeros(size(LR));
for k = 1:size(LR, 3)
  Htemp(:,:,k)=Zn(M(k, 2):S:(size(LR, 1) - 1) * S + M(k, 2), M(k, 1):S:(size(LR, 2) -1) * S + M(k, 1));
end

Wtemp = zeros(size(labuda));
for j = 1:size(LR, 3)
    Wtemp(j) = labuda(j) * norm(Htemp(:, :, j), 2);
end
denominator = sum(Wtemp) + cf;

b = numerator ./ denominator;