3 #include "../_cexports/c_polimago.h" 5 #include "../global.hpp" 6 #include "../image.hpp" 7 #include "../string.hpp" 9 #include "../size_2d.hpp" 10 #include "../point_2d.hpp" 24 inline String GetPreprocessing (CExports::TFeatureMap fm)
27 return String (s.begin (), s.end ());
47 : handle_(std::move(guard)),
48 trainingParameters_(),
68 return handle_.Handle();
89 SaveFunction (fileName);
100 return trainingParameters_.Lambda;
110 return trainingParameters_.Offset;
120 if (trainingParameters_.FeatureMap.Interpolate == 0)
137 return trainingParameters_.FeatureMap.NumImgPlanes;
147 return Rect<int> (trainingParameters_.FeatureMap.FWL, trainingParameters_.FeatureMap.FWT, trainingParameters_.FeatureMap.FWR, trainingParameters_.FeatureMap.FWB);
157 return Size2D<int> (trainingParameters_.FeatureMap.RetinaW, trainingParameters_.FeatureMap.RetinaH);
167 return Point2D<double> (trainingParameters_.FeatureMap.CorrectX, trainingParameters_.FeatureMap.CorrectY);
177 return Private::GetPreprocessing (trainingParameters_.FeatureMap);
181 virtual void SaveFunction (
const String &fileName)
const = 0;
185 ReleaseObjectGuard handle_;
187 CExports::TTrainParams trainingParameters_;
222 VerifyCompatibility (img, pos);
241 VerifyCompatibility (img);
251 void VerifyCompatibility (
const Image &img)
const 263 void VerifyCompatibility (
const Image &img, Point2D<int> pos)
const 265 VerifyCompatibility (img);
268 throw std::invalid_argument (
"The selected position cannot be evaluated because there is not enough image data available around it.");
272 throw std::invalid_argument (
"The selected position cannot be evaluated because there is not enough image data available around it.");
289 CVB_CALL_CAPI(PMGetClfTrainParams(
Handle(), trainingParameters_));
306 return trainingParameters_.FeatureMap.FeatureResolution;
323 std::string asciiCode (Internal::CastToAscii(preproCode));
324 return CVB_CALL_CAPI(PMGetGranularity(asciiCode.c_str()));
int ImagePlanes() const noexcept
The plane count of the images that have been used for generating this classifier. Image on which this...
Definition: predictor_base.hpp:135
T Width() const noexcept
Gets the width of the rectangle.
Definition: rect.hpp:171
double Offset() const noexcept
Intercept weight that has been used for generating this object.
Definition: predictor_base.hpp:108
String FileName() const
Name of the file the object has been loaded from (or empty string if the object was not loaded).
Definition: predictor_base.hpp:76
InterpolationType Interpolation() const noexcept
Interpolation setting used for generating this object.
Definition: predictor_base.hpp:118
double Lambda() const noexcept
Regularization value that has been used for generating this object.
Definition: predictor_base.hpp:98
Rect< int > FeatureWindowExtent() const noexcept
The feature window extent that has been used during classifier training.
Definition: predictor_base.hpp:145
Base class for Polimago objects created by one of the factory classes.
Definition: predictor_base.hpp:43
std::string String
String for wide characters or unicode characters.
Definition: string.hpp:45
bool IsCompatible(const Image &img) const
Verify the compatibility of a CVB image with this classifier.
Definition: predictor_base.hpp:237
Base class for Polimago predictors.
Definition: predictor_base.hpp:197
Image data is (if necessary) extracted with linear interpolation.
T Bottom() const noexcept
Gets bottom row of the rectangle (still inside the rectangle).
Definition: rect.hpp:151
void * Handle() const noexcept
Classic API Polimago handle.
Definition: predictor_base.hpp:66
Size2D< int > RetinaSize() const noexcept
Size of the 'Retina' in pixels. The retina is the set of paxels onto which the input image is project...
Definition: predictor_base.hpp:155
Root namespace for the Image Manager interface.
Definition: version.hpp:11
The Common Vision Blox image.
Definition: decl_image.hpp:44
String Preprocessing() const
Preprocessing code with which this object was generated.
Definition: predictor_base.hpp:175
int GetGranularity(const String &preproCode)
The function returns the granularity associated with a preprocessing code.
Definition: predictor_base.hpp:321
Base class for Polimago predictors.
Definition: predictor_base.hpp:283
T Right() const noexcept
Gets rightmost column of the rectangle (still inside the rectangle).
Definition: rect.hpp:131
int PlanesCount() const noexcept
Get the number of planes for this image.
Definition: decl_image.hpp:230
bool IsCompatible(const Image &img, Point2D< int > pos) const
Verify the compatibility of a CVB image with this classifier.
Definition: predictor_base.hpp:218
T Height() const noexcept
Gets the height of the rectangle.
Definition: rect.hpp:191
The enum element indicating undefined state.
void Save(const String &fileName) const
Save this object into a file.
Definition: predictor_base.hpp:87
Point2D< double > Correction() const noexcept
Correction factors in X and Y direction required to rescale the input images for projection onto the ...
Definition: predictor_base.hpp:165
int Width() const noexcept
Width of the image in pixels.
Definition: decl_image.hpp:285
int FeatureResolution() const noexcept
Feature resolution value with which the classifier was trained.
Definition: predictor_base.hpp:304
InterpolationType
Interpolation to be used when extracting image data for classifier generation.
Definition: predictor_base.hpp:32
int Height() const noexcept
Height of the image in pixels.
Definition: decl_image.hpp:278