RangeImagePlanar.h
Go to the documentation of this file.
00001 /*
00002  * RangeImagePlanar.h
00003  *
00004  *      Author: roberto
00005  *
00006  * This is a modified implementation of the method for online estimation of kinematic structures described in our paper
00007  * "Online Interactive Perception of Articulated Objects with Multi-Level Recursive Estimation Based on Task-Specific Priors"
00008  * (Martín-Martín and Brock, 2014) and the extension to segment, reconstruct and track shapes introduced in our paper
00009  * "An Integrated Approach to Visual Perception of Articulated Objects" (Martín-Martín, Höfer and Brock, 2016)
00010  * This implementation can be used to reproduce the results of the paper and to be applied to new research.
00011  * The implementation allows also to be extended to perceive different information/models or to use additional sources of information.
00012  * A detail explanation of the method and the system can be found in our paper.
00013  *
00014  * If you are using this implementation in your research, please consider citing our work:
00015  *
00016 @inproceedings{martinmartin_ip_iros_2014,
00017 Title = {Online Interactive Perception of Articulated Objects with Multi-Level Recursive Estimation Based on Task-Specific Priors},
00018 Author = {Roberto {Mart\'in-Mart\'in} and Oliver Brock},
00019 Booktitle = {Proceedings of the IEEE/RSJ International Conference on Intelligent Robots and Systems},
00020 Pages = {2494-2501},
00021 Year = {2014},
00022 Location = {Chicago, Illinois, USA},
00023 Note = {http://www.robotics.tu-berlin.de/fileadmin/fg170/Publikationen_pdf/martinmartin_ip_iros_2014.pdf},
00024 Url = {http://www.robotics.tu-berlin.de/fileadmin/fg170/Publikationen_pdf/martinmartin_ip_iros_2014.pdf},
00025 Projectname = {Interactive Perception}
00026 }
00027 
00028 @inproceedings{martinmartin_hoefer_iros_2016,
00029 Title = {An Integrated Approach to Visual Perception of Articulated Objects},
00030 Author = {Roberto {Mart\'{i}n-Mart\'{i}n} and Sebastian H\"ofer and Oliver Brock},
00031 Booktitle = {Proceedings of the IEEE International Conference on Robotics and Automation},
00032 Pages = {5091 - 5097},
00033 Year = {2016},
00034 Doi = {10.1109/ICRA.2016.7487714},
00035 Location = {Stockholm, Sweden},
00036 Month = {05},
00037 Note = {http://www.redaktion.tu-berlin.de/fileadmin/fg170/Publikationen_pdf/martin_hoefer_15_iros_sr_opt.pdf},
00038 Url = {http://www.redaktion.tu-berlin.de/fileadmin/fg170/Publikationen_pdf/martin_hoefer_15_iros_sr_opt.pdf},
00039 Url2 = {http://ieeexplore.ieee.org/xpl/articleDetails.jsp?tp=&arnumber=7487714},
00040 Projectname = {Interactive Perception}
00041 }
00042  * If you have questions or suggestions, contact us:
00043  * roberto.martinmartin@tu-berlin.de
00044  *
00045  * Enjoy!
00046  */
00047 
00048 #ifndef SHAPE_RECONSTRUCTION_RANGE_IMAGE_PLANAR
00049 #define SHAPE_RECONSTRUCTION_RANGE_IMAGE_PLANAR
00050 
00051 #include <map>
00052 #include <pcl/range_image/range_image_planar.h>
00053 
00054 #include <opencv2/core/core.hpp>
00055 
00056 
00057 namespace shape_reconstruction {
00058 
00066 class RangeImagePlanar : public pcl::RangeImagePlanar {
00067 public:
00068     typedef boost::shared_ptr<shape_reconstruction::RangeImagePlanar> Ptr;
00069     typedef boost::shared_ptr<const shape_reconstruction::RangeImagePlanar> ConstPtr;
00070 
00071     RangeImagePlanar () : pcl::RangeImagePlanar(), img_coord_to_point_idx(NULL) {
00072         delete img_coord_to_point_idx;
00073     }
00074 
00076     virtual ~RangeImagePlanar () {
00077     }
00078 
00079     template <typename PointCloudType> void
00080     createFromPointCloudWithFixedSizeAndStorePoints (const PointCloudType& point_cloud,
00081                                        int di_width, int di_height, float di_center_x, float di_center_y,
00082                                        float di_focal_length_x, float di_focal_length_y,
00083                                        const Eigen::Affine3f& sensor_pose,
00084                                        CoordinateFrame coordinate_frame=CAMERA_FRAME, float noise_level=0.0f,
00085                                        float min_range=0.0f);
00086 
00087     template <typename PointCloudType> void
00088     doZBufferAndStorePoints (const PointCloudType& point_cloud,
00089                              float noise_level, float min_range,
00090                              int& top, int& right, int& bottom, int& left);
00091 
00092 
00093 
00095 
00096     template <typename PointCloudType> void
00097     computeZandMatchingPoints (const PointCloudType& point_cloud,
00098                                //float noise_level,
00099                                float min_range,
00100                                const cv::Mat& matching_im, const float matching_im_min_range,
00101                                pcl::PointIndicesPtr& matching_indices,
00102                                pcl::PointIndicesPtr& matching_indices_in_matching_im,
00103                                pcl::PointIndicesPtr& indices_to_remove,
00104                                int height, int width);
00105 
00106     template <typename PointCloudType> void
00107     matchPointCloudAndImage (const PointCloudType& point_cloud,
00108                              int di_width, int di_height,
00109                              float di_center_x, float di_center_y,
00110                              float di_focal_length_x, float di_focal_length_y,
00111                              const Eigen::Affine3f& sensor_pose,
00112                              CoordinateFrame coordinate_frame,
00113                              const cv::Mat& matching_im, const float matching_im_min_range,
00114                              pcl::PointIndicesPtr& matching_indices,
00115                              pcl::PointIndicesPtr& matching_indices_in_matching_im,
00116                              pcl::PointIndicesPtr& indices_to_remove,
00117                              float min_range=0.0f
00118                              );
00119 
00120 
00121     bool getPointIndex(const int& x, const int& y, int& idx) const {
00122         assert (img_coord_to_point_idx != NULL);
00123         int arrayPos = y*width + x;
00124         idx = img_coord_to_point_idx[arrayPos];
00125         if (idx == 0)
00126             return false;
00127 
00128         idx--; // see setPointIndex
00129         return true;
00130     }
00131 
00132     void setPointIndex(const int& x, const int& y, const int& idx) {
00133         assert (img_coord_to_point_idx != NULL);
00134         int arrayPos = y*width + x;
00135         // small hack: because we use 0 as invalid index,
00136         // but in a vector 0 actually could be a valid index (of the first point)
00137         // we add +1, and decrement it again in getPointIndex
00138         img_coord_to_point_idx[arrayPos] = idx+1;
00139     }
00140 
00141     void resetPointIndex(const int& width, const int& height) {
00142         unsigned int size = width*height;
00143         delete img_coord_to_point_idx;
00144         img_coord_to_point_idx = new int[size];
00145         // initial to 0=invalid index
00146         ERASE_ARRAY (img_coord_to_point_idx, size);
00147     }
00148 
00149 
00150 //protected:
00151 //    std::map<std::pair<int,int>, int >  img_coord_to_point_idx;
00152     int*  img_coord_to_point_idx;
00153 
00154 };
00155 
00156 }
00157 
00158 #endif


shape_reconstruction
Author(s): Roberto Martín-Martín
autogenerated on Sat Jun 8 2019 18:34:52