ShapeFinder classifier object.
More...
Inherits ClassifierObject.
|
| Classifier (Classifier other) |
| Copy constructor for ShapeFinder classifiers More...
|
|
| Classifier (string fileName) |
| Load a saved classifier from a file. More...
|
|
SearchResult[] | SearchAll (ImagePlane plane, Rect aoi, PrecisionMode mode, int locality, int threshold) |
| Search for all matches inside an image plane . More...
|
|
SearchResult | SearchBest (ImagePlane plane, Rect aoi, PrecisionMode mode) |
| Search for the best pattern match in the plane More...
|
|
void | DeleteFeatures (Rect window) |
| Delete features in a given window from this classifier. More...
|
|
void | TruncateFeatures (int count) |
| Shorten the list of classifier features based on each feature's quality. More...
|
|
void | ReverseContrasts () |
| Reverse the contrasts on this ShapeFinder classifier. More...
|
|
void | Append (Classifier clf) |
| Append another classifier to this one. Appending means that the layers contained in clf will be appended to the layers of this classifier, so the layers (which may be considered models) of the two classifiers are left unchanged. Note that both classifiers involved must use the same gradient type. More...
|
|
| 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...
|
|
|
int | ContrastThreshold [get, set] |
| Threshold for the gradient slope. More...
|
|
Angle | AngularTolerance [get, set] |
| Acceptance parameter for feature gradient angles. In ShapeFinder the angle of a feature is quantized into the range [0...255], i.e. in steps of roughly 1.41 degrees. When determining whether features extracted from an image match features stored in a classifier, the gradient's angle of the two features is compared not for strict equality, but for whether or not it falls into a certain range of differences. This acceptance window is defined by the Angular tolerance parameter. Valid values range from 0 (always match for identity only) to 16. More...
|
|
int | FeatureCount [get] |
| Number of features this classifier contains. More...
|
|
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.
|
|
ShapeFinder classifier object.
◆ Classifier() [1/2]
Copy constructor for ShapeFinder classifiers
- Parameters
-
other | classifier to be duplicated |
- Exceptions
-
ArgumentNullException | If other is null |
ObjectDisposedException | If other has already been disposed |
◆ Classifier() [2/2]
Load a saved classifier from a file.
- Parameters
-
fileName | name of the file to be loaded |
- Exceptions
-
FileNotFoundException | If the classifier file does not exist |
FileLoadException | If loading an existing classifier file failed either because the file is unreadable or because it does not contain a ShapeFinder2 classifier |
ArgumentNullException | If fileName is null |
◆ Append()
Append another classifier to this one. Appending means that the layers contained in clf will be appended to the layers of this classifier, so the layers (which may be considered models) of the two classifiers are left unchanged. Note that both classifiers involved must use the same gradient type.
- Parameters
-
clf | classifier to be appended to this one |
- Exceptions
-
ArgumentNullException | If clf is null |
ObjectDisposedException | If this classifir or clf have been disposed |
InvalidOperationException | when trying to merge a classifier with a different gradient type |
◆ DeleteFeatures()
void DeleteFeatures |
( |
Rect |
window | ) |
|
Delete features in a given window from this classifier.
- Parameters
-
- Exceptions
-
ObjectDisposedException | If this classifier has already been disposed |
◆ ReverseContrasts()
void ReverseContrasts |
( |
| ) |
|
Reverse the contrasts on this ShapeFinder classifier.
- Exceptions
-
ObjectDisposedException | If this classifier has already been disposed |
◆ SearchAll()
Search for all matches inside an image plane .
- Parameters
-
plane | image plane in which to search |
aoi | area of interest in which to search |
mode | precision to use |
locality | minimum distance between two results (if two results come closer than this distance (measured with the L1 norm) the one with the lower quality will be discarded) |
threshold | minimum quality a result must have for being considered (quality corresponds to the number of model features found in the image) |
- Returns
- list of the found results
- Exceptions
-
ArgumentException | If locality or threshold are less than 1 |
◆ SearchBest()
Search for the best pattern match in the plane
- Parameters
-
plane | image plane to search in |
aoi | area of interest to search in |
mode | precision mode to use |
- Returns
- the best matching result
- Exceptions
-
ArgumentNullException | If plane 's Parent is null |
ArgumentOutOfRangeException | If plane is less than 0 or greater or equal to the number of planes in the image |
CvbException | If the data type of the image plane to be processed is not 8 bits per pixel unsigned |
◆ TruncateFeatures()
void TruncateFeatures |
( |
int |
count | ) |
|
Shorten the list of classifier features based on each feature's quality.
- Parameters
-
count | desired feature count after truncation; if count exceeds the value of FeatureCount then this function will not do anything |
- Exceptions
-
ObjectDisposedException | If this classifier has already been disposed |
◆ AngularTolerance
Acceptance parameter for feature gradient angles. In ShapeFinder the angle of a feature is quantized into the range [0...255], i.e. in steps of roughly 1.41 degrees. When determining whether features extracted from an image match features stored in a classifier, the gradient's angle of the two features is compared not for strict equality, but for whether or not it falls into a certain range of differences. This acceptance window is defined by the Angular tolerance parameter. Valid values range from 0 (always match for identity only) to 16.
- Exceptions
-
ObjectDisposedException | If the classifier has already been disposed |
ArgumentOutOfRangeException | when trying to set a value smaller than 0 or bigger than 16 |
◆ ContrastThreshold
Threshold for the gradient slope.
- Exceptions
-
ObjectDisposedException | If the classifier has already been disposed |
ArgumentOutOfRangeException | when trying to set a value smaller than 1 |
◆ FeatureCount
Number of features this classifier contains.
- Exceptions
-
ObjectDisposedException | If the classifier has already been disposed |