27#ifndef EASY3D_ALGO_POINT_CLOUD_RANSAC_H
28#define EASY3D_ALGO_POINT_CLOUD_RANSAC_H
31#include <easy3d/core/types.h>
92 unsigned int min_support = 1000,
93 float dist_threshold = 0.005f,
94 float bitmap_resolution = 0.02f,
95 float normal_threshold = 0.8f,
96 float overlook_probability = 0.001f
119 const std::vector<int> &vertices,
120 unsigned int min_support = 1000,
121 float dist_threshold = 0.005f,
122 float bitmap_resolution = 0.02f,
123 float normal_threshold = 0.8f,
124 float overlook_probability = 0.001f
140 const std::vector<PlanePrim>&
get_planes()
const {
return plane_primitives_; }
155 const std::vector<CylinderPrim>&
get_cylinders()
const {
return cylinder_primitives_; }
158 std::set<PrimType> types_;
160 std::vector<PlanePrim> plane_primitives_;
161 std::vector<CylinderPrim> cylinder_primitives_;
A data structure for point clouds.
Definition point_cloud.h:45
Extract primitives from point clouds using RANSAC.Usage example:
Definition point_cloud_ransac.h:52
int detect(PointCloud *cloud, unsigned int min_support=1000, float dist_threshold=0.005f, float bitmap_resolution=0.02f, float normal_threshold=0.8f, float overlook_probability=0.001f)
Extract primitives from a point cloud.
Definition point_cloud_ransac.cpp:242
const std::vector< CylinderPrim > & get_cylinders() const
Definition point_cloud_ransac.h:155
void add_primitive_type(PrimType t)
Set up the primitive types to be extracted.
Definition point_cloud_ransac.cpp:232
void remove_primitive_type(PrimType t)
Exclude a primitive types to be extracted.
Definition point_cloud_ransac.cpp:237
const std::vector< PlanePrim > & get_planes() const
Get the detected planes.
Definition point_cloud_ransac.h:140
PrimType
The primitive types that can be extracted.
Definition point_cloud_ransac.h:55
@ TORUS
Torus primitive.
Definition point_cloud_ransac.h:60
@ PLANE
Plane primitive.
Definition point_cloud_ransac.h:56
@ UNKNOWN
Unknown primitive.
Definition point_cloud_ransac.h:61
@ CYLINDER
Cylinder primitive.
Definition point_cloud_ransac.h:58
@ CONE
Cone primitive.
Definition point_cloud_ransac.h:59
@ SPHERE
Sphere primitive.
Definition point_cloud_ransac.h:57
Definition collider.cpp:182
Vec< 3, float > vec3
A 3D point/vector of float type.
Definition types.h:44
GenericPlane< float > Plane3
A 3D plane of float type.
Definition types.h:103
Information about a cylinder primitive.
Definition point_cloud_ransac.h:145
vec3 position
the position of the cylinder (represented by the center of the bottom circle)
Definition point_cloud_ransac.h:149
int primitive_index
the index of this cylinder (w.r.t. the entire list of detected primitives)
Definition point_cloud_ransac.h:146
float radius
the radius of the cylinder
Definition point_cloud_ransac.h:148
std::vector< int > vertices
the vertex indices (w.r.t. the point cloud) of this cylinder
Definition point_cloud_ransac.h:147
vec3 direction
the direction of the cylinder
Definition point_cloud_ransac.h:150
Information about a plane primitive.
Definition point_cloud_ransac.h:130
vec3 position
the position of the plane (represented by a point on the plane)
Definition point_cloud_ransac.h:134
int primitive_index
the index of this plane (w.r.t. the entire list of detected primitives)
Definition point_cloud_ransac.h:131
vec3 normal
the normal of the plane
Definition point_cloud_ransac.h:135
std::vector< int > vertices
the vertex indices (w.r.t. the point cloud) of this plane
Definition point_cloud_ransac.h:132
Plane3 plane
the plane representation
Definition point_cloud_ransac.h:133