本文实例为大家分享了python opencv实现切变换的具体代码,供大家参考,具体内容如下
# -*- coding:gb2312 -*-
import cv2
from math import *
import numpy as np
img = cv2.imread("3-2.jpg")
height,width=img.shape[:2]
degreeAffine=45
#切变换最后结果
heightAffine=height
widthAffine=int(2*height*tan(radians(degreeAffine))+width)
# 随意两点得到仿射变换矩阵
# poi