Public Member Functions | List of all members
SampleList Class Reference

Base class for sample lists. More...

#include <cvb/sample_database/sample_list.hpp>

Inherited by SampleImageList.

Public Member Functions

void * Handle () const noexcept
 Classic API SIL handle. More...
 
String FileName () const
 Name of the file from which this image list was loaded (empty string if this image list was neither loaded nor saved since its construction). More...
 
String Comment () const
 Get the comment text. More...
 
void SetComment (String comment)
 Set the comment text. More...
 
std::chrono::system_clock::time_point CreationDate () const
 Date on which the sample list was created. More...
 
std::chrono::system_clock::time_point ModificationDate () const
 Date on which the sample list was modified. More...
 
int NumClasses () const
 Number of distinguishable classes in the sample list. More...
 
int NumSamples () const
 Total number of samples in the sample list. More...
 
int MinSampleCount () const
 Number samples in the smallest class of the sample list. More...
 
int MaxSampleCount () const
 Number samples in the largest class of the sample list. More...
 
double AverageSampleCount () const
 Average number samples in per class of the sample list. More...
 
void Save (const String &fileName) const
 Save the sample list to a file. More...
 

Detailed Description

Base class for sample lists.

Sample lists can serve two different purposes: Classification or Regression. For each case, a separate derived class has been implemented SampleClassificationImageList and SampleRegressionImageList, while this class contains those elements that are common to both types of classifier.

Member Function Documentation

◆ AverageSampleCount()

double AverageSampleCount ( ) const
inline

Average number samples in per class of the sample list.

Returns
Average sample count.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Comment()

String Comment ( ) const
inline

Get the comment text.

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

◆ CreationDate()

std::chrono::system_clock::time_point CreationDate ( ) const
inline

Date on which the sample list was created.

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

◆ FileName()

String FileName ( ) const
inline

Name of the file from which this image list was loaded (empty string if this image list was neither loaded nor saved since its construction).

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

◆ Handle()

void* Handle ( ) const
inlinenoexcept

Classic API SIL handle.

Returns
Classic API handle.
Exceptions
Doesnot throw any exception.

It is normally not necessary to work with this handle.

◆ MaxSampleCount()

int MaxSampleCount ( ) const
inline

Number samples in the largest class of the sample list.

Returns
Max sample count.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ MinSampleCount()

int MinSampleCount ( ) const
inline

Number samples in the smallest class of the sample list.

Returns
Min sample count.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ ModificationDate()

std::chrono::system_clock::time_point ModificationDate ( ) const
inline

Date on which the sample list was modified.

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

◆ NumClasses()

int NumClasses ( ) const
inline

Number of distinguishable classes in the sample list.

Returns
Number of classes.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ NumSamples()

int NumSamples ( ) const
inline

Total number of samples in the sample list.

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

◆ Save()

void Save ( const String fileName) const
inline

Save the sample list to a file.

Parameters
[in]fileNamePath to save to.
Exceptions
Anyexception derived from std::exception including CvbException.

As a side effect this function sets the IsModified flag to false, if the training set was saved successfully.

◆ SetComment()

void SetComment ( String  comment)
inline

Set the comment text.

Parameters
[in]commentThe comment.
Exceptions
Anyexception derived from std::exception including CvbException.