diff --git a/Classification/doc/Classification/Classification.txt b/Classification/doc/Classification/Classification.txt index d2fc890bafd..ad053f09ace 100644 --- a/Classification/doc/Classification/Classification.txt +++ b/Classification/doc/Classification/Classification.txt @@ -8,10 +8,6 @@ namespace CGAL { This component implements the algorithm described in \cgalCite{cgal:lm-clscm-12} (section 2), generalized to handle different types of data, multiple features and multiple labels. It classifies a data set into a user-defined set of labels, such as _ground_, _vegetation_ and _buildings_. A flexible API is provided so that users can classify any type of data which they can index and for which they can compute relevant features, compute their own local features on the input data set and define their own labels. -\note This component requires C++11 and depends on the Boost libraries -[Serialization](https://www.boost.org/libs/serialization) and -[IO Streams](https://www.boost.org/libs/iostreams) (compiled with the GZIP dependency). - \section Classification_Organization Package Organization %Classification of data sets is achieved as follows (see Figure \cgalFigureRef{Classification_organization_fig}): @@ -35,7 +31,9 @@ Currently, \cgal provides data structures to handle classification of point sets \subsection Classification_labels Label Set -A label represents how an item should be classified, for example: _vegetation_, _building_, _road_, etc. In \cgal, a label has a name and is simply identified by a [Label_handle](@ref CGAL::Classification::Label_handle). Note that names are not used for identification: two labels in the same set can have the same name (but not the same handle). +A label represents how an item should be classified, for example: _vegetation_, _building_, _road_, etc. In \cgal, a label has a name, an index (in a label set), a standard index (for example, the index of the label in the ASPRS standard) and a color. It is simply identified by a [Label_handle](@ref CGAL::Classification::Label_handle). Note that names, standard indices and colors are not used for identification: two labels in the same set can have the same name, standard index and color but not the same handle. + +If labels are initialized with their names only, standard indices and colors can be deduced in some cases (see [Label_set::add()](@ref CGAL::Classification::Label_set::add)). The following code snippet shows how to add labels to the classification object: @@ -231,6 +229,14 @@ An [example](\ref Classification_example_ethz_random_forest) shows how to use this classifier. For more details about the algorithm, please refer to README provided in the [ETH Zurich's code archive](https://www.ethz.ch/content/dam/ethz/special-interest/baug/igp/photogrammetry-remote-sensing-dam/documents/sourcecode-and-datasets/Random%20Forest/rforest.zip). +\subsubsection Classification_ETHZ_random_forest_deprecated Deprecated IO + +The IO functions of this classifier were changed in \cgal +5.2. Configurations generated from previous versions are not valid +anymore and should be converted first as shown in the following example: + +\cgalExample{Classification/example_deprecated_conversion.cpp} + \subsection Classification_OpenCV_random_forest OpenCV Random Forest The second classifier is [OpenCV::Random_forest_classifier](@ref CGAL::Classification::OpenCV::Random_forest_classifier). diff --git a/Classification/doc/Classification/PackageDescription.txt b/Classification/doc/Classification/PackageDescription.txt index 3d78a28993a..16c1b565b5e 100644 --- a/Classification/doc/Classification/PackageDescription.txt +++ b/Classification/doc/Classification/PackageDescription.txt @@ -77,8 +77,7 @@ Data structures specialized to classify clusters. \cgalPkgShortInfoBegin \cgalPkgSince{4.12} -\cgalPkgDependsOn{\ref PkgSolverInterface, \ref PkgSpatialSearchingD, [Boost Serialization](https://www.boost.org/libs/serialization) and -[Boost IO Streams](https://www.boost.org/libs/iostreams)} +\cgalPkgDependsOn{\ref PkgSolverInterface, \ref PkgSpatialSearchingD} \cgalPkgBib{cgal:lm-clscm-12} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgDemo{Operations on Polyhedra,polyhedron_3.zip} diff --git a/Classification/doc/Classification/examples.txt b/Classification/doc/Classification/examples.txt index 90fde632cce..e456d0bea17 100644 --- a/Classification/doc/Classification/examples.txt +++ b/Classification/doc/Classification/examples.txt @@ -3,6 +3,7 @@ \example Classification/example_feature.cpp \example Classification/example_generation_and_training.cpp \example Classification/example_ethz_random_forest.cpp +\example Classification/example_deprecated_conversion.cpp \example Classification/example_opencv_random_forest.cpp \example Classification/example_tensorflow_neural_network.cpp \example Classification/example_mesh_classification.cpp diff --git a/Classification/include/CGAL/Classification/ETHZ/Random_forest_classifier.h b/Classification/include/CGAL/Classification/ETHZ/Random_forest_classifier.h index e741a2cc694..57ba4237a3d 100644 --- a/Classification/include/CGAL/Classification/ETHZ/Random_forest_classifier.h +++ b/Classification/include/CGAL/Classification/ETHZ/Random_forest_classifier.h @@ -322,6 +322,10 @@ public: The input file should be a GZIP container written by the `save_configuration()` method from CGAL 5.1 and earlier. The output is a valid configuration for CGAL 5.2 and later. + + \note This function and depends on the Boost libraries + [Serialization](https://www.boost.org/libs/serialization) and + [IO Streams](https://www.boost.org/libs/iostreams) (compiled with the GZIP dependency). */ static void convert_deprecated_configuration_to_new_format (std::istream& input, std::ostream& output) { diff --git a/Classification/include/CGAL/Classification/Label_set.h b/Classification/include/CGAL/Classification/Label_set.h index c4fab84a9d3..9d4bf324cde 100644 --- a/Classification/include/CGAL/Classification/Label_set.h +++ b/Classification/include/CGAL/Classification/Label_set.h @@ -94,24 +94,24 @@ public: 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)` + - `"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.