Main MRPT website > C++ reference for 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-2017, 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
16 {
17 namespace math
18 {
19 using std::vector;
20 
21 /** @addtogroup ransac_grp
22  * @{ */
23 
24 /** @name RANSAC detectors
25  @{
26  */
27 
28 /** Fit a number of 3-D planes to a given point cloud, automatically determining
29  * the number of existing planes by means of the provided threshold and minimum
30  * number of supporting inliers.
31  * \param out_detected_planes The output list of pairs: number of supporting
32  * inliers, detected plane.
33  * \param threshold The maximum distance between a point and a temptative plane
34  * such as the point is considered an inlier.
35  * \param min_inliers_for_valid_plane The minimum number of supporting inliers
36  * to consider a plane as valid.
37  */
38 template <typename NUMTYPE>
40  const Eigen::Matrix<NUMTYPE, Eigen::Dynamic, 1>& x,
41  const Eigen::Matrix<NUMTYPE, Eigen::Dynamic, 1>& y,
42  const Eigen::Matrix<NUMTYPE, Eigen::Dynamic, 1>& z,
43  std::vector<std::pair<size_t, TPlane>>& out_detected_planes,
44  const double threshold, const size_t min_inliers_for_valid_plane = 10);
45 
46 /** Fit a number of 2-D lines to a given point cloud, automatically determining
47  * the number of existing lines by means of the provided threshold and minimum
48  * number of supporting inliers.
49  * \param out_detected_lines The output list of pairs: number of supporting
50  * inliers, detected line.
51  * \param threshold The maximum distance between a point and a temptative line
52  * such as the point is considered an inlier.
53  * \param min_inliers_for_valid_line The minimum number of supporting inliers
54  * to consider a line as valid.
55  */
56 template <typename NUMTYPE>
58  const Eigen::Matrix<NUMTYPE, Eigen::Dynamic, 1>& x,
59  const Eigen::Matrix<NUMTYPE, Eigen::Dynamic, 1>& y,
60  std::vector<std::pair<size_t, TLine2D>>& out_detected_lines,
61  const double threshold, const size_t min_inliers_for_valid_line = 5);
62 
63 /** A stub for ransac_detect_3D_planes() with the points given as a
64  * mrpt::maps::CPointsMap
65  */
66 template <class POINTSMAP>
68  const POINTSMAP* points_map,
69  std::vector<std::pair<size_t, TPlane>>& out_detected_planes,
70  const double threshold, const size_t min_inliers_for_valid_plane)
71 {
72  CVectorFloat xs, ys, zs;
73  points_map->getAllPoints(xs, ys, zs);
75  xs, ys, zs, out_detected_planes, threshold,
76  min_inliers_for_valid_plane);
77 }
78 
79 /** @} */
80 /** @} */ // end of grouping
81 
82 } // End of namespace
83 } // End of namespace
84 
85 #endif
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
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...
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction...
Definition: eigen_frwds.h:42
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
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: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019