Skip to content
Chen Ruopeng edited this page May 1, 2023 · 20 revisions

Module IO

This module is designed to load and save .ply format point cloud.

namespace io

Methods


LoadColorPlyFile

params

  • const std::string& file_name
  • pcl::PointCloud<pcl::PointXYZRGB>::Ptr point_cloud

return

  • void

Load a point cloud from a PLY file named file_name, the point cloud is saved in point_cloud. file_name must be *.ply and file must follow PLY format.

SaveColorPlyFile

params

  • const std::string& file_name
  • pcl::PointCloud<pcl::PointXYZRGB>::Ptr point_cloud
  • bool binary_mode = false

return

  • void

Save a point cloud to a PLY file named file_name, the point cloud is saved in point_cloud, binary_mode control the writing format, true for binary and false for ascii, false by default. file_name must be *.ply and file must follow PLY format.

SaveUniqueColorPlyFile

params

  • const std::string& file_name
  • pcl::PointCloud<pcl::PointXYZRGB>::Ptr point_cloud
  • unsigned int unique_color = 0x000000
  • bool binary_mode = false

return

  • void

Save a point cloud to a PLY file named file_name, the point cloud is saved in point_cloud, binary_mode control the writing format, true for binary and false for ascii, false by default. Set all points color to unique_color, 0x00rrggbb, 0x00000000 black by default. file_name must be *.ply and file must follow PLY format.

LoadPatch

params

return

  • void

Load a patch from a binary file named _name. _name must be *.patch, _patch should be an empty patch because this method will reset _patch.cloud to a new cloud malloced here.

SavePatch

params

return

  • void

Save a patch to a binary file named _name. _name must be *.patch.

LoadSlice

params

return

  • void

Load a slice from a binary file named _name. _name must be *.slice, _slice should be an empty patch because this method will call _slice.clear() and reset _slice.geometry _slice.color to new vector malloced here.

SaveSlice

params

return

  • void

Save a slice to a binary file named _name. _name must be *.slice.