資源簡介
利用Opencv繪制骨骼,方便不熟悉Direct2D開發(fā)的童鞋使用~
代碼片段和文件信息
?????????
#include?
#include?
#include?
#include
#include
using?namespace?std;
using?namespace?cv;
//釋放接口需要自己定義
template
inline?void?SafeRelease(Interface?*&?pInterfaceToRelease)
{
if?(pInterfaceToRelease?!=?NULL)?{
pInterfaceToRelease->Release();
pInterfaceToRelease?=?NULL;
}
}
?
void?DrawBone(Mat&?SkeletonImage?CvPoint?pointSet[]?const?Joint*?pJoints?int?whichone?JointType?joint0?JointType?joint1);
void?drawSkeleton(Mat&?SkeletonImage?CvPoint?pointSet[]?const?Joint*?pJoints?int?whichone);
int?main(int?argc?char?**argv[])
{
//OpenCV中開啟CPU的硬件指令優(yōu)化功能函數(shù)
setUseOptimized(true);
//?Sensor
IKinectSensor*?pSensor;
HRESULT?hResult?=?S_OK;
hResult?=?GetDefaultKinectSensor(&pSensor);
hResult?=?pSensor->Open();
if?(FAILED(hResult))?{
std::cerr?<“Error?:?IKinectSensor::Open()“?< return?-1;
}
//Source
IColorframeSource*?pColorSourc
評論
共有 條評論