Public Types | Public Member Functions | List of all members
ImageClassificationLabelInfo Class Reference

Classification label information. More...

#include <cvb/sample_database/sample_classification_image_list.hpp>

Public Types

using LabelType = String
 Type of the labels.
 

Public Member Functions

ImageCollection Samples () const
 Get samples under this label. More...
 
int Index () const
 Get the index of this label. More...
 
String Label () const
 Get label under which this class is stored. More...
 
bool IsExcluded () const
 Get the exclusion state of this class. More...
 
void SetIsExcluded (bool isExcluded)
 Set the exclusion state of this class. More...
 
void Add (const Image &srcImage, Point2D< int > extractionLocation, SampleExtractionMode mode=SampleExtractionMode::TopLeftCorner)
 Add a new sample to an existing class. More...
 
void Relabel (const String &label)
 Modify the label of a sample set, but not to one that already exists in the sample list. More...
 

Detailed Description

Classification label information.

Member Function Documentation

◆ Add()

void Add ( const Image srcImage,
Point2D< int >  extractionLocation,
SampleExtractionMode  mode = SampleExtractionMode::TopLeftCorner 
)
inline

Add a new sample to an existing class.

Parameters
[in]srcImageImage from which to extract the sample for the class.
[in]extractionLocationLocation at which to extract the sample for the class. Note that what the extraction location actually refers dependent on the value of the mode parameter.
[in]modeInterpretation hint for the extractionLocation parameter.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Index()

int Index ( ) const
inline

Get the index of this label.

Returns
The label index.
Exceptions
Anyexception derived from std::exception including CvbException.

Note that this index may change when samples are removed from the image list - therefore you should check this index often. Generally it is more recommendable to work label based, not index based.

◆ IsExcluded()

bool IsExcluded ( ) const
inline

Get the exclusion state of this class.

Returns
The is-excluded flag.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Label()

String Label ( ) const
inline

Get label under which this class is stored.

Returns
The label.
Exceptions
Anyexception derived from std::exception including CvbException.

You may change this label, but not to one that already exists in the SampleList. To Merge labels in the SampleList use the merge method(s) of the sample list.

◆ Relabel()

void Relabel ( const String label)
inline

Modify the label of a sample set, but not to one that already exists in the sample list.

Parameters
[in]labelThe new label.
Exceptions
Anyexception derived from std::exception including CvbException.

To merge labels in the list use the merge method of the ImageClassificationInfoCollection.

◆ Samples()

ImageCollection Samples ( ) const
inline

Get samples under this label.

Returns
The samples.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ SetIsExcluded()

void SetIsExcluded ( bool  isExcluded)
inline

Set the exclusion state of this class.

Parameters
[in]isExcludedThe is-excluded flag.
Exceptions
Anyexception derived from std::exception including CvbException.