PCL: 使用带有标记点的欧氏聚类提取会产生 LNK 错误
PCL: use Euclidean Cluster Extraction with labeled points makes a LNK error
我有一个包含标记点的点云,因此它是 pcl::PointCloud<pcl::PointXYZL>.
我严格遵守了这个tutorial
我需要这些标签,我需要从点云中提取聚类。但是,当我使用标签调用 ECE 时,出现 LNK 错误。但是如果我在没有标签的情况下这样做,它确实会提取集群:
#include <pcl/segmentation/extract_polygonal_prism_data.h>
#include <pcl/segmentation/extract_clusters.h>
#include <vector>
#include <memory>
#include <pcl/io/ply_io.h>
pcl::PointCloud<pcl::PointXYZL>::Ptr hello(new pcl::PointCloud<pcl::PointXYZL>);
pcl::PLYReader Reader5;
Reader5.read("sidewalk.ply", *hello);
std::shared_ptr<std::vector<pcl::PointCloud<pcl::PointXYZL>>> clusters = std::make_shared < std::vector<pcl::PointCloud<pcl::PointXYZL>>>();
pcl::search::KdTree<pcl::PointXYZL>::Ptr tree(new pcl::search::KdTree<pcl::PointXYZL>);
tree->setInputCloud(hello);
std::vector<pcl::PointIndices> cluster_indices;
pcl::EuclideanClusterExtraction<pcl::PointXYZL> ec;
ec.setClusterTolerance(2.0);
ec.setMinClusterSize(100);
ec.setMaxClusterSize(25000);
ec.setSearchMethod(tree);
ec.setInputCloud(hello);
ec.extract(cluster_indices);
这是错误:
LNK2019 unresolved external symbol "public: void __cdecl pcl::EuclideanClusterExtraction<struct pcl::PointXYZL>::extract(class std::vector<struct pcl::PointIndices,class std::allocator<struct pcl::PointIndices> > &)" (?extract@?$EuclideanClusterExtraction@UPointXYZL@pcl@@@pcl@@QEAAXAEAV?$vector@UPointIndices@pcl@@V?$allocator@UPointIndices@pcl@@@std@@@std@@@Z) referenced in function main pclProgramme
我是否必须创建一个没有标签的新点云才能继续?
我认为您需要使用 LabeledEuclideanClusterExtraction,请参阅:
https://github.com/PointCloudLibrary/pcl/blob/master/segmentation/include/pcl/segmentation/extract_labeled_clusters.h
这是为带有标签的类型实例化的,因此不会给出带有标签的点类型的链接错误。
我有一个包含标记点的点云,因此它是 pcl::PointCloud<pcl::PointXYZL>.
我严格遵守了这个tutorial
我需要这些标签,我需要从点云中提取聚类。但是,当我使用标签调用 ECE 时,出现 LNK 错误。但是如果我在没有标签的情况下这样做,它确实会提取集群:
#include <pcl/segmentation/extract_polygonal_prism_data.h>
#include <pcl/segmentation/extract_clusters.h>
#include <vector>
#include <memory>
#include <pcl/io/ply_io.h>
pcl::PointCloud<pcl::PointXYZL>::Ptr hello(new pcl::PointCloud<pcl::PointXYZL>);
pcl::PLYReader Reader5;
Reader5.read("sidewalk.ply", *hello);
std::shared_ptr<std::vector<pcl::PointCloud<pcl::PointXYZL>>> clusters = std::make_shared < std::vector<pcl::PointCloud<pcl::PointXYZL>>>();
pcl::search::KdTree<pcl::PointXYZL>::Ptr tree(new pcl::search::KdTree<pcl::PointXYZL>);
tree->setInputCloud(hello);
std::vector<pcl::PointIndices> cluster_indices;
pcl::EuclideanClusterExtraction<pcl::PointXYZL> ec;
ec.setClusterTolerance(2.0);
ec.setMinClusterSize(100);
ec.setMaxClusterSize(25000);
ec.setSearchMethod(tree);
ec.setInputCloud(hello);
ec.extract(cluster_indices);
这是错误:
LNK2019 unresolved external symbol "public: void __cdecl pcl::EuclideanClusterExtraction<struct pcl::PointXYZL>::extract(class std::vector<struct pcl::PointIndices,class std::allocator<struct pcl::PointIndices> > &)" (?extract@?$EuclideanClusterExtraction@UPointXYZL@pcl@@@pcl@@QEAAXAEAV?$vector@UPointIndices@pcl@@V?$allocator@UPointIndices@pcl@@@std@@@std@@@Z) referenced in function main pclProgramme
我是否必须创建一个没有标签的新点云才能继续?
我认为您需要使用 LabeledEuclideanClusterExtraction,请参阅: https://github.com/PointCloudLibrary/pcl/blob/master/segmentation/include/pcl/segmentation/extract_labeled_clusters.h
这是为带有标签的类型实例化的,因此不会给出带有标签的点类型的链接错误。