3#include "../_cexports/c_polimago.h"
5#include "../global.hpp"
6#include "../string.hpp"
7#include "predictor_base.hpp"
30 if (trainingParameters_.Usage != CExports::TClassifierUsage::CU_Regression)
37 static CExports::TCLF LoadInternal (
const String & fileName)
39 CExports::TCLF predictor =
nullptr;
41 CVB_CALL_CAPI_CHECKED (PMOpenClfTyped(fileName.c_str(), predictor));
45 void SaveFunction (
const String &fileName)
const override
47 CVB_CALL_CAPI_CHECKED (PMSaveClfTyped(fileName.c_str(),
Handle()));
52 return thisObjectName_;
112 return static_cast<int>(CVB_CALL_CAPI(PMGetOutputDimension(
Handle())));
124 VerifyCompatibility(img, pos);
127 CVB_CALL_CAPI_CHECKED (PMPredictVector(
Handle(), img.Handle(), pos.
X(), pos.
Y(), &retval[0]));
132 const std::string thisObjectName_ =
"Polimago Regression Predictor";
The Common Vision Blox image.
Definition: decl_image.hpp:45
T X() const noexcept
Gets the x-component of the point.
Definition: point_2d.hpp:86
T Y() const noexcept
Gets the y-component of the point.
Definition: point_2d.hpp:106
void * Handle() const noexcept
Classic API Polimago handle.
Definition: predictor_base.hpp:66
Base class for Polimago predictors.
Definition: predictor_base.hpp:284
Polimago Regression predictor.
Definition: regression_predictor.hpp:24
std::vector< double > PredictVector(const Image &img, Point2D< int > pos) const
Calculate a regression result on a given location.
Definition: regression_predictor.hpp:122
RegressionPredictor(RegressionPredictor &&) noexcept=default
Move constructor.
int RegressionDimension() const
Regression result dimension.
Definition: regression_predictor.hpp:110
static std::unique_ptr< RegressionPredictor > Load(const String &fileName)
Load a saved predictor from a file.
Definition: regression_predictor.hpp:100
static std::unique_ptr< RegressionPredictor > FromHandle(ReleaseObjectGuard &&guard)
Creates predictor from a classic API handle.
Definition: regression_predictor.hpp:85
RegressionPredictor(const String &fileName)
Load a saved Polimago regression predictor from a file.
Definition: regression_predictor.hpp:62
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24