Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

THeBE: The THinning evaluation BEnchmark


OS Build Compiler OpenCV CMake GitHub Actions
16.04 LTS
x32 gcc 5.4.0 3.0.0 3.13.5 Build Status
18.04 LTS
x64 gcc 9.3.0 4.1.2 3.13.5Build Status
(Darwin 19.6.0)
x64 AppleClang 12.0.0
3.1.0 3.13.0 Build Status

THeBE is an open source C++ benchmarking framework, developed using YACCLAB v2.0 as a starting point. It allows to compare thinning algorithms, highlighting strengths and weaknesses of different strategies available in literature.


To correctly install and run THeBE following packages, libraries and utilities are needed:

Notes for gnuplot:

  • on Windows system: be sure of adding gnuplot to the system path to allow the automatic charts generation.
  • on MacOS system: 'pdf terminal' seems to be not available, 'postscript' is used instead.

Installation (refer to the image below)

  • Clone the GitHub repository (HTTPS clone URL: or simply download the full master branch zip file and extract it (e.g THeBE folder).

  • Install software in THeBE/bin subfolder (suggested) or wherever you want using CMake (point 2 of the example image). Note that CMake should automatically find the OpenCV path whether correctly installed on your OS (3), download the THeBE Dataset (be sure to check the box if you want to download it (4) or to select the correct path if the dataset is already on your file system (5)), and create a C++ project for the selected IDE/compiler (7-8).


  • Set the configuration file (config.yaml) placed in the installation folder (bin in this example) in order to select desired tests.

  • Open the project, compile and run it: the work is done!

CMake Configuration Variables

Name Meaning Default
THEBE_DOWNLOAD_DATASET whether to automatically download the THeBE dataset or not OFF
THEBE_INPUT_DATASET_PATH path to the input dataset folder, where to find test datasets ${CMAKE_INSTALL_PREFIX}/input
THEBE_OUTPUT_RESULTS_PATH path to the output folder, where to save output results ${CMAKE_INSTALL_PREFIX}/output
OpenCV_DIR OpenCV installation path -

Configuration File

A YAML configuration file placed in the installation folder lets you to specify which kind of tests should be performed, on which datasets and on which algorithms. A complete description of all configuration parameters is reported below.

  • perform - dictionary which specifies the kind of tests to perform:
  correctness:        false
  average:            true
  average_with_steps: false
  • correctness_tests - dictionary indicating the kind of correctness tests to perform:
  standard: true
  steps:    true
  • tests_number - dictionary which sets the number of runs for each test available:
  average:            10
  average_with_steps: 10
  • algorithms - list of algorithms on which to apply the chosen tests, along with display name and reference for correctness check:
  - ZhangSuenNoPtrs , ZS_OpenCV ; ZhangSuenNoPtrs
  - ZhangSuen       , ZS        ; ZhangSuenNoPtrs
  - ZhangSuenLUT    , ZS_LUT    ; ZhangSuenNoPtrs
  - ZhangSuenTree   , ZS_TREE   ; ZhangSuenNoPtrs
  - ZhangSuenDrag   , ZS_DRAG   ; ZhangSuenNoPtrs
  - GuoHall         , GH        ; GuoHall
  - GuoHallLUT      , GH_LUT    ; GuoHall
  - GuoHallTree     , GH_TREE   ; GuoHall
  - GuoHallDrag     , GH_DRAG   ; GuoHall
  - ChenHsu         , CH        ; ChenHsu
  - ChenHsuLUT      , CH_LUT    ; ChenHsu
  - ChenHsuTree     , CH_TREE   ; ChenHsu
  - ChenHsuDrag     , CH_DRAG   ; ChenHsu
  • check_datasets, average_datasets, average_datasets_with_steps - lists of datasets on which, respectively, correctness, average, and average_with_steps tests should be run:
average_datasets: ["fingerprints", "hamlet", "tobacco800", "xdocs"]
  • color_labels - whether to save output images during tests:
output_images: false
  • paths - dictionary with both input (datasets) and output (results) paths. It is automatically filled by CMake during the creation of the project:
paths: {input: "<datasets_path>", output: "<output_results_path>"}
  • save_middle_tests - dictionary specifying, separately for every test, whether to save the output of single runs, or only a summary of the whole test:
save_middle_tests: {average: false, average_with_steps: false}


The Thinning Evaluation Benchmark







No releases published


No packages published