Ask Your Question
0

Save many ROIs with same time stamp inside a bag file

asked 2011-10-05 06:12:15 -0500

DaHoC gravatar image

updated 2014-01-28 17:10:30 -0500

ngrennan gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2011-10-05 15:59:11 -0500

Tim Field gravatar image

How about creating a new message type to hold the ROIs and masks, e.g.

sensor_msgs/RegionOfInterest[] rois
sensor_msgs/Image[]            masks

stored at the same timestamp of the image?

edit flag offensive delete link more

Comments

Hi, that was easier than I thought because RegionOfInterest is missing a header so I could use one header to store the timestamp and added RegionOfInterest[] regionsArray to my new message definition. I used http://www.ros.org/wiki/ROS/Tutorials/DefiningCustomMessages - Thanks!
DaHoC gravatar image DaHoC  ( 2011-10-10 02:28:37 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-10-05 06:12:15 -0500

Seen: 343 times

Last updated: Oct 05 '11