CVB.Net 14.0
SampleImageList Class Reference

Class that wraps a Manto SIL More...

Inherits INativeHandle.

Classes

struct  ClassInformation
 Base class for providing SIL class informations More...
 
class  ClassInformationCollection
 ClassInformationCollection helper class for MantoSampleImageList More...
 
class  SampleInformationCollection
 Collection of samples inside a class of an SampleImageList. More...
 

Public Member Functions

 SampleImageList (string fileName)
 Constructor that loads an image List from a file. More...
 
 SampleImageList (SampleImageList sourceList)
 Copy Constructor for Sample image List More...
 
 SampleImageList (Size2D featureWindowSize, int featureWindowDimension, Point2D featureWindowOrigin, Point2D maxTranslation, Angle maxRotation)
 Create a new and empty image list from scratch. More...
 
void Dispose ()
 Dispose method that releases the image list
 
Rect GetTotalExtractionWindow ()
 Determine the total feature window parameters based on the current SIL parameters. The width and height of the Rect returned by this function are the minimum width and height of an image that can be passed into a sample image list created with the parameters passed into this function. More...
 
Rect MaximumExtractableRectangle (Image image)
 Check how much of an image may be used for sample extraction More...
 
void Save (string fileName)
 Save the current contents of the image list to a file. More...
 
void MergeClasses (string nameA, string nameB, string nameMerged)
 Merge two classes into a new class. More...
 
void AddClassSample (string name, Image image, Point2D position)
 Add a new sample image to a class. More...
 
void Merge (SampleImageList mergeList)
 Merge the contents of mergeList into this sample image list. More...
 

Static Public Member Functions

static Rect GetTotalExtractionWindow (Size2D featureWindowSize, Point2D featureWindowOrigin, Point2D maxTranslation, Angle maxRotation)
 Determine the total feature window parameters based on the current SIL parameters. The width and height of the Rect returned by this function are the minimum width and height of an image that can be passed into a sample image list created with the parameters passed into this function. More...
 

Protected Member Functions

virtual void Dispose (bool disposing)
 IDispose helper function. More...
 

Properties

IntPtr Handle [get]
 Native Manto image list 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...
 
static Version MantoVersion [get]
 Schema version of the Manto.dll that is currently being used. You can compare this version versus the Version of a Sample Image List to find out whether saving the Sample Image List will potentially break backward compatibility.
 
Version Version [get]
 Schema version of the sample image. The schema version is usually determined by the most up-to-date version of Manto that has saved the image list. Note that when saving an image list with schema version x with a Manto that has schema version y > x then the schema version of the image list becomes y and older versions of Manto will no longer be able to read the list. More...
 
Image MaskImage [get, set]
 Mask image to be applied during learning a classifier. The mask image must have the same size as the feature window! More...
 
Angle MaxRotation [get]
 Maximum rotation possible for automatic sample generation (in degrees). More...
 
Point2D MaxTranslation [get]
 Maximum translation in X and Y direction for automatic sample generation. More...
 
ClassInformationCollection Classes [get]
 Class collection. More...
 
int FeatureWindowDimension [get]
 Dimension of the image list's feature window More...
 
Size2D FeatureWindowSize [get]
 Size of the image list's feature Window. More...
 
Point2D FeatureWindowOrigin [get]
 Origin of the feature window More...
 
int ExcludedClassIndex [get, set]
 Index of the currently excluded class. More...
 
- 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

Class that wraps a Manto SIL

Constructor & Destructor Documentation

◆ SampleImageList() [1/3]

SampleImageList ( string  fileName)

Constructor that loads an image List from a file.

Parameters
fileNamename of the file from which to load the image list
Exceptions
ArgumentNullExceptionIf fileName is null

◆ SampleImageList() [2/3]

Copy Constructor for Sample image List

Parameters
sourceListList from which to copy
Exceptions
OutOfMemoryExceptionIf the creation of the copy failed due to an out of memory condition

◆ SampleImageList() [3/3]

SampleImageList ( Size2D  featureWindowSize,
int  featureWindowDimension,
Point2D  featureWindowOrigin,
Point2D  maxTranslation,
Angle  maxRotation 
)

Create a new and empty image list from scratch.

Parameters
featureWindowSizesize of the feature window for that image list
featureWindowDimensiondimension of the feature windows (number of planes)
featureWindowOrigincenter of the feature window (relative to top left corner)
maxTranslationmaximum translation parameter
maxRotationmaximum rotation parameter
Exceptions
OutOfMemoryExceptionIf the creation of the copy failed due to an out of memory condition

Member Function Documentation

◆ AddClassSample()

void AddClassSample ( string  name,
Image  image,
Point2D  position 
)

Add a new sample image to a class.

Parameters
nameclass to add the sample to. If the class does not yet exist, it will be generated
imageimage from which to take the sample
positionposition at which to extract the sample
Exceptions
ObjectDisposedExceptionIf the image list or the image has already been disposed
ArgumentNullExceptionIf name or image is null
InvalidOperationExceptionIf name contains an empty string
OutOfMemoryExceptionIf the addition failed

◆ Dispose()

virtual void Dispose ( bool  disposing)
protectedvirtual

IDispose helper function.

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

◆ GetTotalExtractionWindow() [1/2]

Rect GetTotalExtractionWindow ( )

Determine the total feature window parameters based on the current SIL parameters. The width and height of the Rect returned by this function are the minimum width and height of an image that can be passed into a sample image list created with the parameters passed into this function.

Returns
the total feature window of this SIL

◆ GetTotalExtractionWindow() [2/2]

static Rect GetTotalExtractionWindow ( Size2D  featureWindowSize,
Point2D  featureWindowOrigin,
Point2D  maxTranslation,
Angle  maxRotation 
)
static

Determine the total feature window parameters based on the current SIL parameters. The width and height of the Rect returned by this function are the minimum width and height of an image that can be passed into a sample image list created with the parameters passed into this function.

Parameters
featureWindowSizesize of the feature window
featureWindowOriginorigin of the feature window
maxTranslationmaximum translation
maxRotationmaximum rotation
Returns
the total feature window of a SIL created with the parameters passed

◆ MaximumExtractableRectangle()

Rect MaximumExtractableRectangle ( Image  image)

Check how much of an image may be used for sample extraction

Returns
Rectangle or Rectangle.Empty
Parameters
imageimage for which to calculate the maximum extractable rectangle
Exceptions
ObjectDisposedExceptionIf the image list or the image has already been disposed
NullReferenceExceptionIf image is null

◆ Merge()

void Merge ( SampleImageList  mergeList)

Merge the contents of mergeList into this sample image list.

If mergeList contains classes that are not present in this list, these classes will be added as necessary

Parameters
mergeListimage list to be merged into this image list
Exceptions
ArgumentNullExceptionIf mergeList is null
ObjectDisposedExceptionIf this image list or mergeList have already been disposed
InvalidOperationExceptionIf this image list and mergeList are not compatible

◆ MergeClasses()

void MergeClasses ( string  nameA,
string  nameB,
string  nameMerged 
)

Merge two classes into a new class.

Parameters
nameAname of the first class
nameBname of the second class
nameMergedname of the merged class (may be identical to that of class A or class B, but not the name of another class in the image list!
Exceptions
ObjectDisposedExceptionIf the image list has already been disposed
ArgumentNullExceptionIf nameA , nameB or nameMerged is null
ArgumentExceptionIf nameA , nameB or nameMerged is empty
InvalidOperationExceptionIf nameMerged already exists in the image list

◆ Save()

void Save ( string  fileName)

Save the current contents of the image list to a file.

Parameters
fileNamefile to which to save
Exceptions
ObjectDisposedExceptionIf the image list has already been disposed
ArgumentNullExceptionIf the fileName parameter is null
IOExceptionIf saving the image list failed

Property Documentation

◆ Classes

Class collection.

Exceptions
ObjectDisposedExceptionIf the image list has already been disposed

◆ ExcludedClassIndex

int ExcludedClassIndex
getset

Index of the currently excluded class.

Exceptions
ObjectDisposedExceptionIf the image list has already been disposed
ArgumentOutOfRangeExceptionIf the image list index is out of range.

◆ FeatureWindowDimension

int FeatureWindowDimension
get

Dimension of the image list's feature window

Exceptions
ObjectDisposedExceptionIf the image list has already been disposed

◆ FeatureWindowOrigin

Point2D FeatureWindowOrigin
get

Origin of the feature window

Exceptions
ObjectDisposedExceptionIf the image list has already been disposed

◆ FeatureWindowSize

Size2D FeatureWindowSize
get

Size of the image list's feature Window.

Exceptions
ObjectDisposedExceptionIf the image 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 Manto image list 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.

◆ MaskImage

Image MaskImage
getset

Mask image to be applied during learning a classifier. The mask image must have the same size as the feature window!

Exceptions
ObjectDisposedExceptionIf the image list or the mask image has already been disposed

◆ MaxRotation

Angle MaxRotation
get

Maximum rotation possible for automatic sample generation (in degrees).

Exceptions
ObjectDisposedExceptionIf the image list has already been disposed

◆ MaxTranslation

Point2D MaxTranslation
get

Maximum translation in X and Y direction for automatic sample generation.

Exceptions
ObjectDisposedExceptionIf the image list has already been disposed

◆ Version

Version Version
get

Schema version of the sample image. The schema version is usually determined by the most up-to-date version of Manto that has saved the image list. Note that when saving an image list with schema version x with a Manto that has schema version y > x then the schema version of the image list becomes y and older versions of Manto will no longer be able to read the list.

Exceptions
ObjectDisposedExceptionIf the image list or the mask image has already been disposed

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.