I've been working on the next release of my app, Beautiful Chaos, and finally got around to trying out some of the new features in the Skeletal Beta. I am excited by the possibility of having robust, reliable, repeatable changes between modes or states of my app.
Specifically, I'm going to have one hand switch between three different states: operating the camera (hand open), operating a new experimental menu (pointing), and returning to a default "no-op" state (hand closed / in fist). Freeform is similar - with one hand you can operate the brushes (pointing), move the camera (hand open), and do nothing (hand closed / in fist).
My previous attempts to do this were all unsatisfactory to me, but the new features are making it a lot more feasible.
This is my current approach that's working well:
// determine state
if ( mFingersExtended == 1 && mHandConfidence > 0.3f ) {
mModeHistory.push_back( POINTING );
} else if ( mGrabStrength < 0.1f && mHandConfidence > 0.3f ) {
mModeHistory.push_back( OPEN );
} else {
mModeHistory.push_back( CLOSED );
}
// maintain list size
if ( mModeHistory.size() > 20 ) {
mModeHistory.pop_front();
}
// data filtering: change mode only if it's been around long enough
int newMode = mModeHistory.back(); // most recent value
for ( auto &mode : mModeHistory ) {
if ( mode != newMode ) {
newMode = mMode;
break;
}
}
mMode = newMode;
Ideally (from my perspective), I wouldn't have to do additional filtering, but I'm finding it necessary, otherwise I get a few frames of "pointing" in between "open" and "closed," and occasional other spikes of false positives.
Any feedback on this approach and its stability over the long term is welcome.
By the way, is there a timeline / target release date for the beta?
Side note: I find it instructive to graph some of these new values when I'm trying to determine the right combination to detect certain hand poses. This screen shot is from a test Cinder app, using my UI block "MinimalUI."