MRPT  2.0.0
ransac_applications.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
12 #include <mrpt/math/TLine2D.h>
13 #include <mrpt/math/TPlane.h>
14 #include <mrpt/math/ransac.h>
15 
16 namespace mrpt::math
17 {
18 using std::vector;
19 
20 /** @addtogroup ransac_grp
21  * @{ */
22 
23 /** @name RANSAC detectors
24  @{
25  */
26 
27 /** Fit a number of 3-D planes to a given point cloud, automatically determining
28  * the number of existing planes by means of the provided threshold and minimum
29  * number of supporting inliers.
30  * \param out_detected_planes The output list of pairs: number of supporting
31  * inliers, detected plane.
32  * \param threshold The maximum distance between a point and a temptative plane
33  * such as the point is considered an inlier.
34  * \param min_inliers_for_valid_plane The minimum number of supporting inliers
35  * to consider a plane as valid.
36  */
37 template <typename NUMTYPE>
39  const CVectorDynamic<NUMTYPE>& x, const CVectorDynamic<NUMTYPE>& y,
40  const CVectorDynamic<NUMTYPE>& 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 CVectorDynamic<NUMTYPE>& x, const CVectorDynamic<NUMTYPE>& y,
57  std::vector<std::pair<size_t, TLine2D>>& out_detected_lines,
58  const double threshold, const size_t min_inliers_for_valid_line = 5);
59 
60 /** A stub for ransac_detect_3D_planes() with the points given as a
61  * mrpt::maps::CPointsMap
62  */
63 template <class POINTSMAP>
65  const POINTSMAP* points_map,
66  std::vector<std::pair<size_t, TPlane>>& out_detected_planes,
67  const double threshold, const size_t min_inliers_for_valid_plane)
68 {
69  CVectorFloat xs, ys, zs;
70  points_map->getAllPoints(xs, ys, zs);
72  xs, ys, zs, out_detected_planes, threshold,
73  min_inliers_for_valid_plane);
74 }
75 
76 /** @} */
77 /** @} */ // end of grouping
78 
79 } // namespace mrpt::math
Template for column vectors of dynamic size, compatible with Eigen.
void ransac_detect_3D_planes(const CVectorDynamic< NUMTYPE > &x, const CVectorDynamic< NUMTYPE > &y, const CVectorDynamic< NUMTYPE > &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...
This base provides a set of functions for maths stuff.
void ransac_detect_2D_lines(const CVectorDynamic< NUMTYPE > &x, const CVectorDynamic< NUMTYPE > &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...



Page generated by Doxygen 1.8.14 for MRPT 2.0.0 Git: b38439d21 Tue Mar 31 19:58:06 2020 +0200 at miƩ abr 1 00:50:30 CEST 2020