Tal
unread,Aug 28, 2012, 5:38:08 AM8/28/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to openn...@googlegroups.com
hello,
I tried to change my depth image and to display it with glutDisplay.
I wrote the following code:
XnPoint3D projection, pPosition2;
pPosition2.X=handXPos;
pPosition2.Y=handYPos;
pPosition2.Z=handZPos;
printf(" position drewSquare: (%f, %f, %f)\n", pPosition2.X,pPosition2.Y,pPosition2.Z);
g_depth.ConvertRealWorldToProjective(1,&pPosition2,&projection);
g_depth.GetMetaData(g_depthMD);
XnDepthPixel* depth = g_depthMD.WritableData();
const XnDepthPixel* depthData = g_depthMD.Data();
int x = projection.X;
int y = projection.Y;
int handDepth = depthData[y*g_depthMD.XRes() + x];
printf("X projection: %d, Y projection: %d\n",x,y);
for (int i = -100; i<100; i++) {
for (int j = -100; j<100; j++){
depth[(y+j)*g_depthMD.XRes() + (i+x)] = 0;
//g_depthMD.WritableData()[(y+j)*g_depthMD.XRes() + (i+x)]=0;
}
}