问题
I have two images, one is the result of applying an affine transform to the other. I can register them using homography by extracting the points using the ORB_create function in OpenCV. However, I want to calculate the Affine matrix needed for this transformation. is there any way of doing it simply by having the two images?
回答1:
Detect a rotated rectangle and use its corners to get your transformation matrix
Use : getPerspectiveTransform or getAffineTransform
Edit: regarding rotated rectangle detection :
Please check this Opencv tutorial on how to find contours and detect rotated rectangles Creating Bounding rotated boxes and ellipses for contours
来源:https://stackoverflow.com/questions/59485056/calculate-the-affine-transformation-matrix-in-image-feature-based-registration