SHARE
TWEET

Code

a guest Sep 15th, 2019 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top