CGAL 5.0.3 - Classification
|
#include <CGAL/Classification/Mesh_feature_generator.h>
Generates a set of generic features for surface mesh classification.
This class takes care of computing and storing all necessary data structures and of generating a set of generic features at multiple scales to increase the reliability of the classification.
A PointMap
is required: this map should associate each face of the mesh to a representative point (for example, the center of mass of the face). It is used to generate point set features by considering the mesh as a point set.
GeomTraits | model of CGAL Kernel. |
FaceListGraph | model of FaceListGraph . |
PointMap | model of ReadablePropertyMap whose key type is boost::graph_traits<FaceListGraph>::face_descriptor and value type is GeomTraits::Point_3 . |
ConcurrencyTag | enables sequential versus parallel computation of CGAL::Classification::Local_eigen_analysis objects. Possible values are Parallel_tag (default value is CGAL is linked with TBB) or Sequential_tag (default value otherwise). |
DiagonalizeTraits | model of DiagonalizeTraits used for matrix diagonalization. It can be omitted: if Eigen 3 (or greater) is available and CGAL_EIGEN3_ENABLED is defined then an overload using Eigen_diagonalize_traits is provided. Otherwise, the internal implementation Diagonalize_traits is used. |
Public Types | |
typedef GeomTraits::Iso_cuboid_3 | Iso_cuboid_3 |
typedef Classification::Planimetric_grid< GeomTraits, Face_range, PointMap > | Planimetric_grid |
typedef Classification::Mesh_neighborhood< FaceListGraph > | Neighborhood |
typedef Classification::Local_eigen_analysis | Local_eigen_analysis |
Constructor | |
Mesh_feature_generator (const FaceListGraph &input, PointMap point_map, std::size_t nb_scales, float voxel_size=-1.f) | |
Initializes a feature generator from an input range. More... | |
Feature Generation | |
void | generate_face_based_features (Feature_set &features) |
Generate geometric features based on face information. More... | |
void | generate_point_based_features (Feature_set &features) |
Generate geometric features based on point position information. More... | |
Data Structures Access | |
const Iso_cuboid_3 & | bbox () const |
Returns the bounding box of the input point set. | |
const Neighborhood & | neighborhood (std::size_t scale=0) const |
Returns the neighborhood structure at scale scale . | |
const Planimetric_grid & | grid (std::size_t scale=0) const |
Returns the planimetric grid structure at scale scale . | |
const Local_eigen_analysis & | eigen (std::size_t scale=0) const |
Returns the local eigen analysis structure at scale scale . | |
Parameters | |
std::size_t | number_of_scales () const |
Returns the number of scales that were computed. | |
float | grid_resolution (std::size_t scale=0) const |
Returns the grid resolution at scale scale . More... | |
float | radius_neighbors (std::size_t scale=0) const |
Returns the radius used for neighborhood queries at scale scale . More... | |
float | radius_dtm (std::size_t scale=0) const |
Returns the radius used for digital terrain modeling at scale scale . More... | |
CGAL::Classification::Mesh_feature_generator< GeomTraits, FaceListGraph, PointMap, ConcurrencyTag, DiagonalizeTraits >::Mesh_feature_generator | ( | const FaceListGraph & | input, |
PointMap | point_map, | ||
std::size_t | nb_scales, | ||
float | voxel_size = -1.f |
||
) |
Initializes a feature generator from an input range.
If not provided by the user, The size of the smallest scale is automatically estimated using a method equivalent to CGAL::compute_average_spacing()
using 6 neighbors. The data structures needed (Neighborhood
, Planimetric_grid
and Local_eigen_analysis
) are computed at nb_scales
recursively larger scales.
input | input mesh. |
point_map | property map to access a representative point of each face. |
nb_scales | number of scales to compute. |
voxel_size | smallest scale used as a voxel size for the planimetric grid (if the default value -1 is used, its value is automatically estimated). |
void CGAL::Classification::Mesh_feature_generator< GeomTraits, FaceListGraph, PointMap, ConcurrencyTag, DiagonalizeTraits >::generate_face_based_features | ( | Feature_set & | features | ) |
Generate geometric features based on face information.
At each scale, the following features are generated:
CGAL::Classification::Feature::Eigenvalue
with indices 0, 1 and 2CGAL::Classification::Feature::Verticality
based on eigenvaluesfeatures | the feature set where the features are instantiated. |
void CGAL::Classification::Mesh_feature_generator< GeomTraits, FaceListGraph, PointMap, ConcurrencyTag, DiagonalizeTraits >::generate_point_based_features | ( | Feature_set & | features | ) |
Generate geometric features based on point position information.
At each scale, the following features are generated by considering the mesh as a point cloud through PointMap
:
CGAL::Classification::Feature::Distance_to_plane
CGAL::Classification::Feature::Elevation
CGAL::Classification::Feature::Height_above
CGAL::Classification::Feature::Height_below
CGAL::Classification::Feature::Vertical_dispersion
CGAL::Classification::Feature::Vertical_range
features | the feature set where the features are instantiated. |
float CGAL::Classification::Mesh_feature_generator< GeomTraits, FaceListGraph, PointMap, ConcurrencyTag, DiagonalizeTraits >::grid_resolution | ( | std::size_t | scale = 0 | ) | const |
Returns the grid resolution at scale scale
.
This resolution is the length and width of a cell of the Planimetric_grid
defined at this scale.
float CGAL::Classification::Mesh_feature_generator< GeomTraits, FaceListGraph, PointMap, ConcurrencyTag, DiagonalizeTraits >::radius_dtm | ( | std::size_t | scale = 0 | ) | const |
Returns the radius used for digital terrain modeling at scale scale
.
This radius represents the minimum size of a building at this scale.
float CGAL::Classification::Mesh_feature_generator< GeomTraits, FaceListGraph, PointMap, ConcurrencyTag, DiagonalizeTraits >::radius_neighbors | ( | std::size_t | scale = 0 | ) | const |
Returns the radius used for neighborhood queries at scale scale
.
This radius is the smallest radius that is relevant from a geometric point of view at this scale (that is to say that encloses a few cells of Planimetric_grid
).