本文主要分享的是一则python+opencv实现任意角度的透视变换的实例,具体如下:
# -*- coding:utf-8 -*-
import cv2
import numpy as np
def rad(x):
return x * np.pi / 180
img = cv2.imread("6.jfif")
cv2.imshow("original", img)
# 扩展图像,保证内容不超出可视范围
img = cv2.copyMakeBorder(img, 200, 200, 200, 200, cv2.BORDER_CONSTANT, 0)
w, h = img.shape[
2021-09-22 11:32:03
41KB
c
nc
op
1