I want to calculate the z coordinate of an object relative to the camera (kinect), knowing the information of depth from the kinect. I know also the intrinsic parameters.
Any help is much appreciated. Thanks!
I want to calculate the z coordinate of an object relative to the camera (kinect), knowing the information of depth from the kinect. I know also the intrinsic parameters.
Any help is much appreciated. Thanks!
If you want the real world measurements (including depth), you want to retrieve the point cloud map, something like:
Mat world;
if( capture.retrieve(world, CV_CAP_OPENNI_POINT_CLOUD_MAP)){
Vec3f pt3D = world.at<Vec3f>(yourY, yourX);
cout << "pt3D" << pt3D << endl;
}
Notice that you pass the y first, then the x. I've learned that somewhat recently :)