Public Member Functions | List of all members
ImageClassificationInfoCollection Class Reference

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...
 
ImageClassificationLabelInfo ReadInfo (int index) const
 Retrieves the indexed item. More...
 
std::vector< ImageClassificationLabelInfoReadInfos () 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 ImageClassificationLabelInfo ::LabelType
 Type of the labels.
 

Detailed Description

Collection of class information inside a classification sample list.

Member Function Documentation

◆ Add()

void Add ( const String label,
const Image srcImage,
Point2D< int >  extractionLocation,
SampleExtractionMode  mode = SampleExtractionMode::TopLeftCorner 
)
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.

Parameters
[in]labelName of the new class.
[in]srcImageImage from which to extract the first sample for the new class.
[in]extractionLocationLocation 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.
Parameters
[in]modeInterpretation hint for the extractionLocation parameter.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ HasLabel()

bool HasLabel ( const String label)
inline

Check if a given label is already present in the classes collection.

Parameters
[in]labelLabel to test for.
Returns
True if a class with the specified label already exists, false otherwise.
Exceptions
Anyexception derived from std::exception including CvbException.