\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 4.12.1 - Classification
CGAL::Classification::Feature::Hsv< GeomTraits, PointRange, ColorMap > Class Template Reference

#include <CGAL/Classification/Feature/Hsv.h>

Inherits from

CGAL::Classification::Feature_base.

Definition

Feature based on HSV colorimetric information.

If the input point cloud has colorimetric information, it can be used for classification purposes. This feature is based on a Gaussian probabilistic model on one of the three HSV channels (hue, saturation or value). It computes the probability of the color of the input point to match this specific color channel defined by a mean and a standard deviation.

The HSV channels are defined this way:

  • Hue ranges from 0 to 360 and measures the general "tint" of the color (green, blue, pink, etc.)
  • Saturation ranges from 0 to 100 and measures the "strength" of the color (0 is gray and 100 is the fully saturated color)
  • Value ranges from 0 to 100 and measures the "brightness" of the color (0 is black and 100 is the fully bright color)

For example, such an feature using the channel 0 (hue) with a mean of 90 (which corresponds to a green hue) can help to identify trees.

trees.png
Left: input point set with colors. Right: HSV feature on hue with a mean of 90 (from low values in white to high values in dark red).

Its default name is the channel followed by the mean value (for example: "hue_180", "saturation_20" or "value_98").

Note
The user only needs to provide a map to standard (and more common) RGB colors, the conversion to HSV is done internally.
Template Parameters
GeomTraitsmodel of CGAL Kernel.
PointRangemodel of ConstRange. Its iterator type is RandomAccessIterator and its value type is the key type of ColorMap.
ColorMapmodel of ReadablePropertyMap whose key type is the value type of the iterator of PointRange and value type is CGAL::Classification::RGB_Color.

Public Types

enum  Channel { HUE = 0, SATURATION = 1, VALUE = 2 }
 Selected channel. More...
 

Public Member Functions

 Hsv (const PointRange &input, ColorMap color_map, Channel channel, float mean, float sd)
 Constructs a feature based on the given color channel, mean and standard deviation. More...
 
- Public Member Functions inherited from CGAL::Classification::Feature_base
const std::string & name () const
 Returns the name of the feature (initialized to abstract_feature for Feature_base).
 
void set_name (const std::string &name)
 Changes the name of the feature.
 
virtual float value (std::size_t index)=0
 Returns the value taken by the feature for at the item for the item at position index. More...
 

Member Enumeration Documentation

◆ Channel

template<typename GeomTraits , typename PointRange , typename ColorMap >
enum CGAL::Classification::Feature::Hsv::Channel

Selected channel.

Enumerator
HUE 

0

SATURATION 

1

VALUE 

2

Constructor & Destructor Documentation

◆ Hsv()

template<typename GeomTraits , typename PointRange , typename ColorMap >
CGAL::Classification::Feature::Hsv< GeomTraits, PointRange, ColorMap >::Hsv ( const PointRange &  input,
ColorMap  color_map,
Channel  channel,
float  mean,
float  sd 
)

Constructs a feature based on the given color channel, mean and standard deviation.

Parameters
inputpoint range.
color_mapproperty map to access the colors of the input points.
channelchosen HSV channel.
meanmean value of the specified channel.
sdstandard deviation of the specified channel.