ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In the code the message is already converted to a cv::Mat ( cv_ptr->image ). Use this Matrix if you want to do some processing of the data.

E.g. you can use

float dist_val = cv_ptr->image.at<float>( 10, 10 );

to get the value at 10, 10. (There are much faster methods if you not just want to access one pixel, though).

See, http://docs.opencv.org for infos on how to handle your data with OpenCV.