Main MRPT website > C++ reference for MRPT 1.5.7
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 the number of existing planes by means of the provided threshold and minimum number of supporting inliers.
29  * \param out_detected_planes The output list of pairs: number of supporting inliers, detected plane.
30  * \param threshold The maximum distance between a point and a temptative plane such as the point is considered an inlier.
31  * \param min_inliers_for_valid_plane The minimum number of supporting inliers to consider a plane as valid.
32  */
33  template <typename NUMTYPE>
35  const Eigen::Matrix<NUMTYPE,Eigen::Dynamic,1> &x,
36  const Eigen::Matrix<NUMTYPE,Eigen::Dynamic,1> &y,
37  const Eigen::Matrix<NUMTYPE,Eigen::Dynamic,1> &z,
38  std::vector<std::pair<size_t,TPlane> > &out_detected_planes,
39  const double threshold,
40  const size_t min_inliers_for_valid_plane = 10
41  );
42 
43  /** Fit a number of 2-D lines to a given point cloud, automatically determining the number of existing lines by means of the provided threshold and minimum number of supporting inliers.
44  * \param out_detected_lines The output list of pairs: number of supporting inliers, detected line.
45  * \param threshold The maximum distance between a point and a temptative line such as the point is considered an inlier.
46  * \param min_inliers_for_valid_line The minimum number of supporting inliers to consider a line as valid.
47  */
48  template <typename NUMTYPE>
50  const Eigen::Matrix<NUMTYPE,Eigen::Dynamic,1> &x,
51  const Eigen::Matrix<NUMTYPE,Eigen::Dynamic,1> &y,
52  std::vector<std::pair<size_t,TLine2D> > &out_detected_lines,
53  const double threshold,
54  const size_t min_inliers_for_valid_line = 5
55  );
56 
57 
58  /** A stub for ransac_detect_3D_planes() with the points given as a mrpt::maps::CPointsMap
59  */
60  template <class POINTSMAP>
62  const POINTSMAP * points_map,
63  std::vector<std::pair<size_t,TPlane> > &out_detected_planes,
64  const double threshold,
65  const size_t min_inliers_for_valid_plane
66  )
67  {
68  CVectorFloat xs,ys,zs;
69  points_map->getAllPoints(xs,ys,zs);
70  ransac_detect_3D_planes(xs,ys,zs,out_detected_planes,threshold,min_inliers_for_valid_plane);
71  }
72 
73  /** @} */
74  /** @} */ // end of grouping
75 
76  } // End of namespace
77 } // End of namespace
78 
79 #endif
GLdouble GLdouble z
Definition: glext.h:3734
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction...
Definition: eigen_frwds.h:35
void BASE_IMPEXP 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...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
GLenum GLint GLint y
Definition: glext.h:3516
GLenum GLint x
Definition: glext.h:3516
void BASE_IMPEXP 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...



Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019