ShapeFinder2 classifier object. More...
#include <cvb/shapefinder2/classifier.hpp>
Public Member Functions | |
Classifier (const String &fileName) | |
Loads a classifier with the given file name. More... | |
void * | Handle () const noexcept |
Classic API classifier handle. More... | |
void | Save (const String &fileName) const |
Writes the classifier to a file. More... | |
std::unique_ptr< Image > | Visualization (int layer=-1) const |
Creates and returns a color coded image representation of this ShapeFinder classifier. More... | |
int | NumLayers () const noexcept |
Number of layers in the classifier. More... | |
String | FileName () const noexcept |
Gets the name of the file, from which this classifier was loaded. More... | |
void | SetComment (const String &comment) noexcept |
Set the comment assigned to the classifier. More... | |
String | Comment () const noexcept |
Get the comment assigned to the classifier. More... | |
Cvb::ShapeFinder2::GradientType | GradientType () const noexcept |
Get the gradient type this classifier uses for feature extraction. More... | |
Rect< int > | FeatureWindow () const noexcept |
Get the feature window of this classifier. More... | |
int | ContrastThreshold () const noexcept |
Get the threshold for the gradient slope. More... | |
void | SetContrastThreshold (int threshold) |
Set the threshold for the gradient slope. More... | |
Angle | AngularTolerance () const noexcept |
Get the acceptance parameter for feature gradient angles. More... | |
void | SetAngularTolerance (Angle angularTolerance) |
Set the acceptance parameter for feature gradient angles. More... | |
int | FeatureCount () const noexcept |
Get the number of features this classifier contains. More... | |
bool | UseCuda (CudaStatus status) const noexcept |
Set the flag to use CUDA if possible or to force not using CUDA. More... | |
std::vector< SearchResult > | SearchAll (const ImagePlane &plane, Rect< int > aoi, PrecisionMode precision, double relativeThreshold, int minimumThreshold, int coarseLocality, ValueRange< Angle > rotationRange, ValueRange< double > scaleRange) |
Use this classifier to perform a ShapeFinder search on an image plane. More... | |
std::vector< SearchResult > | SearchAll (const ImagePlane &plane, Rect< int > aoi, PrecisionMode precision, double relativeThreshold, int minimumThreshold, int coarseLocality) |
Use this classifier to perform a ShapeFinder search on an image plane. More... | |
Rect< int > | TrainingWindow () const noexcept |
Training window of the classes in the classifier relative to the anchor point. More... | |
std::vector< Point2D< double > > | FineFeatures () const noexcept |
The features the classifier uses on the finely granular level. More... | |
std::vector< Point2D< double > > | CoarseFeatures () const noexcept |
Features the classifier uses on the coarsely granular level. More... | |
int | CoarseScale () const noexcept |
Scale factor between the fine and the coarse feature level. More... | |
ValueRange< Angle > | Rotation () |
Range of rotations for which this classifier has been generated. More... | |
ValueRange< double > | Scale () |
Range of scales for which this classifier has been generated. More... | |
Cvb::ShapeFinder2::ContrastMode | ContrastMode () |
Contrast mode for which this classifier has been created. More... | |
double | RotationStep () |
Step size at which the rotations in the classifier have been generated. More... | |
double | ScaleStep () |
Step size at which the scales in the classifier have been generated. More... | |
Static Public Member Functions | |
static std::unique_ptr< Classifier > | FromHandle (HandleGuard< Classifier > &&guard) |
Creates a classifier from a classic API handle. More... | |
static std::unique_ptr< Classifier > | Create (const String &fileName) |
Creates a classifier object loading a classifier file. More... | |
ShapeFinder2 classifier object.
|
inlineexplicit |
Loads a classifier with the given file name.
[in] | fileName | The file name. |
Any | exception derived from std::exception including CvbException. |
|
inlinenoexcept |
Get the acceptance parameter for feature gradient angles.
Does | not throw any exception. |
|
inlinenoexcept |
Features the classifier uses on the coarsely granular level.
Does | not throw any exception. |
|
inlinenoexcept |
Scale factor between the fine and the coarse feature level.
Does | not throw any exception. |
|
inlinenoexcept |
Get the comment assigned to the classifier.
Does | not throw any exception. |
|
inline |
Contrast mode for which this classifier has been created.
Does | not throw any exception. |
|
inlinenoexcept |
Get the threshold for the gradient slope.
Does | not throw any exception. |
|
inlinestatic |
Creates a classifier object loading a classifier file.
[in] | fileName | The file name. |
Any | exception derived from std::exception including CvbException. |
|
inlinenoexcept |
Get the number of features this classifier contains.
Does | not throw any exception. |
|
inlinenoexcept |
Get the feature window of this classifier.
Does | not throw any exception. |
|
inlinenoexcept |
Gets the name of the file, from which this classifier was loaded.
Does | not throw any exception. |
|
inlinenoexcept |
The features the classifier uses on the finely granular level.
Does | not throw any exception. |
|
inlinestatic |
Creates a classifier from a classic API handle.
[in] | guard | Life time guard for C-API handle. |
Any | exception derived from std::exception including CvbException. |
The classifier takes ownership of the handle, so you must share it before using this function.
|
inlinenoexcept |
Get the gradient type this classifier uses for feature extraction.
Does | not throw any exception. |
|
inlinenoexcept |
Classic API classifier handle.
Does | not throw any exception. |
It is normally not necessary to work with this handle.
|
inlinenoexcept |
Number of layers in the classifier.
Does | not throw any exception. |
|
inline |
Range of rotations for which this classifier has been generated.
Does | not throw any exception. |
|
inline |
Step size at which the rotations in the classifier have been generated.
Does | not throw any exception. |
|
inline |
Writes the classifier to a file.
[in] | fileName | The file name to save the classifier. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Range of scales for which this classifier has been generated.
Does | not throw any exception. |
|
inline |
Step size at which the scales in the classifier have been generated.
Does | not throw any exception. |
|
inline |
Use this classifier to perform a ShapeFinder search on an image plane.
[in] | plane | The image plane in which to use the classifier. |
[in] | aoi | The area of interest in the plane to search in. |
[in] | precision | The search mode to use. |
[in] | relativeThreshold | The threshold used for eliminating less promising candidates in the edge model search step. |
[in] | minimumThreshold | The minimum gray value different that must be visible in the image before an edge location may be considered a feature. |
[in] | coarseLocality | The minimum distance between two results in the coarse layer during the edge model search. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Use this classifier to perform a ShapeFinder search on an image plane.
[in] | plane | The image plane in which to use the classifier. |
[in] | aoi | The area of interest in the plane to search in. |
[in] | precision | The search mode to use. |
[in] | relativeThreshold | The threshold used for eliminating less promising candidates in the edge model search step. |
[in] | minimumThreshold | The minimum gray value different that must be visible in the image before an edge location may be considered a feature. |
[in] | coarseLocality | The minimum distance between two results in the coarse layer during the edge model search. |
[in] | rotationRange | The range of rotations to be reported. |
[in] | scaleRange | The range of scales to be reported. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Set the acceptance parameter for feature gradient angles.
[in] | angularTolerance | The angular tolerance. |
Any | exception derived from std::exception including CvbException. |
|
inlinenoexcept |
Set the comment assigned to the classifier.
[in] | comment | The comment string of the classifier. |
Does | not throw any exception. |
|
inline |
Set the threshold for the gradient slope.
[in] | threshold | The contrast threshold. |
Any | exception derived from std::exception including CvbException. |
|
inlinenoexcept |
Training window of the classes in the classifier relative to the anchor point.
Does | not throw any exception. |
|
inlinenoexcept |
Set the flag to use CUDA if possible or to force not using CUDA.
[in] | status | The CUDA status. If CudaStatus::SFCS_ForceDisable CUDA won't be used in SF2Search. |
Does | not throw any exception. |
|
inline |
Creates and returns a color coded image representation of this ShapeFinder classifier.
[in] | layer | The layer of the classifier to be visualized. A value of -1 superimposes all layers. |
Any | exception derived from std::exception including CvbException. |