MRPT  1.9.9
ransac_applications.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #ifndef ransac_optimizers_H
10 #define ransac_optimizers_H
11 
12 #include <mrpt/math/ransac.h>
13 #include <mrpt/math/geometry.h>
14 
15 namespace mrpt::math
16 {
17 using std::vector;
18 
19 /** @addtogroup ransac_grp
20  * @{ */
21 
22 /** @name RANSAC detectors
23  @{
24  */
25 
26 /** Fit a number of 3-D planes to a given point cloud, automatically determining
27  * the number of existing planes by means of the provided threshold and minimum
28  * number of supporting inliers.
29  * \param out_detected_planes The output list of pairs: number of supporting
30  * inliers, detected plane.
31  * \param threshold The maximum distance between a point and a temptative plane
32  * such as the point is considered an inlier.
33  * \param min_inliers_for_valid_plane The minimum number of supporting inliers
34  * to consider a plane as valid.
35  */
36 template <typename NUMTYPE>
38  const Eigen::Matrix<NUMTYPE, Eigen::Dynamic, 1>& x,
39  const Eigen::Matrix<NUMTYPE, Eigen::Dynamic, 1>& y,
40  const Eigen::Matrix<NUMTYPE, Eigen::Dynamic, 1>& z,
41  std::vector<std::pair<size_t, TPlane>>& out_detected_planes,
42  const double threshold, const size_t min_inliers_for_valid_plane = 10);
43 
44 /** Fit a number of 2-D lines to a given point cloud, automatically determining
45  * the number of existing lines by means of the provided threshold and minimum
46  * number of supporting inliers.
47  * \param out_detected_lines The output list of pairs: number of supporting
48  * inliers, detected line.
49  * \param threshold The maximum distance between a point and a temptative line
50  * such as the point is considered an inlier.
51  * \param min_inliers_for_valid_line The minimum number of supporting inliers
52  * to consider a line as valid.
53  */
54 template <typename NUMTYPE>
56  const Eigen::Matrix<NUMTYPE, Eigen::Dynamic, 1>& x,
57  const Eigen::Matrix<NUMTYPE, Eigen::Dynamic, 1>& y,
58  std::vector<std::pair<size_t, TLine2D>>& out_detected_lines,
59  const double threshold, const size_t min_inliers_for_valid_line = 5);
60 
61 /** A stub for ransac_detect_3D_planes() with the points given as a
62  * mrpt::maps::CPointsMap
63  */
64 template <class POINTSMAP>
66  const POINTSMAP* points_map,
67  std::vector<std::pair<size_t, TPlane>>& out_detected_planes,
68  const double threshold, const size_t min_inliers_for_valid_plane)
69 {
70  CVectorFloat xs, ys, zs;
71  points_map->getAllPoints(xs, ys, zs);
73  xs, ys, zs, out_detected_planes, threshold,
74  min_inliers_for_valid_plane);
75 }
76 
77 /** @} */
78 /** @} */ // end of grouping
79 
80 }
81 #endif
82 
83 
void ransac_detect_3D_planes(const Eigen::Matrix< NUMTYPE, Eigen::Dynamic, 1 > &x, const Eigen::Matrix< NUMTYPE, Eigen::Dynamic, 1 > &y, const Eigen::Matrix< NUMTYPE, Eigen::Dynamic, 1 > &z, std::vector< std::pair< size_t, TPlane >> &out_detected_planes, const double threshold, const size_t min_inliers_for_valid_plane=10)
Fit a number of 3-D planes to a given point cloud, automatically determining the number of existing p...
GLdouble GLdouble z
Definition: glext.h:3872
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction...
Definition: eigen_frwds.h:44
This base provides a set of functions for maths stuff.
void ransac_detect_2D_lines(const Eigen::Matrix< NUMTYPE, Eigen::Dynamic, 1 > &x, const Eigen::Matrix< NUMTYPE, Eigen::Dynamic, 1 > &y, std::vector< std::pair< size_t, TLine2D >> &out_detected_lines, const double threshold, const size_t min_inliers_for_valid_line=5)
Fit a number of 2-D lines to a given point cloud, automatically determining the number of existing li...
GLenum GLint GLint y
Definition: glext.h:3538
GLenum GLint x
Definition: glext.h:3538



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020