38 #ifndef OCTREE_COMPRESSION_H
39 #define OCTREE_COMPRESSION_H
41 #include <pcl/common/common.h>
42 #include <pcl/common/io.h>
43 #include <pcl/octree/octree2buf_base.h>
44 #include <pcl/octree/octree_pointcloud.h>
45 #include "entropy_range_coder.h"
46 #include "color_coding.h"
47 #include "point_coding.h"
49 #include "compression_profiles.h"
59 using namespace pcl::octree;
101 bool showStatistics_arg =
false,
102 const double pointResolution_arg = 0.001,
103 const double octreeResolution_arg = 0.01,
104 bool doVoxelGridDownDownSampling_arg =
false,
105 const unsigned int iFrameRate_arg = 30,
106 bool doColorEncoding_arg =
true,
107 const unsigned char colorBitResolution_arg = 6) :
110 binary_tree_data_vector_ (),
111 binary_color_tree_vector_ (),
112 point_count_data_vector_ (),
113 point_count_data_vector_iterator_ (),
117 do_voxel_grid_enDecoding_ (doVoxelGridDownDownSampling_arg), i_frame_rate_ (iFrameRate_arg),
118 i_frame_counter_ (0), frame_ID_ (0), point_count_ (0), i_frame_ (true),
119 do_color_encoding_ (doColorEncoding_arg), cloud_with_color_ (false), data_with_color_ (false),
120 point_color_offset_ (0), b_show_statistics_ (showStatistics_arg),
121 compressed_point_data_len_ (), compressed_color_data_len_ (), selected_profile_(compressionProfile_arg),
122 point_resolution_(pointResolution_arg), octree_resolution_(octreeResolution_arg),
123 color_bit_resolution_(colorBitResolution_arg),
148 point_coder_.setPrecision (static_cast<float> (selectedProfile.
pointResolution));
156 point_coder_.setPrecision (static_cast<float> (point_resolution_));
157 color_coder_.setBitDepth (color_bit_resolution_);
160 if (point_coder_.getPrecision () == this->getResolution ())
162 do_voxel_grid_enDecoding_ =
true;
170 addPointIdx (
const int pointIdx_arg)
182 if (output_ != cloud_arg)
192 getOutputCloud ()
const
202 encodePointCloud (
const PointCloudConstPtr &cloud_arg, std::ostream& compressed_tree_data_out_arg);
209 decodePointCloud (std::istream& compressed_tree_data_in_arg, PointCloudPtr &cloud_arg);
217 writeFrameHeader (std::ostream& compressed_tree_data_out_arg);
223 readFrameHeader (std::istream& compressed_tree_data_in_arg);
229 syncToHeader (std::istream& compressed_tree_data_in_arg);
235 entropyEncoding (std::ostream& compressed_tree_data_out_arg);
241 entropyDecoding (std::istream& compressed_tree_data_in_arg);
248 serializeTreeCallback (LeafT &leaf_arg,
const OctreeKey& key_arg);
255 deserializeTreeCallback (LeafT&,
const OctreeKey& key_arg);
312 template<
typename Po
intT,
typename LeafT,
typename BranchT,
typename OctreeT>