Two kinect initialisation

39 views
Skip to first unread message

Marc Le Guen

unread,
May 10, 2011, 9:57:59 AM5/10/11
to OpenNI
Hello, I have some bugs with that initialisation of two Kinects :

xn::Context globalContext;
xn::Context g_Context[2];
xn::DepthGenerator depthGen[2];
xn::UserGenerator userGen[2];
xn::ImageGenerator imgGen[2];
globalContext.Init();
static xn::NodeInfoList lt;
globalContext.EnumerateProductionTrees(XN_NODE_TYPE_DEVICE,
NULL, lt);
int cpt=0;
for(xn::NodeInfoList::Iterator iter = lt.Begin(); iter != lt.End(); +
+iter)
{
xn::NodeInfo node = (*iter);
g_Context[cpt].Init();
g_Context[cpt].CreateProductionTree(node);
imgGen[cpt].Create(g_Context[cpt]);
depthGen[cpt].Create(g_Context[cpt]);
userGen[cpt].Create(g_Context[cpt]);


depthGen[cpt].GetAlternativeViewPointCap().SetViewPoint(imgGen[cpt]);
g_Context[cpt].SetGlobalMirror(true);


cpt++;
}

rc = g_Context[0].StartGeneratingAll();
rc = g_Context[1].StartGeneratingAll();


I get a strange usermap, and a normal one using both kinect. Any
idea ?

thanks

Marc Le Guen

unread,
May 10, 2011, 11:24:20 AM5/10/11
to OpenNI
More info :

In the following case i have in sceneMetaD the userpixels of the first
userGenerator. But i have it for both usergenerator
for(int p=0;p>2;p++){

nRetVal =
g_Context[p].WaitOneUpdateAll(userGen[p]);
userGen[p].GetUserPixels(1,sceneMetaD);

}


if i do that i have in sceneMetaD the userpixels of the second
userGenerator, and same as before it is for both usergenerator
for(int p=1;p>=0;p--){

nRetVal =
g_Context[p].WaitOneUpdateAll(userGen[p]);
userGen[p].GetUserPixels(1,sceneMetaD);

}
Reply all
Reply to author
Forward
0 new messages