util3d_correspondences.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the name of the Universite de Sherbrooke nor the
13  names of its contributors may be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 #ifndef UTIL3D_CORRESPONDENCES_H_
29 #define UTIL3D_CORRESPONDENCES_H_
30 
32 
33 #include <pcl/point_cloud.h>
34 #include <pcl/point_types.h>
35 #include <opencv2/features2d/features2d.hpp>
36 #include <set>
37 #include <map>
38 #include <list>
39 
40 namespace rtabmap
41 {
42 
43 namespace util3d
44 {
45 
46 
48  const std::multimap<int, cv::KeyPoint> & wordsA,
49  const std::multimap<int, cv::KeyPoint> & wordsB,
50  std::list<std::pair<cv::Point2f, cv::Point2f> > & pairs);
51 
53  const std::multimap<int, cv::Point3f> & words1,
54  const std::multimap<int, cv::Point3f> & words2,
55  std::vector<cv::Point3f> & inliers1,
56  std::vector<cv::Point3f> & inliers2,
57  float maxDepth,
58  std::vector<int> * uniqueCorrespondences = 0);
59 
61  const std::map<int, cv::Point3f> & words1,
62  const std::map<int, cv::Point3f> & words2,
63  std::vector<cv::Point3f> & inliers1,
64  std::vector<cv::Point3f> & inliers2,
65  float maxDepth,
66  std::vector<int> * correspondences = 0);
67 
68 // remove depth by z axis
69 void RTABMAP_EXP extractXYZCorrespondences(const std::multimap<int, pcl::PointXYZ> & words1,
70  const std::multimap<int, pcl::PointXYZ> & words2,
71  pcl::PointCloud<pcl::PointXYZ> & cloud1,
72  pcl::PointCloud<pcl::PointXYZ> & cloud2);
73 
74 void RTABMAP_EXP extractXYZCorrespondencesRANSAC(const std::multimap<int, pcl::PointXYZ> & words1,
75  const std::multimap<int, pcl::PointXYZ> & words2,
76  pcl::PointCloud<pcl::PointXYZ> & cloud1,
77  pcl::PointCloud<pcl::PointXYZ> & cloud2);
78 
79 void RTABMAP_EXP extractXYZCorrespondences(const std::list<std::pair<cv::Point2f, cv::Point2f> > & correspondences,
80  const cv::Mat & depthImage1,
81  const cv::Mat & depthImage2,
82  float cx, float cy,
83  float fx, float fy,
84  float maxDepth,
85  pcl::PointCloud<pcl::PointXYZ> & cloud1,
86  pcl::PointCloud<pcl::PointXYZ> & cloud2);
87 
88 void RTABMAP_EXP extractXYZCorrespondences(const std::list<std::pair<cv::Point2f, cv::Point2f> > & correspondences,
89  const pcl::PointCloud<pcl::PointXYZ> & cloud1,
90  const pcl::PointCloud<pcl::PointXYZ> & cloud2,
91  pcl::PointCloud<pcl::PointXYZ> & inliers1,
92  pcl::PointCloud<pcl::PointXYZ> & inliers2,
93  char depthAxis);
94 void RTABMAP_EXP extractXYZCorrespondences(const std::list<std::pair<cv::Point2f, cv::Point2f> > & correspondences,
95  const pcl::PointCloud<pcl::PointXYZRGB> & cloud1,
96  const pcl::PointCloud<pcl::PointXYZRGB> & cloud2,
97  pcl::PointCloud<pcl::PointXYZ> & inliers1,
98  pcl::PointCloud<pcl::PointXYZ> & inliers2,
99  char depthAxis);
100 
101 int RTABMAP_EXP countUniquePairs(const std::multimap<int, pcl::PointXYZ> & wordsA,
102  const std::multimap<int, pcl::PointXYZ> & wordsB);
103 
104 void RTABMAP_EXP filterMaxDepth(pcl::PointCloud<pcl::PointXYZ> & inliers1,
105  pcl::PointCloud<pcl::PointXYZ> & inliers2,
106  float maxDepth,
107  char depthAxis,
108  bool removeDuplicates);
109 
110 } // namespace util3d
111 } // namespace rtabmap
112 
113 #endif /* UTIL3D_CORRESPONDENCES_H_ */
#define RTABMAP_EXP
Definition: RtabmapExp.h:38
void RTABMAP_EXP extractXYZCorrespondencesRANSAC(const std::multimap< int, pcl::PointXYZ > &words1, const std::multimap< int, pcl::PointXYZ > &words2, pcl::PointCloud< pcl::PointXYZ > &cloud1, pcl::PointCloud< pcl::PointXYZ > &cloud2)
void RTABMAP_EXP filterMaxDepth(pcl::PointCloud< pcl::PointXYZ > &inliers1, pcl::PointCloud< pcl::PointXYZ > &inliers2, float maxDepth, char depthAxis, bool removeDuplicates)
void RTABMAP_EXP extractXYZCorrespondences(const std::multimap< int, pcl::PointXYZ > &words1, const std::multimap< int, pcl::PointXYZ > &words2, pcl::PointCloud< pcl::PointXYZ > &cloud1, pcl::PointCloud< pcl::PointXYZ > &cloud2)
int RTABMAP_EXP countUniquePairs(const std::multimap< int, pcl::PointXYZ > &wordsA, const std::multimap< int, pcl::PointXYZ > &wordsB)
void RTABMAP_EXP findCorrespondences(const std::multimap< int, cv::KeyPoint > &wordsA, const std::multimap< int, cv::KeyPoint > &wordsB, std::list< std::pair< cv::Point2f, cv::Point2f > > &pairs)


rtabmap
Author(s): Mathieu Labbe
autogenerated on Mon Jan 23 2023 03:38:58