CVB.Net 14.0
Classifier Class Reference

Minos classifier object. More...

Inherits INativeHandle.

Classes

struct  ModelInformation
 Information about a Minos classifier model. More...
 
class  ModelInformationCollection
 Collection of model informations. More...
 

Public Member Functions

 Classifier (string fileName)
 Load a saved classifier from a file. More...
 
 Classifier (byte[] buffer)
 Recreate a serialized Minos classifier from a byte array. More...
 
 Classifier (byte[] buffer, int offset, int size)
 Recreate a serialized Minos classifier from a byte array. More...
 
void Dispose ()
 IDisposable implementation. More...
 
void Save (string fileName)
 Write the classifier to a file. More...
 
Classifier Transform (Matrix2D transformation)
 Generate a new classifier by transforming this classifier with a 2x2 transformation matrix. More...
 
unsafe string Read (ImagePlane plane, ReadMode mode, Area2D startAOI, double density, Area2D ocrAOI, out SearchResult startOrStop)
 Reads a string of characters, using the following approach:

  1. To begin with, the first object in the startAOI will be searched.
  2. This result's advance vector will be added to this result's position; around the result position, the ocrAOI will be centered.
  3. The result area will be used as the AOI for a new FindFirst search operation.

The whole process will be repeated until no more results are encountered. String of up to 32k characters are read. More...

 
SearchResult[] Read (ImagePlane plane, Area2D startAOI, double density, Area2D ocrAOI)
 Reads a list of characters, using the following approach:

  1. To begin with, the first object in the startAOI will be searched.
  2. This result's advance vector will be added to this result's position; around the result position, the ocrAOI will be centered.
  3. The result area will be used as the AOI for a new FindFirst search operation.

The whole process will be repeated until no more results are encountered. String of up to 32k characters are read. More...

 
unsafe SearchResult Search (ImagePlane plane, SearchMode mode, Area2D aoi, double density)
 Search one object using this Minos classifier. More...
 
SearchResult Search (ImagePlane plane, SearchMode mode, double density)
 Search one object using this Minos classifier. More...
 
SearchResult Search (ImagePlane plane, SearchMode mode)
 Search one object using this Minos classifier. More...
 
SearchResult[] SearchAll (ImagePlane plane, Area2D aoi, double density, int locality)
 Search all objects using this Minos classifier More...
 
SearchResult[] SearchAll (ImagePlane plane, double density, int locality)
 Overloaded SearchAll function (re-routes with default arguments for area) More...
 
SearchResult[] SearchAll (ImagePlane plane, int locality)
 Overloaded SearchAll function (re-routes with default arguments for area and density) More...
 

Protected Member Functions

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

Properties

IntPtr Handle [get]
 Native Minos 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...
 
ModelInformationCollection Models [get]
 Collection of the models contained in this classifier. More...
 
bool IsDisposed [get]
 Tests if the native handle has already been disposed.
 
bool IsMinos16BitClassifier [get]
 returns true if the classifier was generated by Minos16Bit More...
 
int ContrastTrigger [get, set]
 Trigger value for the contrast of features to be taken into account. More...
 
double Threshold [get, set]
 Threshold for search operations witz normalized quality feedback. More...
 
QualityFeedback QualityMeasure [get, set]
 Selects the type of quality feedback from the classifier. More...
 
Rect Extent [get]
 Extent of the classes in the classifier relative to the anchor point. More...
 
unsafe string TrainingSetName [get]
 Name of the training set from which this classifier was generated. More...
 
DateTime CreationDate [get]
 Creation date of the classifier. More...
 
LearnParameters LearnParameters [get]
 Gets the set of parameters that has been used during classifier generation. More...
 
unsafe string Comment [get, set]
 Comment assigned to the classifier at generation time 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

Minos classifier object.

Constructor & Destructor Documentation

◆ Classifier() [1/3]

Classifier ( string  fileName)

Load a saved classifier from a file.

Parameters
fileNamename of the file to be loaded
Exceptions
FileNotFoundExceptionIf the classifier file does not exist
FileLoadExceptionIf loading an existing classifier file failed
ArgumentNullExceptionIf fileName is null

◆ Classifier() [2/3]

Classifier ( byte[]  buffer)

Recreate a serialized Minos classifier from a byte array.

Parameters
bufferbyte array from which to create the classifier.

◆ Classifier() [3/3]

Classifier ( byte[]  buffer,
int  offset,
int  size 
)

Recreate a serialized Minos classifier from a byte array.

Parameters
bufferByte array from which to create the classifier
offsetoffset at which to start
sizenumber of bytes to use
Exceptions
ArgumentNullExceptionIf buffer is null
ArgumentExceptionIf offset is less than zero or size is less than zero
ArgumentOutOfRangeExceptionIf offset and size have values that together exceed the length of buffer
InvalidDataExceptionIf buffer does not contain a deserializable Minos classifier at the given offset.

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.

◆ Read() [1/2]

SearchResult[] Read ( ImagePlane  plane,
Area2D  startAOI,
double  density,
Area2D  ocrAOI 
)

Reads a list of characters, using the following approach:

  1. To begin with, the first object in the startAOI will be searched.
  2. This result's advance vector will be added to this result's position; around the result position, the ocrAOI will be centered.
  3. The result area will be used as the AOI for a new FindFirst search operation.

The whole process will be repeated until no more results are encountered. String of up to 32k characters are read.

Parameters
planeimage plane to read on
startAOIarea in which to start the read operation
densitydensity to be used for the read operation
ocrAOIarea to be used for the intermediate read steps; this area will be applied relative to the expected position of the next character and is typically only a few pixels wide and high
Returns
the list of characters that has been read by this function
Exceptions
ArgumentNullExceptionIf the Parent of plane is null
ArgumentOutOfRangeExceptionIf density is either less than 0 or greater than 1
ObjectDisposedExceptionIf the classifier or the image it should work on has already been disposed

◆ Read() [2/2]

unsafe string Read ( ImagePlane  plane,
ReadMode  mode,
Area2D  startAOI,
double  density,
Area2D  ocrAOI,
out SearchResult  startOrStop 
)

Reads a string of characters, using the following approach:

  1. To begin with, the first object in the startAOI will be searched.
  2. This result's advance vector will be added to this result's position; around the result position, the ocrAOI will be centered.
  3. The result area will be used as the AOI for a new FindFirst search operation.

The whole process will be repeated until no more results are encountered. String of up to 32k characters are read.

Parameters
planeimage plane to read on
moderead mode
startAOIarea in which to start the read operation
densitydensity to be used for the read operation
ocrAOIarea to be used for the intermediate read steps; this area will be applied relative to the expected position of the next character and is typically only a few pixels wide and high
startOrStopfirst or last character that has been read (depending on the value of the mode parameter)
Returns
the string that has been read by this function
Exceptions
ArgumentNullExceptionIf the Parent of plane is null
ArgumentOutOfRangeExceptionIf if density is either less than 0 or greater than 1
ObjectDisposedExceptionIf the classifier or the image it should work on has already been disposed

◆ 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


◆ Search() [1/3]

SearchResult Search ( ImagePlane  plane,
SearchMode  mode 
)

Search one object using this Minos classifier.

Parameters
planeimage plane to search on
modesearch mode to be used
Returns
the found result (SearchResult.Empty if none was found).
Exceptions
ArgumentNullExceptionIf the Parent of plane is null
ObjectDisposedExceptionIf the classifier or the Image it should be used on has already been disposed


◆ Search() [2/3]

unsafe SearchResult Search ( ImagePlane  plane,
SearchMode  mode,
Area2D  aoi,
double  density 
)

Search one object using this Minos classifier.

Parameters
planeimage plane to search on
modesearch mode to be used
aoiarea to search in
densitydensity at which to search ([0...1])
Returns
the found result (SearchResult.Empty if none was found).
Exceptions
ArgumentNullExceptionIf the Parent of plane is null
ArgumentOutOfRangeExceptionIf density is either less than 0 or greater than 1
ObjectDisposedExceptionIf the classifier or the image it should be used on has already been disposed

◆ Search() [3/3]

SearchResult Search ( ImagePlane  plane,
SearchMode  mode,
double  density 
)

Search one object using this Minos classifier.

Parameters
planeimage plane to search on
modesearch mode to be used
densitydensity at which to search ([0...1])
Returns
the found result (SearchResult.Empty if none was found).
Exceptions
ArgumentNullExceptionIf the Parent of plane is null
ArgumentOutOfRangeExceptionIf density is either less than 0 or greater than 1
ObjectDisposedExceptionIf the classifier has already been disposed


◆ SearchAll() [1/3]

SearchResult[] SearchAll ( ImagePlane  plane,
Area2D  aoi,
double  density,
int  locality 
)

Search all objects using this Minos classifier

Parameters
planeimage plane to search on
aoiArea to search in
densitydensity at which to search ([0...1])
localityRadius within which no better solution may exist
Returns
list of found results
Exceptions
ArgumentNullExceptionIf the Parent of plane is null
ArgumentOutOfRangeExceptionIf plane is either less than 0 or greater than the number of planes minus 1, or if density is either less than 0 or greater than 1 or if locality is less than 0
ObjectDisposedExceptionIf the classifier has already been disposed

◆ SearchAll() [2/3]

SearchResult[] SearchAll ( ImagePlane  plane,
double  density,
int  locality 
)

Overloaded SearchAll function (re-routes with default arguments for area)

Parameters
planeimage plane to search in
densitydensity with which to search
localityminimum distance between results
Returns
result list
Exceptions
ArgumentNullExceptionIf the Parent of plane is null
ArgumentOutOfRangeExceptionIf density is either less than 0 or greater than 1 or if locality is less than 0
ObjectDisposedExceptionIf the classifier or the Image it should be used on has already been disposed

◆ SearchAll() [3/3]

SearchResult[] SearchAll ( ImagePlane  plane,
int  locality 
)

Overloaded SearchAll function (re-routes with default arguments for area and density)

Parameters
planeImage plane to search in
localityminimum distance between results
Returns
result list
Exceptions
ArgumentNullExceptionIf the Parent of plane is null
ArgumentOutOfRangeExceptionIf locality is less than 0
ObjectDisposedExceptionIf the classifier has already been disposed

◆ Transform()

Classifier Transform ( Matrix2D  transformation)

Generate a new classifier by transforming this classifier with a 2x2 transformation matrix.

Parameters
transformationmatrix with which to transform the geometry of this classifier
Returns
transformed classifier
Exceptions
ObjectDisposedExceptionIf the classifier has already been disposed
DivideByZeroExceptionwhen providing a transformation matrix that is singular.

Property Documentation

◆ Comment

unsafe string Comment
getset

Comment assigned to the classifier at generation time

Exceptions
ObjectDisposedExceptionIf the classifier has already been disposed

◆ ContrastTrigger

int ContrastTrigger
getset

Trigger value for the contrast of features to be taken into account.

Exceptions
ObjectDisposedExceptionIf the classifier has already been disposed
ArgumentExceptionwhen trying to set an invalid trigger value

◆ CreationDate

DateTime CreationDate
get

Creation date of the classifier.

Exceptions
ObjectDisposedExceptionIf the classifier has already been disposed

◆ Extent

Rect Extent
get

Extent of the classes in the classifier relative to the anchor point.

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

◆ Handle

IntPtr Handle
get

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

◆ IsMinos16BitClassifier

bool IsMinos16BitClassifier
get

returns true if the classifier was generated by Minos16Bit

Exceptions
ObjectDisposedExceptionIf the classifier has already been disposed

◆ LearnParameters

Gets the set of parameters that has been used during classifier generation.

Exceptions
ObjectDisposedExceptionIf the classifier has already been disposed

◆ Models

Collection of the models contained in this classifier.

Exceptions
ObjectDisposedExceptionIf the classifier has already been disposed

◆ QualityMeasure

QualityFeedback QualityMeasure
getset

Selects the type of quality feedback from the classifier.

Exceptions
ObjectDisposedExceptionIf the classifier has already been disposed

◆ Threshold

double Threshold
getset

Threshold for search operations witz normalized quality feedback.

Exceptions
ObjectDisposedExceptionIf the classifier has already been disposed
ArgumentOutOfRangeExceptionwhen trying to set a value less than 0.0 or greater than 1.0

◆ TrainingSetName

unsafe string TrainingSetName
get

Name of the training set from which this classifier was generated.

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.