Pcl::EuclideanClusterExtraction не удалось извлечь первый кластер. ⇐ C++
-
Anonymous
Pcl::EuclideanClusterExtraction не удалось извлечь первый кластер.
Я пытаюсь извлечь первый кластер из облака точек. Вот мой код
Ввод
cluster_pcd_ptr толерантность тело
pcl::search::KdTree::Ptruster_tree( новый pcl::search::KdTree); Cluster_tree->setInputCloud(cluster_pcd_ptr); std::vector Cluster_indices; pcl::EuclideanClusterExtraction ec; ec.setClusterTolerance(толерантность); ec.setSearchMethod(cluster_tree); ec.setInputCloud(cluster_pcd_ptr); ec.extract(cluster_indices); pcl::PointIndices::Ptr patch_indices_ptr(новый pcl::PointIndices); patch_indices_ptr->header = Cluster_indices[0].header; patch_indices_ptr->indices = кластер_indices[0].indices; pcl::ExtractIndices patch_extract; patch_extract.setInputCloud(cluster_pcd_ptr); patch_extract.setIndices(patch_indices_ptr); pcl::PointCloud::Ptr patch_pcd_ptr(new pcl::PointCloud); patch_extract.filter(*patch_pcd_ptr); Но я всегда получал ошибку чтения местоположения нарушения прав доступа в patch_extract.filter(*patch_pcd_ptr). Так в чем проблема в моем коде?
Я пытаюсь извлечь первый кластер из облака точек. Вот мой код
Ввод
cluster_pcd_ptr толерантность тело
pcl::search::KdTree::Ptruster_tree( новый pcl::search::KdTree); Cluster_tree->setInputCloud(cluster_pcd_ptr); std::vector Cluster_indices; pcl::EuclideanClusterExtraction ec; ec.setClusterTolerance(толерантность); ec.setSearchMethod(cluster_tree); ec.setInputCloud(cluster_pcd_ptr); ec.extract(cluster_indices); pcl::PointIndices::Ptr patch_indices_ptr(новый pcl::PointIndices); patch_indices_ptr->header = Cluster_indices[0].header; patch_indices_ptr->indices = кластер_indices[0].indices; pcl::ExtractIndices patch_extract; patch_extract.setInputCloud(cluster_pcd_ptr); patch_extract.setIndices(patch_indices_ptr); pcl::PointCloud::Ptr patch_pcd_ptr(new pcl::PointCloud); patch_extract.filter(*patch_pcd_ptr); Но я всегда получал ошибку чтения местоположения нарушения прав доступа в patch_extract.filter(*patch_pcd_ptr). Так в чем проблема в моем коде?
Мобильная версия