平面提取检测的方法
https://github.com/muratkendir/PlaneDetectionwPCL
报错一:找不到头文件
include路径更改符号,系统不同注意斜杠方向,解决路径报错问题。
对‘pcl::SACSegmentation<pcl::PointXYZ>::segment(pcl::PointIndices&, pcl::ModelCoefficients&)’未定义的引用
warning: ‘pcl::SAC_SAMPLE_SIZE’ is deprecated: This map is deprecated and is kept only to prevent breaking existing user code. Starting from PCL 1.8.0 model sample size is a protected member of the SampleConsensusModel class [-Wdeprecated-declarations]
SAC_SAMPLE_SIZE (sample_size_pairs, sample_size_pairs + sizeof (sample_size_pairs) / sizeof (SampleSizeModel));
报错2:未定义的引用
问题出现在FIND_PACKAGE( PCL REQUIRED COMPONENTS common io visualization ),后续代码中添加了其他模块调用,还要再添加,这样的方法其实是很麻烦的,我们最好使用FIND_PACKAGE( PCL REQUIRED QUIET)。
# 增加一个可执行的二进制
ADD_EXECUTABLE( main main.cpp )
# 增加PCL库的依赖
FIND_PACKAGE( PCL REQUIRED COMPONENTS common io visualization )
#list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4") # use this in Ubuntu 16.04
# 增加opencv的依赖
FIND_PACKAGE( OpenCV REQUIRED )
# 添加头文件和库文件
ADD_DEFINITIO

本文介绍了使用PCL库进行点云平面检测的RANSAC方法,并分享了在实践中遇到的两个问题及解决方案:一是解决找不到头文件的报错,通过调整include路径中的斜杠方向;二是处理未定义的引用问题,通过添加相应模块调用,但建议采用更简洁的方法来避免此类问题。
最低0.47元/天 解锁文章
789

被折叠的 条评论
为什么被折叠?



