CVB++ 14.0
ModelInfoCollection Class Reference

Class that maintains the collection of Training Images inside a Minos Training Set. More...

#include <cvb/minos/training_set.hpp>

Public Member Functions

int Count () const
 Retrieves the number of elements in the collection. More...
 
ModelInfo ReadInfo (int index) const
 Retrieves the indexed model information block. More...
 
std::vector< ModelInfoReadInfos () const
 Retrieves all the items stored in the collection. More...
 
int IndexOf (const ModelInfo &obj) const
 Determine the index of an image information object inside this collection. More...
 
bool Contains (const String &name)
 Check if the collection contains a model with the specified name. More...
 
void Add (const ImageInfo &image, const String &name, Point2D< double > location, Rect< int > featureWindow)
 Add a new model (plus the first instance of that model) to the training set. More...
 
bool Remove (const ModelInfo &model)
 Remove a model (and all the instances extracted for that model!) from the training set. More...
 
bool RemoveAt (int index)
 Remove a model (and all the instances extracted for that model!) from the training set. More...
 
void SetGlobalAdvanceVector (Point2D< double > vec)
 Set an advance vector for all available models. More...
 

Detailed Description

Class that maintains the collection of Training Images inside a Minos Training Set.

Member Function Documentation

◆ Add()

void Add ( const ImageInfo image,
const String name,
Point2D< double >  location,
Rect< int >  featureWindow 
)
inline

Add a new model (plus the first instance of that model) to the training set.

Parameters
[in]imageImage from which to extract the first instance (needs to be taken from the TrainingSet::Images().
[in]nameName of the model to be generation.
[in]locationPosition in the image from which to extract the first instance.
[in]featureWindowFeature window of the model to be generated.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Contains()

bool Contains ( const String name)
inline

Check if the collection contains a model with the specified name.

Parameters
[in]nameName for which to check the collection.
Returns
True if the collection contains at least one model with the specified name, false otherwise.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Count()

int Count ( ) const
inline

Retrieves the number of elements in the collection.

Returns
Number of elements in the collection.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ IndexOf()

int IndexOf ( const ModelInfo obj) const
inline

Determine the index of an image information object inside this collection.

Parameters
[in]objObject for which to determine the index.
Returns
Index through which the object can be accessed within this collection if it is part of this collection, -1 otherwise.
Exceptions
Anyexception derived from std::exception including CvbException.

Note that the returned index may be invalidated by Remove calls.

◆ ReadInfo()

ModelInfo ReadInfo ( int  index) const
inline

Retrieves the indexed model information block.

Parameters
[in]indexIndex of the collection to be accessed.
Returns
Model information.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ ReadInfos()

std::vector< ModelInfo > ReadInfos ( ) const
inline

Retrieves all the items stored in the collection.

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

◆ Remove()

bool Remove ( const ModelInfo model)
inline

Remove a model (and all the instances extracted for that model!) from the training set.

Parameters
[in]modelModel to be removed from the training set.
Returns
True if the model has been removed successfully, false otherwise.
Exceptions
Anyexception derived from std::exception including CvbException.

Calling this method will potentially invalidate any references to training set images or instances you are currently holding - so make sure you renew those where necessary!

◆ RemoveAt()

bool RemoveAt ( int  index)
inline

Remove a model (and all the instances extracted for that model!) from the training set.

Parameters
[in]indexIndex of the training set model to be removed.
Returns
True if the model has been removed successfully, false otherwise.
Exceptions
Anyexception derived from std::exception including CvbException.

Calling this method will potentially invalidate any references to training set images or instances you are currently holding - so make sure you renew those where necessary!

◆ SetGlobalAdvanceVector()

void SetGlobalAdvanceVector ( Point2D< double >  vec)
inline

Set an advance vector for all available models.

Parameters
[in]vecAdvance vector to be set for all models.
Exceptions
Anyexception derived from std::exception including CvbException.