question about publishXYZPointCloud() in openni_camera [closed]

asked 2011-12-29 19:14:10 -0600

yayafree186 gravatar image

updated 2011-12-29 19:17:57 -0600

i'm using the newest version of openni_kinect from http://www.ros.org/wiki/openni_kinect. To find out how to get pointcloud from depth image, i read through the source codes and find that in openni_nodelet.cpp there is a function publishXYZPointCloud()

centerX = (cloud_msg->width >> 1) - 0.5f;
centerY = (cloud_msg->height >> 1) - 0.5f;
float constant = 0.001 / device_->getDepthFocalLength (depth_width_);
pt.x = (u - centerX) * depth_md[depth_idx] * constant;
pt.y = (v - centerY) * depth_md[depth_idx] * constant;
pt.z = depth_md[depth_idx] * 0.001;

according to the camera's pin-hole model, this function does a right job. but the question is, it seems that it's using built-in camera's intrincis parameters. i.e. centerX = (depth_width_ >> 1) - 0.5f; centerY = (depth_height_ >> 1) - 0.5f; also there is another sentence in openni_device.cpp that rgb_focal_length_SXGA_ = 1050; so the calibration file cannot affect the result. i think this is a bug. what's your opinion?

question 2: about the z value we get from the depth image, is it a distance from the target point to the camera's origin, or is it only the distance's z-coordinate? Let's imagine an experiment, say we have a plane parallel to the camera's image plane, if the z we get is the later one, then every point in the plane have the same z; on the other side, if z is the former one, then points in the plane have different z because the distance to the camera's origin is different. the problem following this is, if z if the later one, then the formula in function publishXYZPointCloud() is right, otherwise it is wrong.

question 3: to get the XYZRGB point cloud, we need to align the depth image to the rgb image. how this is done? i read through the codes in openni_camera but i didn't find any cue. or maybe this is done in the kinect's hardware? what's more, to do the alignment, i think we need the calibration information between the IR camera and the rgb camera. so if this done in kinect's hardware, we cannot change this through calibration.

sorry for so many questions. don't know if i make myself clear... thanks in advance for any comment.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2013-09-06 13:37:41