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缺失的成分......你知道嗎?