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
00040
00041
00042
00043
00044
00045
00046
00047
00048 #ifndef SR_UTILS_H_
00049 #define SR_UTILS_H_
00050
00051 #include "shape_reconstruction/RangeImagePlanar.h"
00052 #include "omip_common/OMIPUtils.h"
00053 #include "omip_common/OMIPTypeDefs.h"
00054
00055 #include <opencv2/core/core.hpp>
00056 #include <camera_info_manager/camera_info_manager.h>
00057 #include <pcl/range_image/range_image_planar.h>
00058 #include <pcl/filters/extract_indices.h>
00059 #include <pcl/common/transforms.h>
00060 #include <pcl/search/search.h>
00061 #include <pcl/search/organized.h>
00062 #include <pcl/search/kdtree.h>
00063 #include <pcl/filters/extract_indices.h>
00064 #include <pcl/filters/voxel_grid.h>
00065 #include <pcl/kdtree/kdtree_flann.h>
00066 #include <pcl/filters/radius_outlier_removal.h>
00067 #include <pcl/filters/approximate_voxel_grid.h>
00068 #include <pcl/features/normal_3d_omp.h>
00069 #include <pcl/point_types.h>
00070 #include <pcl/io/pcd_io.h>
00071 #include <pcl/kdtree/kdtree_flann.h>
00072 #include <pcl/features/normal_3d.h>
00073 #include <pcl/surface/gp3.h>
00074 #include <pcl/io/vtk_lib_io.h>
00075 #include <boost/circular_buffer.hpp>
00076
00077 namespace omip
00078 {
00079
00080
00081
00082
00083 #ifdef DOWNSAMPLING
00084 #define IMG_WIDTH 320
00085 #define IMG_HEIGHT 240
00086 #else
00087 #define IMG_WIDTH 640
00088 #define IMG_HEIGHT 480
00089 #endif
00090
00091 #define NUM_SCALES 3
00092
00093 typedef pcl::PointXYZRGB SRPoint;
00094 typedef pcl::PointCloud<SRPoint> SRPointCloud;
00095
00096 void RangeImagePlanar2DepthMap(const pcl::RangeImagePlanar::Ptr& rip, cv::Mat& depth_map_mat);
00097
00098 void RangeImagePlanar2PointCloud(const pcl::RangeImagePlanar::Ptr& rip, SRPointCloud::Ptr& pc);
00099
00100 void OrganizedPC2DepthMap(const SRPointCloud::Ptr organized_pc, cv::Mat& depth_map_mat);
00101 void OrganizedPC2DepthMapAlternative(const SRPointCloud::Ptr organized_pc, const cv::Ptr<cv::Mat>& depth_map_mat_ptr);
00102 void OrganizedPC2ColorMap(const SRPointCloud::Ptr organized_pc, cv::Mat& color_map_mat);
00103
00104
00105 void UnorganizedPC2DepthMap(const SRPointCloud::Ptr& organized_pc,
00106 const int& width,
00107 const int& height,
00108 cv::Mat& depth_map,
00109 ::shape_reconstruction::RangeImagePlanar::Ptr& rip,
00110 const float& noiseLevel=0.f,
00111 const float& minRange=0.5f);
00112
00113 void DepthImage2CvImage(const cv::Mat& depth_image_raw, sensor_msgs::ImagePtr& depth_msg);
00114
00115 void Image8u2Indices(const cv::Mat& image_8u, pcl::PointIndices::Ptr indices_ptr);
00116
00117 void Indices2Image8u(const std::vector<int>& indices, cv::Mat& image_8u);
00118
00119 void drawOptFlowMap(const cv::Mat& flow, cv::Mat& cflowmap, int step,double scale, const cv::Scalar& color);
00120
00121 void drawOpticalFlowModule(const cv::Mat& optical_flow, cv::Mat& optical_flow_module);
00122
00123 void fillNaNsCBF(const sensor_msgs::Image& color_img, const cv::Mat& depth_img, cv::Mat& filled_depth_img, ros::Time query_time);
00124
00125 void removeDuplicateIndices(std::vector<int>& vec);
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143 cv::Mat fill_depth_cbf(cv::Mat imgRgb, cv::Mat imgDepthAbs, double* spaceSigmas, double* rangeSigmas);
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154 void cbf(uint8_t* depth, uint8_t* intensity, bool* mask, uint8_t* result, double* sigma_s, double* sigma_r);
00155
00156 }
00157
00158 #endif
00159