mirror of
https://github.com/storytold/LiveScan3D.git
synced 2026-11-23 02:30:48 +01:00
Added the option to only stream the body data (skeleton and body point cloud) instead of everything.
This commit is contained in:
1 parent
948eee769e
commit
ef1c5ac2ce
10 files changed
+116
-40
No files matched your search
@@ -97,6 +97,7 @@ bool KinectCapture::AcquireFrame()
|
||||
GetDepthFrame(pMultiFrame);
|
||||
GetColorFrame(pMultiFrame);
|
||||
GetBodyFrame(pMultiFrame);
|
||||
GetBodyIndexFrame(pMultiFrame);
|
||||
|
||||
|
||||
return true;
|
||||
@@ -217,4 +218,27 @@ void KinectCapture::GetBodyFrame(IMultiSourceFrame* pMultiFrame)
|
||||
|
||||
SafeRelease(pBodyFrame);
|
||||
SafeRelease(pBodyFrameReference);
|
||||
}
|
||||
|
||||
void KinectCapture::GetBodyIndexFrame(IMultiSourceFrame* pMultiFrame)
|
||||
{
|
||||
IBodyIndexFrameReference* pBodyIndexFrameReference = NULL;
|
||||
IBodyIndexFrame* pBodyIndexFrame = NULL;
|
||||
pMultiFrame->get_BodyIndexFrameReference(&pBodyIndexFrameReference);
|
||||
HRESULT hr = pBodyIndexFrameReference->AcquireFrame(&pBodyIndexFrame);
|
||||
|
||||
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
if (pBodyIndex == NULL)
|
||||
{
|
||||
pBodyIndex = new BYTE[nDepthFrameHeight * nDepthFrameWidth];
|
||||
}
|
||||
|
||||
UINT nBufferSize = nDepthFrameHeight * nDepthFrameWidth;
|
||||
hr = pBodyIndexFrame->CopyFrameDataToArray(nBufferSize, pBodyIndex);
|
||||
}
|
||||
|
||||
SafeRelease(pBodyIndexFrame);
|
||||
SafeRelease(pBodyIndexFrameReference);
|
||||
}
|
||||
Reference in new issue
Block a user