PCLlab—双边滤波(1

http://www.cnblogs.com/pcl-lab/articles/3975879.html
http://www.pclcn.org/bbs/forum.php?mod=viewthread&tid=299&extra=&page=2    修改源码 重新编译模块

序:本节介绍PCL里的双边滤波,双边滤波主要作用是具有保边的功能,即在滤波的过程中不会连带边界一起都平滑掉,这样有利于计算准确的法线。这里我们主要介绍其实现过程,算法会在后续补充上。

1. 代码如下:

复制代码
void Filters::bilateralFilter(pcl::PCLPointCloud2::ConstPtr input, pcl::PCLPointCloud2& output,
    float sigma_s, float sigma_r)
{
    // Convert data to PointCloud<T>
    pcl::PointCloud<pcl::PointXYZ>::Ptr xyz (new pcl::PointCloud<pcl::PointXYZ>);
    fromPCLPointCloud2 (*input, *xyz);

    // Apply the filter
    pcl::FastBilateralFilter<pcl::PointXYZ> fbf;
    fbf.setInputCloud (xyz);
    fbf.setSigmaS (sigma_s);
    fbf.setSigmaR (sigma_r);
    pcl::PointCloud<pcl::PointXYZ> xyz_filtered;
    fbf.filter (xyz_filtered);

    // Convert data back
    pcl::PCLPointCloud2 output_xyz;
    toPCLPointCloud2 (xyz_filtered, output_xyz);
    pcl::concatenateFields (*input, output_xyz, output);
}
复制代码

2. 运行结果

直接观察运行的结果是很难区分出有什么差别的,所以这里我们分别计算了运行前后点云的法线,可以通过法线的分布清楚的分出效果来。

(1)采用默认参数滤波

(2)滤波前的法线分布

(3)滤波后的法线分布

 

转载请注明:http://www.cnblogs.com/pcl-lab/articles/3975879.html

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值