Opencv, Image Transformation, Homography, Streamlit, Github.
image. scaling_matrix = np.array([ [scale_x, 0, 0], [0, scale_y, 0], [0, 0, 1] ], dtype=np.float32) scaled_image = cv2.warpPerspective(image, scaling_matrix, (int(image.shape[1] * scale_x), int(image.shape[0] * scale_y))) The scaling matrix requires scale for the horizontal direction (x) and the