5 from scipy.misc
import face
6 img = face()[:, :, ::-1]
9 from scipy.misc
import lena
10 img = cv2.cvtColor(lena().astype(np.uint8), cv2.COLOR_GRAY2BGR)
14 from sensor_msgs.msg
import Image
18 imgmsg.header.stamp = rospy.Time.now()
19 pub_img.publish(imgmsg)
22 if __name__ ==
'__main__':
23 rospy.init_node(
'static_image_publisher')
25 pub_img = rospy.Publisher(
'~output', Image, queue_size=1)
27 bridge = cv_bridge.CvBridge()
28 imgmsg = bridge.cv2_to_imgmsg(img, encoding=
'bgr8')
30 rospy.Timer(rospy.Duration(0.1), timer_cb)