CVB.Net 14.0
SampleClassificationImageList.ImageClassificationInfoCollection Class Reference

Collection of class information inside a classification sample list. More...

Inherits LabelInfoCollection< ImageClassificationLabelInfo, Image >.

Public Member Functions

void Add (string label, Image srcImage, Point2D extractionLocation, SampleExtractionMode mode=SampleExtractionMode.TopLeftCorner)
 Add a sample to a new class. If the class indicated by the label already exists the sample will be added to the existing class. More...
 
bool HasLabel (string label)
 Check if a given label is already present in the classes collection. More...
 
void Remove (string label)
 Remove a class and all the data objects associated with it based on its name. More...
 
void MergeClasses (string fromLabel, string toLabel)
 Merge two classes into one class. The class label will be taken from the 2nd class index. Note that this operation will invalidate all indices higher than fromLabel . More...
 

Protected Member Functions

override ImageClassificationLabelInfo GetInfo (int index)
 Parent class calls this method to extract one info object by index. More...
 

Detailed Description

Collection of class information inside a classification sample list.

Member Function Documentation

◆ Add()

void Add ( string  label,
Image  srcImage,
Point2D  extractionLocation,
SampleExtractionMode  mode = SampleExtractionMode.TopLeftCorner 
)

Add a sample to a new class. If the class indicated by the label already exists the sample will be added to the existing class.

Parameters
labelName of the new class.
srcImageImage from which to extract the first sample for the new class.
extractionLocationLocation at which to extract the first sample for the new class. Note that what the extraction location actually refers dependent on the value of the mode parameter.
Exceptions
ObjectDisposedExceptionIf the image list has already been disposed.
Parameters
modeInterpretation hint for the extractionLocation parameter.

◆ GetInfo()

override ImageClassificationLabelInfo 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 SampleImageList has already been disposed
ArgumentOutOfRangeExceptionIf the index is invalid

◆ HasLabel()

bool HasLabel ( string  label)

Check if a given label is already present in the classes collection.

Parameters
labelLabel to test for.
Returns
True if a class with the specified label already exists; false otherwise.

◆ MergeClasses()

void MergeClasses ( string  fromLabel,
string  toLabel 
)

Merge two classes into one class. The class label will be taken from the 2nd class index. Note that this operation will invalidate all indices higher than fromLabel .

Parameters
fromLabelClass to merge to the other classes.
toLabelClass to merge the samples to.

◆ Remove()

void Remove ( string  label)

Remove a class and all the data objects associated with it based on its name.

Parameters
labelName of the class to be removed.
Exceptions
ObjectDisposedExceptionIf the sample list has already been disposed.