def test_triangulation_inliers(pairs_and_their_E): for f1, f2, _, pose in pairs_and_their_E: Rt = pose.get_cam_to_world()[:3] count_outliers = np.random.randint(0, len(f1) / 10) f1[:count_outliers, :] += np.random.uniform(0, 1e-1, size=(count_outliers, 3)) inliers = matching.compute_inliers_bearings(f1, f2, Rt[:, :3], Rt[:, 3]) assert sum(inliers) >= len(f1) - count_outliers
def _two_view_reconstruction_inliers(b1: np.ndarray, b2: np.ndarray, R: np.ndarray, t: np.ndarray, threshold: float) -> List[int]: """Returns indices of matches that can be triangulated.""" ok = matching.compute_inliers_bearings(b1, b2, R, t, threshold) return np.nonzero(ok)[0]
def _two_view_reconstruction_inliers(b1, b2, R, t, threshold): """ Returns indices of matches that can be triangulated. """ ok = matching.compute_inliers_bearings(b1, b2, R, t, threshold) return np.nonzero(ok)[0]