CGAL 5.1.2 - Classification
CGAL::Classification::Mesh_feature_generator< GeomTraits, FaceListGraph, PointMap, ConcurrencyTag, DiagonalizeTraits > Class Template Reference

#include <CGAL/Classification/Mesh_feature_generator.h>

Definition

template<typename GeomTraits, typename FaceListGraph, typename PointMap, typename ConcurrencyTag, typename DiagonalizeTraits = CGAL::Default_diagonalize_traits<float,3>>
class CGAL::Classification::Mesh_feature_generator< GeomTraits, FaceListGraph, PointMap, ConcurrencyTag, DiagonalizeTraits >

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.

Warning
The generated features use data structures that are stored inside the generator. For this reason, the generator should be instantiated within the same scope as the feature set and should not be deleted before the feature set.
Template Parameters
GeomTraitsmodel of CGAL Kernel.
FaceListGraphmodel of FaceListGraph.
PointMapmodel of ReadablePropertyMap whose key type is boost::graph_traits<FaceListGraph>::face_descriptor and value type is GeomTraits::Point_3.
ConcurrencyTagenables sequential versus parallel computation of CGAL::Classification::Local_eigen_analysis objects. Possible values are Parallel_tag (default value if CGAL is linked with TBB) or Sequential_tag (default value otherwise).
DiagonalizeTraitsmodel 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< FaceListGraphNeighborhood
 
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_3bbox () const
 Returns the bounding box of the input point set.
 
const Neighborhoodneighborhood (std::size_t scale=0) const
 Returns the neighborhood structure at scale scale.
 
const Planimetric_gridgrid (std::size_t scale=0) const
 Returns the planimetric grid structure at scale scale.
 
const Local_eigen_analysiseigen (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...
 

Constructor & Destructor Documentation

◆ Mesh_feature_generator()

template<typename GeomTraits , typename FaceListGraph , typename PointMap , typename ConcurrencyTag , typename DiagonalizeTraits = CGAL::Default_diagonalize_traits<float,3>>
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.

Parameters
inputinput mesh.
point_mapproperty map to access a representative point of each face.
nb_scalesnumber of scales to compute.
voxel_sizesmallest scale used as a voxel size for the planimetric grid (if the default value -1 is used, its value is automatically estimated).

Member Function Documentation

◆ generate_face_based_features()

template<typename GeomTraits , typename FaceListGraph , typename PointMap , typename ConcurrencyTag , typename DiagonalizeTraits = CGAL::Default_diagonalize_traits<float,3>>
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:

Parameters
featuresthe feature set where the features are instantiated.

◆ generate_point_based_features()

template<typename GeomTraits , typename FaceListGraph , typename PointMap , typename ConcurrencyTag , typename DiagonalizeTraits = CGAL::Default_diagonalize_traits<float,3>>
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:

Parameters
featuresthe feature set where the features are instantiated.

◆ grid_resolution()

template<typename GeomTraits , typename FaceListGraph , typename PointMap , typename ConcurrencyTag , typename DiagonalizeTraits = CGAL::Default_diagonalize_traits<float,3>>
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.

◆ radius_dtm()

template<typename GeomTraits , typename FaceListGraph , typename PointMap , typename ConcurrencyTag , typename DiagonalizeTraits = CGAL::Default_diagonalize_traits<float,3>>
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.

◆ radius_neighbors()

template<typename GeomTraits , typename FaceListGraph , typename PointMap , typename ConcurrencyTag , typename DiagonalizeTraits = CGAL::Default_diagonalize_traits<float,3>>
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).