1
我目前正在尝试使用PCL过滤pointCloud感谢统计脱离删除没有使用ROS,只使用PCL我安装通过official github repository。我曾经在我的代码this,我得到以下错误而链接:问题与PCL和CMake:统计脱离删除时链接
CMakeFiles/tests/11_pcl/removeOutliers.dir/removeOutliers.cpp.o: In function `pcl::StatisticalOutlierRemoval<pcl::PointXYZRGB>::applyFilter(std::vector<int, std::allocator<int> >&)':
removeOutliers.cpp:(.text._ZN3pcl25StatisticalOutlierRemovalINS_11PointXYZRGBEE11applyFilterERSt6vectorIiSaIiEE[_ZN3pcl25StatisticalOutlierRemovalINS_11PointXYZRGBEE11applyFilterERSt6vectorIiSaIiEE]+0x1): undefined reference to `pcl::StatisticalOutlierRemoval<pcl::PointXYZRGB>::applyFilterIndices(std::vector<int, std::allocator<int> >&)'
CMakeFiles/tests/11_pcl/removeOutliers.dir/removeOutliers.cpp.o:(.rodata._ZTVN3pcl25StatisticalOutlierRemovalINS_11PointXYZRGBEEE[_ZTVN3pcl25StatisticalOutlierRemovalINS_11PointXYZRGBEEE]+0x48): undefined reference to `pcl::StatisticalOutlierRemoval<pcl::PointXYZRGB>::applyFilter(pcl::PointCloud<pcl::PointXYZRGB>&)'
在我CMakeList我有以下行:
find_package(PCL 1.3 REQUIRED COMPONENTS common io visualization)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
和:
add_executable(tests/11_pcl/removeOutliers removeOutliers.cpp)
target_link_libraries(tests/11_pcl/removeOutliers ${PCL_LIBRARIES} ${OpenCV_LIBS})
在我的cpp我只试图用以下方法初始化异常值:
pcl::StatisticalOutlierRemoval<pcl::PointXYZRGB> sor;
而且我有以下标题:
#include <pcl/common/common_headers.h>
#include <pcl/features/normal_3d.h>
#include <pcl/io/pcd_io.h>
#include <pcl/visualization/pcl_visualizer.h>
#include <pcl/console/parse.h>
//Filters
#include <pcl/point_types.h>
#include <pcl/filters/statistical_outlier_removal.h>
我想我可能在PCL缺失的成分......你知道吗?