8bit kinect data
I search disparity and depth data 11bit.
But kinect pulish just 8bit.
Why do they have difference?
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
I search disparity and depth data 11bit.
But kinect pulish just 8bit.
Why do they have difference?
Looking at the openni_camera documentation on the ROS wiki, you can see that the openni_node
broadcasts several topics.
I think for the data that you are looking for, the topics of interest will be the depth/image_raw
messages, or the depth_registered/image_raw
if you have the OpenNI registration turned on.
The */image_raw messages are in the sensor_msgs/Image message format, which stores the data in a byte array, that can then be reassembled in the subscriber. This is accomplished using cv_bridge.
cv_bridge
allows you to write code like this for your callback:
void imageCb(const sensor_msgs::ImageConstPtr& msg)
{
cv_bridge::CvImagePtr cv_ptr;
try
{
cv_ptr = cv_bridge::toCvCopy(msg, enc::TYPE_32FC1);
}
catch (cv_bridge::Exception& e)
{
ROS_ERROR("cv_bridge exception: %s", e.what());
return;
}
cv::imshow(WINDOW, cv_ptr->image);
image_pub_.publish(cv_ptr->toImageMsg());
}
cv_ptr->image
will contain an OpenCV cv::Mat
, in this case containing floating point values, which represent the depth in millimeters for that pixel.
They might also be interested in the rectified images, depth_registered/image_rect_raw
Do you mean 16 bit? In any case, kinect depth image is 16 bit, not 8.
How can I 16bit data? depth data is sensor_msgs/Image Message. They have uint8[] data. (http://ros.org/doc/api/sensor_msgs/html/msg/Image.html)
Not sure exactly what you mean, but if you know what the image encoding is, you can easily convert it to an opencv Mat of the same size and type, using cv_bridge
If I use cv_bridge, can I get depth or disparity value?
( I don't read last question. so I ask one more. you understand it )
Asked: 2012-08-25 16:46:52 -0500
Seen: 660 times
Last updated: Aug 29 '12
How to convert the 2D laser data in the laser coordinate system to the data under the base?
How to store in a variable some data published by node using rosmatlab?
Using the same data structure in multiple nodes
how to force hector slam to set robot position ?
Create Data Conversion Package C++! [closed]
do some mathematical calculation and algorithms on dynamic data
Data Definition RGB16 Image Encoding