skeleton_marker / Openni_tracker Publish Depth Image

asked 2016-06-20 14:40:20 -0600

Pototo gravatar image

Folks,

skeleton_marker and openni_tracker only publish TF data. How can I publish the depth image being used inside skeleton_tracker? I am converting the data in the skeleton_tracker.cpp, but I get a black image on my node subscribed the data, like so:

g_kinect_controller.getDepthGenerator().GetMetaData(depthMD);
.
.
cv::Mat depthWrapper(depthMD.YRes(), depthMD.XRes(), CV_32FC1, (void*) depthMD.Data());
sensor_msgs::ImagePtr msg = cv_bridge::CvImage(std_msgs::Header(),
       sensor_msgs::image_encodings::TYPE_32FC1, depthWrapper).toImageMsg();
depth_image_pub_.publish(msg);

On my subscribing node I follow the standart cv_bridge subscriber tutorial, but I use 32FC1 instead of "brg8," then I convert to 8UC1 to process the image. But I get weird images, and nothing like the image being displayed in the skeleton_tracker OpenGL window.

edit retag flag offensive close merge delete