util3d_correspondences.h
Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
00003 All rights reserved.
00004 
00005 Redistribution and use in source and binary forms, with or without
00006 modification, are permitted provided that the following conditions are met:
00007     * Redistributions of source code must retain the above copyright
00008       notice, this list of conditions and the following disclaimer.
00009     * Redistributions in binary form must reproduce the above copyright
00010       notice, this list of conditions and the following disclaimer in the
00011       documentation and/or other materials provided with the distribution.
00012     * Neither the name of the Universite de Sherbrooke nor the
00013       names of its contributors may be used to endorse or promote products
00014       derived from this software without specific prior written permission.
00015 
00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
00017 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00018 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00019 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
00020 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00021 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00022 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00023 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00024 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00025 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00026 */
00027 
00028 #ifndef UTIL3D_CORRESPONDENCES_H_
00029 #define UTIL3D_CORRESPONDENCES_H_
00030 
00031 #include <rtabmap/core/RtabmapExp.h>
00032 
00033 #include <pcl/point_cloud.h>
00034 #include <pcl/point_types.h>
00035 #include <opencv2/features2d/features2d.hpp>
00036 #include <set>
00037 #include <map>
00038 #include <list>
00039 
00040 namespace rtabmap
00041 {
00042 
00043 namespace util3d
00044 {
00045 
00046 
00047 void RTABMAP_EXP findCorrespondences(
00048                 const std::multimap<int, cv::KeyPoint> & wordsA,
00049                 const std::multimap<int, cv::KeyPoint> & wordsB,
00050                 std::list<std::pair<cv::Point2f, cv::Point2f> > & pairs);
00051 
00052 void RTABMAP_EXP findCorrespondences(
00053                 const std::multimap<int, cv::Point3f> & words1,
00054                 const std::multimap<int, cv::Point3f> & words2,
00055                 std::vector<cv::Point3f> & inliers1,
00056                 std::vector<cv::Point3f> & inliers2,
00057                 float maxDepth,
00058                 std::vector<int> * uniqueCorrespondences = 0);
00059 
00060 void RTABMAP_EXP findCorrespondences(
00061                 const std::map<int, cv::Point3f> & words1,
00062                 const std::map<int, cv::Point3f> & words2,
00063                 std::vector<cv::Point3f> & inliers1,
00064                 std::vector<cv::Point3f> & inliers2,
00065                 float maxDepth,
00066                 std::vector<int> * correspondences = 0);
00067 
00068 // remove depth by z axis
00069 void RTABMAP_EXP extractXYZCorrespondences(const std::multimap<int, pcl::PointXYZ> & words1,
00070                                                                           const std::multimap<int, pcl::PointXYZ> & words2,
00071                                                                           pcl::PointCloud<pcl::PointXYZ> & cloud1,
00072                                                                           pcl::PointCloud<pcl::PointXYZ> & cloud2);
00073 
00074 void RTABMAP_EXP extractXYZCorrespondencesRANSAC(const std::multimap<int, pcl::PointXYZ> & words1,
00075                                                                           const std::multimap<int, pcl::PointXYZ> & words2,
00076                                                                           pcl::PointCloud<pcl::PointXYZ> & cloud1,
00077                                                                           pcl::PointCloud<pcl::PointXYZ> & cloud2);
00078 
00079 void RTABMAP_EXP extractXYZCorrespondences(const std::list<std::pair<cv::Point2f, cv::Point2f> > & correspondences,
00080                                                                            const cv::Mat & depthImage1,
00081                                                                            const cv::Mat & depthImage2,
00082                                                                            float cx, float cy,
00083                                                                            float fx, float fy,
00084                                                                            float maxDepth,
00085                                                                            pcl::PointCloud<pcl::PointXYZ> & cloud1,
00086                                                                            pcl::PointCloud<pcl::PointXYZ> & cloud2);
00087 
00088 void RTABMAP_EXP extractXYZCorrespondences(const std::list<std::pair<cv::Point2f, cv::Point2f> > & correspondences,
00089                                                            const pcl::PointCloud<pcl::PointXYZ> & cloud1,
00090                                                            const pcl::PointCloud<pcl::PointXYZ> & cloud2,
00091                                                            pcl::PointCloud<pcl::PointXYZ> & inliers1,
00092                                                            pcl::PointCloud<pcl::PointXYZ> & inliers2,
00093                                                            char depthAxis);
00094 void RTABMAP_EXP extractXYZCorrespondences(const std::list<std::pair<cv::Point2f, cv::Point2f> > & correspondences,
00095                                                            const pcl::PointCloud<pcl::PointXYZRGB> & cloud1,
00096                                                            const pcl::PointCloud<pcl::PointXYZRGB> & cloud2,
00097                                                            pcl::PointCloud<pcl::PointXYZ> & inliers1,
00098                                                            pcl::PointCloud<pcl::PointXYZ> & inliers2,
00099                                                            char depthAxis);
00100 
00101 int RTABMAP_EXP countUniquePairs(const std::multimap<int, pcl::PointXYZ> & wordsA,
00102                                          const std::multimap<int, pcl::PointXYZ> & wordsB);
00103 
00104 void RTABMAP_EXP filterMaxDepth(pcl::PointCloud<pcl::PointXYZ> & inliers1,
00105                                         pcl::PointCloud<pcl::PointXYZ> & inliers2,
00106                                         float maxDepth,
00107                                         char depthAxis,
00108                                         bool removeDuplicates);
00109 
00110 } // namespace util3d
00111 } // namespace rtabmap
00112 
00113 #endif /* UTIL3D_CORRESPONDENCES_H_ */


rtabmap
Author(s): Mathieu Labbe
autogenerated on Sat Jul 23 2016 11:44:28