A Minos Training Set from which a classifier can be generated. More...
#include <cvb/minos/training_set.hpp>
Public Member Functions | |
TrainingSet () | |
Create an empty training set. More... | |
TrainingSet (const String &fileName) | |
Load a saved training set from a file. More... | |
TrainingSet (TrainingSet &&) noexcept=default | |
Move constructor. | |
TrainingSet & | operator= (TrainingSet &&) noexcept=default |
Move assignment operator. | |
void * | Handle () const noexcept |
Classic API CLF handle. More... | |
void | Save (const String &fileName) const |
Write the training set to a file. More... | |
std::vector< std::uint8_t > | ToBuffer () const |
Serializes the training set into a buffer. More... | |
std::unique_ptr< TrainingSet > | Transform (Matrix2D transformation) |
Generate a new training set by transforming this training set with a 2x2 transformation matrix. More... | |
std::vector< SearchResult > | CheckConsistency (double threshold, double density=1.0) |
Test all images in the parent training set for instances of this model that might have been forgotten during the training process. More... | |
int | ClassCount () const |
The number of identifiable classes inside this training set. More... | |
InstanceInfoCollection | Instances () const |
The instances contained in this training set. More... | |
int | InstancesTotal () const |
Total number of instances currently trained in this training set. More... | |
ImageInfoCollection | Images () const |
The images contained in this training set. More... | |
ModelInfoCollection | Models () const |
The models contained in this training set. More... | |
String | FileName () const |
Name of the file, from which this training set was loaded (empty string if this image list was neither loaded nor saved since its construction). More... | |
bool | IsModified () const |
Get a flag that informs about unsaved modifications to the training set. More... | |
void | SetIsModified (bool isModified) |
Set a flag that informs about unsaved modifications to the training set. More... | |
Rect< int > | Extent () const |
Extent of the classes in the training set relative to the anchor point. More... | |
Rect< int > | LastFeatureWindow () const |
Feature window of the last model that has been created for the training set. More... | |
String | Comment () const |
Get the comment assigned to the training set at generation time. More... | |
void | SetComment (String comment) |
Set the comment assigned to the training set at generation time. More... | |
double | ExpectationRadius () const |
Get the expectation radius - the radius that is searched for the best occurrence of a sample, when adding a new sample to the training set. More... | |
void | SetExpectationRadius (double expectationRadius) |
Set the expectation radius - the radius that is searched for the best occurrence of a sample, when adding a new sample to the training set. More... | |
double | CorrelationThreshold () const |
Gets the correlation threshold. The correlation value under which Minos proposes generating a new model, not generating a new instance of an existing model with which the new instance correlates poorly. More... | |
void | SetCorrelationThreshold (double correlationThreshold) |
Set the correlation threshold - the correlation value below which Minos will suggest the generation of a new model rather over the generation of a new instance of an existing model, with which the new instance correlates poorly. More... | |
Static Public Member Functions | |
static std::unique_ptr< TrainingSet > | Load (const String &fileName) |
Load a saved training set from a file. More... | |
static std::unique_ptr< TrainingSet > | FromBuffer (const void *buffer, size_t size) |
Recreate a serialized Minos training set from a byte array. More... | |
template<class RANGE > | |
static TypedRange< std::unique_ptr< TrainingSet >, std::uint8_t, RANGE >::type | FromBuffer (const RANGE &buffer) |
Recreate a serialized Minos training set from a byte array. More... | |
static std::unique_ptr< TrainingSet > | FromHandle (HandleGuard< TrainingSet > &&guard) |
Creates training set from a classic API handle. More... | |
A Minos Training Set from which a classifier can be generated.
|
inline |
Create an empty training set.
Any | exception derived from std::exception including CvbException. |
|
inline |
Load a saved training set from a file.
[in] | fileName | Name of the file to be loaded. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Test all images in the parent training set for instances of this model that might have been forgotten during the training process.
[in] | threshold | Correlation threshold to be used for the consistency check. |
[in] | density | Density to be used for the consistency check. |
Any | exception derived from std::exception including CvbException. |
|
inline |
The number of identifiable classes inside this training set.
Any | exception derived from std::exception including CvbException. |
The number of classes cannot be higher than the number of trained models (see property Models). If two models have the same name, the classifier can no longer distinguish between these two models, reducing the ClassCount property.
|
inline |
Get the comment assigned to the training set at generation time.
Any | exception derived from std::exception including CvbException. |
|
inline |
Gets the correlation threshold. The correlation value under which Minos proposes generating a new model, not generating a new instance of an existing model with which the new instance correlates poorly.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get the expectation radius - the radius that is searched for the best occurrence of a sample, when adding a new sample to the training set.
Any | exception derived from std::exception including CvbException. |
|
inline |
Extent of the classes in the training set relative to the anchor point.
Any | exception derived from std::exception including CvbException. |
|
inline |
Name of the file, from which this training set 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 training set from a byte array.
[in] | buffer | Byte array from which to create the training set. |
Any | exception derived from std::exception including CvbException. |
|
inlinestatic |
Recreate a serialized Minos training set from a byte array.
[in] | buffer | Byte array from which to create the training set. |
[in] | size | Number of bytes to use. |
Any | exception derived from std::exception including CvbException. |
|
inlinestatic |
Creates training set from a classic API handle.
[in] | guard | Life time guard for C-API handle. |
Any | exception derived from std::exception including CvbException. |
The training set 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 |
The images contained in this training set.
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 |
The instances contained in this training set.
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 |
Total number of instances currently trained in this training set.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get a flag that informs about unsaved modifications to the training set.
Any | exception derived from std::exception including CvbException. |
Saving the training set will set this flag to false.
|
inline |
Feature window of the last model that has been created for the training set.
Any | exception derived from std::exception including CvbException. |
|
inlinestatic |
Load a saved training set from a file.
[in] | fileName | Name of the file to be loaded. |
Any | exception derived from std::exception including CvbException. |
|
inline |
The models contained in this training set.
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 |
Write the training set to a file.
[in] | fileName | Path to save to. |
Any | exception derived from std::exception including CvbException. |
As a side effect this function sets the IsModified flag to false, if the training set was saved successfully.
|
inline |
Set the comment assigned to the training set at generation time.
[in] | comment | The comment. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Set the correlation threshold - the correlation value below which Minos will suggest the generation of a new model rather over the generation of a new instance of an existing model, with which the new instance correlates poorly.
[in] | correlationThreshold | The correlation threshold. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Set the expectation radius - the radius that is searched for the best occurrence of a sample, when adding a new sample to the training set.
[in] | expectationRadius | The expectation radius. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Set a flag that informs about unsaved modifications to the training set.
[in] | isModified | The is-modified flag. |
Any | exception derived from std::exception including CvbException. |
Saving the training set will set this flag to false.
|
inline |
Serializes the training set into a buffer.
Any | exception derived from std::exception including CvbException. |
|
inline |
Generate a new training set by transforming this training set with a 2x2 transformation matrix.
[in] | transformation | Matrix with which to transform the geometry of this training set. |
Any | exception derived from std::exception including CvbException. |