Advertisement
Guest User

Code

a guest
Sep 15th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. !pip3 install gnupg
  2. import roslib
  3. import rospy
  4. import jupyros as jr
  5. import rosbag
  6. import cv2
  7. from cv_bridge import CvBridge
  8. from sensor_msgs.msg import Image, CompressedImage
  9. import matplotlib.pyplot as plt
  10. import numpy as np
  11.  
  12. bridge = CvBridge()
  13. with rosbag.Bag('images.bag', 'r') as image_bag:
  14.     for topic, image_message, t in image_bag.read_messages():
  15.         cv_image = bridge.imgmsg_to_cv2(image_message, "bgr8")
  16.         cv2.imshow("image", cv_image)
  17.         break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement