41 #include <pcl/common/io.h>
42 #include <pcl/octree/octree2buf_base.h>
43 #include <pcl/octree/octree_pointcloud.h>
44 #include "entropy_range_coder.h"
45 #include "color_coding.h"
46 #include "point_coding.h"
48 #include "compression_profiles.h"
81 using Ptr = shared_ptr<OctreePointCloudCompression<PointT, LeafT, BranchT, OctreeT> >;
82 using ConstPtr = shared_ptr<const OctreePointCloudCompression<PointT, LeafT, BranchT, OctreeT> >;
102 bool showStatistics_arg =
false,
103 const double pointResolution_arg = 0.001,
104 const double octreeResolution_arg = 0.01,
105 bool doVoxelGridDownDownSampling_arg =
false,
106 const unsigned int iFrameRate_arg = 30,
107 bool doColorEncoding_arg =
true,
108 const unsigned char colorBitResolution_arg = 6) :
113 do_voxel_grid_enDecoding_ (doVoxelGridDownDownSampling_arg), i_frame_rate_ (iFrameRate_arg),
114 i_frame_counter_ (0), frame_ID_ (0), point_count_ (0), i_frame_ (true),
115 do_color_encoding_ (doColorEncoding_arg), cloud_with_color_ (false), data_with_color_ (false),
116 point_color_offset_ (0), b_show_statistics_ (showStatistics_arg),
117 compressed_point_data_len_ (), compressed_color_data_len_ (), selected_profile_(compressionProfile_arg),
118 point_resolution_(pointResolution_arg), octree_resolution_(octreeResolution_arg),
119 color_bit_resolution_(colorBitResolution_arg),
144 point_coder_.setPrecision (
static_cast<float> (selectedProfile.
pointResolution));
152 point_coder_.setPrecision (
static_cast<float> (point_resolution_));
153 color_coder_.setBitDepth (color_bit_resolution_);
156 if (point_coder_.getPrecision () == this->getResolution ())
158 do_voxel_grid_enDecoding_ =
true;
178 if (output_ != cloud_arg)
198 encodePointCloud (
const PointCloudConstPtr &cloud_arg, std::ostream& compressed_tree_data_out_arg);
205 decodePointCloud (std::istream& compressed_tree_data_in_arg, PointCloudPtr &cloud_arg);
213 writeFrameHeader (std::ostream& compressed_tree_data_out_arg);
219 readFrameHeader (std::istream& compressed_tree_data_in_arg);
225 syncToHeader (std::istream& compressed_tree_data_in_arg);
231 entropyEncoding (std::ostream& compressed_tree_data_out_arg);
237 entropyDecoding (std::istream& compressed_tree_data_in_arg);
244 serializeTreeCallback (LeafT &leaf_arg,
const OctreeKey& key_arg)
override;
251 deserializeTreeCallback (LeafT&,
const OctreeKey& key_arg)
override;
308 template<
typename Po
intT,
typename LeafT,
typename BranchT,
typename OctreeT>