资源描述:
《基于Dragonboard 410c的kinect应用系列之四——获取人体骨骼图.doc》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、基于Dragonboard410c的kinect应用系列之四——获取人体骨骼图//------------------------------------------------------------------------------////Copyright(c)MicrosoftCorporaTIon.Allrightsreserved.////------------------------------------------------------------------------------#include“s
2、tdafx.h”#include#include“SkeletonBasics.h”#include“resource.h”staTIcconstfloatg_JointThickness=3.0f;staTIcconstfloatg_TrackedBoneThickness=6.0f;staTIcconstfloatg_InferredBoneThickness=1.0f;//////Entrypointfortheapplication////// handletotheapplicationinstance/// a
3、lways0/// commandlinearguments/// whethertodisplayminimized,maximized,ornormally///statusintAPIENTRYwWinMain(HINSTANCEhInstance,HINSTANCEhPrevInstance,LPWSTRlpCmdLine,intnCmdShow){CSkeletonBasicsapplication;application.Run(hInstance,nCmdShow);}//////Constructor///
4、CSkeletonBasics::CSkeletonBasics():m_pD2DFactory(NULL),m_hNextSkeletonEvent(INVALID_HANDLE_VALUE),m_pSkeletonStreamHandle(INVALID_HANDLE_VALUE),m_bSeatedMode(false),m_pRenderTarget(NULL),m_pBrushJointTracked(NULL),m_pBrushJointInferred(NULL),m_pBrushBoneTracked(NULL
5、),m_pBrushBoneInferred(NULL),m_pNuiSensor(NULL){ZeroMemory(m_Points,sizeof(m_Points));}//////Destructor///CSkeletonBasics::~CSkeletonBasics(){if(m_pNuiSensor){m_pNuiSensor->NuiShutdown();}if(m_hNextSkeletonEvent&&(m_hNextSkeletonEvent!=INVALID_HANDLE_VALUE)){CloseHa
6、ndle(m_hNextSkeletonEvent);}//cleanupDirect2DobjectsDiscardDirect2DResources();//cleanupDirect2DSafeRelease(m_pD2DFactory);SafeRelease(m_pNuiSensor);}//////Createsthemainwindowandbeginsprocessing////// handletotheapplicationinstance/// whethertodisplayminimized,ma
7、ximized,ornormallyintCSkeletonBasics::Run(HINSTANCEhInstance,intnCmdShow){MSGmsg={0};WNDCLASSwc={0};//Dialogcustomwindowclasswc.style=CS_HREDRAW
8、CS_VREDRAW;wc.cbWndExtra=DLGWINDOWEXTRA;wc.hInstance=hInstance;wc.hCursor=LoadCursorW(NULL,IDC_ARROW);wc.hIcon=LoadIconW(
9、hInstance,MAKEINTRESOURCE(IDI_APP));wc.lpfnWndProc=DefDlgProcW;wc.lpszClassName=L”SkeletonBasicsAppDlgWndClass”;if(!RegisterClassW(&wc)){r