Skip to content

Instantly share code, notes, and snippets.

@Yengas
Created April 11, 2018 22:40
Show Gist options
  • Select an option

  • Save Yengas/9b87734cdb9f8bd19151d582c024b3fa to your computer and use it in GitHub Desktop.

Select an option

Save Yengas/9b87734cdb9f8bd19151d582c024b3fa to your computer and use it in GitHub Desktop.
Multiplying two homography with opencv python. Combining two homography so the output will be rotated
# Rotates the given homography from the origin point
def getRotatedHomography(homography, size, angle):
width, height = size
rotation = cv2.getRotationMatrix2D((width / 2, height / 2), angle, 1)
rotationHomography = np.concatenate((rotation, np.array([[0, 0, 1]])))
return np.dot(rotationHomography, homography)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment