util3d_motion_estimation.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_MOTION_ESTIMATION_H_
29 #define UTIL3D_MOTION_ESTIMATION_H_
30 
32 
33 #include <rtabmap/core/Transform.h>
35 
36 namespace rtabmap
37 {
38 
39 namespace util3d
40 {
41 
43  const std::map<int, cv::Point3f> & words3A,
44  const std::map<int, cv::KeyPoint> & words2B,
45  const CameraModel & cameraModel,
46  int minInliers = 10,
47  int iterations = 100,
48  double reprojError = 5.,
49  int flagsPnP = 0,
50  int pnpRefineIterations = 1,
51  float maxVariance = 0,
52  const Transform & guess = Transform::getIdentity(),
53  const std::map<int, cv::Point3f> & words3B = std::map<int, cv::Point3f>(),
54  cv::Mat * covariance = 0, // mean reproj error if words3B is not set
55  std::vector<int> * matchesOut = 0,
56  std::vector<int> * inliersOut = 0);
57 
59  const std::map<int, cv::Point3f> & words3A,
60  const std::map<int, cv::KeyPoint> & words2B,
61  const std::vector<CameraModel> & cameraModels,
62  int minInliers = 10,
63  int iterations = 100,
64  double reprojError = 5.,
65  int flagsPnP = 0,
66  int pnpRefineIterations = 1,
67  float maxVariance = 0,
68  const Transform & guess = Transform::getIdentity(),
69  const std::map<int, cv::Point3f> & words3B = std::map<int, cv::Point3f>(),
70  cv::Mat * covariance = 0, // mean reproj error if words3B is not set
71  std::vector<int> * matchesOut = 0,
72  std::vector<int> * inliersOut = 0);
73 
75  const std::map<int, cv::Point3f> & words3A,
76  const std::map<int, cv::Point3f> & words3B,
77  int minInliers = 10,
78  double inliersDistance = 0.1,
79  int iterations = 100,
80  int refineIterations = 5,
81  cv::Mat * covariance = 0,
82  std::vector<int> * matchesOut = 0,
83  std::vector<int> * inliersOut = 0);
84 
86  const std::vector<cv::Point3f> & objectPoints,
87  const std::vector<cv::Point2f> & imagePoints,
88  const cv::Mat & cameraMatrix,
89  const cv::Mat & distCoeffs,
90  cv::Mat & rvec,
91  cv::Mat & tvec,
92  bool useExtrinsicGuess,
93  int iterationsCount,
94  float reprojectionError,
95  int minInliersCount,
96  std::vector<int> & inliers,
97  int flags,
98  int refineIterations = 1,
99  float refineSigma = 3.0f);
100 
101 } // namespace util3d
102 } // namespace rtabmap
103 
104 #endif /* UTIL3D_TRANSFORMS_H_ */
static Transform getIdentity()
Definition: Transform.cpp:401
#define RTABMAP_EXP
Definition: RtabmapExp.h:38
Transform RTABMAP_EXP estimateMotion3DTo2D(const std::map< int, cv::Point3f > &words3A, const std::map< int, cv::KeyPoint > &words2B, const CameraModel &cameraModel, int minInliers=10, int iterations=100, double reprojError=5., int flagsPnP=0, int pnpRefineIterations=1, float maxVariance=0, const Transform &guess=Transform::getIdentity(), const std::map< int, cv::Point3f > &words3B=std::map< int, cv::Point3f >(), cv::Mat *covariance=0, std::vector< int > *matchesOut=0, std::vector< int > *inliersOut=0)
Transform RTABMAP_EXP estimateMotion3DTo3D(const std::map< int, cv::Point3f > &words3A, const std::map< int, cv::Point3f > &words3B, int minInliers=10, double inliersDistance=0.1, int iterations=100, int refineIterations=5, cv::Mat *covariance=0, std::vector< int > *matchesOut=0, std::vector< int > *inliersOut=0)
void RTABMAP_EXP solvePnPRansac(const std::vector< cv::Point3f > &objectPoints, const std::vector< cv::Point2f > &imagePoints, const cv::Mat &cameraMatrix, const cv::Mat &distCoeffs, cv::Mat &rvec, cv::Mat &tvec, bool useExtrinsicGuess, int iterationsCount, float reprojectionError, int minInliersCount, std::vector< int > &inliers, int flags, int refineIterations=1, float refineSigma=3.0f)


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