38 from cv_bridge
import CvBridge, CvBridgeError
39 from sensor_msgs.msg
import Image
43 from sensor_msgs.msg
import CompressedImage
48 '''Callback function of subscribed topic. 49 Here images get converted to cv2 format''' 52 currentImage = self.bridge.imgmsg_to_cv2(ros_data,
"rgb8")
54 np_arr = np.fromstring(ros_data.data, np.uint8)
55 image_np = cv2.imdecode(np_arr, 1)
57 currentImage = cv2.cvtColor(image_np, cv2.BGR2RGB)
73 sub_string +=
"/compressed" 75 sub_string, CompressedImage, callback, queue_size=1)