旋转图像后如何重新映射点?

旋转图像后如何重新映射点?,第1张

旋转图像后如何重新映射点?

只需使用仿射变换和逆矩阵中所述的矩阵运算即可。

# inverse matrix of simple rotation is reversed rotation.M_inv = cv2.getRotationMatrix2D((100/2, 300/2),-30,1)# pointspoints = np.array([[35.,  0.],        [175., 0.],        [105., 200.],        [105., 215.],       ])# add onesones = np.ones(shape=(len(points), 1))points_ones = np.hstack([points, ones])# transform pointstransformed_points = M_inv.dot(points_ones.T).T


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5617732.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-15
下一篇 2022-12-15

发表评论

登录后才能评论

评论列表(0条)

保存