Friday, August 8, 2008

$1 Gesture Recogniser by Wobbrock, J. O. et. al. adaptation in C++

The original codes can be found at http://depts.washington.edu/aimgroup/proj/dollar/

I made a C++ adaptation of the original C# version to use with OpenCV during my internship.
I've uploaded a copy here for academics to use in their C++ projects with as little code change as possible.

For simplicity, the code follows a singleton pattern.

http://www.comp.nus.edu.sg/~situyi/DollarRecogniser/



// Include headers at the top of your code
#include "dollarUtils.h"

#include "dollarRecogniser.h"

......

// Somewhere within the body of the code
Recogniser* gestureRecogniser = Recogniser::Instance();

vector<point> gesturePts;
// Populate gesture pts here
Result res = gestureRecogniser->Recognise(gesturePts);


if(res.GetScore() <= 0.6) {
strGesture = "0";
cout << "Unrecognised gesture." << endl;
}
else {
strGesture = res.GetName();
cout << "Best gesture match is " << res.GetName() << " (" << res.GetScore() << ")" << endl;
}

gesturePts.clear();


No comments: