深度图预处理方法之线性插值

深度数据线性插值算法
本文介绍了一种用于处理深度数据的线性插值算法,该算法通过拉伸每行图像并仅保留前景像素来减少背景像素的影响,适用于车载应用中的深度头部姿势估计。

参考文献:Deep_Head_Pose_Estimation_from_Depth_Data for In-car Automotive Applications

算法步骤


Algorithm 1 Linear Interpolation Algorithm


procedure


  • w : image width
  • for row in image rows do
    • x_min = first foreground pixel in row
    • x_max = last foreground pixel in row
      • for x=0 to w-1 do
        • x_src = x/(w-1)*(x_max-x_min)
        • x_1 = floor(x_src)
        • x_2 = x_1+1
        • if x_2<=w then
          • lambda = x_2 - x_src
          • row_out[x]=row[x_1]lambda+row[x_2]*(1-lambda)
        • else
          • row_out[x]=row[x_1]

代码实现如下:

    def scale_interpolation(filename)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值