38 #ifndef OCTREE_COMPRESSION_H
39 #define OCTREE_COMPRESSION_H
68 template<
typename Po
intT,
typename LeafT = OctreeContainerDataTVector<
int>,
69 typename BranchT = OctreeContainerEmpty<
int>,
70 typename OctreeT = Octree2BufBase<
int, LeafT, BranchT> >
98 bool showStatistics_arg =
false,
99 const double pointResolution_arg = 0.001,
100 const double octreeResolution_arg = 0.01,
101 bool doVoxelGridDownDownSampling_arg =
false,
102 const unsigned int iFrameRate_arg = 30,
103 bool doColorEncoding_arg =
true,
104 const unsigned char colorBitResolution_arg = 6) :
107 binaryTreeDataVector_ (),
108 binaryColorTreeVector_ (),
109 pointCountDataVector_ (),
110 pointCountDataVectorIterator_ (),
114 doVoxelGridEnDecoding_ (doVoxelGridDownDownSampling_arg), iFrameRate_ (iFrameRate_arg),
115 iFrameCounter_ (0), frameID_ (0), pointCount_ (0), iFrame_ (true),
116 doColorEncoding_ (doColorEncoding_arg), cloudWithColor_ (false), dataWithColor_ (false),
117 pointColorOffset_ (0), bShowStatistics (showStatistics_arg),
118 compressedPointDataLen_ (), compressedColorDataLen_ (), selectedProfile_(compressionProfile_arg),
119 pointResolution_(pointResolution_arg), octreeResolution_(octreeResolution_arg), colorBitResolution_(colorBitResolution_arg)
143 pointCoder_.setPrecision (static_cast<float> (selectedProfile.
pointResolution));
151 pointCoder_.setPrecision (static_cast<float> (pointResolution_));
152 colorCoder_.setBitDepth (colorBitResolution_);
157 doVoxelGridEnDecoding_ =
true;
167 if (output_ != cloud_arg)
202 writeFrameHeader (std::ostream& compressedTreeDataOut_arg);
208 readFrameHeader (std::istream& compressedTreeDataIn_arg);
214 syncToHeader (std::istream& compressedTreeDataIn_arg);
220 entropyEncoding (std::ostream& compressedTreeDataOut_arg);
226 entropyDecoding (std::istream& compressedTreeDataIn_arg);
247 std::vector<char> binaryTreeDataVector_;
250 std::vector<char> binaryColorTreeVector_;
253 std::vector<unsigned int> pointCountDataVector_;
256 std::vector<unsigned int>::const_iterator pointCountDataVectorIterator_;
267 bool doVoxelGridEnDecoding_;
268 uint32_t iFrameRate_;
269 uint32_t iFrameCounter_;
271 uint64_t pointCount_;
274 bool doColorEncoding_;
275 bool cloudWithColor_;
277 unsigned char pointColorOffset_;
280 bool bShowStatistics;
281 uint64_t compressedPointDataLen_;
282 uint64_t compressedColorDataLen_;
285 static const char* frameHeaderIdentifier_;
288 const double pointResolution_;
289 const double octreeResolution_;
290 const unsigned char colorBitResolution_;
295 template<
typename Po
intT,
typename LeafT,
typename BranchT,
typename OctreeT>
296 const char* PointCloudCompression<PointT, LeafT, BranchT, OctreeT>::frameHeaderIdentifier_ =
"<PCL-COMPRESSED>";