def process_image(self, msg):
""" Process image messages from ROS and stash them in an attribute
called cv_image for subsequent processing """
self.cv_image = self.bridge.imgmsg_to_cv2(msg, desired_encoding="bgr8")
self.arc_image = np.zeros((480, 640, 3), np.uint8)
self.draw_arc()
# Transform the image of our arc from a top down image into the plane of our CV
self.transform_img()
# overlay the projected path onto cv_image
self.overlay_img()
if self.omega is not None and self.omega == 0.0:
self.hsv_image = cv2.cvtColor(self.cv_image, cv2.COLOR_BGR2HSV)
self.binary_image = cv2.inRange(self.hsv_image, self.hsv_lb, self.hsv_ub)
self.spot_delineators = self.find_delineators()
if self.color != (0, 255, 0): # This logic makes it such that once the lines turn green, they stay green
self.color = (0,0,255) if not self.check_aligned() else (0,255,0)
评论列表
文章目录