CGAL 6.1 - Classification
|
#include <CGAL/Classification/Label_set.h>
sets of Label
used as input by classification algorithms.
Public Types | |
using | const_iterator = unspecified_type |
A random access constant iterator with value type Label_handle . | |
using | iterator = unspecified_type |
A random access iterator with value type Label_handle . | |
Constructors | |
Label_set () | |
Label_set (std::initializer_list< const char * > labels) | |
constructs a label set from a set of label names. | |
Modifications | |
Label_handle | add (const char *name, CGAL::IO::Color color, std::size_t standard_index=-1) |
adds a label. | |
Label_handle | add (const char *name) |
adds a label with default standard index and color. | |
bool | remove (Label_handle label) |
removes a label. | |
void | clear () |
removes all labels. | |
Access | |
const_iterator | begin () const |
iterator | begin () |
const_iterator | end () const |
iterator | end () |
std::size_t | size () const |
returns how many labels are defined. | |
Label_handle | operator[] (std::size_t i) const |
returns the \(i^{th}\) label. | |
Validity | |
template<typename LabelIndexRange > | |
bool | is_valid_ground_truth (const LabelIndexRange &ground_truth, bool verbose=false) const |
checks the validity of the ground truth with respect to the label set. | |
A random access constant iterator with value type Label_handle
.
A random access iterator with value type Label_handle
.
CGAL::Classification::Label_set::Label_set | ( | ) |
constructs a label set from a set of label names.
Label_handle CGAL::Classification::Label_set::add | ( | const char * | name | ) |
adds a label with default standard index and color.
This functions tries to map label names to standard ASPRS labels and automatically picks the standard_index
and color
of the label:
"unassigned"
is given standard index 2 and color (0, 0, 0)
"ground"
is given standard index 2 and color (186, 189, 182)
"low_vegetation"
is given standard index 3 and color (78, 154, 6)
"medium_vegetation"
is given standard index 4 and color (138, 226, 52)
"high_vegetation"
is given standard index 5 and color (204, 255, 201)
"building"
is given standard index 6 and color (245, 121, 0)
"noise"
is given standard index 7 and color (128, 0, 0)
"reserved"
is given standard index 8 and color (233, 185, 110)
"water"
is given standard index 9 and color (114, 159, 207)
"rail"
is given standard index 10 and color (136, 46, 25)
"road_surface"
is given standard index 11 and color (56, 56, 56)
"reserved_2"
is given standard index 12 and color (193, 138, 51)
"wire_guard"
is given standard index 13 and color (37, 61, 136)
"wire_conductor"
is given standard index 14 and color (173, 127, 168)
"transmission_tower"
is given standard index 15 and color (136, 138, 133)
"wire_connect"
is given standard index 16 and color (145, 64, 236)
"bridge_deck"
is given standard index 17 and color (213, 93, 93)
"high_noise"
is given standard index 18 and color (255, 0, 0)
If the name is not found, the label is given standard index std::size_t(-1)
and a random color.
add()
generates a new distinct label.name | name of the label. |
Label_handle CGAL::Classification::Label_set::add | ( | const char * | name, |
CGAL::IO::Color | color, | ||
std::size_t | standard_index = -1 |
||
) |
adds a label.
add()
generates a new distinct label.name | name of the label. |
color | used to represent the label. |
standard_index | standard index of the classification label (i.e. index in the ASPRS standard). |
iterator CGAL::Classification::Label_set::begin | ( | ) |
const_iterator CGAL::Classification::Label_set::begin | ( | ) | const |
void CGAL::Classification::Label_set::clear | ( | ) |
removes all labels.
iterator CGAL::Classification::Label_set::end | ( | ) |
const_iterator CGAL::Classification::Label_set::end | ( | ) | const |
bool CGAL::Classification::Label_set::is_valid_ground_truth | ( | const LabelIndexRange & | ground_truth, |
bool | verbose = false |
||
) | const |
checks the validity of the ground truth with respect to the label set.
ground_truth | range of label indices. This function checks that all these indices are either -1 (for unclassified) or a valid index of one of the labels. If at least one of the indices is out of range, this function returns false , otherwise it returns true . |
verbose | if set to true , the number of inliers of each label, the number of unclassified items and the potential number of out-of-range items are displayed. Otherwise, this function does not display anything. |
Label_handle CGAL::Classification::Label_set::operator[] | ( | std::size_t | i | ) | const |
returns the \(i^{th}\) label.
bool CGAL::Classification::Label_set::remove | ( | Label_handle | label | ) |
removes a label.
label | the handle to the label that must be removed. |
true
if the label was correctly removed, false
if its handle was not found. std::size_t CGAL::Classification::Label_set::size | ( | ) | const |
returns how many labels are defined.