CVB.Net 14.0
SampleClassificationImageList Class Reference

Classifier type that operates on images. More...

Inherits SampleImageList.

Classes

class  ImageClassificationInfoCollection
 Collection of class information inside a classification sample list. More...
 
class  ImageClassificationLabelInfo
 Classification label information More...
 

Public Member Functions

 SampleClassificationImageList (SampleListImageDataType imageDataType)
 Create a sample image list suitable for classification tasks. More...
 
SampleClassificationImageList Transform (DataTransformImageToImage dlg)
 Transform this Sample Image List into a new sample image list by transforming each sample inside it. More...
 
SampleClassificationImageList Transform (LabelTransformStringToString dlg)
 Transform this Sample Image List into a new sample image list by transforming each label inside it. More...
 
SampleRegressionImageList Transform (LabelTransformStringToVector dlg)
 Transform this Sample Image List into a new sample image list by transforming each label inside it. More...
 
ImageClassificationLabelInfo GetClassFromSample (int sampleIndex)
 Retrieve the label information that goes with a given sample. More...
 
void GetIndicesForSampleIndex (int sampleIndex, out int clsIdx, out int splIdx)
 For a given sample index (running from 0 to NumSamples-1) this method determines the indices of the class and the sample inside the class. More...
 
- Public Member Functions inherited from SampleImageList
void SetFeatureWindow (Point2D location, Size2D size, Point2D origin)
 Redefine the feature window of the sample image list. Note that the values provided must be consistent with the image size for which this sample image list has been created, otherwise an exception will be raised. More...
 
bool IsCompatible (Image img)
 Check whether a CVB image is compatible with this image list, i.e. if it is generally possible to add samples from that image to the list. More...
 
Image GetSampleImage (int sampleIndex)
 Retrieve an image by its overall sample index (ranging from 0 to NumSamples-1. More...
 
- Public Member Functions inherited from SampleList
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 SampleClassificationImageList ImportMantoSil (string fileName)
 Load a Manto2 sample list from disc. More...
 
- Static Public Member Functions inherited from SampleList
static SampleList FromFile (string fileName)
 Load a Manto2 sample list from disc. More...
 

Properties

ImageClassificationInfoCollection Classes [get]
 Class collection. More...
 
override Type LabelType [get]
 Type of the labels used by this SampleList.
 
- Properties inherited from SampleImageList
Fringes Fringes [get]
 Fringes (= size difference between the images and the feature window) of the sample images.
 
Size2D FeatureWindowSize [get]
 Size of the feature window.
 
Point2D FeatureWindowLocation [get]
 Location of the feature window (position of left top corner inside the image).
 
Point2D FeatureWindowOrigin [get]
 Location of the feature window origin in pixel coordinates measured from the left top corner of the feature window.
 
Size2D ImageSize [get]
 Size of the images (in pixels) that can be added to the image list.
 
int ImageDimension [get]
 Size of the images (in pixels) that can be added to the image list.
 
DataType ImageDataType [get]
 Data type of the images that can be added to the image list. (all planes must have same data type)
 
override Type SampleType [get]
 Type of the samples used by this SampleList.
 
- Properties inherited from SampleList
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.
 

Additional Inherited Members

- Protected Member Functions inherited from SampleImageList
void BaseInit ()
 Allows the inheritor to do a reinitialization of the base class parameters.
 
IntPtr CreateNativeImageData (Image srcImage, Point2D extractionLocation)
 Utility function for inheritors that creates a native image data object to be added to the SIL. Make sure to manually release the handle once it is no longer needed! More...
 
- Protected Member Functions inherited from SampleList
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...
 
- Events inherited from SampleList
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

Classifier type that operates on images.

Constructor & Destructor Documentation

◆ SampleClassificationImageList()

Create a sample image list suitable for classification tasks.

Parameters
imageDataTypeData type of the images to be added to the sample image list.
Exceptions
OutOfMemoryExceptionIf the creation of the sample image list failed.

Member Function Documentation

◆ GetClassFromSample()

ImageClassificationLabelInfo GetClassFromSample ( int  sampleIndex)

Retrieve the label information that goes with a given sample.

Parameters
sampleIndexIndex of the sample for which to retrieve the class information.
Returns
The indexed class.
Exceptions
ArgumentOutOfRangeExceptionif sampleIndex is outside the range [0...NumSamples-1]

◆ GetIndicesForSampleIndex()

void GetIndicesForSampleIndex ( int  sampleIndex,
out int  clsIdx,
out int  splIdx 
)

For a given sample index (running from 0 to NumSamples-1) this method determines the indices of the class and the sample inside the class.

Parameters
sampleIndexSample index to get the indices for.
clsIdxClass Index
splIdxSample index inside the claass's Sample collection.

◆ ImportMantoSil()

static SampleClassificationImageList ImportMantoSil ( string  fileName)
static

Load a Manto2 sample list from disc.

Parameters
fileNameFile to import.
Returns
The imported Manto image list.
Exceptions
FileNotFoundExceptionif the file referred to by fileName was not found
FileLoadExceptionif importing the Manto SIL from the file referred to by fileName failed.

◆ Transform() [1/3]

Transform this Sample Image List into a new sample image list by transforming each sample inside it.

Parameters
dlgSample transformation delegate.
Returns
New sample list or null on error.

◆ Transform() [2/3]

Transform this Sample Image List into a new sample image list by transforming each label inside it.

Parameters
dlgLabel transformation delegate.
Returns
New sample list or null on error.

◆ Transform() [3/3]

Transform this Sample Image List into a new sample image list by transforming each label inside it.

Parameters
dlgLabel transformation delegate.
Returns
New sample list or null on error.

Property Documentation

◆ Classes

Class collection.

Exceptions
ObjectDisposedExceptionIf the image list has already been disposed