1. 数据填充
std::vector<pcl::PointCloud<pcl::PointXYZRGB>::Ptr> pure_static_landmarks_underk;std::vector<pcl::PointCloud<pcl::PointXYZRGB>::Ptr> pure_static_landmarks_k;vector<vector<int>> matched_indices;对数据pure_static_landmarks_underk和pure_static_landmarks_k进行填充对数据matched_indices进行填充
2. 可视化(非函数,直接用)
pcl::visualization::PCLVisualizer viewer("Matched Point Clouds Visualization");for (size_t i = 0; i < matched_indices.size(); ++i) {int idx_k = matched_indices[i][0];int idx_underk = matched_indices[i][1];// 确保索引有效if (idx_k >= pure_static_landmarks_k.size() || idx_underk >= pure_static_landmarks_underk.size()) {continue;}// 为这对点云生成唯一的IDstd::string id_k = "cloud_k_" + std::to_string(i);std::string id_underk = "cloud_underk_" + std::to_string(i);// 添加点云到可视化器viewer.addPointCloud<pcl::PointXYZRGB>(pure_static_landmarks_k[idx_k], id_k);viewer.addPointCloud<pcl::PointXYZRGB>(pure_static_landmarks_underk[idx_underk], id_underk);// 可以选择设置点大小viewer.setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 2, id_k);viewer.setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 2, id_underk);}// 循环直到视窗关闭while (!viewer.wasStopped()) {viewer.spinOnce();}