提交 a32f3bbd 编写于 作者: 幻灰龙's avatar 幻灰龙

Merge branch 'youcans-master-patch-08987' into 'master'

上传新文件 仿射变换 py

See merge request !23
import cv2 as cv
import numpy as np
if __name__ == '__main__':
img = cv.imread("affine1.jpg")
pts1 = np.float32([[50, 50], [200, 50], [50, 200]])
pts2 = np.float32([[50, 100], [200, 50], [100, 250]])
MA = cv.getAffineTransform(pts1, pts2)
dst = cv.warpAffine(img, MA, img.shape[:2])
cv.imshow("Origin image", img)
cv.imshow("Affine transform", dst)
cv.waitKey(0)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册