Commit 9b5b2da9 authored by Jussi Lindgren's avatar Jussi Lindgren
Browse files

Algorithms: Classifiers can now be provided the class count from outside

parent 2d002e44
......@@ -12,10 +12,11 @@
#define OVTK_ClassId_Algorithm_Classifier OpenViBE::CIdentifier(0x3B910935, 0xE4DBACC4)
#define OVTK_ClassId_Algorithm_ClassifierDesc OpenViBE::CIdentifier(0xFDB84F2F, 0x2F5C510D)
#define OVTK_Algorithm_Classifier_InputParameterId_FeatureVector OpenViBE::CIdentifier(0x6D69BF98, 0x1EB9EE66)
#define OVTK_Algorithm_Classifier_InputParameterId_FeatureVectorSet OpenViBE::CIdentifier(0x27C05927, 0x5DE9103A)
#define OVTK_Algorithm_Classifier_InputParameterId_Configuration OpenViBE::CIdentifier(0xA705428E, 0x5BB1CADD)
#define OVTK_Algorithm_Classifier_InputParameterId_ExtraParameter OpenViBE::CIdentifier(0x42AD6BE3, 0xF483DE3F)
#define OVTK_Algorithm_Classifier_InputParameterId_FeatureVector OpenViBE::CIdentifier(0x6D69BF98, 0x1EB9EE66) // Single vector to classify
#define OVTK_Algorithm_Classifier_InputParameterId_FeatureVectorSet OpenViBE::CIdentifier(0x27C05927, 0x5DE9103A) // Training set
#define OVTK_Algorithm_Classifier_InputParameterId_Configuration OpenViBE::CIdentifier(0xA705428E, 0x5BB1CADD) // The model
#define OVTK_Algorithm_Classifier_InputParameterId_ExtraParameter OpenViBE::CIdentifier(0x42AD6BE3, 0xF483DE3F) // Params specific to classifier type
#define OVTK_Algorithm_Classifier_InputParameterId_NumberOfClasses OpenViBE::CIdentifier(0x1B95825A, 0x24F2E949)
#define OVTK_Algorithm_Classifier_OutputParameterId_Class OpenViBE::CIdentifier(0x8A39A7EA, 0xF2EE45C4)
#define OVTK_Algorithm_Classifier_OutputParameterId_ClassificationValues OpenViBE::CIdentifier(0xDA77D7E4, 0x766B48EA)
......@@ -89,6 +90,7 @@ namespace OpenViBEToolkit
rAlgorithmPrototype.addInputParameter (OVTK_Algorithm_Classifier_InputParameterId_FeatureVectorSet, "Feature vector set", OpenViBE::Kernel::ParameterType_Matrix);
rAlgorithmPrototype.addInputParameter (OVTK_Algorithm_Classifier_InputParameterId_Configuration, "Configuration", OpenViBE::Kernel::ParameterType_Pointer);
rAlgorithmPrototype.addInputParameter (OVTK_Algorithm_Classifier_InputParameterId_ExtraParameter, "Extra parameter", OpenViBE::Kernel::ParameterType_Pointer);
rAlgorithmPrototype.addInputParameter (OVTK_Algorithm_Classifier_InputParameterId_NumberOfClasses, "Number of classes", OpenViBE::Kernel::ParameterType_UInteger);
rAlgorithmPrototype.addOutputParameter(OVTK_Algorithm_Classifier_OutputParameterId_Class, "Class", OpenViBE::Kernel::ParameterType_Float);
rAlgorithmPrototype.addOutputParameter(OVTK_Algorithm_Classifier_OutputParameterId_ClassificationValues, "Hyperplane distance", OpenViBE::Kernel::ParameterType_Matrix);
......
......@@ -33,12 +33,12 @@ boolean CAlgorithmClassifier::uninitialize()
boolean CAlgorithmClassifier::process(void)
{
TParameterHandler < IMatrix* > ip_pFeatureVector(this->getInputParameter(OVTK_Algorithm_Classifier_InputParameterId_FeatureVector));
TParameterHandler < IMatrix* > ip_pFeatureVectorSet(this->getInputParameter(OVTK_Algorithm_Classifier_InputParameterId_FeatureVectorSet));
TParameterHandler < XML::IXMLNode* > ip_pConfiguration(this->getInputParameter(OVTK_Algorithm_Classifier_InputParameterId_Configuration));
TParameterHandler < float64 > op_pClass(this->getOutputParameter(OVTK_Algorithm_Classifier_OutputParameterId_Class));
TParameterHandler < IMatrix* > op_pClassificationValues(this->getOutputParameter(OVTK_Algorithm_Classifier_OutputParameterId_ClassificationValues));
TParameterHandler < IMatrix* > op_pProbabilityValues(this->getOutputParameter(OVTK_Algorithm_Classifier_OutputParameterId_ProbabilityValues));
TParameterHandler < IMatrix* > ip_pFeatureVectorSet(this->getInputParameter(OVTK_Algorithm_Classifier_InputParameterId_FeatureVectorSet));
TParameterHandler < XML::IXMLNode* > op_pConfiguration(this->getOutputParameter(OVTK_Algorithm_Classifier_OutputParameterId_Configuration));
if(this->isInputTriggerActive(OVTK_Algorithm_Classifier_InputTriggerId_Train))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment