我有一个包含标记点的点云,因此它是pcl::PointCloud<pcl::PointXYZL>.
我严格遵循了本教程中所说的内容
我需要这些标签,我需要从点云中提取聚类。但当我用标签打电话给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
这是为带有标签的类型实例化的,因此不会给带有标签的点类型带来链接错误。