March 2020
Intermediate to advanced
366 pages
9h 8m
English
Now that we have obtained the matches between keypoints, we can calculate two important camera matrices—the fundamental matrix and the essential matrix. These matrices will specify the camera motion in terms of rotational and translational components. Obtaining the fundamental matrix (self.F) is another OpenCV one-liner:
def _find_fundamental_matrix(self):
self.F, self.Fmask = cv2.findFundamentalMat(self.match_pts1, self.match_pts2, cv2.FM_RANSAC, 0.1, 0.99)
The only difference between fundamental_matrix and essential_matrix is that the latter operates on rectified images:
def _find_essential_matrix(self):
self.E = self.K.T.dot(self.F).dot(self.K)
The essential matrix (self.E) can then be decomposed into rotational ...