Easy3D 2.6.1
|
Extract primitives from point clouds using RANSAC.Usage example: More...
#include <easy3d/algo/point_cloud_ransac.h>
Classes | |
struct | CylinderPrim |
Information about a cylinder primitive. More... | |
struct | PlanePrim |
Information about a plane primitive. More... | |
Public Types | |
enum | PrimType { PLANE = 0 , SPHERE = 1 , CYLINDER = 2 , CONE = 3 , TORUS = 4 , UNKNOWN = -1 } |
The primitive types that can be extracted. More... | |
Public Member Functions | |
void | add_primitive_type (PrimType t) |
Set up the primitive types to be extracted. | |
void | remove_primitive_type (PrimType t) |
Exclude a primitive types to be extracted. | |
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. | |
int | detect (PointCloud *cloud, const std::vector< int > &vertices, 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 subset of a point cloud. | |
const std::vector< PlanePrim > & | get_planes () const |
Get the detected planes. | |
const std::vector< CylinderPrim > & | get_cylinders () const |
Extract primitives from point clouds using RANSAC.
Usage example:
Todo: (1) redesign the APIs (2) allow all five types of primitives (and support parameters)
enum PrimType |
void add_primitive_type | ( | PrimType | t | ) |
Set up the primitive types to be extracted.
This is done by adding the interested primitive types one by one.
int detect | ( | PointCloud * | cloud, |
const std::vector< int > & | vertices, | ||
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 subset of a point cloud.
The extracted primitives are stored as per-vertex properties:
cloud | The input point cloud. |
vertices | The indices of the subset of the input point cloud. |
min_support | The minimal number of points required for a primitive. |
dist_threshold | The distance threshold, defined relative to the bounding box's max dimension. |
bitmap_resolution | The bitmap resolution, defined relative to the bounding box width. |
normal_threshold | The cosine of the maximal normal deviation. |
overlook_probability | The probability with which a primitive is overlooked. |
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.
The extracted primitives are stored as properties:
cloud | The input point cloud. |
min_support | The minimal number of points required for a primitive. |
dist_threshold | The distance threshold, defined relative to the bounding box's max dimension. |
bitmap_resolution | The bitmap resolution, defined relative to the bounding box width. |
normal_threshold | The cosine of the maximal normal deviation. |
overlook_probability | The probability with which a primitive is overlooked. |
|
inline |
Get the detected cylinders.
void remove_primitive_type | ( | PrimType | t | ) |
Exclude a primitive types to be extracted.
This is done by removing the primitive type from the existing list.