Extract multiple frames from camera using ROS
Write a class, create a buffer and buffer the images. Each time you get a new one, add it to the buffer. now you have all previous ones as well.
Make sure to also empty the buffer once there are enough frames, otherwise you'll run out of memory at some point.
How do I extract multiple frames from a video streaming using ROS ?
I subscribed to my camera topic :
self.image_sub = rospy.Subscriber('/bebop2/image_raw',Image, self.image_callback)
And then :
frame = self.bridge.imgmsg_to_cv2(msg,desired_encoding='bgr8')
This way I have the actual frame from my streaming. How can I store N frames (the actual and previous ones) ?