does Opencv Images have timestamp info?

Viewed 220

I am currently trying to use ROS' cv_bridge to convert to and from Opencv Mat images and ROS sensor_msgs/Images. I am not putting this question in the ROS answer site but here because I've already read in this answer that apparently in this conversion, cv_bridge does not put or fill or take the header message (with the timestamp) of the ROS Image.

So my remaining question is more on the OpenCV's side:

Does OpenCV Mat Images have some timestamp info embedded in them? If so, how can I access it?

1 Answers

OpenCV Mat images don't have any timing info built into them. You can see the class reference for them here.

You can, however, get the timestamp from your video capture source. It has a property CAP_PROP_POS_MSEC that returns the position the current frame is in a video source. You can use that to put into your ROS message header, although, you might have to do some extra work to convert the time from the video into the same timebase as ROS.

Related