I want to estimate the orientation angles of a moving camera. I have the camera intrinsics K
and can track keypoints to calculate the essential matrix E
and from there on also the rotational matrix R
with respect to the previous frame of the video.
E, _ = cv2.findEssentialMat(kpn_cur, kpn_ref, focal=1, pp=(0., 0.), method=cv2.RANSAC, prob=kRansacProb, threshold=kRansacThresholdNormalized)
_, R, t, mask = cv2.recoverPose(E, kpn_cur, kpn_ref, focal=1, pp=(0., 0.))
(using already normalized keypoints kpn_cur
and kpn_ref
, calculated with the camera intrinsics K
)
This enables me to get the direction and location of the frames with respect to each other, but what I really want is the position (and orientation) of the camera with respect to ground plane of each frame.
I know there are ways using vanishing points to calculate the camera orientation (also by calculating the rotation matrix from vanishing points).
Whats the way to calculate the orientation with respect to ground plane from the given rotation matrix?
Thanks!