CVB.Net 14.0
SampleList Class Referenceabstract

Base class for sample lists. Sample lists can serve two different purposes: Classification or Regression. For each case, a separate derived class has been implemented (SampleClassificationImageList and SampleRegressionImageList), while this class contains those elements that are common to both types of classifier. More...

Inherits INativeHandle.

Inherited by SampleImageList.

Classes

interface  ILabelInfo
 Interface for label information. More...
 
interface  ISampleListChild
 Interface for anything that is child of a native sample image list (i.e. has a handle to the parent list through which the managed calls may be routed). More...
 
class  LabelInfoCollection
 Information collection for class labels. More...
 
class  SampleCollection
 Collection of data samples. SampleImageList. More...
 

Public Member Functions

delegate string LabelTransformStringToString (string labelIn)
 Delegate for label transformation. More...
 
delegate float[] LabelTransformStringToVector (string labelIn)
 Delegate for label transformation. More...
 
delegate float[] LabelTransformVectorToVector (float[] labelIn)
 Delegate for label transformation. More...
 
delegate string LabelTransformVectorToString (float[] labelIn)
 Delegate for label transformation. More...
 
delegate Image DataTransformImageToImage (Image imgIn)
 Image data transformation delegate. More...
 
void Dispose ()
 Dispose method that releases the classifier
 
void Save (string fileName)
 Save the Manto2 sample list to a file. More...
 

Static Public Member Functions

static SampleList FromFile (string fileName)
 Load a Manto2 sample list from disc. More...
 

Protected Member Functions

virtual void Dispose (bool disposing)
 IDispose helper function. More...
 
abstract int LabelToIndex< TLabel > (TLabel label)
 Convert a class label to a class index. More...
 
bool ContainsLabel< TLabel > (TLabel label)
 Check if the sample list contains a given label... More...
 
void RemoveLabel (int index)
 Remove a label and all the data objects associated with it based on its index. More...
 

Properties

IntPtr Handle [get]
 Native Manto2 classifier handle. More...
 
bool IsDisposed [get]
 Tests if the native handle has already been disposed.
 
string FileName [get]
 Name of the file from which this image list was loaded (string.Empty if this image list was neither loaded nor saved since its construction). More...
 
string Comment [get, set]
 Classifier comment text. More...
 
DateTime CreationDate [get]
 Date on which the SampleList was created.
 
DateTime ModificationDate [get]
 Date on which the SampleList was last modified.
 
int NumClasses [get]
 Number of distinguishable classes in the sample list.
 
int NumSamples [get]
 Total number of samples in the sample list.
 
int MinSampleCount [get]
 Number samples in the smallest class of the sample list.
 
int MaxSampleCount [get]
 Number samples in the largest class of the sample list.
 
double AverageSampleCount [get]
 Average number samples in per class of the sample list.
 
abstract Type LabelType [get]
 Type of the labels used by this SampleList.
 
abstract Type SampleType [get]
 Type of the samples used by this SampleList.
 
- Properties inherited from INativeHandle
IntPtr Handle [get]
 The native handle of the object.
 
bool IsDisposed [get]
 Possibility to check whether the object has already been disposed of.
 

Events

NativeHandleEventDelegate ObjectDisposing
 Raised when this object is about to be disposed via the IDisposable.Dispose method.
More...
 
- Events inherited from INativeHandle
NativeHandleEventDelegate ObjectDisposing
 Raised when this object is about to be disposed via the IDisposable.Dispose method.
More...
 

Detailed Description

Base class for sample lists. Sample lists can serve two different purposes: Classification or Regression. For each case, a separate derived class has been implemented (SampleClassificationImageList and SampleRegressionImageList), while this class contains those elements that are common to both types of classifier.

Member Function Documentation

◆ ContainsLabel< TLabel >()

bool ContainsLabel< TLabel > ( TLabel  label)
protected

Check if the sample list contains a given label...

Parameters
labelLabel to be checked.
Returns
True if the label was found in the sample list, false otherwise.
Template Parameters
TLabelLabel type.

◆ DataTransformImageToImage()

delegate Image DataTransformImageToImage ( Image  imgIn)

Image data transformation delegate.

Parameters
imgInImage to be transformed.
Returns
Transformed image.

◆ Dispose()

virtual void Dispose ( bool  disposing)
protectedvirtual

IDispose helper function.

Parameters
disposingtrue when called via IDisposable.Dispose, false when called by the finalizer.

◆ FromFile()

static SampleList FromFile ( string  fileName)
static

Load a Manto2 sample list from disc.

Parameters
fileNameFile to load the sample list from.
Returns
The loaded sample list object. Depending on the content of the file referred to by fileName the resulting SampleList can be cast to SampleRegressionImageList or SampleClassificationImageList after loading.
Exceptions
FileNotFoundExceptionif the file referred to by fileName does not exist.
FileLoadExceptionif loading the file referred to by fileName failed - probably due to incompatible file content.

◆ LabelToIndex< TLabel >()

abstract int LabelToIndex< TLabel > ( TLabel  label)
protectedpure virtual

Convert a class label to a class index.

Parameters
labelLabel to be converted.
Returns
Index of the label; -1 if the label is not found in the sample list.
Template Parameters
TLabelLabel type.

◆ LabelTransformStringToString()

delegate string LabelTransformStringToString ( string  labelIn)

Delegate for label transformation.

Parameters
labelInLabel to be transformed.
Returns
Transformed label.

◆ LabelTransformStringToVector()

delegate float[] LabelTransformStringToVector ( string  labelIn)

Delegate for label transformation.

Parameters
labelInLabel to be transformed.
Returns
Transformed label.

◆ LabelTransformVectorToString()

delegate string LabelTransformVectorToString ( float[]  labelIn)

Delegate for label transformation.

Parameters
labelInLabel to be transformed.
Returns
Transformed label.

◆ LabelTransformVectorToVector()

delegate float[] LabelTransformVectorToVector ( float[]  labelIn)

Delegate for label transformation.

Parameters
labelInLabel to be transformed.
Returns
Transformed label.

◆ RemoveLabel()

void RemoveLabel ( int  index)
protected

Remove a label and all the data objects associated with it based on its index.

Parameters
indexindex of the label to be removed
Exceptions
ObjectDisposedExceptionIf the sample list has already been disposed

◆ Save()

void Save ( string  fileName)

Save the Manto2 sample list to a file.

Parameters
fileNameFile name to save to.
Exceptions
ObjectDisposedExceptionIf the object to be saved has already been disposed.

Property Documentation

◆ Comment

string Comment
getset

Classifier comment text.

Exceptions
ObjectDisposedExceptionIf the sample list has already been disposed

◆ FileName

string FileName
get

Name of the file from which this image list was loaded (string.Empty if this image list was neither loaded nor saved since its construction).

Exceptions
ObjectDisposedExceptionIf the classifier has already been disposed

◆ Handle

IntPtr Handle
get

Native Manto2 classifier handle.

It is normally not necessary to work with this handle in CVB.Net. Note that using this handle in connection with the legacy CVB managed wrappers may actually be disruptive to your application.

Implements INativeHandle.

Event Documentation

◆ ObjectDisposing

NativeHandleEventDelegate ObjectDisposing

Raised when this object is about to be disposed via the IDisposable.Dispose method.

This event is raised right before this object is disposed. The dispose itself cannot be canceled.