CVB.Net 14.0
TrainingSet.ModelInfoCollection Class Reference

ModelInformationCollection class that aggregates the collection of Models inside a Minos Training Set. More...

Inherits TrainingSet.TrainingSetObjectInfoCollection< TrainingSet, ModelInfo >.

Public Member Functions

bool Contains (string name)
 Check if the collection contains a model with the specified name. More...
 
void Add (ImageInfo image, string name, Point2D location, Rect featureWindow)
 Add a new model (plus the first instance of that model) to the training set. More...
 
bool Remove (ModelInfo model)
 Remove a model (and all the instances extracted for that model!) from the training set. More...
 
void Remove (int index)
 Remove a training set image along with its instances from the training set. More...
 
void SetGlobalAdvanceVector (Point2Dd vec)
 Set an advance vector for all available models. More...
 
- Public Member Functions inherited from TrainingSet.TrainingSetObjectInfoCollection< TrainingSet, ModelInfo >
int IndexOf (TInfo obj)
 Determine the index of an image information object inside this collection. More...
 

Protected Member Functions

override int GetCount ()
 Parent class calls this method to determine the number of objects in the collection. More...
 
override ModelInfo GetInfo (int index)
 Parent class calls this method to extract one info object by index. More...
 

Properties

ModelInfo this[int index] [get]
 Index-based item access. More...
 
ModelInfo this[string name] [get]
 String-based item access. More...
 

Detailed Description

ModelInformationCollection class that aggregates the collection of Models inside a Minos Training Set.

Member Function Documentation

◆ Add()

void Add ( ImageInfo  image,
string  name,
Point2D  location,
Rect  featureWindow 
)

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

Parameters
imageimage from which to extract the first instance (needs to be taken from the TrainingSet.Images collection)
namename of the model to be generation
locationposition in the image from which to extract the first instance
featureWindowfeature of the model to be generated
Exceptions
ObjectDisposedExceptionIf the training set has already been disposed
ArgumentNullExceptionIf image or name are null
InvalidOperationExceptionwhen one of the following applies:
  • the image has been taken from a training set that is not the parent of this collection
  • the name is an empty string
  • location references a location that lies outside the image or too close to the image border to extract a model with the given feature window.

◆ Contains()

bool Contains ( string  name)

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

Parameters
namename for which to check the collection
Returns
true if the collection contains at least one model with the specified name, false otherwise
Exceptions
ObjectDisposedExceptionIf the training set has already been disposed

◆ GetCount()

override int GetCount ( )
protected

Parent class calls this method to determine the number of objects in the collection.

Returns
number of objects in the collection
Exceptions
ObjectDisposedExceptionIf the TrainingSet has already been disposed

◆ GetInfo()

override ModelInfo GetInfo ( int  index)
protected

Parent class calls this method to extract one info object by index.

Parameters
indexindex at which to extract
Returns
extracted object
Exceptions
ObjectDisposedExceptionIf the TrainingSet has already been disposed
ArgumentOutOfRangeExceptionIf the index is invalid

◆ Remove() [1/2]

void Remove ( int  index)

Remove a training set image along with its instances from the training set.

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!

Parameters
indexindex of the training set image to be removed
Exceptions
ObjectDisposedExceptionIf the TrainingSet has already been disposed
ArgumentOutOfRangeExceptionIf index exceeds the range [0...Count]

◆ Remove() [2/2]

bool Remove ( ModelInfo  model)

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

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

Parameters
modelmodel to be removed from the training set
Returns
true if the model has been removed successfully, false otherwise
Exceptions
ObjectDisposedExceptionIf the TrainingSet has already been disposed
ArgumentNullExceptionIf model is null

◆ SetGlobalAdvanceVector()

void SetGlobalAdvanceVector ( Point2Dd  vec)

Set an advance vector for all available models.

Parameters
vecAdvance vector to be set for all models.

Property Documentation

◆ this[int index]

ModelInfo this[int index]
get

Index-based item access.

Parameters
indexindex to be accessed
Returns
indexed class object
Exceptions
ObjectDisposedExceptionIf the TrainingSet has already been disposed
ArgumentOutOfRangeExceptionIf the index is invalid

◆ this[string name]

ModelInfo this[string name]
get

String-based item access.

Note that this will only return the first model with a matching model name. If several models by the same name exist, they will need to be accessed index-based.

Parameters
nameName of the model to retrieve.
Returns
ModelInformation object.
Exceptions
IndexOutOfRangeExceptionIf the name does not exist in the model collection.