RTAB-Map 0.23.10
Real-Time Appearance-Based Mapping
Loading...
Searching...
No Matches
util3d_features.h
1/*
2Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without
6modification, 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
16THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23ON 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
25SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*/
27
28#ifndef UTIL3D_FEATURES_H_
29#define UTIL3D_FEATURES_H_
30
31#include <rtabmap/core/rtabmap_core_export.h>
32
33#include <opencv2/core/version.hpp>
34#if CV_MAJOR_VERSION < 5
35#include <opencv2/calib3d/calib3d.hpp>
36#else
37#include <opencv2/calib.hpp>
38#endif
39#include <rtabmap/core/Transform.h>
40#include <rtabmap/core/CameraModel.h>
41#include <rtabmap/core/StereoCameraModel.h>
42#include <list>
43#include <map>
44
45namespace rtabmap
46{
47
48namespace util3d
49{
50
75std::vector<cv::Point3f> RTABMAP_CORE_EXPORT generateKeypoints3DDepth(
76 const std::vector<cv::KeyPoint> & keypoints,
77 const cv::Mat & depth,
78 const std::vector<CameraModel> & cameraModels,
79 float minDepth = 0,
80 float maxDepth = 0);
86std::vector<cv::Point3f> RTABMAP_CORE_EXPORT generateKeypoints3DDepth(
87 const std::vector<cv::KeyPoint> & keypoints,
88 const cv::Mat & depth,
89 const CameraModel & cameraModel,
90 float minDepth = 0,
91 float maxDepth = 0);
92
116std::vector<cv::Point3f> RTABMAP_CORE_EXPORT generateKeypoints3DDisparity(
117 const std::vector<cv::KeyPoint> & keypoints,
118 const cv::Mat & disparity,
119 const StereoCameraModel & stereoCameraModel,
120 float minDepth = 0,
121 float maxDepth = 0);
122
153std::vector<cv::Point3f> RTABMAP_CORE_EXPORT generateKeypoints3DStereo(
154 const std::vector<cv::Point2f> & leftCorners,
155 const std::vector<cv::Point2f> & rightCorners,
156 const StereoCameraModel & model,
157 const std::vector<unsigned char> & mask = std::vector<unsigned char>(),
158 float minDepth = 0,
159 float maxDepth = 0);
160
161std::map<int, cv::Point3f> RTABMAP_CORE_EXPORT generateWords3DMono(
162 const std::map<int, cv::KeyPoint> & kpts,
163 const std::map<int, cv::KeyPoint> & previousKpts,
164 const CameraModel & cameraModel,
165 Transform & cameraTransform,
166 float ransacReprojThreshold = 3.0f,
167 float ransacConfidence = 0.99f,
168 int varianceMedianRatio = 4,
169 const std::map<int, cv::Point3f> & refGuess3D = std::map<int, cv::Point3f>(),
170 double * variance = 0,
171 std::vector<int> * matchesOut = 0);
172
190std::multimap<int, cv::KeyPoint> RTABMAP_CORE_EXPORT aggregate(
191 const std::list<int> & wordIds,
192 const std::vector<cv::KeyPoint> & keypoints);
193
194} // namespace util3d
195} // namespace rtabmap
196
197#endif /* UTIL3D_FEATURES_H_ */
Represents a pinhole camera model containing intrinsic and extrinsic parameters, used for projection,...
Definition CameraModel.h:53
A class representing a calibrated stereo camera system.
Represents a 3D rigid body transformation (rotation + translation).
Definition Transform.h:53
std::vector< cv::Point3f > RTABMAP_CORE_EXPORT generateKeypoints3DDepth(const std::vector< cv::KeyPoint > &keypoints, const cv::Mat &depth, const std::vector< CameraModel > &cameraModels, float minDepth=0, float maxDepth=0)
Projects 2D keypoints to 3D space using the provided depth image and camera models.
std::vector< cv::Point3f > RTABMAP_CORE_EXPORT generateKeypoints3DStereo(const std::vector< cv::Point2f > &leftCorners, const std::vector< cv::Point2f > &rightCorners, const StereoCameraModel &model, const std::vector< unsigned char > &mask=std::vector< unsigned char >(), float minDepth=0, float maxDepth=0)
Computes 3D keypoints from corresponding 2D points in a stereo image pair.
std::multimap< int, cv::KeyPoint > RTABMAP_CORE_EXPORT aggregate(const std::list< int > &wordIds, const std::vector< cv::KeyPoint > &keypoints)
Aggregates word IDs and corresponding keypoints into a multimap.
std::vector< cv::Point3f > RTABMAP_CORE_EXPORT generateKeypoints3DDisparity(const std::vector< cv::KeyPoint > &keypoints, const cv::Mat &disparity, const StereoCameraModel &stereoCameraModel, float minDepth=0, float maxDepth=0)
Projects 2D keypoints into 3D space using a disparity image and a stereo camera model.