code: def estimate_rotation(self, camera, ransac_threshold=7.0):
          
          if self.axis is None:
              x = self.points[:, 0, :].T
              y = self.points[:, -1, :].T
              inlier_ratio = 0.5
              R, t, dist, idx = rotations.estimate_rotation_procrustes_ransac(x, y,
                                                                       camera, 
                                                                       ransac_threshold,
                                                                       inlier_ratio=inlier_ratio,
                                                                       do_translation=False)
              
              if R is not None:                                      
                  self.axis, self.angle = rotations.rotation_matrix_to_axis_angle(R)
                  if self.angle < 0: # Constrain to positive angles
                      self.angle = -self.angle
                      self.axis = -self.axis
                  self.inliers = idx
                                                            
          return self.axis is not None
docs: Estimate the rotation between first and last frame
  
          It uses RANSAC where the error metric is the reprojection error of the points
          from the last frame to the first frame.
  
          Parameters
          -----------------
          camera : CameraModel
              Camera model
          ransac_threshold : float
              Distance threshold (in pixels) for a reprojected point to count as an inlier