Esempio n. 1
0
def test_reconstruction_incremental_rig(
    scene_synthetic_rig: synthetic_scene.SyntheticInputData,
):
    reference = scene_synthetic_rig.reconstruction
    dataset = synthetic_dataset.SyntheticDataSet(
        reference,
        scene_synthetic_rig.exifs,
        scene_synthetic_rig.features,
        scene_synthetic_rig.tracks_manager,
    )

    dataset.config["align_method"] = "orientation_prior"
    _, reconstructed_scene = reconstruction.incremental_reconstruction(
        dataset, scene_synthetic_rig.tracks_manager
    )
    errors = synthetic_scene.compare(reference, reconstructed_scene[0])

    assert reconstructed_scene[0].reference.lat == 47.0
    assert reconstructed_scene[0].reference.lon == 6.0

    assert errors["ratio_cameras"] == 1.0
    assert 0.7 < errors["ratio_points"] < 1.0

    assert 0 < errors["aligned_position_rmse"] < 0.005
    assert 0 < errors["aligned_rotation_rmse"] < 0.001
    assert 0 < errors["aligned_points_rmse"] < 0.05

    assert 0 < errors["absolute_gps_rmse"] < 0.15
Esempio n. 2
0
def test_reconstruction_incremental(
    scene_synthetic: synthetic_scene.SyntheticInputData,
):
    reference = scene_synthetic.reconstruction
    dataset = synthetic_dataset.SyntheticDataSet(
        reference,
        scene_synthetic.exifs,
        scene_synthetic.features,
        scene_synthetic.tracks_manager,
    )

    _, reconstructed_scene = reconstruction.incremental_reconstruction(
        dataset, scene_synthetic.tracks_manager
    )
    errors = synthetic_scene.compare(reference, reconstructed_scene[0])

    assert reconstructed_scene[0].reference.lat == 47.0
    assert reconstructed_scene[0].reference.lon == 6.0

    assert errors["ratio_cameras"] == 1.0
    assert 0.7 < errors["ratio_points"] < 1.0

    assert 0 < errors["aligned_position_rmse"] < 0.02
    assert 0 < errors["aligned_rotation_rmse"] < 0.001
    assert 0 < errors["aligned_points_rmse"] < 0.1

    # Sanity check that GPS error is similar to the generated gps_noise
    assert 4.0 < errors["absolute_gps_rmse"] < 7.0
Esempio n. 3
0
def test_reconstruction_incremental(scene_synthetic):
    reference = scene_synthetic[0].get_reconstruction()
    dataset = synthetic_dataset.SyntheticDataSet(
        reference,
        scene_synthetic[1],
        scene_synthetic[2],
        scene_synthetic[3],
        scene_synthetic[4],
        scene_synthetic[5],
    )

    _, reconstructed_scene = reconstruction.incremental_reconstruction(
        dataset, scene_synthetic[5]
    )
    errors = synthetic_scene.compare(reference, reconstructed_scene[0])

    assert errors["ratio_cameras"] == 1.0
    assert 0.7 < errors["ratio_points"] < 1.0

    assert 0 < errors["aligned_position_rmse"] < 0.02
    assert 0 < errors["aligned_rotation_rmse"] < 0.001
    assert 0 < errors["aligned_points_rmse"] < 0.1

    # Sanity check that GPS error is similar to the generated gps_noise
    assert 4.0 < errors["absolute_gps_rmse"] < 7.0
Esempio n. 4
0
def test_reconstruction_incremental_rig(scene_synthetic_rig):
    reference = scene_synthetic_rig[0].get_reconstruction()
    dataset = synthetic_dataset.SyntheticDataSet(
        reference,
        scene_synthetic_rig[1],
        scene_synthetic_rig[2],
        scene_synthetic_rig[3],
        scene_synthetic_rig[4],
        scene_synthetic_rig[5],
    )

    _, reconstructed_scene = reconstruction.incremental_reconstruction(
        dataset, scene_synthetic_rig[5]
    )
    errors = synthetic_scene.compare(reference, reconstructed_scene[0])
def test_reconstruction_triangulation(
    scene_synthetic_triangulation: synthetic_scene.SyntheticInputData,
) -> None:
    reference = scene_synthetic_triangulation.reconstruction
    dataset = synthetic_dataset.SyntheticDataSet(
        reference,
        scene_synthetic_triangulation.exifs,
        scene_synthetic_triangulation.features,
        scene_synthetic_triangulation.tracks_manager,
        scene_synthetic_triangulation.gcps,
    )

    dataset.config["bundle_compensate_gps_bias"] = True
    dataset.config["bundle_use_gcp"] = True
    _, reconstructed_scene = reconstruction.triangulation_reconstruction(
        dataset, scene_synthetic_triangulation.tracks_manager
    )
    errors = synthetic_scene.compare(
        reference,
        scene_synthetic_triangulation.gcps,
        reconstructed_scene[0],
    )

    assert reconstructed_scene[0].reference.lat == 47.0
    assert reconstructed_scene[0].reference.lon == 6.0

    assert errors["ratio_cameras"] == 1.0
    assert 0.7 < errors["ratio_points"] < 1.0

    assert 0 < errors["aligned_position_rmse"] < 0.030
    assert 0 < errors["aligned_rotation_rmse"] < 0.002
    assert 0 < errors["aligned_points_rmse"] < 0.1

    # Sanity check that GPS error is similar to the generated gps_noise
    assert 0.01 < errors["absolute_gps_rmse"] < 0.1

    # Sanity check that GCP error is similar to the generated gcp_noise
    assert 0.01 < errors["absolute_gcp_rmse_horizontal"] < 0.03
    assert 0.005 < errors["absolute_gcp_rmse_vertical"] < 0.04

    # Check that the GPS bias (only translation) is recovered
    translation = reconstructed_scene[0].biases["1"].translation
    assert 9.9 < translation[0] < 10.11
    assert 99.9 < translation[2] < 100.11
Esempio n. 6
0
def test_reconstruction_incremental_rig(scene_synthetic_rig):
    reference = scene_synthetic_rig[0].get_reconstruction()
    dataset = synthetic_dataset.SyntheticDataSet(
        reference,
        scene_synthetic_rig[1],
        scene_synthetic_rig[2],
        scene_synthetic_rig[3],
        scene_synthetic_rig[4],
        scene_synthetic_rig[5],
    )

    dataset.config["align_method"] = "orientation_prior"
    _, reconstructed_scene = reconstruction.incremental_reconstruction(
        dataset, scene_synthetic_rig[5])
    errors = synthetic_scene.compare(reference, reconstructed_scene[0])

    assert errors["ratio_cameras"] == 1.0
    assert 0.7 < errors["ratio_points"] < 1.0

    assert 0 < errors["aligned_position_rmse"] < 0.005
    assert 0 < errors["aligned_rotation_rmse"] < 0.001
    assert 0 < errors["aligned_points_rmse"] < 0.05

    assert 0 < errors["absolute_gps_rmse"] < 0.15
def test_reconstruction_incremental(scene_synthetic):
    reference = scene_synthetic[0].get_reconstruction()
    dataset = synthetic_dataset.SyntheticDataSet(reference, scene_synthetic[1],
                                                 scene_synthetic[2],
                                                 scene_synthetic[3],
                                                 scene_synthetic[4],
                                                 scene_synthetic[5])

    _, reconstructed_scene = reconstruction.\
        incremental_reconstruction(dataset, scene_synthetic[5])
    errors = synthetic_scene.compare(reference, reconstructed_scene[0])

    assert errors[
        'ratio_cameras'] >= 0.95  # Keeps jumping last resection between 9 and 14 inliers with Python3
    assert 0.920 < errors['ratio_points'] < 0.950

    assert 0.002 < errors['rotation_average'] < 0.09
    assert 0.0002 < errors['rotation_std'] < 0.0020

    # below, (av+std) should be in order of ||gps_noise||^2
    assert 1.5 < errors['position_average'] < 3
    assert 1.1 < errors['position_std'] < 4
    assert 8.0 < errors['gps_std'] < 10.0
    assert np.allclose(errors['gps_average'], 0.0)