复现PCL点云库教程遇到的问题
复现程序时遇到问题:
问题一:namespace "PCL"没有成员getFilenameWithoutExtension
1、问题描述:
getFilenameWithoutExtension进行报错:namespace "PCL"没有成员getFilenameWithoutExtension
2、问题图片:
3、解决办法:
添加file_io的头文件:#include <pcl/common/file_io.h>
问题二:
E0304 没有与参数列表匹配的 重载函数 “pcl::visualization::PCLVisualizer::addPointCloud” 实例
E0289 没有与参数列表匹配的构造函数 “pcl::visualization::PointCloudColorHandlerCustom::PointCloudColorHandlerCustom [其中 PointT=pcl::PointWithRange]” 实例##
2、问题图片:
此问题来源于第七章可视化的第二个练习章节《怎样可视化深度图像》
3、问题分析:
给官方解释:
getFilenameWithoutPath()
std::string pcl::getFilenameWithoutPath ( const std::string & input )
Remove the path from the given string and return only the filename (the remaining string after the last ‘/’)
Parameters
input the input filename (with full path)
Returns
the resulting filename, stripped of the path
Definition at line 76 of file file_io.hpp.
是所以要更改range_image_ptr的格式
4、解决办法:
把
boost::shared_ptrpcl::RangeImage range_image_ptr(new pcl::RangeImage);
改为:
const std::shared_ptr<pcl::RangeImage> range_image_ptr(new pcl::RangeImage);
下相当于把range_image_ptr的类型进行一个更换
问题三:
E0312 不存在用户定义的从 “boost::shared_ptr” 到 “const std::shared_ptr<const pcl::PointRepresentation>” 的适当转换
C2664 “void pcl::Registration<PointSource,PointTarget,Scalar>::setPointRepresentation(const std::shared_ptr<const pcl::PointRepresentationpcl::PointNormal> &)”: 无法将参数 1 从“boost::shared_ptr”转换为“const std::shared_ptr<const pcl::PointRepresentationpcl::PointNormal> &”
1、问题描述(来源):
本问题来自第13章 点云配准的——13.3.2 如何逐步匹配多幅点云时,遇到了报错
2、问题图片展示:
3、问题分析:
官方文档解释:
setPointRepresentation()
void pcl::KdTree< PointT >::setPointRepresentation ( const PointRepresentationConstPtr & point_representation )
Provide a pointer to the point representation to use to convert points into k-D vectors.
Parameters
[in] point_representation the const boost shared pointer to a PointRepresentation
4、解决方案:
把原程序的
reg.setPointRepresentation(boost::make_shared<const MyPointRepresentation>(point_representation));
改为:
reg.setPointRepresentation(pcl::make_shared<const MyPointRepresentation>(point_representation));
这里要感谢BoYang_Zz博主的解决方案
链接: PCL 报错修改 pairwise_incremental_registration.
问题四:C2039 “KdTree”: 不是 “pcl::search” 的成员
1、问题描述(来源):
本问题来自第15章中15.3.1基于多项式拟合的法线估计、估计平滑和数据重采样中
2、问题图片展示:
3、问题分析:
这种大量.h文件的确实,多半是缺少头文件所导致
4、解决方案:
在头文件处添加如下
#include<pcl/search/impl/kdtree.hpp>
问题四:由于找不到 qhull_rd.dll,无法继续执行代码。重新安装程序可能会解决此问题。
1、问题描述(来源):
本问题来自第15章中15.3.1基于多项式拟合的法线估计、估计平滑和数据重采样中,点击运行后,产生的报错
2、问题图片展示:
3、问题分析:
此问题为,PCL没有检测到.dll文件出现的报错,但是在我们安装的时候此文件是有的,只是放的路径可能需要修改。
4、解决方案:
在安装的PCL中搜索qhull_rd.dll
右键,打开文件夹所在的位置,把qhull_rd.dll文件夹下复制,
在pcl-版本/bin目录下进行复制。
问题解决!
后续更新的模板
1、问题描述(来源):
2、问题图片展示:
3、问题分析:
4、解决方案: