plane_fitting_ransac.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <optional>
4 
5 #include <Eigen/Geometry>
6 
7 #include <pcl/point_types.h>
8 #include <pcl/point_cloud.h>
9 #include <pcl/PointIndices.h>
10 
11 
12 // This header exposes minimal includes. For templates, include *.hpp.
13 
14 
15 namespace Eigen
16 {
17  using Hyperplane3f = Hyperplane<float, 3>;
18 }
19 
20 
21 namespace visionx::tools
22 {
23 
25  {
26  pcl::PointIndices::Ptr inliers;
27  Eigen::Hyperplane3f plane = Eigen::Hyperplane3f(Eigen::Vector3f::UnitZ(), 0);
28  };
29 
30 
31 #define DECLARE_fitPlaneRansac_PointT(PointT) \
32  std::optional<PlaneFittingResult> fitPlaneRansac( \
33  pcl::PointCloud< PointT >::Ptr cloud, double distanceThreshold = 1.0, \
34  pcl::PointIndices::Ptr indices = nullptr)
35 
36 
37  DECLARE_fitPlaneRansac_PointT(pcl::PointXYZ);
38  DECLARE_fitPlaneRansac_PointT(pcl::PointXYZRGB);
39  DECLARE_fitPlaneRansac_PointT(pcl::PointXYZRGBA);
40  DECLARE_fitPlaneRansac_PointT(pcl::PointXYZRGBL);
41 
42 
43 #undef DECLARE_fitPlaneRansac_PointT
44 
45 }
Eigen
Definition: Elements.h:36
visionx::tools
Definition: PCLUtilities.cpp:4
Eigen::Hyperplane3f
Hyperplane< float, 3 > Hyperplane3f
Definition: Elements.h:38
visionx::tools::PlaneFittingResult::inliers
pcl::PointIndices::Ptr inliers
Definition: plane_fitting_ransac.h:26
visionx::tools::PlaneFittingResult::plane
Eigen::Hyperplane3f plane
Definition: plane_fitting_ransac.h:27
visionx::tools::PlaneFittingResult
Definition: plane_fitting_ransac.h:24
visionx::tools::DECLARE_fitPlaneRansac_PointT
DECLARE_fitPlaneRansac_PointT(pcl::PointXYZ)