<s> import rospy , cv2 , cv_bridge , numpy <EOL> from sensor_msgs . msg import Image <EOL> class Follower : <EOL> def __init__ ( self ) : <EOL> self . bridge = cv_bridge . CvBridge ( ) <EOL> cv2 . namedWindow ( "<STR_LIT>" , <NUM_LIT:1> ) <EOL> self . image_sub = rospy . Subscriber ( '<STR_LIT>' , <EOL> Image , self . image_callback ) <EOL> def image_callback ( self , msg ) : <EOL> image = self . bridge . imgmsg_to_cv2 ( msg ) <EOL> hsv = cv2 . cvtColor ( image , cv2 . COLOR_BGR2HSV ) <EOL> lower_yellow = numpy . array ( [ <NUM_LIT:50> , <NUM_LIT:50> , <NUM_LIT> ] ) <EOL> upper_yellow = numpy . array ( [ <NUM_LIT:255> , <NUM_LIT:255> , <NUM_LIT> ] ) <EOL> mask = cv2 . inRange ( hsv , lower_yellow , upper_yellow ) <EOL> masked = cv2 . bitwise_and ( image , image , mask = mask ) <EOL> cv2 . imshow ( "<STR_LIT>" , mask ) <EOL> cv2 . waitKey ( <NUM_LIT:3> ) <EOL> rospy . init_node ( '<STR_LIT>' ) <EOL> follower = Follower ( ) <EOL> rospy . spin ( ) </s>
