CGAL 6.1 - Classification

Loading...
Searching...
No Matches
List of all members | Classes | Public Types
CGAL::Classification::Point_set_feature_generator< GeomTraits, PointRange, PointMap, ConcurrencyTag, DiagonalizeTraits > Class Template Reference
Reference Manual » Point Set Classification

`#include <CGAL/Classification/Point_set_feature_generator.h>`

## Definition

template<typename GeomTraits, typename PointRange, typename PointMap, typename ConcurrencyTag, typename DiagonalizeTraits>
class CGAL::Classification::Point_set_feature_generator< GeomTraits, PointRange, PointMap, ConcurrencyTag, DiagonalizeTraits >

generates a set of generic features for point set 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.

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.
  PointRange | model of `ConstRange`. Its iterator type is `RandomAccessIterator` and its value type is the key type of `PointMap`.
  PointMap | model of `ReadablePropertyMap` whose key type is the value type of the iterator of `PointRange` 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: in that case, an overload using `Eigen_diagonalize_traits` is provided.

## Public Types
using | Iso_cuboid_3 = typename GeomTraits::Iso_cuboid_3
using | Planimetric_grid = Classification::Planimetric_grid< GeomTraits, PointRange, PointMap >
using | Neighborhood = Classification::Point_set_neighborhood< GeomTraits, PointRange, PointMap >
using | Local_eigen_analysis = Classification::Local_eigen_analysis

## Constructor
| Point_set_feature_generator (const PointRange &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_point_based_features (Feature_set &features)
| generates geometric features based on point position information.
void | generate_eigen_features (Feature_set &features)
| generates geometric eigen features.
void | generate_dispersion_features (Feature_set &features)
| generates geometric features based on local dispersion information.
void | generate_elevation_features (Feature_set &features)
| generates geometric features based on elevation information.
void | generate_normal_based_features (Feature_set &features)
| generates geometric features based on normal analysis information.
template<typename VectorMap >
void | generate_normal_based_features (Feature_set &features, const VectorMap &normal_map)
| generates geometric features based on normal vector information.
template<typename ColorMap >
void | generate_color_based_features (Feature_set &features, const ColorMap &color_map)
| generates geometric features based on point color information.
template<typename EchoMap >
void | generate_echo_based_features (Feature_set &features, const EchoMap &echo_map)
| generates geometric features based on echo 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

## ◆ Point_set_feature_generator()

template<typename GeomTraits , typename PointRange , typename PointMap , typename ConcurrencyTag , typename DiagonalizeTraits >

CGAL::Classification::Point_set_feature_generator< GeomTraits, PointRange, PointMap, ConcurrencyTag, DiagonalizeTraits >::Point_set_feature_generator | ( | const PointRange & | 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 | point range.
  point_map | property map to access the input points.
  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_color_based_features()

template<typename GeomTraits , typename PointRange , typename PointMap , typename ConcurrencyTag , typename DiagonalizeTraits >
template<typename ColorMap >

void CGAL::Classification::Point_set_feature_generator< GeomTraits, PointRange, PointMap, ConcurrencyTag, DiagonalizeTraits >::generate_color_based_features | ( | Feature_set & | features,
|  | const ColorMap & | color_map
| ) |  |

generates geometric features based on point color information.

Generates `CGAL::Classification::Feature::Color_channel` with channels `HUE`, `SATURATION` and `VALUE`.

Template Parameters

  ColorMap | model of `ReadablePropertyMap` whose key type is the value type of the iterator of `PointRange` and value type is `CGAL::IO::Color`.

Parameters

  features | the feature set where the features are instantiated.
  color_map | property map to access the colors of the input points (if any).

## ◆ generate_dispersion_features()

template<typename GeomTraits , typename PointRange , typename PointMap , typename ConcurrencyTag , typename DiagonalizeTraits >

void CGAL::Classification::Point_set_feature_generator< GeomTraits, PointRange, PointMap, ConcurrencyTag, DiagonalizeTraits >::generate_dispersion_features | ( | Feature_set & | features | ) |

generates geometric features based on local dispersion information.

At each scale, the following features are generated:

- `CGAL::Classification::Feature::Distance_to_plane`
- `CGAL::Classification::Feature::Vertical_dispersion`

Parameters

  features | the feature set where the features are instantiated.

## ◆ generate_echo_based_features()

template<typename GeomTraits , typename PointRange , typename PointMap , typename ConcurrencyTag , typename DiagonalizeTraits >
template<typename EchoMap >

void CGAL::Classification::Point_set_feature_generator< GeomTraits, PointRange, PointMap, ConcurrencyTag, DiagonalizeTraits >::generate_echo_based_features | ( | Feature_set & | features,
|  | const EchoMap & | echo_map
| ) |  |

generates geometric features based on echo information.

At each scale, generates `CGAL::Classification::Feature::Echo_scatter`.

Template Parameters

  EchoMap | model of `ReadablePropertyMap` whose key type is the value type of the iterator of `PointRange` and value type is `std::size_t`.

Parameters

  features | the feature set where the features are instantiated.
  echo_map | property map to access the echo values of the input points (if any).

## ◆ generate_eigen_features()

template<typename GeomTraits , typename PointRange , typename PointMap , typename ConcurrencyTag , typename DiagonalizeTraits >

void CGAL::Classification::Point_set_feature_generator< GeomTraits, PointRange, PointMap, ConcurrencyTag, DiagonalizeTraits >::generate_eigen_features | ( | Feature_set & | features | ) |

generates geometric eigen features.

At each scale, features `CGAL::Classification::Feature::Eigenvalue` with indices 0, 1 and 2 are generated.

Parameters

  features | the feature set where the features are instantiated.

## ◆ generate_elevation_features()

template<typename GeomTraits , typename PointRange , typename PointMap , typename ConcurrencyTag , typename DiagonalizeTraits >

void CGAL::Classification::Point_set_feature_generator< GeomTraits, PointRange, PointMap, ConcurrencyTag, DiagonalizeTraits >::generate_elevation_features | ( | Feature_set & | features | ) |

generates geometric features based on elevation information.

At each scale, the following features are generated:

- `CGAL::Classification::Feature::Elevation`
- `CGAL::Classification::Feature::Height_above`
- `CGAL::Classification::Feature::Height_below`
- `CGAL::Classification::Feature::Vertical_range`

Parameters

  features | the feature set where the features are instantiated.

## ◆ generate_normal_based_features() [1/2]

template<typename GeomTraits , typename PointRange , typename PointMap , typename ConcurrencyTag , typename DiagonalizeTraits >

void CGAL::Classification::Point_set_feature_generator< GeomTraits, PointRange, PointMap, ConcurrencyTag, DiagonalizeTraits >::generate_normal_based_features | ( | Feature_set & | features | ) |

generates geometric features based on normal analysis information.

At each scale, the version of `CGAL::Classification::Feature::Verticality` based on eigenvalue is generated.

Parameters

  features | the feature set where the features are instantiated.

## ◆ generate_normal_based_features() [2/2]

template<typename GeomTraits , typename PointRange , typename PointMap , typename ConcurrencyTag , typename DiagonalizeTraits >
template<typename VectorMap >

void CGAL::Classification::Point_set_feature_generator< GeomTraits, PointRange, PointMap, ConcurrencyTag, DiagonalizeTraits >::generate_normal_based_features | ( | Feature_set & | features,
|  | const VectorMap & | normal_map
| ) |  |

generates geometric features based on normal vector information.

Generates the version of `CGAL::Classification::Feature::Verticality` based on normal vectors.

Template Parameters

  VectorMap | model of `ReadablePropertyMap` whose key type is the value type of the iterator of `PointRange` and value type is `GeomTraits::Vector_3`.

Parameters

  features | the feature set where the features are instantiated.
  normal_map | property map to access the normal vectors of the input points (if any).

## ◆ generate_point_based_features()

template<typename GeomTraits , typename PointRange , typename PointMap , typename ConcurrencyTag , typename DiagonalizeTraits >

void CGAL::Classification::Point_set_feature_generator< GeomTraits, PointRange, PointMap, ConcurrencyTag, DiagonalizeTraits >::generate_point_based_features | ( | Feature_set & | features | ) |

generates geometric features based on point position information.

This is a meta-function that calls the following functions:

- `generate_eigen_features()`
- `generate_dispersion_features()`
- `generate_elevation_features()`
- The version of `generate_normal_based_features()` without a normal map

Parameters

  features | the feature set where the features are instantiated.

## ◆ grid_resolution()

template<typename GeomTraits , typename PointRange , typename PointMap , typename ConcurrencyTag , typename DiagonalizeTraits >

float CGAL::Classification::Point_set_feature_generator< GeomTraits, PointRange, 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 PointRange , typename PointMap , typename ConcurrencyTag , typename DiagonalizeTraits >

float CGAL::Classification::Point_set_feature_generator< GeomTraits, PointRange, 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 PointRange , typename PointMap , typename ConcurrencyTag , typename DiagonalizeTraits >

float CGAL::Classification::Point_set_feature_generator< GeomTraits, PointRange, 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`).