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

Regression label information. More...

#include <cvb/sample_database/sample_regression_image_list.hpp>

Public Types

using LabelType = std::vector< float >
 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...
 
std::vector< float > Label () const
 Get label under which this class is stored. 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 std::vector< float > &label)
 Modify the label of a sample set, but not to one that already exists in the sample list. More...
 

Detailed Description

Regression 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.

◆ Label()

std::vector<float> 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 std::vector< float > &  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.