The GestureRecognitionPipeline is the core module of the Gesture Recognition Toolkit. You can use the GestureRecognitionPipeline to link the various GRT modules together, for instace you can link a PreProcessing module to a FeatureExtraction module to a Classification module and then to a PostProcessing module.
using namespace std;
int main (int argc, const char * argv[])
{
if( argc != 2 ){
cout << "Error: failed to parse data filename from command line. You should run this example with one argument pointing to the data filename!\n";
return EXIT_FAILURE;
}
const string filename = argv[1];
if( !trainingData.
load( filename ) ){
cout << "Failed to load Iris data from file!\n";
return EXIT_FAILURE;
}
if( !pipeline.
train( trainingData ) ){
cout << "Failed to train the pipeline!\n";
return EXIT_FAILURE;
}
if( !pipeline.
test( testData ) ){
cout << "Failed to test the pipeline!\n";
return EXIT_FAILURE;
}
cout <<
"The classification accuracy was: " << pipeline.
getTestAccuracy() <<
"%\n" << endl;
cout << "The precision for class " << classLabel << " was " << classPrecision << endl;
}
cout << endl;
cout << "The recall for class " << classLabel << " was " << classRecall << endl;
}
cout << endl;
cout << "Confusion Matrix: \n";
for(UINT i=0; i<confusionMatrix.
getNumRows(); i++){
for(UINT j=0; j<confusionMatrix.
getNumCols(); j++){
cout << confusionMatrix[i][j] << "\t";
}
cout << endl;
}
cout << endl;
return EXIT_SUCCESS;
}