CGAL 5.2.1 - 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...
 

Function Documentation

◆ 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
ConcurrencyTagenables sequential versus parallel algorithm. Possible values are Parallel_if_available_tag, Parallel_tag or Sequential_tag.
ItemRangemodel 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).
Classifiermodel of Classifier.
Modelof Range with random access iterators whose value type is an integer type.
Parameters
inputinput range.
labelsset of input labels.
classifierinput classifier.
outputwhere 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
ConcurrencyTagenables sequential versus parallel algorithm. Possible values are Parallel_if_available_tag, Parallel_tag or Sequential_tag.
ItemRangemodel of ConstRange. Its iterator type is RandomAccessIterator.
ItemMapmodel 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).
NeighborQuerymodel of NeighborQuery.
Classifiermodel of Classifier.
Modelof Range with random access iterators whose value type is an integer type.
Parameters
inputinput range.
item_mapproperty map to access the input items.
labelsset of input labels.
classifierinput classifier.
neighbor_queryused to access neighborhoods of items.
strengthstrength 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_subdivisionsminimum number of subdivisions (for parallel processing to be efficient, this should be at least the number of cores of the processor).
outputwhere 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
ConcurrencyTagenables sequential versus parallel algorithm. Possible values are Parallel_if_available_tag, Parallel_tag or Sequential_tag.
ItemRangemodel of ConstRange. Its iterator type is RandomAccessIterator.
ItemMapmodel 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).
NeighborQuerymodel of NeighborQuery.
Classifiermodel of Classifier.
Modelof Range with random access iterators whose value type is an integer type.
Parameters
inputinput range.
item_mapproperty map to access the input items.
labelsset of input labels.
classifierinput classifier.
neighbor_queryused to access neighborhoods of items.
outputwhere 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.