def test_dataset_load_features_sift(tmpdir):
    data = data_generation.create_berlin_test_folder(tmpdir)

    assert len(data.images()) == 3

    data.config['feature_type'] = 'SIFT'

    image = data.images()[0]
    points = np.random.random((3, 4))
    descriptors = np.random.random((128, 4))
    colors = np.random.random((3, 4))
    data.save_features(image, points, descriptors, colors)

    p, d, c = data.load_features(image)

    assert np.allclose(p, points)
    assert np.allclose(d, descriptors)
    assert np.allclose(c, colors)
示例#2
0
def test_run_all(tmpdir):
    data = data_generation.create_berlin_test_folder(tmpdir)

    run_all_commands = [
        commands.extract_metadata,
        commands.detect_features,
        commands.match_features,
        commands.create_tracks,
        commands.reconstruct,
        commands.mesh,
    ]

    for module in run_all_commands:
        command = module.Command()
        run_command(command, [data.data_path])

    reconstruction = data.load_reconstruction()
    assert len(reconstruction[0].shots) == 3
    assert len(reconstruction[0].points) > 1000