pcl-converter.hpp 624 B

12345678910111213141516171819
  1. #pragma once
  2. #include <librealsense2/rs.hpp>
  3. #include <tuple>
  4. #include <pcl/io/ply_io.h>
  5. #include <pcl/point_types.h>
  6. typedef pcl::PointXYZRGB PointRGB;
  7. typedef pcl::PointCloud<PointRGB> PointCloudRGB;
  8. typedef PointCloudRGB::Ptr PtrCloud;
  9. class PCLConverter
  10. {
  11. public:
  12. static PtrCloud points_to_pcl(const rs2::points &points, const rs2::video_frame &color);
  13. static void convert_and_save_ply(const std::string &fileName, const rs2::points &points, const rs2::video_frame &color);
  14. private:
  15. static std::tuple<uint8_t, uint8_t, uint8_t> get_texcolor(rs2::video_frame texture, rs2::texture_coordinate texcoords);
  16. };