Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to find rotation angle from homography matrix?

if len(good)>MIN_MATCH_COUNT: src_pts = np.float32([ kp1[m.queryIdx].pt for m in good ]).reshape(-1,1,2) dst_pts = np.float32([ kp2[m.trainIdx].pt for m in good ]).reshape(-1,1,2)

M, mask = cv2.findHomography(src_pts, dst_pts, cv2.RANSAC,5.0)

I have 2 images and i am finding simliar key points by SURF. I want to find rotation angle between the two images from homograpohy matrix. Can someone please tell me how to find rotation angle between two images from homography matrix.

Thank you.

click to hide/show revision 2
None

updated 2018-11-23 04:50:04 -0600

berak gravatar image

How to find rotation angle from homography matrix?

if len(good)>MIN_MATCH_COUNT: src_pts = np.float32([ kp1[m.queryIdx].pt for m in good ]).reshape(-1,1,2) dst_pts = np.float32([ kp2[m.trainIdx].pt for m in good ]).reshape(-1,1,2)

M, mask = cv2.findHomography(src_pts, dst_pts, cv2.RANSAC,5.0)

I have 2 images and i am finding simliar key points by SURF. I want to find rotation angle between the two images from homograpohy matrix. Can someone please tell me how to find rotation angle between two images from homography matrix.

 if len(good)>MIN_MATCH_COUNT:
    src_pts = np.float32([ kp1[m.queryIdx].pt for m in good ]).reshape(-1,1,2)
    dst_pts = np.float32([ kp2[m.trainIdx].pt for m in good ]).reshape(-1,1,2)

    M, mask = cv2.findHomography(src_pts, dst_pts, cv2.RANSAC,5.0)

Thank you.