Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef UTIL3D_MOTION_ESTIMATION_H_
00029 #define UTIL3D_MOTION_ESTIMATION_H_
00030
00031 #include <rtabmap/core/RtabmapExp.h>
00032
00033 #include <rtabmap/core/Transform.h>
00034 #include <rtabmap/core/CameraModel.h>
00035
00036 namespace rtabmap
00037 {
00038
00039 namespace util3d
00040 {
00041
00042 Transform RTABMAP_EXP estimateMotion3DTo2D(
00043 const std::map<int, cv::Point3f> & words3A,
00044 const std::map<int, cv::KeyPoint> & words2B,
00045 const CameraModel & cameraModel,
00046 int minInliers = 10,
00047 int iterations = 100,
00048 double reprojError = 5.,
00049 int flagsPnP = 0,
00050 int pnpRefineIterations = 1,
00051 const Transform & guess = Transform::getIdentity(),
00052 const std::map<int, cv::Point3f> & words3B = std::map<int, cv::Point3f>(),
00053 double * varianceOut = 0,
00054 std::vector<int> * matchesOut = 0,
00055 std::vector<int> * inliersOut = 0);
00056
00057 Transform RTABMAP_EXP estimateMotion3DTo3D(
00058 const std::map<int, cv::Point3f> & words3A,
00059 const std::map<int, cv::Point3f> & words3B,
00060 int minInliers = 10,
00061 double inliersDistance = 0.1,
00062 int iterations = 100,
00063 int refineIterations = 5,
00064 double * varianceOut = 0,
00065 std::vector<int> * matchesOut = 0,
00066 std::vector<int> * inliersOut = 0);
00067
00068 void RTABMAP_EXP solvePnPRansac(
00069 const std::vector<cv::Point3f> & objectPoints,
00070 const std::vector<cv::Point2f> & imagePoints,
00071 const cv::Mat & cameraMatrix,
00072 const cv::Mat & distCoeffs,
00073 cv::Mat & rvec,
00074 cv::Mat & tvec,
00075 bool useExtrinsicGuess,
00076 int iterationsCount,
00077 float reprojectionError,
00078 int minInliersCount,
00079 std::vector<int> & inliers,
00080 int flags,
00081 int refineIterations = 1,
00082 float refineSigma = 3.0f);
00083
00084 }
00085 }
00086
00087 #endif