gpt4 book ai didi

point-cloud-library - 如何可视化 "XYZL"点云?

转载 作者:行者123 更新时间:2023-12-01 03:20:17 24 4
gpt4 key购买 nike

我有一个像这样的“XYZL”点云:

pcl::PointCloud<pcl::PointXYZL>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZL>);

我想把它可视化。它无法通过可视化“XYZ”或“XYZRGB”点云的命令进行可视化。

现在,我想知道如何可视化这种类型的点云?

最佳答案

PointXYZL 可以可视化为 PointXYZI 云。只需在两者之间转换,然后

void displayCloud(pcl::PointCloud<pcl::PointXYZI>::Ptr cloud, const std::string& window_name)
{
if (cloud->size() < 1)
{
std::cout << window_name << " display failure. Cloud contains no points\n";
return;
}

boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer(new pcl::visualization::PCLVisualizer(window_name));
pcl::visualization::PointCloudColorHandlerGenericField<pcl::PointXYZI> point_cloud_color_handler(cloud, "intensity");

viewer->addPointCloud< pcl::PointXYZI >(cloud, point_cloud_color_handler, "id");
viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 2, "id");

viewer->registerKeyboardCallback(keyboardEventOccurred, (void*)viewer.get());

while (!viewer->wasStopped() && !close_window){
viewer->spinOnce(50);
}
close_window = false;
viewer->close();
}

关于point-cloud-library - 如何可视化 "XYZL"点云?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45799577/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com