Minos classifier object. More...
#include <cvb/minos/classifier.hpp>
Public Member Functions | |
| Classifier (const String &fileName) | |
| Loads a classifier with the given file name. | |
| void * | Handle () const noexcept |
| Classic API CLF handle. | |
| void | Save (const String &fileName) const |
| Write the classifier to a file. | |
| std::vector< std::uint8_t > | ToBuffer () const |
| Builds a byte buffer with the classifier. | |
| String | FileName () const |
| Name of the file from which this classifier was loaded (empty string, if this image list was neither loaded nor saved since its construction). | |
| ClassifierModelInfoCollection | Models () const |
| Collection of the models contained in this classifier. | |
| Rect< int > | Extent () const noexcept |
| Extent of the classes in the classifier relative to the anchor point. | |
| std::chrono::system_clock::time_point | CreationDate () const noexcept |
| Creation date of the classifier. | |
| bool | IsMinos16BitClassifier () const |
| Returns true if the classifier was generated by Minos16Bit. | |
| int | ContrastTrigger () const |
| Get the trigger value for the contrast of features to be taken into account. | |
| void | SetContrastTrigger (int trigger) |
| Set the trigger value for the contrast of features to be taken into account. | |
| double | Threshold () const |
| Get the threshold for search operations with normalized quality feedback. | |
| void | SetThreshold (double threshold) |
| Set the threshold for search operations with normalized quality feedback. | |
| QualityFeedback | QualityMeasure () const |
| Get the type of quality feedback from the classifier. | |
| void | SetQualityMeasure (QualityFeedback quality) |
| Set the type of quality feedback from the classifier. | |
| String | TrainingSetName () const |
| Get name of the training set from which this classifier was generated. | |
| class LearnParameters | LearnParameters () const |
| Get the set of parameters that has been used during classifier generation. | |
| String | Comment () const |
| Get the comment assigned to the classifier at generation time. | |
| void | SetComment (String comment) |
| Set the comment assigned to the classifier at generation time. | |
| std::unique_ptr< Classifier > | Transform (Matrix2D transformation) |
| Generate a new classifier by transforming this classifier with a 2x2 transformation matrix. | |
| std::unique_ptr< Classifier > | SetGlobalAdvanceVector (Point2D< int > advance) |
| Create a new classifier, that is a copy of this classifier, but with a global advance vector applied to all classes in the classifier. | |
| String | Read (const ImagePlane &plane, ReadMode mode, Area2D startAOI, Area2D ocrAOI, SearchResult &startOrStop, double density=1.0) |
| Reads a string of characters. | |
| std::vector< SearchResult > | Read (const ImagePlane &plane, Area2D startAOI, Area2D ocrAOI, double density=1.0) |
| Reads a list of characters. | |
| SearchResult | Search (const ImagePlane &plane, SearchMode mode, Area2D aoi, double density=1.0) |
| Search one object using this Minos classifier. | |
| SearchResult | Search (const ImagePlane &plane, SearchMode mode, double density=1.0) |
| Search one object using this Minos classifier. | |
| std::vector< SearchResult > | SearchAll (const ImagePlane &plane, int locality, Area2D aoi, double density=1.0) |
| Search all objects using this Minos classifier. | |
| std::vector< SearchResult > | SearchAll (const ImagePlane &plane, int locality, double density=1.0) |
| Search all objects using this Minos classifier. | |
Static Public Member Functions | |
| static std::unique_ptr< Classifier > | Load (const String &fileName) |
| Load a saved classifier from a file. | |
| static std::unique_ptr< Classifier > | FromBuffer (const void *buffer, size_t size) |
| Recreate a serialized Minos classifier from a byte array. | |
| template<class RANGE> | |
| static TypedRange< std::unique_ptr< Classifier >, std::uint8_t, RANGE >::type | FromBuffer (const RANGE &buffer) |
| Recreate a serialized Minos classifier from a byte array. | |
| static std::unique_ptr< Classifier > | FromHandle (HandleGuard< Classifier > &&guard) |
| Creates classifier from a classic API handle. | |
Minos classifier object.
|
inlineexplicit |
Loads a classifier with the given file name.
| [in] | fileName | The file name. |
| Any | exception derived from std::exception including CvbException. |
|
inline |
Get the comment assigned to the classifier at generation time.
| Any | exception derived from std::exception including CvbException. |
|
inline |
Get the trigger value for the contrast of features to be taken into account.
| Any | exception derived from std::exception including CvbException. |
|
inlinenoexcept |
Creation date of the classifier.
| Does | not throw any exception. |
|
inlinenoexcept |
Extent of the classes in the classifier relative to the anchor point.
| Does | not throw any exception. |
|
inline |
Name of the file from which this classifier was loaded (empty string, if this image list was neither loaded nor saved since its construction).
| Any | exception derived from std::exception including CvbException. |
|
inlinestatic |
Recreate a serialized Minos classifier from a byte array.
| [in] | buffer | Byte array from which to create the classifier. |
| Any | exception derived from std::exception including CvbException. |
|
inlinestatic |
Recreate a serialized Minos classifier from a byte array.
| [in] | buffer | Byte array from which to create the classifier. |
| [in] | size | Number of bytes to use. |
| Any | exception derived from std::exception including CvbException. |
|
inlinestatic |
Creates 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 |
Classic API CLF handle.
| Does | not throw any exception. |
It is normally not necessary to work with this handle.
|
inline |
Returns true if the classifier was generated by Minos16Bit.
| Any | exception derived from std::exception including CvbException. |
|
inline |
Get the set of parameters that has been used during classifier generation.
| Any | exception derived from std::exception including CvbException. |
|
inlinestatic |
Load a saved classifier from a file.
| [in] | fileName | Name of the file to be loaded. |
| Any | exception derived from std::exception including CvbException. |
|
inline |
Collection of the models contained in this classifier.
| Any | exception derived from std::exception including CvbException. |
The collection keeps internal link to the classifier, shares resources with it and stays valid even if the classifier object itself gets destroyed.
|
inline |
Get the type of quality feedback from the classifier.
| Any | exception derived from std::exception including CvbException. |
|
inline |
Reads a list of characters.
| [in] | plane | Image plane to read on. |
| [in] | startAOI | Area in which to start the read operation. |
| [in] | ocrAOI | Area 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. |
| [in] | density | Density to be used for the read operation. |
| Any | exception derived from std::exception including CvbException. |
Uses the following approach:
|
inline |
Reads a string of characters.
| [in] | plane | Image plane to read on. |
| [in] | mode | Read mode. |
| [in] | startAOI | Area in which to start the read operation. |
| [in] | ocrAOI | Area 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. |
| [out] | startOrStop | First or last character that has been read (depending on the value of the mode parameter), output. |
| [in] | density | Density to be used for the read operation. |
| Any | exception derived from std::exception including CvbException. |
Uses the following approach:
|
inline |
Write the classifier to a file.
| [in] | fileName | Path to save to. |
| Any | exception derived from std::exception including CvbException. |
|
inline |
Search one object using this Minos classifier.
| [in] | plane | Image plane to search on. |
| [in] | mode | Search mode to be used. |
| [in] | aoi | Area to search in. |
| [in] | density | Density at which to search ([0...1]). |
| Any | exception derived from std::exception including CvbException. |
|
inline |
Search one object using this Minos classifier.
| [in] | plane | Image plane to search on. |
| [in] | mode | Search mode to be used. |
| [in] | density | Density at which to search ([0...1]). |
| Any | exception derived from std::exception including CvbException. |
|
inline |
Search all objects using this Minos classifier.
| [in] | plane | Image plane to search on. |
| [in] | locality | Radius within which no better solution may exist. |
| [in] | aoi | Area to search in. |
| [in] | density | Density at which to search ([0...1]). |
| Any | exception derived from std::exception including CvbException. |
|
inline |
Search all objects using this Minos classifier.
| [in] | plane | Image plane to search on. |
| [in] | locality | Radius within which no better solution may exist. |
| [in] | density | Density at which to search ([0...1]). |
| Any | exception derived from std::exception including CvbException. |
|
inline |
Set the comment assigned to the classifier at generation time.
| [in] | comment | The comment. |
| Any | exception derived from std::exception including CvbException. |
|
inline |
Set the trigger value for the contrast of features to be taken into account.
| [in] | trigger | The trigger value. |
| Any | exception derived from std::exception including CvbException. |
|
inline |
Create a new classifier, that is a copy of this classifier, but with a global advance vector applied to all classes in the classifier.
| [in] | advance | Advance vector to apply globally. |
| Any | exception derived from std::exception including CvbException. |
|
inline |
Set the type of quality feedback from the classifier.
| [in] | quality | The quality value. |
| Any | exception derived from std::exception including CvbException. |
|
inline |
Set the threshold for search operations with normalized quality feedback.
| [in] | threshold | The threshold value. |
| Any | exception derived from std::exception including CvbException. |
|
inline |
Get the threshold for search operations with normalized quality feedback.
| Any | exception derived from std::exception including CvbException. |
|
inline |
Builds a byte buffer with the classifier.
| Any | exception derived from std::exception including CvbException. |
|
inline |
Get name of the training set from which this classifier was generated.
| Any | exception derived from std::exception including CvbException. |
|
inline |
Generate a new classifier by transforming this classifier with a 2x2 transformation matrix.
| [in] | transformation | Matrix with which to transform the geometry of this classifier. |
| Any | exception derived from std::exception including CvbException. |