Point Cloud Library (PCL)
1.10.0
|
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"
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>
PointCloudPtr getOutputCloud() const
Get a pointer to the output point cloud dataset.
void initialization()
Initialize globals.
This file defines compatibility wrappers for low level I/O functions.
StaticRangeCoder compression class
shared_ptr< const OctreePointCloudCompression< PointT, LeafT, BranchT, OctreeT > > ConstPtr
const double octreeResolution
std::vector< unsigned int > point_count_data_vector_
Vector for storing points per voxel information
const unsigned char color_bit_resolution_
std::vector< unsigned int >::const_iterator point_count_data_vector_iterator_
Iterator on points per voxel vector.
typename OctreePointCloud< PointT, LeafT, BranchT, OctreeT >::PointCloudPtr PointCloudPtr
const compression_Profiles_e selected_profile_
typename PointCloud::ConstPtr PointCloudConstPtr
shared_ptr< OctreePointCloudCompression< PointT, LeafT, BranchT, OctreeT > > Ptr
typename OctreeT::BranchNode BranchNode
const struct configurationProfile_t compressionProfiles_[COMPRESSION_PROFILE_COUNT]
ColorCoding< PointT > color_coder_
Color coding instance.
const double octree_resolution_
Octree container class that does store a vector of point indices.
PointCloud represents the base class in PCL for storing collections of 3D points.
A point structure representing Euclidean xyz coordinates, and the RGB color.
virtual void addPointIdx(const int point_idx_arg)
Add point at index from input pointcloud dataset to octree.
typename OctreePointCloud< PointT, LeafT, BranchT, OctreeT >::PointCloud PointCloud
Octree double buffer class
Abstract octree leaf class
~OctreePointCloudCompression()
Empty deconstructor.
const double point_resolution_
typename OctreePointCloud< PointT, LeafT, BranchT, OctreeT >::PointCloudConstPtr PointCloudConstPtr
const unsigned char colorBitResolution
std::uint64_t compressed_point_data_len_
bool doVoxelGridDownSampling
OctreePointCloudCompression(compression_Profiles_e compressionProfile_arg=MED_RES_ONLINE_COMPRESSION_WITH_COLOR, bool showStatistics_arg=false, const double pointResolution_arg=0.001, const double octreeResolution_arg=0.01, bool doVoxelGridDownDownSampling_arg=false, const unsigned int iFrameRate_arg=30, bool doColorEncoding_arg=true, const unsigned char colorBitResolution_arg=6)
Constructor.
bool do_voxel_grid_enDecoding_
std::vector< char > binary_tree_data_vector_
Vector for storing binary tree structure.
typename PointCloud::Ptr PointCloudPtr
std::uint64_t compressed_color_data_len_
std::size_t object_count_
StaticRangeCoder entropy_coder_
Static range coder instance.
void setOutputCloud(const PointCloudPtr &cloud_arg)
Provide a pointer to the output data set.
Octree pointcloud compression class
std::uint32_t i_frame_rate_
PointCloudPtr output_
Pointer to output point cloud dataset.
void addPointIdx(const int pointIdx_arg) override
Add point at index from input pointcloud dataset to octree.
typename OctreeT::LeafNode LeafNode
static const char * frame_header_identifier_
std::vector< char > binary_color_tree_vector_
Iterator on binary tree structure vector.
unsigned char point_color_offset_
PointCoding< PointT > point_coder_
Point coding instance.
Octree container class that does not store any information.
boost::shared_ptr< T > shared_ptr
Alias for boost::shared_ptr.
std::uint64_t point_count_
std::uint32_t i_frame_counter_