我想要旋转图像,但不想使用 cv2.warpPerspective()
函数。如何从 cv2.findHomography()
函数的输出中获取角度?
# Find homography
H, mask = cv2.findHomography(points1, points2, cv2.RANSAC)
# for example my H:
array([[ 1.20001976e-01, 5.19205433e-04, -1.21739638e+01],
[ 1.51272694e-03, 1.18686196e-01, -1.59772594e+01],
[ 1.98308723e-06, -1.18197608e-07, 1.00000000e+00]])
# What should be the someFunction function?
angle = someFunction(H) # from 0 to 360
rotated = imutils.rotate(image, angle=angle)
decomposeHomographyMat
方法来完成这个任务。 - EdChum