manual_park.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:AutonomousParking 作者: jovanduy 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号