Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用 ROS 从视频流中提取多个帧?
我订阅了我的相机主题:
self.image_sub = rospy.Subscriber('/bebop2/image_raw',Image, self.image_callback)
接着 :
frame = self.bridge.imgmsg_to_cv2(msg,desired_encoding='bgr8')
这样我就有了来自流媒体的实际帧。如何存储 N 帧(实际的和以前的)?
编写一个类,创建一个缓冲区并缓冲图像。每次你得到一个新的,把它添加到缓冲区中。现在你也有了以前的所有。一旦有足够的帧,请确保也清空缓冲区,否则您将在某些时候耗尽内存。