Kinect SDK2.0提供了MultiSouceFrameReader,它可以同时读取许多流数据,例如:颜色,深度,主体,推断。据我所知,multisouceFrame阅读器以某种方式将所有流融合在一起,我们可以获得最慢的fps(例如彩色15fps,深度,推断:30fps-> Multisouces = 15fps)。 但是,当我调试时,我看到如果MultiSoucesFrame成功,则Color和Depth成功,但Body失败。谁能为我解释为什么会这样?
2)如果第一步是“成功多源阅读器”,则内部的所有特定类型都将成功。因此,我们不需要再次检查对吗?但是我看到很多有关Kinect v.2的教程,它们都需要仔细检查。我想我误会了一部分,非常感谢您的帮助!
> tsmochanyc@1.0.0 test /home/ole/Junk/tsmochanyc
> mocha -r ts-node/register src/**/*.spec.ts
Error: Cannot find module 'hello'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
///我进入了GetBodyFrame。这里的问题是,身体不成功
// Open multi Souces
pKinectSensor->OpenMultiSourceFrameReader(FrameSourceTypes::FrameSourceTypes_Color |
FrameSourceTypes::FrameSourceTypes_Depth |
FrameSourceTypes::FrameSourceTypes_Body |
FrameSourceTypes::FrameSourceTypes_BodyIndex,
&pMultiSourceFrameReader);
// Check multisouces success
HRESULT hr = pMultiSourceFrameReader->AcquireLatestFrame(&pMultiFrame);
if (!SUCCEEDED(hr))
{
return false;
}
// if go to here, it is mean that the multisources succesful
GetDepthFrame(pMultiFrame);
GetColorFrame(pMultiFrame);
GetBodyFrame(pMultiFrame);// However, The problem in here, Getbody not sucessful
GetBodyIndexFrame(pMultiFrame);
//我进入彩色。深度相似
void KinectCapture::GetBodyFrame(IMultiSourceFrame* pMultiFrame)
{//some code
pMultiFrame->get_BodyFrameReference(&pBodyFrameReference);
HRESULT hr = pBodyFrameReference->AcquireFrame(&pBodyFrame);
// test
if (!SUCCEEDED(hr))
{
int test = 1;// Somehow, it go into here, the Getbody cannot succes!!!!!
}
if (SUCCEEDED(hr))
{
//some code....
}
}