Coding4Fun Kinect Projects

C++ Kinect SDK Usage Tutorial

Description

There's a good number of .Net and C# Kinect SDK examples, but for C++ I'm not seeing as many. So when I saw this, even thought it's not in my native tongue, I knew it as a must share...

This Kinect C++ tutorial, while in Russian, is still weirdly easy to follow. I guess code really is the universal  language. Smiley

Kinect SDK usage in C++ applications - Complete Tutorial [RU]

I've just published a complete tutorial about usage of Kinect SDK in C++ applications (http://habrahabr.ru/blogs/cpp/123588/).

Tutorial is in Russian but source code is self-explanatory and, in case if you want to read the text, you can use Google Translate.

Also the source code (sample application and object-oriented helper library) is available for free download at Google Code (http://code.google.com/p/wxkinecthelper/).

Project Information URL: http://habrahabr.ru/blogs/cpp/123588/ (English Translation)

Project Download URL: http://code.google.com/p/wxkinecthelper/

Project Source URL: http://code.google.com/p/wxkinecthelper/

97c7b107

bool KinectGrabberMSW::ReadSkeletonFrame()
{
     do
     {
         if(m_DeviceIndex < 0 || !m_Instance) break;
         if(FAILED(m_Instance->NuiSkeletonGetNextFrame(200, &m_SkeletonFrame))) break;
         if(m_Handler)
         {
             wxCommandEvent e(KINECT_SKELETON_FRAME_RECEIVED, wxID_ANY);
             e.SetInt(m_DeviceIndex);
             m_Handler->AddPendingEvent(e);
         }
         return true;
     }
     while(false);
     return false;
}

void KinectTestMainFrame::OnSkeletonFrame(wxCommandEvent & event)
{
     do
     {
         if(!m_Grabber) break;
         SkeletonPainter painter;
         wxBitmap bmp(m_SkeletonImage.GetWidth(), m_SkeletonImage.GetHeight());
         wxMemoryDC mdc(bmp);
         painter.DrawSkeleton(mdc, m_Grabber->GrabSkeletonFrame());
         mdc.SelectObject(wxNullBitmap);
         m_SkeletonImage = bmp.ConvertToImage();
         m_SkeletonCanvas->Refresh();
     }
     while(false);
}

Contact Information:

The Discussion

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.