def test_absolute_pose_three_points(shots_and_their_points): exact_found = 0 for pose, bearings, points in shots_and_their_points: result = pygeometry.absolute_pose_three_points(bearings, points) expected = pose.get_world_to_cam()[:3] for Rt in result: exact_found += np.linalg.norm(expected - Rt, ord="fro") < 1e-6 exacts = len(shots_and_their_points) - 2 assert exact_found >= exacts
def test_absolute_pose_three_points(shots_and_their_points): exact_found = 0 for pose, bearings, points in shots_and_their_points: result = pygeometry.absolute_pose_three_points(bearings, points) expected = pose.get_Rt() for Rt in result: exact_found += (np.linalg.norm(expected - Rt, ord='fro') < 1e-6) exacts = len(shots_and_their_points) - 2 assert exact_found >= exacts
def test_absolute_pose_three_points(one_shot_and_its_points): pose, bearings, points = one_shot_and_its_points result = pygeometry.absolute_pose_three_points(bearings, points) exact_found = False expected = pose.get_Rt() for Rt in result: if np.linalg.norm(expected-Rt, ord='fro') < 1e-6: exact_found = True assert exact_found