美文网首页
2.阅读笔记:Joint Bilateral Upsamplin

2.阅读笔记:Joint Bilateral Upsamplin

作者: Persistently | 来源:发表于2017-06-21 16:51 被阅读0次

    Abstract:

    图像分析和增强任务,例如色调映射,彩色化,立体声深度和照相蒙太奇,通常需要计算像素网格上的解(例如,用于曝光,色度,视差,标签)。 计算和存储器成本通常要求在下采样图像上运行较小的解。 虽然通用上采样方法可以用于将低分辨率解决方案内插到全分辨率,但是这些方法通常假定内插之前的平滑性。
    我们证明在诸如上面的情况下,可用的高分辨率输入图像可以被利用作为在联合双向上采样程序的上下文中的先验,以产生更好的高分辨率解决方案。 我们显示上述每个应用的结果,并将其与传统的上采样方法进行比较。

    来我们来回顾一下之前的BF和JBF

    BF:

    f为the spatial filter kernel,就想高斯kernel,是以p为中心。
    g 为the range filter kernel,图像中心的像素值为Ip.
    Ω is the spatial support of the kernel f
    kp is a normalizing factor, the sum of the f · g filter weights
    kp为一个window中的所有的f与g相乘的值

    JBF(joint bilateral filters):

    Joint Bilateral Upsampling:

    S is the low resolution solution
    可以看出对于像素值差值的高斯函数是通过采样得到的,至于怎么采样,就是选取color图像的(i,j)为中心,以离中心(i,j)采样间隔的整数倍距离进行采样,当然采样范围不能超过给定windows的范围
    g:就是正常的从depth image中获得的距离的高斯函数(在代码中,depth image是经过下采样后的图像)

    matlab code:

    function result = JointBilateralUpsample(color,depth,factor,sigma_w,sigma_c,w)
    if( size(color,3) ~= 3 ),
        error( 'color data must be of 3 channel' );
    end
    
    depth = double(depth);
    color = double(color);
    highHeight = size( color, 1 );
    highWidth  = size( color, 2 );
    lowHeight = size(depth,1);
    lowWidth = size(depth,2);
    result = zeros(highHeight,highWidth);
    for i = 1:highHeight
        for j = 1:highWidth
            id = i/factor;
            jd = j/factor;
            iMin = ceil(max(id-w,1));
            iMax = floor(min(id+w,lowHeight));
            jMin = ceil(max(jd-w,1));
            jMax = floor(min(jd+w,lowWidth));
            
            depth_sec = depth(iMin:iMax,jMin:jMax);
            color_sec = color(iMin * factor:factor:iMax * factor,jMin * factor:factor:jMax * factor,:);
            
            % Compute Gaussian range weights.
            dR = color_sec(:,:,1)-color(i,j,1);
            dG = color_sec(:,:,2)-color(i,j,2);
            dB = color_sec(:,:,3)-color(i,j,3);
            range = exp( -(dR.^2 + dG.^2 + dB.^2) / (2*sigma_c^2));
            % Calculate bilateral filter response.
            iw = (iMin:iMax) - id;
            jw = (jMin:jMax) - jd;
            [mx,my] = meshgrid(jw,iw);
            spatial = exp( -(mx.^2 + my.^2) / (2*sigma_w^2) );
            depth_weight = (depth_sec>0) .* range .* spatial;
            depth_sum = depth_sec .* depth_weight;
            result(i,j) = sum(depth_sum(:)) / sum(depth_weight(:));
         end
       end
     end
    

    Reference:
    http://delivery.acm.org/10.1145/1280000/1276497/a96-kopf.pdf?ip=116.7.245.186&id=1276497&acc=ACTIVE%20SERVICE&key=BF85BBA5741FDC6E%2E5FBA890B628FA01E%2E4D4702B0C3E38B35%2E4D4702B0C3E38B35&CFID=726004424&CFTOKEN=40527807&acm=1486607422_ae441afbcedf5ad482b545daeb52ab34

    相关文章

      网友评论

          本文标题:2.阅读笔记:Joint Bilateral Upsamplin

          本文链接:https://www.haomeiwen.com/subject/ayhgmttx.html