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 
31 #include <rtabmap/core/rtabmap_core_export.h>
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 
47 void RTABMAP_CORE_EXPORT findCorrespondences(
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 
52 void RTABMAP_CORE_EXPORT findCorrespondences(
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 
60 void RTABMAP_CORE_EXPORT findCorrespondences(
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_CORE_EXPORT 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_CORE_EXPORT 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_CORE_EXPORT 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_CORE_EXPORT 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_CORE_EXPORT 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_CORE_EXPORT countUniquePairs(const std::multimap<int, pcl::PointXYZ> & wordsA,
102  const std::multimap<int, pcl::PointXYZ> & wordsB);
103 
104 void RTABMAP_CORE_EXPORT 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_ */
rtabmap::util3d::filterMaxDepth
void RTABMAP_CORE_EXPORT filterMaxDepth(pcl::PointCloud< pcl::PointXYZ > &inliers1, pcl::PointCloud< pcl::PointXYZ > &inliers2, float maxDepth, char depthAxis, bool removeDuplicates)
Definition: util3d_correspondences.cpp:226
rtabmap::util3d::findCorrespondences
void RTABMAP_CORE_EXPORT findCorrespondences(const std::multimap< int, cv::KeyPoint > &wordsA, const std::multimap< int, cv::KeyPoint > &wordsB, std::list< std::pair< cv::Point2f, cv::Point2f > > &pairs)
Definition: util3d_correspondences.cpp:300
rtabmap::util3d::countUniquePairs
int RTABMAP_CORE_EXPORT countUniquePairs(const std::multimap< int, pcl::PointXYZ > &wordsA, const std::multimap< int, pcl::PointXYZ > &wordsB)
Definition: util3d_correspondences.cpp:209
rtabmap::util3d::extractXYZCorrespondencesRANSAC
void RTABMAP_CORE_EXPORT 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)
Definition: util3d_correspondences.cpp:65
rtabmap::util3d::extractXYZCorrespondences
void RTABMAP_CORE_EXPORT 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)
Definition: util3d_correspondences.cpp:44
rtabmap
Definition: CameraARCore.cpp:35


rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:23