请选择 进入手机版 | 继续访问电脑版

点云技术相关产学研社区

 找回密码
 立即注册加入PCL中国点云技术相关产学研社区

扫一扫,访问微社区

查看: 7379|回复: 4

高斯滤波程序出错,求助

[复制链接]
发表于 2014-5-30 08:50:11 | 显示全部楼层 |阅读模式
网上找的一段高斯滤波程序,运行一直出错,下面是代码和错误信息
#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/common/gaussian.h>
#include <pcl/filters/filter.h>
#include <pcl/filters/convolution.h>
#include <pcl/filters/convolution_3d.h>
int
main (int argc, char** argv)
{
        //Create the input and filtered cloud objects
        pcl::PointCloud<pcl::PointXYZ>::Ptr inputcloud (new pcl::PointCloud<pcl::PointXYZ>);
        pcl::PointCloud<pcl::PointXYZ>::Ptr outputcloud (new pcl::PointCloud<pcl::PointXYZ>);

        //Read in the input file
        if (pcl::io::loadPCDFile("D:\\frame_saver_output\\front\\cloud_front_1_filtered.pcd", *inputcloud) == -1) //* load the file
    {
                PCL_ERROR ("Couldn't read file test_pcd.pcd \n"); // if couldnt open the file ?
                return (-1);
    }

        //Set up the Gaussian Kernel
        pcl::filters::GaussianKernel<pcl::PointXYZ,pcl::PointXYZ>:: Ptr kernel (new pcl::filters::GaussianKernel<pcl::PointXYZ, pcl::PointXYZ>);
        (*kernel).setSigma(4);
        (*kernel).setThresholdRelativeToSigma(4);
        std::cout << "Kernel made" << std::endl;

        //Set up the KDTree
        pcl::search::KdTree<pcl::PointXYZ>::Ptr kdtree (new pcl::search::KdTree<pcl::PointXYZ>);
        (*kdtree).setInputCloud(inputcloud);
        std::cout << "KdTree made" << std::endl;
       
        //Set up the Convolution Filter
        pcl::filters::Convolution3D <pcl::PointXYZ, pcl::PointXYZ, pcl::filters::GaussianKernel<pcl::PointXYZ,pcl::PointXYZ> > convolution;
        convolution.setKernel(*kernel);
        convolution.setInputCloud(inputcloud);
        convolution.setSearchMethod(kdtree);
        convolution.setRadiusSearch(0.05);
        std::cout << "Convolution Start" << std::endl;
        convolution.convolve(*outputcloud);
        std::cout << "Convoluted" << std::endl;

        //write to file
        pcl::io::savePCDFileASCII ("D:\\frame_saver_output\\front\\cloud_front_1_filtered_GaussianKernel_filters.pcd", *outputcloud);
        std::cout << "Written to File" << std::endl;
       
        system ("pause");
        return (0);
}



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册加入PCL中国点云技术相关产学研社区

x
回复

使用道具 举报

发表于 2016-1-11 09:34:54 | 显示全部楼层
楼主,高斯滤波你解决了没?
回复 支持 反对

使用道具 举报

发表于 2016-1-12 00:01:04 | 显示全部楼层
楼主,你好,你高斯滤波解决了没?是不是要修改头文件
回复 支持 反对

使用道具 举报

发表于 2016-4-26 10:18:59 | 显示全部楼层
丫丫e 发表于 2016-1-11 09:34
楼主,高斯滤波你解决了没?

请问你解决了吗
回复 支持 反对

使用道具 举报

本版积分规则

QQ|小黑屋|点云技术相关产学研社区 ( 陕ICP备13001629号 )

GMT+8, 2024-3-29 05:52 , Processed in 1.633669 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表