I have adapted code clips from hand-viewer sample to my code following the instruction article "Hand Analysis Tutorial".
I can capture the totalNumberOfGestures as 10. I used config->EnableAllGestures() and config->EnabledAllAlerts(). The problem is
outputData->QueryFiredGesturesNumber() is always returned 0 even if I made gestures in front of camera.
I have done the same debug on hand-viewer sample it returned the right number of fired gestures.
I checked the CPU usage and I found that when I made gestures in front of camera the CPU usage was increased. That means the camera actually actived in the recognization of gesture.
What is wrong to return the zero number of gesture calling?
Do you have sample to run the code in "Hand Analysis Tutorial" without GUI code mixed?
I can not understand the following code clips:
https://software.intel.com/sites/default/files/managed/15/33/intel-realsense-hand-and-finger-tracking-tutorial.pdf
// stream data
while (psm->AcquireFrame(true)>=PXC_STATUS_NO_ERROR)
{
outputData->Update();
// create data structs
PXCHandData::GestureData gestureData;
pxcCHAR gestures[NUM_HANDS][PXCHandData::MAX_NAME_SIZE] = {};
PXCHandData::BodySideType handSide[NUM_HANDS] = {PXCHandData::BODY_SIDE_UNKNOWN};
// iterate through fired gestures
for(unsigned int i = 0; i < outputData->QueryFiredGesturesNumber(); i++)
{
// initialize data
wmemset(gestures, 0, sizeof(gestures));
handSide = PXCHandData::BODY_SIDE_UNKNOWN;
// get fired gesture data
if(outputData->QueryFiredGestureData(i,gestureData) == PXC_STATUS_NO_ERROR)
{
// get hand data related to fired gesture
PXCHandData::IHand* handData;
if(outputData->QueryHandDataById(gestureData.handId,handData) == PXC_STATUS_NO_ERROR)
{
// save gesture only if you know that its right/left hand
if(!handData->QueryBodySide() == PXCHandData::BODY_SIDE_UNKNOWN)
{
wmemcpy_s (gestures,PXCHandData::MAX_NAME_SIZE*2, gestureData.name, sizeof(gestureData.name));
handSide = handData->QueryBodySide();
}
}
}
}
}
The outputData->QueryFiredGesturesNumber() is supposed to be 0 or 1?
Then how can I detected various gestures such as fist, thumb_up, .etc?