コード例 #1
0
def compute_translation_distance_metrics(
        wti_list: List[Optional[Point3]],
        gt_wti_list: List[Optional[Point3]]) -> StatsDict:
    """Computes statistics for the distance between estimated and GT translations.

    Assumes that the estimated and GT translations have been aligned and do not
    have a gauge freedom (including scale).

    Args:
        wti_list: List of estimated camera translations.
        gt_wti_list: List of ground truth camera translations.

    Returns:
        A statistics dict of the metrics errors in degrees.
    """
    errors = []
    for (wti, gt_wti) in zip(wti_list, gt_wti_list):
        errors.append(comp_utils.compute_points_distance_l2(wti, gt_wti))
    return compute_errors_statistics(errors)
コード例 #2
0
 def test_compute_points_distance_l2_is_nonzero(self):
     wti1 = Point3(1, 1, 1)
     wti2 = Point3(1, 1, -1)
     self.assertEqual(
         geometry_comparisons.compute_points_distance_l2(wti1, wti2), 2)
コード例 #3
0
 def test_compute_points_distance_l2_is_none(self):
     self.assertEqual(
         geometry_comparisons.compute_points_distance_l2(wti1=Point3(
             0, 0, 0),
                                                         wti2=None), None)
コード例 #4
0
 def test_compute_points_distance_l2_is_zero(self):
     self.assertEqual(
         geometry_comparisons.compute_points_distance_l2(
             wti1=Point3(1, -2, 3), wti2=Point3(1, -2, 3)), 0.0)