def undistort(self, raw_image, show_dotted=False): image = cv2.undistort(raw_image, self.cam_matrix, self.dist_coef, None, self.cam_matrix) if show_dotted: show_dotted_image(image, self.spoints) return image
def sky_view(self, ground_image, show_dotted=False): temp_image = self.undistort(ground_image, show_dotted=False) shape = (temp_image.shape[1], temp_image.shape[0]) warp_image = cv2.warpPerspective(temp_image, self.warp_matrix, shape, flags=cv2.INTER_LINEAR) if show_dotted: show_dotted_image(warp_image, self.dpoints) return warp_image