CGAL 5.6.3 - Classification

Loading...
Searching...
No Matches
List of all members | Classes | Public Types
CGAL::Classification::Mesh_feature_generator< GeomTraits, FaceListGraph, PointMap, ConcurrencyTag, DiagonalizeTraits > Class Template Reference
Classification Reference » Mesh Classification

`#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

  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 if 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
using | Iso_cuboid_3 = typename GeomTraits::Iso_cuboid_3
using | Planimetric_grid = Classification::Planimetric_grid< GeomTraits, Face_range, PointMap >
using | Neighborhood = Classification::Mesh_neighborhood< FaceListGraph >
using | Local_eigen_analysis = Classification::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.

## Feature Generation
void | generate_face_based_features (Feature_set &features)
| generates geometric features based on face information.
void | generate_point_based_features (Feature_set &features)
| generates geometric features based on point position information.

## 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`.
float | radius_neighbors (std::size_t scale=0) const
| returns the radius used for neighborhood queries at scale `scale`.
float | radius_dtm (std::size_t scale=0) const
| returns the radius used for digital terrain modeling at scale `scale`.

## 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

  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).

## 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 | ) |

generates geometric features based on face information.

At each scale, the following features are generated:

- `CGAL::Classification::Feature::Eigenvalue` with indices 0, 1 and 2
- The version of `CGAL::Classification::Feature::Verticality` based on eigenvalues

Parameters

  features | the 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 | ) |

generates 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`

Parameters

  features | the 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`).