基于Dragonboard 410c的kinect应用系列之五——脸部识别实现代码
}
else if(0 == wcsncmp(token, KEY_NEAR_MODE, ARRAYSIZE(KEY_NEAR_MODE)))
{
tokenType = TOKEN_NEARMODE;
m_bNearMode = TRUE;
}
else if(0 == wcsncmp(token, KEY_DEFAULT_DISTANCE_MODE, ARRAYSIZE(KEY_DEFAULT_DISTANCE_MODE)))
{
tokenType = TOKEN_DEFAULTDISTANCEMODE;
m_bNearMode = FALSE;
}
else if(0 == wcsncmp(token, KEY_SEATED_SKELETON_MODE, ARRAYSIZE(KEY_SEATED_SKELETON_MODE)))
{
tokenType = TOKEN_SEATEDSKELETON;
m_bSeatedSkeletonMode = TRUE;
}
if(tokenType == TOKEN_DEPTH || tokenType == TOKEN_COLOR)
{
_ASSERT(pType != NULL && pRes != NULL);
while((token = wcstok_s(NULL, L":", &context)) != NULL)
{
if(0 == wcsncmp(token, STR_NUI_IMAGE_TYPE_DEPTH, ARRAYSIZE(STR_NUI_IMAGE_TYPE_DEPTH)))
{
*pType = NUI_IMAGE_TYPE_DEPTH;
}
else if(0 == wcsncmp(token, STR_NUI_IMAGE_TYPE_DEPTH_AND_PLAYER_INDEX, ARRAYSIZE(STR_NUI_IMAGE_TYPE_DEPTH_AND_PLAYER_INDEX)))
{
*pType = NUI_IMAGE_TYPE_DEPTH_AND_PLAYER_INDEX;
}
else if(0 == wcsncmp(token, STR_NUI_IMAGE_TYPE_COLOR, ARRAYSIZE(STR_NUI_IMAGE_TYPE_COLOR)))
{
*pType = NUI_IMAGE_TYPE_COLOR;
}
else if(0 == wcsncmp(token, STR_NUI_IMAGE_TYPE_COLOR_YUV, ARRAYSIZE(STR_NUI_IMAGE_TYPE_COLOR_YUV)))
{
*pType = NUI_IMAGE_TYPE_COLOR_YUV;
}
else if(0 == wcsncmp(token, STR_NUI_IMAGE_RESOLUTION_80x60, ARRAYSIZE(STR_NUI_IMAGE_RESOLUTION_80x60)))
{
*pRes = NUI_IMAGE_RESOLUTION_80x60;
}
else if(0 == wcsncmp(token, STR_NUI_IMAGE_RESOLUTION_320x240, ARRAYSIZE(STR_NUI_IMAGE_RESOLUTION_320x240)))
{
*pRes = NUI_IMAGE_RESOLUTION_320x240;
}
else if(0 == wcsncmp(token, STR_NUI_IMAGE_RESOLUTION_640x480, ARRAYSIZE(STR_NUI_IMAGE_RESOLUTION_640x480)))
{
*pRes = NUI_IMAGE_RESOLUTION_640x480;
}
else if(0 == wcsncmp(token, STR_NUI_IMAGE_RESOLUTION_1280x960, ARRAYSIZE(STR_NUI_IMAGE_RESOLUTION_1280x960)))
{
*pRes = NUI_IMAGE_RESOLUTION_1280x960;
}
}
}
}
if(argv) LocalFree(argv);
}
// Program's main entry point
int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR lpCmdLine, int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
SingleFace app;
HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
return app.Run(hInstance, lpCmdLine, nCmdShow);
}
二、实测效果图:(活生生把美女脸"切割"出了形状,哈哈~!)
三、例程工程分享:
http://pan.baidu.com/s/1qYiv7HU
DragonBoard 410c 脸部识别 Kinect 相关文章: