Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef PCL_ORGANIZED_POINT_COMPRESSION_H_
00040 #define PCL_ORGANIZED_POINT_COMPRESSION_H_
00041
00042 #include <pcl/pcl_macros.h>
00043 #include <pcl/point_cloud.h>
00044
00045 #include <pcl/common/boost.h>
00046 #include <pcl/common/eigen.h>
00047 #include <pcl/common/common.h>
00048 #include <pcl/common/io.h>
00049
00050 #include <pcl/io/openni_camera/openni_shift_to_depth_conversion.h>
00051
00052 #include <vector>
00053
00054 namespace pcl
00055 {
00056 namespace io
00057 {
00060 template<typename PointT>
00061 class OrganizedPointCloudCompression
00062 {
00063 public:
00064 typedef pcl::PointCloud<PointT> PointCloud;
00065 typedef boost::shared_ptr<PointCloud> PointCloudPtr;
00066 typedef boost::shared_ptr<const PointCloud> PointCloudConstPtr;
00067
00069 OrganizedPointCloudCompression ()
00070 {
00071 }
00072
00074 virtual ~OrganizedPointCloudCompression ()
00075 {
00076 }
00077
00086 void encodePointCloud (const PointCloudConstPtr &cloud_arg,
00087 std::ostream& compressedDataOut_arg,
00088 bool doColorEncoding = false,
00089 bool convertToMono = false,
00090 bool bShowStatistics_arg = true,
00091 int pngLevel_arg = -1);
00092
00108 void encodeRawDisparityMapWithColorImage ( std::vector<uint16_t>& disparityMap_arg,
00109 std::vector<uint8_t>& colorImage_arg,
00110 uint32_t width_arg,
00111 uint32_t height_arg,
00112 std::ostream& compressedDataOut_arg,
00113 bool doColorEncoding = false,
00114 bool convertToMono = false,
00115 bool bShowStatistics_arg = true,
00116 int pngLevel_arg = -1,
00117 float focalLength_arg = 525.0f,
00118 float disparityShift_arg = 174.825f,
00119 float disparityScale_arg = -0.161175f);
00120
00127 bool decodePointCloud (std::istream& compressedDataIn_arg,
00128 PointCloudPtr &cloud_arg,
00129 bool bShowStatistics_arg = true);
00130
00131 protected:
00137 void analyzeOrganizedCloud (PointCloudConstPtr cloud_arg,
00138 float& maxDepth_arg,
00139 float& focalLength_arg) const;
00140
00141 private:
00142
00143 static const char* frameHeaderIdentifier_;
00144
00145
00146 openni_wrapper::ShiftToDepthConverter sd_converter_;
00147 };
00148
00149
00150 template<typename PointT>
00151 const char* OrganizedPointCloudCompression<PointT>::frameHeaderIdentifier_ = "<PCL-ORG-COMPRESSED>";
00152 }
00153 }
00154
00155 #endif