Esempio n. 1
0
def test_reconstruction_statistics_null(
    scene_synthetic: synthetic_scene.SyntheticInputData,
    null_scene: types.Reconstruction,
) -> None:
    dataset = synthetic_dataset.SyntheticDataSet(
        null_scene,
        scene_synthetic.exifs,
        scene_synthetic.features,
        scene_synthetic.tracks_manager,
    )

    reconstruction_statistics = stats.reconstruction_statistics(
        dataset, scene_synthetic.tracks_manager, [null_scene]
    )

    assert reconstruction_statistics["components"] == 1
    assert not reconstruction_statistics["has_gps"]
    assert not reconstruction_statistics["has_gcp"]
    assert 4900 < reconstruction_statistics["initial_points_count"] < 5000
    assert reconstruction_statistics["initial_shots_count"] == 0
    assert reconstruction_statistics["reconstructed_points_count"] == 0
    assert reconstruction_statistics["reconstructed_shots_count"] == 0
    assert reconstruction_statistics["observations_count"] == 0
    assert reconstruction_statistics["average_track_length"] == -1
    assert reconstruction_statistics["average_track_length_over_two"] == -1
    assert len(reconstruction_statistics["histogram_track_length"]) == 0
    assert reconstruction_statistics["reprojection_error_normalized"] == -1.0
    assert reconstruction_statistics["reprojection_error_pixels"] == -1.0
    assert len(reconstruction_statistics["reprojection_histogram_normalized"][0]) == 0
    assert len(reconstruction_statistics["reprojection_histogram_normalized"][1]) == 0
    assert len(reconstruction_statistics["reprojection_histogram_pixels"][0]) == 0
    assert len(reconstruction_statistics["reprojection_histogram_pixels"][1]) == 0
Esempio n. 2
0
def test_reconstruction_statistics_normal(
    scene_synthetic: synthetic_scene.SyntheticInputData,
) -> None:
    reference = scene_synthetic.reconstruction
    dataset = synthetic_dataset.SyntheticDataSet(
        reference,
        scene_synthetic.exifs,
        scene_synthetic.features,
        scene_synthetic.tracks_manager,
    )

    reconstruction_statistics = stats.reconstruction_statistics(
        dataset, scene_synthetic.tracks_manager, [reference]
    )

    assert reconstruction_statistics["components"] == 1
    assert not reconstruction_statistics["has_gps"]
    assert not reconstruction_statistics["has_gcp"]
    assert 4900 < reconstruction_statistics["initial_points_count"] < 5000
    assert reconstruction_statistics["initial_shots_count"] == 20
    assert 4900 < reconstruction_statistics["reconstructed_points_count"] < 5000
    assert reconstruction_statistics["reconstructed_shots_count"] == 20
    assert 16800 < reconstruction_statistics["observations_count"] < 16900
    assert 3.3 < reconstruction_statistics["average_track_length"] < 3.4
    assert 3.4 < reconstruction_statistics["average_track_length_over_two"] < 3.5
    assert len(reconstruction_statistics["histogram_track_length"]) == 5
    assert 0.15 < reconstruction_statistics["reprojection_error_normalized"] < 0.16
    assert 1.25 < reconstruction_statistics["reprojection_error_pixels"] < 1.28
    assert len(reconstruction_statistics["reprojection_histogram_normalized"][0]) == 30
    assert len(reconstruction_statistics["reprojection_histogram_normalized"][1]) == 31
    assert len(reconstruction_statistics["reprojection_histogram_pixels"][0]) == 30
    assert len(reconstruction_statistics["reprojection_histogram_pixels"][1]) == 31