[ros-users] Save ROIs inside bag files

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
Delete this message
Reply to this message
Author: J H
Date:  
To: ROS user discussions
Subject: [ros-users] Save ROIs inside bag files
Hi,
I would like to save ROIs (cv::Rect) and masks (cv::Mat) inside a bag file along with images (cv::Mat).
I put the 4 rect values (x,y,width,height) inside a cv::Mat and store them and the masks and the images each with a separate topic and the same corresponding time stamp as the image inside the bag file.

Now it may occur that I have multiple ROIs and masks for one image, in which case I need to save several cv::Mat with the same time stamp into the bag file and I don't think that even works.
What would be an elegant approach to cleanly resolve this? I currently add one nsec for each additional mask and ROI to the timestamp of the image, but that clearly is a bad solution.

Any help appreciated,

best regards,
Jan Hendriks