Collection of class information inside a classification sample list. More...
#include <cvb/sample_database/sample_classification_image_list.hpp>
Inherits LabelInfoCollection< ImageClassificationLabelInfo >.
Public Member Functions | |
void | Add (const String &label, const Image &srcImage, Point2D< int > extractionLocation, SampleExtractionMode mode=SampleExtractionMode::TopLeftCorner) |
Add a sample to a new class. If the class indicated by the label already exists the sample will be added to the existing class. More... | |
bool | HasLabel (const String &label) |
Check if a given label is already present in the classes collection. More... | |
Public Member Functions inherited from LabelInfoCollection< ImageClassificationLabelInfo > | |
int | Count () const |
Retrieves the number of elements in the collection. More... | |
std::unique_ptr< ImageClassificationLabelInfo > | ReadInfo (int index) const |
Retrieves the indexed item. More... | |
std::vector< std::shared_ptr< ImageClassificationLabelInfo > > | ReadInfos () const |
Retrieves all the items stored in the collection. More... | |
void | RemoveAt (int index) |
Remove a class by index. More... | |
void | Remove (const LabelType &label) |
Remove a class and all the data objects associated with it based on its name. More... | |
void | Clear () |
Remove all labels (and their associated data) from the sample list. More... | |
void | MergeClasses (int fromIndex, int toIndex) |
Merge two classes into one class. More... | |
void | MergeClasses (const LabelType &fromLabel, const LabelType &toLabel) |
Merge two classes into one class. More... | |
Additional Inherited Members | |
Public Types inherited from LabelInfoCollection< ImageClassificationLabelInfo > | |
using | LabelType = typename TLabelInformation::LabelType |
Type of the labels. | |
Collection of class information inside a classification sample list.
|
inline |
Add a sample to a new class. If the class indicated by the label already exists the sample will be added to the existing class.
[in] | label | Name of the new class. |
[in] | srcImage | Image from which to extract the first sample for the new class. |
[in] | extractionLocation | Location at which to extract the first sample for the new class. Note that what the extraction location actually refers dependent on the value of the mode parameter. |
[in] | mode | Interpretation hint for the extractionLocation parameter. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Check if a given label is already present in the classes collection.
[in] | label | Label to test for. |
Any | exception derived from std::exception including CvbException. |