コード例 #1
0
def compare(reference, reconstruction):
    completeness = sm.completeness_errors(reference, reconstruction)

    absolute_position = sm.position_errors(reference, reconstruction)
    absolute_rotation = sm.rotation_errors(reference, reconstruction)
    absolute_points = sm.points_errors(reference, reconstruction)
    absolute_gps = sm.gps_errors(reconstruction)

    aligned = sm.aligned_to_reference(reference, reconstruction)
    aligned_position = sm.position_errors(reference, aligned)
    aligned_rotation = sm.rotation_errors(reference, aligned)
    aligned_points = sm.points_errors(reference, aligned)
    aligned_gps = sm.gps_errors(aligned)

    return {
        'ratio_cameras': completeness[0],
        'ratio_points': completeness[1],

        'absolute_position_rmse': sm.rmse(absolute_position),
        'absolute_rotation_rmse': sm.rmse(absolute_rotation),
        'absolute_points_rmse': sm.rmse(absolute_points),
        'absolute_gps_rmse': sm.rmse(absolute_gps),

        'aligned_position_rmse': sm.rmse(aligned_position),
        'aligned_rotation_rmse': sm.rmse(aligned_rotation),
        'aligned_points_rmse': sm.rmse(aligned_points),
        'aligned_gps_rmse': sm.rmse(aligned_gps),
    }
コード例 #2
0
def compare(reference: types.Reconstruction,
            reconstruction: types.Reconstruction) -> Dict[str, float]:
    """Compare a reconstruction with reference groundtruth."""
    completeness = sm.completeness_errors(reference, reconstruction)

    absolute_position = sm.position_errors(reference, reconstruction)
    absolute_rotation = sm.rotation_errors(reference, reconstruction)
    absolute_points = sm.points_errors(reference, reconstruction)
    absolute_gps = sm.gps_errors(reconstruction)

    aligned = sm.aligned_to_reference(reference, reconstruction)
    aligned_position = sm.position_errors(reference, aligned)
    aligned_rotation = sm.rotation_errors(reference, aligned)
    aligned_points = sm.points_errors(reference, aligned)
    aligned_gps = sm.gps_errors(aligned)

    return {
        "ratio_cameras": completeness[0],
        "ratio_points": completeness[1],
        "absolute_position_rmse": sm.rmse(absolute_position),
        "absolute_rotation_rmse": sm.rmse(absolute_rotation),
        "absolute_points_rmse": sm.rmse(absolute_points),
        "absolute_gps_rmse": sm.rmse(absolute_gps),
        "aligned_position_rmse": sm.rmse(aligned_position),
        "aligned_rotation_rmse": sm.rmse(aligned_rotation),
        "aligned_points_rmse": sm.rmse(aligned_points),
        "aligned_gps_rmse": sm.rmse(aligned_gps),
    }
コード例 #3
0
def compare(reference, reconstruction):
    position = sm.position_errors(reference, reconstruction)
    gps = sm.gps_errors(reconstruction)
    rotation = sm.rotation_errors(reference, reconstruction)
    points = sm.points_errors(reference, reconstruction)
    completeness = sm.completeness_errors(reference, reconstruction)
    return {
        'position_average': np.linalg.norm(np.average(position, axis=0)),
        'position_std': np.linalg.norm(np.std(position, axis=0)),
        'gps_average': np.linalg.norm(np.average(gps, axis=0)),
        'gps_std': np.linalg.norm(np.std(gps, axis=0)),
        'rotation_average': np.average(rotation),
        'rotation_std': np.std(rotation),
        'points_average': np.linalg.norm(np.average(points, axis=0)),
        'points_std': np.linalg.norm(np.std(points, axis=0)),
        'ratio_cameras': completeness[0],
        'ratio_points': completeness[1]
    }
コード例 #4
0
ファイル: synthetic_scene.py プロジェクト: mapillary/OpenSfM
 def compare(self, reconstruction):
     reference = self.get_reconstruction()
     position = sm.position_errors(reference, reconstruction)
     gps = sm.gps_errors(reconstruction)
     rotation = sm.rotation_errors(reference, reconstruction)
     points = sm.points_errors(reference, reconstruction)
     completeness = sm.completeness_errors(reference, reconstruction)
     return {
         'position_average': np.linalg.norm(np.average(position, axis=0)),
         'position_std': np.linalg.norm(np.std(position, axis=0)),
         'gps_average': np.linalg.norm(np.average(gps, axis=0)),
         'gps_std': np.linalg.norm(np.std(gps, axis=0)),
         'rotation_average': np.average(rotation),
         'rotation_std': np.std(rotation),
         'points_average': np.linalg.norm(np.average(points, axis=0)),
         'points_std': np.linalg.norm(np.std(points, axis=0)),
         'ratio_cameras': completeness[0],
         'ratio_points': completeness[1]
     }
コード例 #5
0
def compare(
    reference: types.Reconstruction,
    gcps: Dict[str, pymap.GroundControlPoint],
    reconstruction: types.Reconstruction,
) -> Dict[str, float]:
    """Compare a reconstruction with reference groundtruth."""
    completeness = sm.completeness_errors(reference, reconstruction)

    absolute_position = sm.position_errors(reference, reconstruction)
    absolute_rotation = sm.rotation_errors(reference, reconstruction)
    absolute_points = sm.points_errors(reference, reconstruction)
    absolute_gps = sm.gps_errors(reconstruction)
    absolute_gcp = sm.gcp_errors(reconstruction, gcps)

    aligned = sm.aligned_to_reference(reference, reconstruction)
    aligned_position = sm.position_errors(reference, aligned)
    aligned_rotation = sm.rotation_errors(reference, aligned)
    aligned_points = sm.points_errors(reference, aligned)
    aligned_gps = sm.gps_errors(aligned)

    return {
        "ratio_cameras":
        completeness[0],
        "ratio_points":
        completeness[1],
        "absolute_position_rmse":
        sm.rmse(absolute_position),
        "absolute_position_mad":
        sm.mad(absolute_position),
        "absolute_rotation_rmse":
        sm.rmse(absolute_rotation),
        "absolute_rotation_median":
        np.median(absolute_rotation),
        "absolute_points_rmse":
        sm.rmse(absolute_points),
        "absolute_points_mad":
        sm.mad(absolute_points),
        "absolute_gps_rmse":
        sm.rmse(absolute_gps),
        "absolute_gps_mad":
        sm.mad(absolute_gps),
        "absolute_gcp_rmse_horizontal":
        sm.rmse(absolute_gcp[:, :2]) if len(absolute_gcp.shape) > 1 else 0.0,
        "absolute_gcp_rmse_vertical":
        sm.rmse(absolute_gcp[:, 2]) if len(absolute_gcp.shape) > 1 else 0.0,
        "aligned_position_rmse":
        sm.rmse(aligned_position),
        "aligned_position_mad":
        sm.mad(aligned_position),
        "aligned_rotation_rmse":
        sm.rmse(aligned_rotation),
        "aligned_rotation_median":
        np.median(aligned_rotation),
        "aligned_gps_rmse":
        sm.rmse(aligned_gps),
        "aligned_gps_mad":
        sm.mad(aligned_gps),
        "aligned_points_rmse":
        sm.rmse(aligned_points),
        "aligned_points_mad":
        sm.mad(aligned_points),
    }