Kinect Gesture builder files (gba) C++ RRS feed

  • Question

  • BSD


    I have been using the kinect gesture builder to train few gestures and generate gba files to each gesture.Now I want to to use the IVisualGestureBuilderDatabase  interface and function CreateVisualGestureBuilderDatabaseInstanceFromFile to add all the files to the same database. How can I do that?



    Thursday, December 4, 2014 8:37 AM

All replies

  • Have you tried any of the C# samples from the SDK? Have you seen the Visual Gesture Builder video from channel 9? If not please review those first.

    After you've done that you need to compile your gesture into a VGB Database file. Then in your code you open up this database and depending on your getsture type - Progress or Discreet, you listen for events or code based on progression values, to determine if a gesture matches.

    Sr. Enterprise Architect | Trainer | Consultant | MCT | MCSD | MCPD | SharePoint TS | MS Virtual TS |Windows 8 App Store Developer | Linux Gentoo Geek | Raspberry Pi Owner | Micro .Net Developer | Kinect For Windows Device Developer |blog:

    Thursday, December 4, 2014 7:15 PM
  • Hi,

    I'm trying do something like this, but i have a lot of troubles!

    Now I have something like that:

    // Create Gesture Dataase from File (*.gbd)
        IVisualGestureBuilderDatabase* GestureDatabase;
        hResult = CreateVisualGestureBuilderDatabaseInstanceFromFile( L"Gestures.gbd", &GestureDatabase );

        // Add Gesture
        UINT32 gestureCount = 0;
        hResult = GestureDatabase->get_AvailableGesturesCount( &gestureCount );
        IGesture* Gesture;
        hResult = GestureDatabase->get_AvailableGestures( gestureCount, &Gesture );
        if( SUCCEEDED( hResult ) && Gesture != nullptr ){
                hResult = GestureSource->AddGestures(gestureCount, &Gesture );
                hResult = GestureSource->SetIsEnabled( Gesture, true );

    But I get: Unhandled exception at 0x00E74D24 in ConsoleApplication3.exe: 0xC0000005: Access violation reading location 0x00000000.

    And next:

    // Detect Gesture
                IVisualGestureBuilderFrame* GestureFrame = nullptr;
                hResult = GestureReader->CalculateAndAcquireLatestFrame( &GestureFrame );
                if( SUCCEEDED( hResult ) && GestureFrame != nullptr ){
                    BOOLEAN GestureTracked = false;
                    hResult = GestureFrame->get_IsTrackingIdValid( &GestureTracked );
                    if( SUCCEEDED( hResult ) && GestureTracked ){
                        // Discrete Gesture (Sample HandUp.gba is Action to Hand Up above the head.)
                        IDiscreteGestureResult* GestureResult = nullptr;
                        hResult = GestureFrame->get_DiscreteGestureResult( Gesture, &GestureResult );
                        if( SUCCEEDED( hResult ) && GestureResult != nullptr ){
                            BOOLEAN bDetected = false;
                            hResult = GestureResult->get_Detected( &bDetected );
                            if( SUCCEEDED( hResult ) && bDetected){
                        SafeRelease( GestureResult );

    How should I change it, to get multiple gestures detector?

    I cant make it work. I need multiple gestures detection to easily control the image viewer using Kinect2 sensor..

    Thanks for any help..


    Wednesday, June 24, 2015 5:52 AM
  • Hello, 

    I'm trying to develop a C++ console application to detect multiple gestures from a .gbd database. For the first gesture it works but i have problems to add the other ones. I tried to add all gestures with... 

    hResult = pGestureSource[count]->AddGestures(gestureCount, &pGestures);

    But then i don't know how to pick a single gesture in the detector? Should i create 

    IGesture* gesture1; ... for each gesture? But then i need to initialize them anyhow.

    If i would add each gesture seperately, how can compare the name of a single gesture in pGestures, like it is done in the C# codes (for example: ....if (gesture.Name.Equals(this.handsAboveHeadGestureName))....

    anything like:


    IGesture* pGestures = nullptr; IGesture* swipe_right; hResult = pGestureDatabase->get_AvailableGestures(gestureCount, &pGestures); if (SUCCEEDED(hResult) && pGestures.Name.Equals("swipe_right")){ for (int count = 0; count < BODY_COUNT; count++){ swipe_right = pGestures; hResult = pGestureSource[count]->AddGesture(swipe_right); if (FAILED(hResult)){ std::cerr << "Error : IVisualGestureBuilderFrameSource::AddGesture()" << std::endl; return -1; } hResult = pGestureSource[count]->SetIsEnabled(swipe_right, true); if (FAILED(hResult)){ std::cerr << "Error : IVisualGestureBuilderFrameSource::SetIsEnabled()" << std::endl; return -1; } } } ...

    But how do i refer to the specific gesture name in pGesture ? 

    I would be very happy for any help 


    Tuesday, July 7, 2015 12:17 PM