3#include "../_cexports/c_polimago.h"
5#include "../global.hpp"
6#include "predictor_factory_base.hpp"
7#include "classification_predictor.hpp"
8#include "classification_test_result.hpp"
9#include "../minos/training_set.hpp"
10#include "../sample_database/sample_classification_image_list.hpp"
34 return CExports::CU_ClassifyOneVersusAll;
36 return CExports::CU_ClassifyOneVersusOne;
40 inline ClassificationType ToClassificationType(CExports::TClassifierUsage val)
noexcept
46 case CExports::CU_ClassifyOneVersusAll:
48 case CExports::CU_ClassifyOneVersusOne:
67 : PredictorFactoryBaseEx()
68 , usage_(Private::ToClassifierUsageType(usageType))
80 return Private::ToClassificationType(usage_);
90 usage_ = Private::ToClassifierUsageType(usage);
101 PredictorFactoryBaseEx::UseSettingsFromPredictor(clf);
113 PredictorFactoryBaseEx::UseSettingsFromTestResult(res);
126 return Internal::DoResCallObjectOut<ClassificatioPredictor>([&](
void* & res)
128 return CVB_CALL_CAPI(PMTrainClassifierFromSil(sil.
Handle(), ..., usage_, preproCode_, featureResolution_, lambda_, interpolation_ ==
InterpolationType::Linear, res);
141 return Internal::DoResCallObjectOut<ClassificatioPredictor>([&](
void* & res)
143 return CVB_CALL_CAPI(PMTrainClassifierFromMts(sil.
Handle(), ..., usage_, preproCode_, featureResolution_, lambda_, interpolation_ ==
InterpolationType::Linear, res);
149 CExports::TClassifierUsage usage_;
A Minos Training Set from which a classifier can be generated.
Definition training_set.hpp:1188
ClassificationPredictorFactory(ClassificationType usageType)
Constructor.
Definition classification_predictor_factory.hpp:66
Predictor to classify patterns with.
Definition classification_predictor.hpp:57
ClassificationType Classification() const
The classification type for which this classifier has been generated.
Definition classification_predictor.hpp:151
Classification test result object.
Definition classification_test_result.hpp:27
Predictor factory for classification predictor.
Definition classification_predictor_factory.hpp:59
void SetUsage(ClassificationType usage)
Sets the type of classification for which to generate the predictor.
Definition classification_predictor_factory.hpp:88
ClassificationType Usage() const noexcept
Gets the type of classification for which to generate the predictor.
Definition classification_predictor_factory.hpp:78
ClassificationPredictorFactory(ClassificationType usageType)
Constructor.
Definition classification_predictor_factory.hpp:66
void UseSettingsFromPredictor(const ClassificationPredictor &clf)
Copy the predictor generation settings from a predictor.
Definition classification_predictor_factory.hpp:99
void UseSettingsFromTestResult(const ClassificationTestResult &res)
Copy the predictor generation settings from a test result.
Definition classification_predictor_factory.hpp:111
Classifier type that operates on images.
Definition decl_classification_sil.hpp:213
void * Handle() const noexcept
Classic API SIL handle.
Definition sample_list.hpp:411
Namespace for the Polimago package training functionality.
Definition classification_predictor_factory.hpp:23
std::shared_ptr< ClassificationPredictorFactory > ClassificationPredictorFactoryPtr
Convenience shared pointer for ClassificationPredictorFactory.
Definition classification_predictor_factory.hpp:153
Namespace for the Polimago package.
Definition classification_predictor.hpp:38
ClassificationType
Determine the classification type to be carried out.
Definition classification_predictor.hpp:42
@ None
The enum element indicating undefined state.
Definition classification_predictor.hpp:44
@ OneVersusAll
Definition classification_predictor.hpp:47
@ OneVersusOne
Definition classification_predictor.hpp:50
@ Linear
Image data is (if necessary) extracted with linear interpolation.
Definition predictor_base.hpp:37
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17