40 #include <pcl/octree/octree2buf_base.h>
41 #include <pcl/octree/octree_pointcloud.h>
42 #include "entropy_range_coder.h"
43 #include "color_coding.h"
44 #include "point_coding.h"
46 #include "compression_profiles.h"
76 using Ptr = shared_ptr<OctreePointCloudCompression<PointT, LeafT, BranchT, OctreeT> >;
77 using ConstPtr = shared_ptr<const OctreePointCloudCompression<PointT, LeafT, BranchT, OctreeT> >;
97 bool showStatistics_arg =
false,
98 const double pointResolution_arg = 0.001,
99 const double octreeResolution_arg = 0.01,
100 bool doVoxelGridDownDownSampling_arg =
false,
101 const unsigned int iFrameRate_arg = 30,
102 bool doColorEncoding_arg =
true,
103 const unsigned char colorBitResolution_arg = 6) :
108 do_voxel_grid_enDecoding_ (doVoxelGridDownDownSampling_arg), i_frame_rate_ (iFrameRate_arg),
109 i_frame_counter_ (0), frame_ID_ (0), point_count_ (0), i_frame_ (true),
110 do_color_encoding_ (doColorEncoding_arg), cloud_with_color_ (false), data_with_color_ (false),
111 point_color_offset_ (0), b_show_statistics_ (showStatistics_arg),
112 compressed_point_data_len_ (), compressed_color_data_len_ (), selected_profile_(compressionProfile_arg),
113 point_resolution_(pointResolution_arg), octree_resolution_(octreeResolution_arg),
114 color_bit_resolution_(colorBitResolution_arg),
139 point_coder_.setPrecision (
static_cast<float> (selectedProfile.
pointResolution));
147 point_coder_.setPrecision (
static_cast<float> (point_resolution_));
148 color_coder_.setBitDepth (color_bit_resolution_);
151 if (point_coder_.getPrecision () == this->getResolution ())
153 do_voxel_grid_enDecoding_ =
true;
173 if (output_ != cloud_arg)
193 encodePointCloud (
const PointCloudConstPtr &cloud_arg, std::ostream& compressed_tree_data_out_arg);
200 decodePointCloud (std::istream& compressed_tree_data_in_arg, PointCloudPtr &cloud_arg);
208 writeFrameHeader (std::ostream& compressed_tree_data_out_arg);
214 readFrameHeader (std::istream& compressed_tree_data_in_arg);
220 syncToHeader (std::istream& compressed_tree_data_in_arg);
226 entropyEncoding (std::ostream& compressed_tree_data_out_arg);
232 entropyDecoding (std::istream& compressed_tree_data_in_arg);
239 serializeTreeCallback (LeafT &leaf_arg,
const OctreeKey& key_arg)
override;
246 deserializeTreeCallback (LeafT&,
const OctreeKey& key_arg)
override;
303 template<
typename Po
intT,
typename LeafT,
typename BranchT,
typename OctreeT>