CVB++ 14.0
SearchPredictorFactory Class Reference

Factory class for the generation of search predictors. More...

#include <cvb/polimago/search_predictor_factory.hpp>

Inherits PredictorFactoryBase.

Public Member Functions

 SearchPredictorFactory ()
 Constructor. More...
 
int SampleSize () const noexcept
 Gets the sample size that has been used in each training set. More...
 
void SetSampleSize (int sampleSize)
 Sets the sample size that has been used in each training set. More...
 
double ExtractionRadius () const noexcept
 Gets the radius for extracting positive search instances. More...
 
void SetExtractionRadius (double radius)
 Sets the radius for extracting positive search instances. More...
 
ValueRange< AngleAngleRange () const
 Gets the range of angles to be covered during classifier training. More...
 
void SetAngleRange (ValueRange< Angle > range)
 Sets the range of angles to be covered during classifier training. More...
 
ValueRange< double > ScaleRange () const
 Gets the range of scale factors to be covered during classifier training. Only meaningful if the invariance type RotationScaleTranslation has been set. More...
 
void SetScaleRange (ValueRange< double > range)
 Sets the range of scale factors to be covered during classifier training. Only meaningful if the invariance type RotationScaleTranslation has been set. More...
 
ValueRange< double > SingularValueRange () const
 Gets the range of permissible singular values to be covered during classifier training. Only meaningful if the invariance type AffineGroup has been set. More...
 
void SetSingularValueRange (ValueRange< double > range)
 Sets the range of permissible singular values to be covered during classifier training. Only meaningful if the invariance type AffineGroup has been set. More...
 
InvarianceType Invariances () const noexcept
 Gets the invariances to be used for generating the classifier. More...
 
void SetInvariances (InvarianceType invariances)
 Sets the invariances to be used for generating the classifier. More...
 
int NumClassificationSteps () const noexcept
 Gets the number of classification steps during search operation. More...
 
void SetNumClassificationSteps (int numSteps)
 Sets the number of classification steps during search operation. More...
 
int FeatureResolutionStep1And2 () const noexcept
 Gets the feature resolution (determines the size of the classification retina) for search step 1 and 2. More...
 
void SetFeatureResolutionStep1And2 (int resolution)
 Sets the feature resolution (determines the size of the classification retina) for search step 1 and 2. More...
 
int FeatureResolutionRest () const noexcept
 Gets the feature resolution (determines the size of the classification retina) for step 3 and up. More...
 
void SetFeatureResolutionRest (int resolution)
 Sets the feature resolution (determines the size of the classification retina) for step 3 and up. More...
 
void UseSettingsFromPredictor (const SearchPredictor &clf)
 Copy the predictor generation settings from a predictor. More...
 
- Public Member Functions inherited from PredictorFactoryBase
double Lambda () const noexcept
 Gets the regularization value to be used for generating the object. More...
 
void SetLambda (double lambda)
 Sets the regularization value to be used for generating the object. Possible values range from 0 to 10, good starting values for experiments are usually around 0.01. More...
 
String Preprocessing () const
 Get preprocessing code with which the object is to be generated. More...
 
void SetPreprocessing (const String &code)
 Set preprocessing code with which the object is to be generated. More...
 

Static Public Member Functions

static ValueRange< double > ScaleFactorRangeDefault ()
 Default value for the scale factor range.
 
static ValueRange< double > SingularValueRangeDefault ()
 Default value for the singular value range.
 
static ValueRange< double > ScaleFactorRange ()
 Acceptable scale factor range for search classifier training.
 
- Static Public Member Functions inherited from PredictorFactoryBase
static ValueRange< double > LambdaRange ()
 Acceptable scale factor range for search classifier training.
 
static ValueRange< int > FeatureResolutionRange ()
 Valid range of feature resolution value.
 
static constexpr std::array< char, 4 > PreprocessingValidCharacters ()
 Characters that a preprocessing string may contain.
 
static String FormatPreprocessingCode (const String &input)
 Correct a preprocessing code to make sure that no invalid characters are in the code and the code does not exceed the maximum length. More...
 

Static Public Attributes

static constexpr int NumClassificationStepsMin = 3
 Minimum classification step count.
 
static constexpr int SampleSizeMin = 1
 Absolute minimum value for SampleSize.
 
- Static Public Attributes inherited from PredictorFactoryBase
static constexpr double LambdaDefault = 0.1
 Default value for lambda.
 
static constexpr int FeatureResolutionDefault = 1
 Default value for feature resolution.
 
static constexpr int PreprocessingMaxLength = 15
 Maximum length of a preprocessing code (excluding the terminating zero).
 

Detailed Description

Factory class for the generation of search predictors.

Constructor & Destructor Documentation

◆ SearchPredictorFactory()

Constructor.

Exceptions
Anyexception derived from std::exception including CvbException.

Member Function Documentation

◆ AngleRange()

ValueRange< Angle > AngleRange ( ) const
inline

Gets the range of angles to be covered during classifier training.

Returns
The angle range.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ ExtractionRadius()

double ExtractionRadius ( ) const
inlinenoexcept

Gets the radius for extracting positive search instances.

Returns
The extration radius.
Exceptions
Doesnot throw any exception.

The unit size is the size of the feature window, i.e. a value of 0.5 means that positive samples can be extracted from withing a range of +/- Feature Window Width and +/- Feature Window Height around each trained instance. Smaller values will necessitate a finer search grid but may yield better results on difficult search tasks.

◆ FeatureResolutionRest()

int FeatureResolutionRest ( ) const
inlinenoexcept

Gets the feature resolution (determines the size of the classification retina) for step 3 and up.

Returns
The feature resolution.
Exceptions
Doesnot throw any exception.

◆ FeatureResolutionStep1And2()

int FeatureResolutionStep1And2 ( ) const
inlinenoexcept

Gets the feature resolution (determines the size of the classification retina) for search step 1 and 2.

Returns
The feature resolution.
Exceptions
Doesnot throw any exception.

◆ Invariances()

InvarianceType Invariances ( ) const
inlinenoexcept

Gets the invariances to be used for generating the classifier.

Returns
The invariance type.
Exceptions
Doesnot throw any exception.

◆ NumClassificationSteps()

int NumClassificationSteps ( ) const
inlinenoexcept

Gets the number of classification steps during search operation.

Returns
The number of steps.
Exceptions
Doesnot throw any exception.

◆ SampleSize()

int SampleSize ( ) const
inlinenoexcept

Gets the sample size that has been used in each training set.

Returns
The sample size.
Exceptions
Doesnot throw any exception.

◆ ScaleRange()

ValueRange< double > ScaleRange ( ) const
inline

Gets the range of scale factors to be covered during classifier training. Only meaningful if the invariance type RotationScaleTranslation has been set.

Returns
The scale range.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ SetAngleRange()

void SetAngleRange ( ValueRange< Angle range)
inline

Sets the range of angles to be covered during classifier training.

Parameters
[in]rangeThe angle range.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ SetExtractionRadius()

void SetExtractionRadius ( double  radius)
inline

Sets the radius for extracting positive search instances.

Parameters
[in]radiusThe extration radius.
Exceptions
Anyexception derived from std::exception including CvbException.

The unit size is the size of the feature window, i.e. a value of 0.5 means that positive samples can be extracted from withing a range of +/- Feature Window Width and +/- Feature Window Height around each trained instance. Smaller values will necessitate a finer search grid but may yield better results on difficult search tasks.

◆ SetFeatureResolutionRest()

void SetFeatureResolutionRest ( int  resolution)
inline

Sets the feature resolution (determines the size of the classification retina) for step 3 and up.

Parameters
[in]resolutionThe feature resolution.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ SetFeatureResolutionStep1And2()

void SetFeatureResolutionStep1And2 ( int  resolution)
inline

Sets the feature resolution (determines the size of the classification retina) for search step 1 and 2.

Parameters
[in]resolutionThe feature resolution.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ SetInvariances()

void SetInvariances ( InvarianceType  invariances)
inline

Sets the invariances to be used for generating the classifier.

Parameters
[in]invariancesThe invariance type.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ SetNumClassificationSteps()

void SetNumClassificationSteps ( int  numSteps)
inline

Sets the number of classification steps during search operation.

Parameters
[in]numStepsThe number of steps.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ SetSampleSize()

void SetSampleSize ( int  sampleSize)
inline

Sets the sample size that has been used in each training set.

Parameters
[in]sampleSizeThe sample size.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ SetScaleRange()

void SetScaleRange ( ValueRange< double >  range)
inline

Sets the range of scale factors to be covered during classifier training. Only meaningful if the invariance type RotationScaleTranslation has been set.

Parameters
[in]rangeThe scale range.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ SetSingularValueRange()

void SetSingularValueRange ( ValueRange< double >  range)
inline

Sets the range of permissible singular values to be covered during classifier training. Only meaningful if the invariance type AffineGroup has been set.

Parameters
[in]rangeThe singular value range.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ SingularValueRange()

ValueRange< double > SingularValueRange ( ) const
inline

Gets the range of permissible singular values to be covered during classifier training. Only meaningful if the invariance type AffineGroup has been set.

Returns
The singular value range.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ UseSettingsFromPredictor()

void UseSettingsFromPredictor ( const SearchPredictor clf)
inline

Copy the predictor generation settings from a predictor.

Parameters
[in]clfPredictor to take the settings from.
Exceptions
Anyexception derived from std::exception including CvbException.