Software Archive
Read-only legacy content
17061 Discussions

Right swipe or left swipe

HexLord
Beginner
1,222 Views

Hi,

I want to know if there is a way to identify whether the swipe gesture made by the user is a left swipe or right swipe.

Is there a way to find that out?

the gesture is recognized as "swipe" and the body part is not mentioned.

Pls help.

 

Thanks,

Shaleen

0 Kudos
8 Replies
Colleen_C_Intel
Employee
1,222 Views

At this time (Release 1 Gold RSSDK), only one direction is supported per hand (each going towards the other only).

0 Kudos
HexLord
Beginner
1,222 Views

Hi Collen,

I understand that only one gesture is supported by each hand, but is there a way to find out which hand was, as in left or right?

0 Kudos
Colleen_C_Intel
Employee
1,222 Views

If one swipes left then it's right hand - See /RSSDK/doc/HTML/manuals_pose_and_gesture_recognition.html?zoom_highlightsub=swipe

left and right hand are separately recognized.

0 Kudos
samontab
Valued Contributor II
1,222 Views

Colleen Culbertson (Intel) wrote:

At this time (Release 1 Gold RSSDK), only one direction is supported per hand (each going towards the other only).

So this means there is no zoom out gesture?, or is that another gesture altogether?

0 Kudos
Colleen_C_Intel
Employee
1,222 Views

I was specifically speaking only of swipe - which is performed with palm facing toward the side (side to swipe towards) and fingers mostly pointing at the camera waving fingers slowly from body edge to body center. Zoom is built using the high 5 open palm towards camera hand or 2 finger pinch with full hands moving away from each other. 

0 Kudos
HexLord
Beginner
1,222 Views

Hi Colleen,

if one swipes left then it's right hand

I can get the left and right swipe to work but when I try to print the name of the gesture - it only prints swipe.

I need to know whether the swipe recognized by the camera was made with left hand or right hand.

Is there a way to know that?

Thanks,
Shaleen

 

 

0 Kudos
Colleen_C_Intel
Employee
1,222 Views

There is hand recognition of right vs left that could be used if you can't tell by the direction of the gesture.

0 Kudos
Jonathan_M_Intel
Employee
1,222 Views

Here's the code that might help you, from the hands_viewer sample (this is c++ but you should be able to perform the same calls sorts of calls in c#):

static void DisplayGesture(HWND hwndDlg, PXCHandData *handAnalysis) {

	if(!GetGestureCheckState(hwndDlg))
		return;

	//Iterate fired gestures
	for(int i = 0; i < handAnalysis->QueryFiredGesturesNumber() ; i++)
	{
		//Get fired gesture data
		PXCHandData::GestureData gestureData;
		if(handAnalysis->QueryFiredGestureData(i,gestureData) == PXC_STATUS_NO_ERROR)
		{
			//Get hand data related to fired gesture
			PXCHandData::IHand* handData;
			if(handAnalysis->QueryHandDataById(gestureData.handId,handData) == PXC_STATUS_NO_ERROR)
			{
				//Draw gesture only if we know if its right/left hand
				if(!handData->QueryBodySide() == PXCHandData::BodySideType::BODY_SIDE_UNKNOWN)
					DrawGesture(hwndDlg,gestureData,handData->QueryBodySide());
			}
		}
	}
}

You can see that you should be able to first register that a swipe has been recognized, and then use "QueryBodySide()" to identify whether is was a right-handed swipe or a left-handed swipe.  The possible return options are below:

0 = PXCHandData::BodySideType::BODY_SIDE_UNKNOWN
1 = PXCHandData::BodySideType::BODY_SIDE_LEFT
2 = PXCHandData::BodySideType::BODY_SIDE_RIGHT
0 Kudos
Reply