CVB.Net 14.0
Classifier Class Reference

Manto classifier object. More...

Inherits INativeHandle.

Classes

struct  ClassInformation
 Information about one of the classes in a Classifier. More...
 
class  ClassInformationCollection
 Collection for classifier-based class information. Classifier-based class information is a bit more scarce because it lacks the sample list. More...
 

Public Member Functions

 Classifier (string fileName)
 Constructor that loads a classifier from a file More...
 
void Dispose ()
 Dispose method that releases the classifier
 
void Save (string fileName)
 Save the classifier to a file. More...
 
SearchResult[] SearchAll (Image image, Rect aoi, bool useVote, double minConfidence, int locality, int granularity)
 Search for all occurrences of a known class in an image. More...
 
SearchResult[] SearchAll (Image image, Rect aoi, bool useVote, double minConfidence, int locality)
 Search for all occurrences of a known class in an image. More...
 
SearchResult Search (Image image, Rect aoi, bool useVote, double minConfidence, out Image accumulator)
 Search for the result with the highest confidence. More...
 
SearchResult Search (Image image, Rect aoi, bool useVote, double minConfidence)
 Search for the result with the highest confidence. More...
 

Protected Member Functions

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

Properties

IntPtr Handle [get]
 Native Manto 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...
 
ClassInformationCollection Classes [get]
 Collection of classes in this classifier. More...
 
string PreprocessingCode [get]
 Retrieves the preprocessing code that has been used for generating this Manto classifier. More...
 
string Comment [get, set]
 Textual comment for the classifier. More...
 
Size2D FeatureWindowSize [get]
 Size of the classifier's feature window. More...
 
int FeatureWindowDimension [get]
 Dimension of the classifier's feature window. More...
 
Point2D FeatureWindowOrigin [get]
 Dimension of the classifier's feature window. More...
 
int ExcludedClassIndex [get, set]
 index of the currently excluded class. More...
 
DecisionBoundary DecisionBoundary [get]
 Decision boundary setting that has been used for classifier generation. 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

Manto classifier object.

Constructor & Destructor Documentation

◆ Classifier()

Classifier ( string  fileName)

Constructor that loads a classifier from a file

Parameters
fileNamefile from which to load the classifier
Exceptions
FileNotFoundExceptionwhen the file specified by the fileName parameter does not exist
FileLoadExceptionIf the file specified by the fileName parameter exists, but cannot be loaded
ArgumentNullExceptionIf fileName is null

Member Function Documentation

◆ Dispose()

virtual void Dispose ( bool  disposing)
protectedvirtual

IDispose helper function.

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

◆ Save()

void Save ( string  fileName)

Save the classifier to a file.

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

◆ Search() [1/2]

SearchResult Search ( Image  image,
Rect  aoi,
bool  useVote,
double  minConfidence 
)

Search for the result with the highest confidence.

Parameters
imageimage in which to search
aoiregion of the image in which to search
useVoteswitch voting on or off (voting is a parameter that can allow for more precise class assignment when set to true, but setting voting to true will significantly increase the processing time)
minConfidenceminimum confidence for the results to be reported; must not exceed the range [0...1]
Returns
search result (SearchResult.Empty if nothing was found)
Exceptions
ObjectDisposedExceptionIf this classifier or the image has already been disposed
ArgumentOutOfRangeExceptionIf the minConfidence parameter exceeds the range [0..1]

◆ Search() [2/2]

SearchResult Search ( Image  image,
Rect  aoi,
bool  useVote,
double  minConfidence,
out Image  accumulator 
)

Search for the result with the highest confidence.

Parameters
imageimage in which to search
aoiregion of the image in which to search
useVoteswitch voting on or off (voting is a parameter that can allow for more precise class assignment when set to true, but setting voting to true will significantly increase the processing time)
minConfidenceminimum confidence for the results to be reported; must not exceed the range [0...1]
accumulatorreturns the accumulator built during the search operation; the accumulator may be useful for further result investigation
Returns
search result (SearchResult.Empty if nothing was found)
Exceptions
ObjectDisposedExceptionIf this classifier or the image has already been disposed
ArgumentOutOfRangeExceptionIf the minConfidence parameter exceeds the range [0..1]
ArgumentExceptionIf the image is incompatible with the classifier or the aoi cannot hold one of the classifier's classes.

◆ SearchAll() [1/2]

SearchResult[] SearchAll ( Image  image,
Rect  aoi,
bool  useVote,
double  minConfidence,
int  locality 
)

Search for all occurrences of a known class in an image.

Parameters
imageimage in which to search
aoiregion of the image in which to search
useVoteswitch voting on or off (voting is a parameter that can allow for more precise class assignment when set to true, but setting voting to true will significantly increase the processing time)
minConfidenceminimum confidence for the results to be reported; must not exceed the range [0...1]
localityseparation of the search results in pixels (no two results should be closer to each other than the distance specified here)
Returns
list of found results; might be empty if nothing was found, null if the search call failed
Exceptions
ObjectDisposedExceptionIf this classifier or the image has already been disposed
ArgumentOutOfRangeExceptionIf the minConfidence parameter exceeds the range [0..1]

◆ SearchAll() [2/2]

SearchResult[] SearchAll ( Image  image,
Rect  aoi,
bool  useVote,
double  minConfidence,
int  locality,
int  granularity 
)

Search for all occurrences of a known class in an image.

Parameters
imageimage in which to search
aoiregion of the image in which to search
useVoteswitch voting on or off (voting is a parameter that can allow for more precise class assignment when set to true, but setting voting to true will significantly increase the processing time)
minConfidenceminimum confidence for the results to be reported; must not exceed the range [0...1]
localityseparation of the search results in pixels (no two results should be closer to each other than the distance specified here)
granularitythe granularity parameter may be used to simulate a shorter or longer preprocessing code, making the grid of points to be calculated for classification denser or thinner; -1 indicates that the default value should be used; note that the granularity parameter can have a huge impact on processing time - it is generally not recommended to use parameters other than -1
Returns
list of found results; might be empty if nothing was found, null if the search call failed
Exceptions
ObjectDisposedExceptionIf this classifier or the image has already been disposed
ArgumentOutOfRangeExceptionIf the minConfidence parameter exceeds the range [0..1]
ArgumentExceptionIf the image is incompatible with the classifier or the aoi cannot hold one of the classifier's classes.

Property Documentation

◆ Classes

Collection of classes in this classifier.

Exceptions
ObjectDisposedExceptionIf the classifier has already been disposed

◆ Comment

string Comment
getset

Textual comment for the classifier.

Exceptions
ObjectDisposedExceptionIf the classifier has already been disposed

◆ DecisionBoundary

Decision boundary setting that has been used for classifier generation.

Exceptions
ObjectDisposedExceptionIf the image list has already been disposed

◆ ExcludedClassIndex

int ExcludedClassIndex
getset

index of the currently excluded class.

Exceptions
ObjectDisposedExceptionIf the classifier has already been disposed
ArgumentOutOfRangeExceptionIf the class index is out of range.

◆ FeatureWindowDimension

int FeatureWindowDimension
get

Dimension of the classifier's feature window.

Exceptions
ObjectDisposedExceptionIf the classifier has already been disposed

◆ FeatureWindowOrigin

Point2D FeatureWindowOrigin
get

Dimension of the classifier's feature window.

Exceptions
ObjectDisposedExceptionIf the classifier has already been disposed

◆ FeatureWindowSize

Size2D FeatureWindowSize
get

Size of the classifier's feature window.

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

◆ PreprocessingCode

string PreprocessingCode
get

Retrieves the preprocessing code that has been used for generating this Manto classifier.

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.