manual_park.py 文件源码

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

项目:AutonomousParking 作者: jovanduy 项目源码 文件源码
def transform_img(self):
        """ Transform the top-down image of the arc so that it lays flat in a plane on our cv_image """
        if self.vel is not None and self.omega is not None:
            pts1 = np.float32([[0,0], [0, IMG_HEIGHT], [IMG_WIDTH, IMG_HEIGHT], [IMG_WIDTH, 0]])
            pts2 = np.float32([[200,240], [0, IMG_HEIGHT], [IMG_WIDTH, IMG_HEIGHT], [400, 240]])
            M = cv2.getPerspectiveTransform(pts1, pts2)
            self.transformed = cv2.warpPerspective(self.arc_image, M, (self.cv_image.shape[0], self.cv_image.shape[1]))
            rows, cols, channels = self.transformed.shape
            self.transformed = self.transformed[0:IMG_HEIGHT, 0: cols]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号