我想使用k-means聚类算法为PCL 1.8.1中的点提取标签。根据{{3}},有一个受保护的属性PointsToClusters。 关于如何访问此属性或如何提取群集的任何想法?
谢谢!
pcl::Kmeans real(static_cast<int> (cloud->points.size()), 3);
real.setClusterSize(nominalClusterNumber);
for (size_t i = 0; i < cloud->points.size(); i++)
{
std::vector<float> data(3);
data[0] = cloud->points[i].x;
data[1] = cloud->points[i].y;
data[2] = cloud->points[i].z;
real.addDataPoint(data);
}
real.kMeans();