Public Member Functions | List of all members
SampleImageList Class Reference

Classifier type that operates on images. More...

#include <cvb/sample_database/sample_image_list.hpp>

Inherits SampleList.

Inherited by SampleClassificationImageList, and SampleRegressionImageList.

Public Member Functions

class Fringes Fringes () const
 Get fringes (= size difference between the images and the feature window) of the sample images. More...
 
Size2D< int > FeatureWindowSize () const
 Size of the feature window. More...
 
Point2D< int > FeatureWindowLocation () const
 Location of the feature window (position of left top corner inside the image). More...
 
Point2D< int > FeatureWindowOrigin () const
 Location of the feature window origin in pixel coordinates measured from the left top corner of the feature window. More...
 
Size2D< int > ImageSize () const
 Size of the images (in pixels) that can be added to the image list. More...
 
int ImageDimension () const
 Dimension (# of planes) of the images that can be added to the image list. More...
 
DataType ImageDataType () const
 Data type of the images that can be added to the image list (all planes must have same data type). More...
 
void SetFeatureWindow (Point2D< int > location, Size2D< int > size, Point2D< int > origin)
 Redefine the feature window of the sample image list. More...
 
bool IsCompatible (const Image &img) const
 Check whether a CVB image is compatible with this image list, i.e. if it is generally possible to add samples from that image to the list. More...
 
std::shared_ptr< ImageGetSampleImage (int sampleIndex) const
 Retrieve an image by its overall sample index (ranging from 0 to NumSamples()-1). More...
 
- Public Member Functions inherited from SampleList
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

Classifier type that operates on images.

Member Function Documentation

◆ FeatureWindowLocation()

Point2D<int> FeatureWindowLocation ( ) const
inline

Location of the feature window (position of left top corner inside the image).

Returns
The feature window location.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ FeatureWindowOrigin()

Point2D<int> FeatureWindowOrigin ( ) const
inline

Location of the feature window origin in pixel coordinates measured from the left top corner of the feature window.

Returns
The feature window origin.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ FeatureWindowSize()

Size2D<int> FeatureWindowSize ( ) const
inline

Size of the feature window.

Returns
The feature window size.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Fringes()

class Fringes Fringes ( ) const
inline

Get fringes (= size difference between the images and the feature window) of the sample images.

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

◆ GetSampleImage()

std::shared_ptr<Image> GetSampleImage ( int  sampleIndex) const
inline

Retrieve an image by its overall sample index (ranging from 0 to NumSamples()-1).

Parameters
[in]sampleIndexIndex of the image to be retrieved.
Returns
Indexed image.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ ImageDataType()

DataType ImageDataType ( ) const
inline

Data type of the images that can be added to the image list (all planes must have same data type).

Returns
The image data type.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ ImageDimension()

int ImageDimension ( ) const
inline

Dimension (# of planes) of the images that can be added to the image list.

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

◆ ImageSize()

Size2D<int> ImageSize ( ) const
inline

Size of the images (in pixels) that can be added to the image list.

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

◆ IsCompatible()

bool IsCompatible ( const Image img) const
inline

Check whether a CVB image is compatible with this image list, i.e. if it is generally possible to add samples from that image to the list.

Parameters
[in]imgImage object to be checked for compatibility.
Returns
True if the image referred to by img is compatible with this image list, false otherwise.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ SetFeatureWindow()

void SetFeatureWindow ( Point2D< int >  location,
Size2D< int >  size,
Point2D< int >  origin 
)
inline

Redefine the feature window of the sample image list.

Parameters
[in]locationFeature window location (pixel coordinate of the left top corner) inside the sample images.
[in]sizeFeature window size in pixels.
[in]originLocation of the origin of the feature window (relative to the left top corner of the feature window, in pixels).
Exceptions
Anyexception derived from std::exception including CvbException.

Note that the values provided must be consistent with the image size for which this sample image list has been created, otherwise an exception will be raised.