cv2.getRotationMatrix2D的第三列

The third column of cv2.getRotationMatrix2D

我最近一直在学习如何在不裁剪的情况下旋转图像。但是我对 cv2 的 getRotationMatrix2D 的第三列有点困惑。它 returns 大小为 2 x 3 的矩阵。

虽然我的代码是基于 Rotate an image without cropping in OpenCV in C++ and Python 2.7.3 + OpenCV 2.4 after rotation window doesn't fit Image 工作的,但我很高兴也很想知道这个转换矩阵的第三列到底做了什么。

感谢@Yunus 提供的文档link。根据文档

The transformation maps the rotation center to itself. If this is not the target, adjust the shift.

表示 M_rotation * vector_of_rotation_center = vector_of_rotation_center 文档中的表达式设置为等式成立。

旋转矩阵的前两列指定了旋转变换和缩放变换;第三列用于指定翻译转换。