如何在 PCL 数据文件中 store/write 点云的表面法线?

How to store/write the surface normals of a point cloud in a PCL data file?

我正在使用 PCL,并且我能够使用 PCL Visualizer 实时可视化法线的方向。

当我存储点云时,我只存储了点而不是法线的方向。

如何将法线的方向存储在 PCD 文件中,以便使用 pcl_viewer 可视化它们?

您必须使用正确的点类型存储点云。

我猜你把云分类为pcl::PointXYZ,但你应该用支持正常信息的点类型存储云,即pcl::PointNormal;或者只存储普通信息:pcl::Normal.

检查此 link 以了解有关 PCL 支持的点类型的信息: http://pointclouds.org/documentation/tutorials/adding_custom_ptype.php#id3

并查看此 link 的 'Normals and other information' 部分,了解有关如何可视化法线的信息: http://pointclouds.org/documentation/tutorials/pcl_visualizer.php