I tried to subscribe to a topic called /image and tried to convert the ros message to a opencv image. Here below is the code.
rospy.Subscriber("image", SenMsg.Image)
rospy.spin()
cv_image = bridge.imgmsg_to_cv2(Image, "bgr8")
cv2.imwrite('img.jpg',cv_image)
But when i do that, i am not able to write any thing.. there is no output at all.. can any one help me ?
thanks in advance