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

OpenCV Error: Image step is wrong () in cvInitMatHeader

asked 2012-01-26 10:32:24 -0500

wyosae67 gravatar image

Name : left_mat_ Details:{flags = 1124007936, dims = 2, rows = 480, cols = 752, data = 0x80b6bc8 023"..., dataend = 0x8110bb8 "", datalimit = 0x8110bc8 "", allocator = 0x0, size = {p = 0xbffff238}, step = {p = 0xbffff260, buf = {768, 1}}} Default:{...} Decimal:{...} Hex:{...} Binary:{...}

This is from grabbing my image from a focus robotics stereo cam then I use stereo bridge and get this

Name : left_image_ Details:{_vptr.Image_ = 0x80840e8, header = {_vptr.Header_ = 0x8084128, seq = 0, stamp = {<ros::timebase<ros::time, ros::duration="">> = {sec = 0, nsec = 0}, <no data="" fields="">}, frame_id = {static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<no data="" fields="">}, <no data="" fields="">}, _M_p = 0x808f5fc ""}}, __connection_header = {px = 0x0, pn = {pi_ = 0x0}}}, height = 480, width = 752, encoding = {static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<no data="" fields="">}, <no data="" fields="">}, _M_p = 0x808f5fc ""}}, is_bigendian = 0 '\000', step = 768, data = {<std::_vector_base<unsigned char,="" std::allocator<unsigned="" char=""> >> = {_M_impl = {<std::allocator<unsigned char="">> = {<__gnu_cxx::new_allocator<unsigned char="">> = {<no data="" fields="">}, <no data="" fields="">}, _M_start 023"..., _M_finish = 0x8252c00 "", _M_end_of_storage = 0x8252c00 ""}}, <no data="" fields="">}, __connection_header = {px = 0x0, pn = {pi_ = 0x0}}} Default:{...} Decimal:{...} Hex:{...} Binary:{...} Octal:{...}

When I try and run image viewer I get the error in the title what is going wrong?

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
0

answered 2012-01-27 01:51:08 -0500

wyosae67 gravatar image

just had to change it to lower case mono8.

edit flag offensive delete link more
0

answered 2012-01-26 11:29:38 -0500

Patrick Mihelich gravatar image

It looks like the camera driver doesn't set the encoding field of the sensor_msgs/Image message. Try

rostopic echo /image_topic/encoding

Normally this should be one of mono8, rgb8 or bgr8.

Which version of ROS are you using?

edit flag offensive delete link more
0

answered 2012-01-26 12:37:25 -0500

wyosae67 gravatar image

That is set manually with dynamic reconfigure as the driver has many different types of images it can return Right now it is set as MONO8 before it is published. I am using electric ros.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-01-26 10:32:24 -0500

Seen: 1,682 times

Last updated: Jan 27 '12