ShapeFinder2 classifier object.
More...
Inherits ClassifierObject.
|
| Classifier (string fileName) |
| Load a saved classifier from a file. More...
|
|
SearchResult[] | SearchAll (ImagePlane plane, Rect aoi, PrecisionMode precision, double relativeThreshold, int minimumThreshold, int coarseLocality) |
| Use this classifier to perform a ShapeFinder search on an image plane . More...
|
|
bool | UseCuda (CudaStatus status) |
| Allows disabling the use of CUDA and returns whether CUDA will in fact be used. 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...
|
|
|
Rect | Extent [get] |
| Training window of the classes in the classifier relative to the anchor point. More...
|
|
ReadOnlyCollection< Point2D > | FineFeatures [get] |
| Features the classifier uses on the finely granular level. More...
|
|
ReadOnlyCollection< Point2D > | CoarseFeatures [get] |
| Features the classifier uses on the coarsely granular level. More...
|
|
int | CoarseScale [get] |
| Scale factor between the fine and the coarse feature level. More...
|
|
ValueRange< Angle > | Rotation [get] |
| Range of rotations for which this classifier has been generated. Rotations are given in degrees. More...
|
|
ValueRange< double > | Scale [get] |
| Range of scales for which this classifier has been generated. More...
|
|
ContrastMode | ContrastMode [get] |
| Contrast mode for which this classifier has been created. More...
|
|
double | RotationStep [get] |
| Step size at which the rotations in the classifier have been generated. Rotations steps are given in degrees. More...
|
|
double | ScaleStep [get] |
| Step size at which the scales in the classifier have been generated. 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.
|
|
ShapeFinder2 classifier object.
◆ Classifier()
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 |
◆ SearchAll()
Use this classifier to perform a ShapeFinder search on an image plane .
- Parameters
-
plane | the image plane to search in; must have 8 bits per pixel in the plane in which the ShapeFinder2 classifier should search |
aoi | The area of interest in the plane to search in; reducing the area of interest will decrease search time but not necessarily linearly (i.e. a reduction to half the image will not necessarily reduce the processing time by a factor of 2). Note that strictly speaking the area parameter applies only to the ShapeFinder2 edge model search; if you use one of the correlation modes (precision set to either PrecisionMode.CorrelationCoarse or PrecisionMode.CorrelationFine) it is possible for reported results to actually lie outside the area if hill climbing did lead them out of the area. |
precision | search mode to use (see description of PrecisionMode for a description of the different search modes |
relativeThreshold | Threshold used for eliminating less promising candidates in the edge model search step of ShapeFinder2. During the edge model search phase, ShapeFinder2 gathers a list of candidates for possible object sites, and each candidate is assigned a quality derived from the number of features present at its site. The relative threshold is applied when deciding whether or not a new candidate may enter the list: If its quality is less than relativeThreshold percent of the so far best candidate, it may not enter the candidate list. Eliminating less promising candidates in this way has the advantage that the time needed for calculating their correlation in the (optional) correlation search step of ShapeFinder2 may be drastically reduced. Relative threshold must be given as a per cent value in in the range [0...1] |
minimumThreshold | minimum gray value different that must be visible in the image before an edge location may be considered a feature; minimumThreshold must be given a value great than 0 |
coarseLocality | Minimum distance between two results in the coarse layer during the ShapeFinder2 edge model search. If two of the candidates are closer than coarseLocality pixels in the coarse layer, the one with the lower quality will be eliminated. Keep in mind that this locality operates on the coarse layer: Setting it to a value of 10 will effectively lead to a minimum distance of 40 if the size factor (2^Scale) between the coarse and the fine layer is 4. Also note that if you perform a correlation step (precision set to either PrecisionMode.CorrelationCoarse or PrecisionMode.CorrelationFine) the actually reported results can (and are indeed not unlikely to) be less than coarseLocality * 2^Scale if the hill climbing algorithm brings them closer together. |
- Returns
- list of all results that were found
- Exceptions
-
ObjectDisposedException | If this classifier or the Parent of plane has already been disposed |
ArgumentNullException | If the Parent of plane is null |
CvbException | If the selected plane has a data type other than 8 bits per pixel unsigned or if an unspecified error occurred |
ArgumentOutOfRangeException | If the relativeThreshold exceeds its valid ranges or if minimumThreshold is 0 or less or coarseLocality is less than 0 |
◆ UseCuda()
Allows disabling the use of CUDA and returns whether CUDA will in fact be used.
- Parameters
-
- Returns
- True if status is CudaStatus.Default and a CUDA capable device is present, false otherwise.
◆ CoarseFeatures
ReadOnlyCollection<Point2D> CoarseFeatures |
|
get |
Features the classifier uses on the coarsely granular level.
- Exceptions
-
ObjectDisposedException | If the classifier has already been disposed |
◆ CoarseScale
Scale factor between the fine and the coarse feature level.
- Exceptions
-
ObjectDisposedException | If the classifier has already been disposed |
◆ ContrastMode
Contrast mode for which this classifier has been created.
- Exceptions
-
ObjectDisposedException | If the classifier has already been disposed |
◆ Extent
Training window of the classes in the classifier relative to the anchor point.
- Exceptions
-
ObjectDisposedException | If the classifier has already been disposed |
◆ FineFeatures
ReadOnlyCollection<Point2D> FineFeatures |
|
get |
Features the classifier uses on the finely granular level.
- Exceptions
-
ObjectDisposedException | If the classifier has already been disposed |
◆ Rotation
Range of rotations for which this classifier has been generated. Rotations are given in degrees.
- Exceptions
-
ObjectDisposedException | If the classifier has already been disposed |
◆ RotationStep
Step size at which the rotations in the classifier have been generated. Rotations steps are given in degrees.
- Exceptions
-
ObjectDisposedException | If the classifier has already been disposed |
◆ Scale
Range of scales for which this classifier has been generated.
- Exceptions
-
ObjectDisposedException | If the classifier has already been disposed |
◆ ScaleStep
Step size at which the scales in the classifier have been generated.
- Exceptions
-
ObjectDisposedException | If the classifier has already been disposed |