CVB.Net 14.0
ClassifierObject Class Referenceabstract

Base class for ShapeFinder classifiers. More...

Inherits INativeHandle.

Inherited by Classifier, and Classifier.

Public Member Functions

 ClassifierObject (string fileName, string typeName)
 Load a saved classifier from a file. More...
 
void Dispose ()
 IDisposable implementation. More...
 
void Transform (Matrix2D m)
 Transform this ShapeFinder classifier using a 2x2 matrix. More...
 
void Translate (Point2D offset)
 Translate this classifier by a selectable offset . More...
 
void Save (string fileName)
 Write the classifier to a file. More...
 
Image GetVisualization (int layer)
 Create and return a color coded image representation of this ShapeFinder classifier. The colors in the output image correspond to the gradient directions, the positions to the displacement vectors. This visual representation might be useful during interactive supervision and debugging. More...
 
Image GetVisualization ()
 Create and return a color coded image representation of this ShapeFinder classifier. The colors in the output image correspond to the gradient directions, the positions to the displacement vectors. This visual representation might be useful during interactive supervision and debugging. More...
 

Protected Member Functions

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

Properties

IntPtr Handle [get]
 Native ShapeFinder2 classifier handle. More...
 
string FileName [get]
 Name of the file from which this classifier was loaded (string.Empty if this image list was neither loaded nor saved since its construction). More...
 
bool IsDisposed [get]
 Tests if the native handle has already been disposed.
 
unsafe string Comment [get, set]
 Comment assigned to the classifier. More...
 
GradientType GradientType [get]
 Gradient type this classifier uses for feature extraction. More...
 
Rect FeatureWindow [get]
 Feature window of this classifier (i.e. the bounding rectangle into which all the classifier's features fit) relative to the classifier's origin. More...
 
int NumLayers [get]
 Number of layers in the classifier (and in the accumulator generated by the search function). In ShapeFinder classifiers layers may be associated with specific classes or rotation information. In ShapeFinder2 the layer count is a purely informational value. 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

Base class for ShapeFinder classifiers.

Constructor & Destructor Documentation

◆ ClassifierObject()

ClassifierObject ( string  fileName,
string  typeName 
)

Load a saved classifier from a file.

Parameters
fileNamename of the file to be loaded
typeNametype name to be used for generating error messages
Exceptions
FileNotFoundExceptionIf the classifier file does not exist
FileLoadExceptionIf loading an existing classifier file failed either because the file is unreadable or because it does not contain a ShapeFinder classifier of the correct type
ArgumentNullExceptionIf fileName is null

Member Function Documentation

◆ Dispose() [1/2]

void Dispose ( )

IDisposable implementation.

Call this method to release the resources allocated by this object immediately. Remember that after calling Dispose, any subsequent access to references to this object will result in an ObjectDisposedException.

◆ Dispose() [2/2]

virtual void Dispose ( bool  disposing)
protectedvirtual

IDispose helper function.

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

◆ GetVisualization() [1/2]

Image GetVisualization ( )

Create and return a color coded image representation of this ShapeFinder classifier. The colors in the output image correspond to the gradient directions, the positions to the displacement vectors. This visual representation might be useful during interactive supervision and debugging.

Returns
image representation of the selected classifier layer(s)
Exceptions
ObjectDisposedExceptionIf this classifier has already been disposed

◆ GetVisualization() [2/2]

Image GetVisualization ( int  layer)

Create and return a color coded image representation of this ShapeFinder classifier. The colors in the output image correspond to the gradient directions, the positions to the displacement vectors. This visual representation might be useful during interactive supervision and debugging.

Parameters
layerlayer of the classifier to be visualized; a value of -1 superimposes all layers
Returns
image representation of the selected classifier layer(s)
Exceptions
ObjectDisposedExceptionIf this classifier has already been disposed
ArgumentOutOfRangeExceptionIf the layer parameter exceeds the range [-1...NumLayers]

◆ Save()

void Save ( string  fileName)

Write the classifier to a file.

Parameters
fileName
Exceptions
ObjectDisposedExceptionIf the classifier has already been disposed
ArgumentNullExceptionwhen fileName is null


◆ Transform()

void Transform ( Matrix2D  m)

Transform this ShapeFinder classifier using a 2x2 matrix.

Parameters
mmatrix to transform the this classifier with
Exceptions
ObjectDisposedExceptionIf this classifier has already been disposed

◆ Translate()

void Translate ( Point2D  offset)

Translate this classifier by a selectable offset .

Parameters
offsetoffset vector by which to translate the classifier
Exceptions
ObjectDisposedExceptionIf this classifier has already been disposed

Property Documentation

◆ Comment

unsafe string Comment
getset

Comment assigned to the classifier.

Exceptions
ObjectDisposedExceptionIf the classifier has already been disposed

◆ FeatureWindow

Rect FeatureWindow
get

Feature window of this classifier (i.e. the bounding rectangle into which all the classifier's features fit) relative to the classifier's origin.

Exceptions
ObjectDisposedExceptionIf the classifier has already been disposed

◆ FileName

string FileName
get

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

Exceptions
ObjectDisposedExceptionIf the classifier has already been disposed

◆ GradientType

Gradient type this classifier uses for feature extraction.

Exceptions
ObjectDisposedExceptionIf the classifier has already been disposed

◆ Handle

IntPtr Handle
get

Native ShapeFinder2 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.

◆ NumLayers

int NumLayers
get

Number of layers in the classifier (and in the accumulator generated by the search function). In ShapeFinder classifiers layers may be associated with specific classes or rotation information. In ShapeFinder2 the layer count is a purely informational value.

Exceptions
ObjectDisposedExceptionIf the classifier 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.