CGAL 5.2.1 - Shape Detection
Shape Detection Reference

shapes_detail.png
Sven Oesau, Yannick Verdie, Clément Jamin, Pierre Alliez, Florent Lafarge, Simon Giraudot, Thien Hoang, and Dmitry Anisimov
This package implements the Efficient RANSAC (RANdom SAmple Consensus) approach for detecting arbitrary shapes in an unorganized point set with unoriented normals and the Region Growing approach for detecting shapes in a set of arbitrary items. With the Efficient RANSAC approach, five canonical shapes can be detected: planes, spheres, cylinders, cones, and tori. Additional shapes can be detected, given a custom shape class by the user. For the Region Growing approach, this package provides three particular shape detection components: detecting lines in a 2D point set, detecting planes in a 3D point set, and detecting planes on a polygon mesh.
Introduced in: CGAL 4.7
BibTeX: cgal:ovja-pssd-21a
License: GPL
Windows Demo: Polyhedron demo
Common Demo Dlls: dlls

Classified Reference Pages

Efficient RANSAC

Concepts

Algorithm

Shapes

Shape Interface

Property Maps

Region Growing

Concepts

Algorithm

Point Set

Polygon Mesh

Deprecated Components

Functions

Modules

 Region Growing
 Reference Manual for the Region Growing shape detection component.
 
 Efficient RANSAC
 Reference Manual for the Efficient RANSAC shape detection component.
 
 Deprecated
 Deprecated components.
 

Functions

template<typename PointRange , typename PointMap , typename PlaneRange , typename PlaneMap , typename IndexMap , typename Kernel >
void CGAL::regularize_planes (const PointRange &points, PointMap point_map, PlaneRange &planes, PlaneMap plane_map, IndexMap index_map, const Kernel &, bool regularize_parallelism, bool regularize_orthogonality, bool regularize_coplanarity, bool regularize_axis_symmetry, double tolerance_angle=25.0, double tolerance_coplanarity=0.01, typename Kernel::Vector_3 symmetry_direction=typename Kernel::Vector_3(0.0, 0.0, 1.0))
 Given a set of detected planes with their corresponding inlier sets, this function enables to regularize the planes: More...
 

Function Documentation

◆ regularize_planes()

template<typename PointRange , typename PointMap , typename PlaneRange , typename PlaneMap , typename IndexMap , typename Kernel >
void CGAL::regularize_planes ( const PointRange &  points,
PointMap  point_map,
PlaneRange &  planes,
PlaneMap  plane_map,
IndexMap  index_map,
const Kernel ,
bool  regularize_parallelism,
bool  regularize_orthogonality,
bool  regularize_coplanarity,
bool  regularize_axis_symmetry,
double  tolerance_angle = 25.0,
double  tolerance_coplanarity = 0.01,
typename Kernel::Vector_3  symmetry_direction = typename Kernel::Vector_3 (0.0, 0.0, 1.0) 
)

#include <CGAL/Regularization/regularize_planes.h>

Given a set of detected planes with their corresponding inlier sets, this function enables to regularize the planes:

  • Planes near parallel can be made exactly parallel;
  • Planes near orthogonal can be made exactly orthogonal;
  • Planes parallel and near coplanar can be made exactly coplanar;
  • Planes near symmetrical with a user-defined axis can be made exactly symmetrical.

Planes are directly modified. Points are left unaltered, as well as their relationships to planes (no transfer of point from a primitive plane to another).

The implementation follows [3].

Template Parameters
PointRangemust be a model of ConstRange with points.
PointPMapmust be a model of ReadablePropertyMap with value type Kernel::Point_3. It can be omitted if the value type of the iterator of PointRange is convertible to Point_3<Kernel>.
PlaneRangemust be a model of Range with planes.
PlaneMapmust be a model of WritablePropertyMap with value type Kernel::Plane_3. It can be omitted if the value type of the iterator of PlaneRange is convertible to Plane_3<Kernel>.
IndexMapmust be a model of ReadablePropertyMap with value type int.
Kernelmust be a geometric traits class. It can be omitted and deduced automatically from the value type of PointMap.
Parameters
pointsConstRange of points
point_mapproperty map: value_type of typename PointRange::const_iterator -> Point_3
planesrange of planes
plane_mapproperty map: value_type of typename PlaneRange::iterator -> Plane_3
index_mapproperty map: index of point std::size_t -> index of plane int (-1 if the point is not assigned to a plane)
regularize_parallelismselect whether parallelism is regularized or not
regularize_orthogonalityselect whether orthogonality is regularized or not
regularize_coplanarityselect whether coplanarity is regularized or not
regularize_axis_symmetryselect whether axis symmetry is regularized or not
tolerance_angletolerance of deviation between normal vectors of planes (in degrees) used for parallelism, orthogonality, and axis symmetry. Default value is 25 degrees.
tolerance_coplanaritymaximal distance between two parallel planes such that they are considered coplanar. Default value is 0.01.
symmetry_directionchosen axis for symmetry regularization. Default value is the Z axis.
Examples:
Shape_detection/efficient_RANSAC_and_plane_regularization.cpp.