CGAL 5.0.2 - Classification

Functions that perform classification based on a set of labels and a classifier, with or without regularization.

Functions

template<typename ConcurrencyTag , typename ItemRange , typename Classifier , typename LabelIndexRange >
void CGAL::Classification::classify (const ItemRange &input, const Label_set &labels, const Classifier &classifier, LabelIndexRange &output)
Runs the classification algorithm without any regularization. More...

template<typename ConcurrencyTag , typename ItemRange , typename ItemMap , typename NeighborQuery , typename Classifier , typename LabelIndexRange >
void CGAL::Classification::classify_with_local_smoothing (const ItemRange &input, const ItemMap item_map, const Label_set &labels, const Classifier &classifier, const NeighborQuery &neighbor_query, LabelIndexRange &output)
Runs the classification algorithm with a local smoothing. More...

template<typename ConcurrencyTag , typename ItemRange , typename ItemMap , typename NeighborQuery , typename Classifier , typename LabelIndexRange >
void CGAL::Classification::classify_with_graphcut (const ItemRange &input, const ItemMap item_map, const Label_set &labels, const Classifier &classifier, const NeighborQuery &neighbor_query, const float strength, const std::size_t min_number_of_subdivisions, LabelIndexRange &output)
Runs the classification algorithm with a global regularization based on a graph cut. More...

◆ classify()

template<typename ConcurrencyTag , typename ItemRange , typename Classifier , typename LabelIndexRange >
 void CGAL::Classification::classify ( const ItemRange & input, const Label_set & labels, const Classifier & classifier, LabelIndexRange & output )

#include <CGAL/Classification/classify.h>

Runs the classification algorithm without any regularization.

There is no relationship between items, the classification energy is only minimized itemwise. This method is quick but produces suboptimal results.

Template Parameters
 ConcurrencyTag enables sequential versus parallel algorithm. Possible values are Parallel_tag or Sequential_tag. ItemRange model of ConstRange. Its iterator type is RandomAccessIterator. Its value type depends on the data that is classified (for example, CGAL::Point_3 or CGAL::Triangle_3). Classifier model of Classifier. Model of Range with random access iterators whose value type is an integer type.
Parameters
 input input range. labels set of input labels. classifier input classifier. output where to store the result. It is stored as a sequence, ordered like the input range, containing for each point the index (in the Label_set) of the assigned label.

◆ classify_with_graphcut()

template<typename ConcurrencyTag , typename ItemRange , typename ItemMap , typename NeighborQuery , typename Classifier , typename LabelIndexRange >
 void CGAL::Classification::classify_with_graphcut ( const ItemRange & input, const ItemMap item_map, const Label_set & labels, const Classifier & classifier, const NeighborQuery & neighbor_query, const float strength, const std::size_t min_number_of_subdivisions, LabelIndexRange & output )

#include <CGAL/Classification/classify.h>

Runs the classification algorithm with a global regularization based on a graph cut.

The computed classification energy is globally regularized through an alpha-expansion algorithm. This method is slow but provides the user with good quality results.

To speed up computation, the input domain can be subdivided into smaller subsets such that several smaller graph cuts are applied instead of a big one. The computation of these smaller graph cuts can be done in parallel. Increasing the number of subsets allows for faster computation times but can also reduce the quality of the results.

Template Parameters
 ConcurrencyTag enables sequential versus parallel algorithm. Possible values are Parallel_tag or Sequential_tag. ItemRange model of ConstRange. Its iterator type is RandomAccessIterator. ItemMap model of ReadablePropertyMap whose key type is the value type of the iterator of ItemRange and value type is the type of item to classify (for example, CGAL::Point_3). NeighborQuery model of NeighborQuery. Classifier model of Classifier. Model of Range with random access iterators whose value type is an integer type.
Parameters
 input input range. item_map property map to access the input items. labels set of input labels. classifier input classifier. neighbor_query used to access neighborhoods of items. strength strength of the regularization with respect to the classification energy. Higher values produce more regularized output but may result in a loss of details. min_number_of_subdivisions minimum number of subdivisions (for parallel processing to be efficient, this should be at least the number of cores of the processor). output where to store the result. It is stored as a sequence, ordered like the input range, containing for each point the index (in the Label_set) of the assigned label.

◆ classify_with_local_smoothing()

template<typename ConcurrencyTag , typename ItemRange , typename ItemMap , typename NeighborQuery , typename Classifier , typename LabelIndexRange >
 void CGAL::Classification::classify_with_local_smoothing ( const ItemRange & input, const ItemMap item_map, const Label_set & labels, const Classifier & classifier, const NeighborQuery & neighbor_query, LabelIndexRange & output )

#include <CGAL/Classification/classify.h>

Runs the classification algorithm with a local smoothing.

The computed classification energy is smoothed on a user defined local neighborhood of items. This method is a compromise between efficiency and better quality results.

Template Parameters
 ConcurrencyTag enables sequential versus parallel algorithm. Possible values are Parallel_tag or Sequential_tag. ItemRange model of ConstRange. Its iterator type is RandomAccessIterator. ItemMap model of ReadablePropertyMap whose key type is the value type of the iterator of ItemRange and value type is the type of item to classify (for example, CGAL::Point_3). NeighborQuery model of NeighborQuery. Classifier model of Classifier. Model of Range with random access iterators whose value type is an integer type.
Parameters
 input input range. item_map property map to access the input items. labels set of input labels. classifier input classifier. neighbor_query used to access neighborhoods of items. output where to store the result. It is stored as a sequence, ordered like the input range, containing for each point the index (in the Label_set) of the assigned label.