0
$\begingroup$

Rosanswers logo

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?


Originally posted by latida on ROS Answers with karma: 1 on 2018-09-05

Post score: 0


Original comments

Comment by pavel92 on 2018-09-05:
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)

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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?


Originally posted by gvdhoorn with karma: 86574 on 2018-09-05

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by latida on 2018-09-05:
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?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.