资源描述:
《基于Dragonboard 410c的kinect应用系列之五——脸部识别实现代码.doc》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、基于Dragonboard410c的kinect应用系列之五——脸部识别实现代码//------------------------------------------------------------------------------////Copyright(c)MicrosoftCorporaTIon.Allrightsreserved.////------------------------------------------------------------------------------//DefinestheentrypointfortheapplicaTI
2、on.//#include“stdafx.h”#include“SingleFace.h”#include“EggAvatar.h”#include#include“FTHelper.h”classSingleFace{public:SingleFace():m_hInst(NULL),m_hWnd(NULL),m_hAccelTable(NULL),m_pImageBuffer(NULL),m_pVideoBuffer(NULL),m_depthType(NUI_IMAGE_TYPE_DEPTH_AND_PLAYER_INDEX),m_colorType(NUI_IMAGE_TY
3、PE_COLOR),m_depthRes(NUI_IMAGE_RESOLUTION_320x240),m_colorRes(NUI_IMAGE_RESOLUTION_640x480),m_bNearMode(TRUE),m_bSeatedSkeletonMode(FALSE){}intRun(HINSTANCEhInst,PWSTRlpCmdLine,intnCmdShow);protected:BOOLInitInstance(HINSTANCEhInst,PWSTRlpCmdLine,intnCmdShow);voidParseCmdString(PWSTRlpCmdLine)
4、;voidUninitInstance();ATOMRegisterClass(PCWSTRszWindowClass);staticLRESULTCALLBACKWndProcStatic(HWNDhwnd,UINTmessage,WPARAMwParam,LPARAMlParam);LRESULTCALLBACKWndProc(HWNDhwnd,UINTmessage,WPARAMwParam,LPARAMlParam);staticINT_PTRCALLBACKAbout(HWNDhwnd,UINTmessage,WPARAMwParam,LPARAMlParam);BOOL
5、PaintWindow(HDChdc,HWNDhWnd);BOOLShowVideo(HDChdc,intwidth,intheight,intoriginX,intoriginY);BOOLShowEggAvatar(HDChdc,intwidth,intheight,intoriginX,intoriginY);staticvoidFTHelperCallingBack(LPVOIDlpParam);staticintconstMaxLoadStringChars=100;HINSTANCEm_hInst;HWNDm_hWnd;HACCELm_hAccelTable;EggAv
6、atarm_eggavatar;FTHelperm_FTHelper;IFTImage*m_pImageBuffer;IFTImage*m_pVideoBuffer;NUI_IMAGE_TYPEm_depthType;NUI_IMAGE_TYPEm_colorType;NUI_IMAGE_RESOLUTIONm_depthRes;NUI_IMAGE_RESOLUTIONm_colorRes;BOOLm_bNearMode;BOOLm_bSeatedSkeletonMode;};//RuntheSingleFaceapplication.intSingleFace::Run(HINS
7、TANCEhInst,PWSTRlpCmdLine,intnCmdShow){MSGmsg={static_castHWND>(0),static_castUINT>(0),static_castWPARAM>(-1)};if(InitInstance(hInst,lpCmdLine,nCmdShow)){//Mainmessageloop:while(GetMessage(&msg,NULL,0,0)){if(!TranslateAccelerator(msg.hw