LDR图像融合HDR: RamenTMO方法

参考文献:

"Bilateral Filter Based Compositing for Variable Exposure Photography" by Shanmuganathan Raman and Subhasis Chaudhuri in Eurographics 2009 Short papers program

 

算法流程:

  1. Gamma变换计算归一化的图像队列,范围[0, 1]
  2. 计算图像队列中的最大最小值
  3. 计算双边滤波的sigma_s和sigma_r
  4. 对图像队列中的所有图像计算其亮度图像L
  5. 对亮度图像L进行双边滤波得到L_filtered
  6. 计算权重和:
    1. 通过高频图像,计算单个图像的权重:weight = abs(L - L_filtered) + C
    2. 计算所有图像的权重和total
  7. 通过单个图像的权重比计算混合图像:imgOut = img(i) * weight / total
C = 70.0 / 255.0; %As reported in Raman and Chaudhuri
 
%number of images in the imageStack
[r, c, col, n] = size(imageStack);
 
K1 = 1.0; %As reported in Raman and Chaudhuri
K2 = 1.0 / 10.0; %As reported in Raman and Chaudhuri 
sigma_s = K1 * min([r, c]);
imageStackMin = min(imageStack(:));
imageStackMax = max(imageStack(:));
sigma_r = K2 * (imageStackMax - imageStackMin);
 
%Computation of weights for each image
total = zeros(r, c);
weight = zeros(r, c, n);
for i=1:n
    L = lum(imageStack(:,:,:,i));
    L_filtered = bilateralFilter(L, [], imageStackMin, imageStackMax, sigma_s, sigma_r);
    weight(:,:,i) = C + abs(L - L_filtered);
    total = total + weight(:,:,i);
end
 
%merging
imgOut = zeros(r, c, col);
for i=1:n
    for j=1:col
        tmp = imageStack(:,:,j,i) .* weight(:,:,i) ./ total;
        imgOut(:,:,j) = imgOut(:,:,j) + RemoveSpecials(tmp);
    end
end
 
%Clamping
imgOut = ClampImg(imgOut, 0.0, 1.0);

 

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值