CVB.Net 15.0
Loading...
Searching...
No Matches
TrainingSet.ModelInfoCollection Class Referencesealed

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

Inherits TrainingSet.TrainingSetObjectInfoCollection< TParent, TInfo >.

Public Member Functions

bool Contains (string name)
 Check if the collection contains a model with the specified name.
 
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.
 
bool Remove (ModelInfo model)
 Remove a model (and all the instances extracted for that model!) from the training set.
 
void Remove (int index)
 Remove a training set image along with its instances from the training set.
 
void SetGlobalAdvanceVector (Point2Dd vec)
 Set an advance vector for all available models.
 
- Public Member Functions inherited from TrainingSet.TrainingSetObjectInfoCollection< TParent, TInfo >
int IndexOf (TInfo obj)
 Determine the index of an image information object inside this collection.
 
- Public Member Functions inherited from InfoCollection< TParent, TInfo >
TInfo[] ToArray ()
 Converts this collection into an array.
 

Protected Member Functions

override int GetCount ()
 Parent class calls this method to determine the number of objects in the collection.
 
override ModelInfo GetInfo (int index)
 Parent class calls this method to extract one info object by index.
 
- Protected Member Functions inherited from InfoCollection< TParent, TInfo >
 InfoCollection (TParent parent)
 Constructor.
 
int GetCount ()
 Function with which the collection queries the number of elements.
 
TInfo GetInfo (int index)
 Function with which the collection retrieves the information object with the given index.
 

Properties

ModelInfo this[int index] [get]
 Index-based item access.
 
ModelInfo this[string name] [get]
 String-based item access.
 
- Properties inherited from InfoCollection< TParent, TInfo >
int Count [get]
 Number of elements in the collection.
 

Additional Inherited Members

- Protected Attributes inherited from InfoCollection< TParent, TInfo >
readonly TParent Parent
 Parent image reference helps keeping track of the lifetime and provides the information basis for index access.
 

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.