I am using opencv warpPerspective to generate images with different rotation to evaluate my feature point detection algorithm.
In homography matrix, the up-left 2×2 matrix is the rotation matrix, as referred here.
But the result is a rotation about the origin( the up-left corner), how can I modify the homography matrix to rotate the image about its center?
Regards.
See this matrix
an affine transformation that translates and rotates, center is the center of rotation. To get a homography from this just need to add the last raw
[ 0 0 1]. You can use getRotationMatrix2D to compute this matrix, and then either usewarpAffineor form the homography and usewarpPerspective. Please let us know how it goes.