bm_experiments.bm_comp_perform module

Simple benchmarks measuring basic computer performances

We run image registration in single thread and then in all available thread in parallel and measure the execution time.

The tested image registration scenario is as following

  1. load both images

  2. perform som simple denoising

  3. extract ORB features

  4. estimate affine transform via RANSAC

  5. warp and export image

Example run:

pip install --user tqdm numpy scikit-image https://github.com/Borda/BIRL/archive/master.zip
python bm_comp_perform.py -o ../output -n 3

Copyright (C) 2018 Jiri Borovec <jiri.borovec@fel.cvut.cz>

bm_experiments.bm_comp_perform._clean_images(image_paths)[source]

remove temporary images

Parameters

image_paths (str) – path to images

bm_experiments.bm_comp_perform._prepare_images(path_out, im_size=(2000, 2000))[source]

generate and prepare synth. images for registration

Parameters
  • path_out (str) – path to the folder

  • im_size (tuple(int,int)) – desired image size

Return tuple(str,str)

paths to target and source image

bm_experiments.bm_comp_perform._rand_float(low, high)[source]
bm_experiments.bm_comp_perform.arg_parse_params()[source]

parse the input parameters :return dict: parameters

bm_experiments.bm_comp_perform.main(path_out='', nb_runs=5)[source]

the main entry point

Parameters
  • path_out (str) – path to export the report and save temporal images

  • nb_runs (int) – number of trails to have an robust average value

bm_experiments.bm_comp_perform.measure_registration_parallel(path_out, nb_iter=3, nb_workers=2)[source]

measure mean execration time for image registration running in N thread

Parameters
  • path_out (str) – path to the temporary output space

  • nb_iter (int) – number of experiments to be averaged

  • nb_workers (int) – number of thread available on the computer

Return dict

dictionary of float values results

bm_experiments.bm_comp_perform.measure_registration_single(path_out, nb_iter=5)[source]

measure mean execration time for image registration running in 1 thread

Parameters
  • path_out (str) – path to the temporary output space

  • nb_iter (int) – number of experiments to be averaged

Return dict

dictionary of float values results

bm_experiments.bm_comp_perform.register_image_pair(idx, path_img_target, path_img_source, path_out)[source]

register two images together

Parameters
  • idx (int) – empty parameter for using the function in parallel

  • path_img_target (str) – path to the target image

  • path_img_source (str) – path to the source image

  • path_out (str) – path for exporting the output

Return tuple(str,float)