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

How to convert CameraInfo sensor msgs to Images?

asked 2018-09-05 07:49:31 -0500

latida gravatar image

updated 2018-09-05 09:58:13 -0500

gvdhoorn gravatar image

Hi, is there any function for converting CameraInfo sensor messages to images. I'm aware of CvBridge library but it seems to me like it only works for Image sensor messages. I appreciate your help!


Edit:

Sorry if you misunderstood me. Video was recorded from the camera, but the .bag wasn't recorded using Image msg type. It's structured like this:

some header
     <Preface Index>    // preface frame index
     <Message Data> // first frame record
....
     <Message Data> // last frame record
<Index Data>    // index of all records in the previous chunk
<Connection>    // connection specs
<Chunk Info>    // additional chunk info

So, when I type rosbag info in command line, I get only CameraInfo msg type recognized, but that msgs are probably containing our special format.

So, what I'm then interested in is how to access/view the content of these msgs?

edit retag flag offensive close merge delete

Comments

sensor_msgs/CameraInfo.msg contains only information for a camera such as camera, projection and distortion matrices. It does not contain the images so you should use CvBridge to convert ROS images (sensor_msgs/Image) into OpenCV (cv::Mat)

pavel92 gravatar image pavel92  ( 2018-09-05 08:21:15 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-09-05 08:07:58 -0500

gvdhoorn gravatar image

updated 2018-09-05 10:00:12 -0500

is there any function for converting CameraInfo sensor messages to images

CameraInfo msgs do not encode images, so this is impossible and no such function exists.


Edit:

my .bag file contains only CameraInfo msg type

So only those messages, no other messages?

but the video that's recorded from the camera has a special format in which it's stored into

But not in the bag then? That's at least what you write in the previous sentence.

Is there a way at least to access the message to view raw string format?

Messages are not always strings, especially not images, so I'm not sure what you are asking.


Edit2:

Video was recorded from the camera, but the .bag wasn't recorded using Image msg type. It's structured like this:

some header
     <Preface Index>    // preface frame index
     <Message Data> // first frame record
....
     <Message Data> // last frame record
<Index Data>    // index of all records in the previous chunk
<Connection>    // connection specs
<Chunk Info>    // additional chunk info

Is this the structure of the bag, or data from the camera?

edit flag offensive delete link more

Comments

Thanks, the problem is that my .bag file contains only CameraInfo msg type, but the video that's recorded from the camera has a special format in which it's stored into. Is there a way at least to access the message to view raw string format?

latida gravatar image latida  ( 2018-09-05 08:31:30 -0500 )edit

Question Tools

Stats

Asked: 2018-09-05 07:49:31 -0500

Seen: 468 times

Last updated: Sep 05 '18