SkillAgentSearch skills...

YACCLAB

YACCLAB: Yet Another Connected Components Labeling Benchmark

Install / Use

/learn @prittt/YACCLAB

README

Yet Another Connected Components Labeling Benchmark

release license<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --> contributors

<!-- ALL-CONTRIBUTORS-BADGE:END --> <table> <thead> <tr> <th>OS</th> <th>Build</th> <th>Compiler</th> <th>OpenCV</th> <th>CMake</th> <th>GPU</th> <!--<th width="200px">Travis CI</th>--> <th width="200px">GitHub Actions</th> <th width="200px">Jenkins</th> </tr> <thead> <tbody> <!-- <tr> <td align="center">Ubuntu<br/>16.04 LTS</td> <td align="center">x32</td> <td align="center">gcc 5.4.0</td> <td align="center">3.0.0</td> <td align="center">3.13.5</td> <td align="center">None</td> <td align="center"><a href="https://github.com/prittt/YACCLAB/actions"><img src="https://github.com/prittt/YACCLAB/workflows/linux32/badge.svg?branch=master" alt="Build Status"/></a></td> <td align="center">N/A</td> </tr> --> <tr> <td align="center">Ubuntu<br/>18.04 LTS</td> <td align="center">x64</td> <td align="center">gcc 9.3.0</td> <td align="center">4.1.2</td> <td align="center">3.13.5</td> <td align="center">None</td> <td align="center"><a href="https://github.com/prittt/YACCLAB/actions"><img src="https://github.com/prittt/YACCLAB/workflows/linux64/badge.svg?branch=master" alt="Build Status"/></a></td> <td align="center">N/A</td> </tr> <tr> <td align="center">MacOS<br/>(Darwin 19.6.0)</td> <td align="center">x64</td> <td align="center">AppleClang 12.0.0<br/>(Xcode-12)</td> <td align="center">3.1.0</td> <td align="center">3.13.0</td> <td align="center">None</td> <td align="center"><a href="https://github.com/prittt/YACCLAB/actions"><img src="https://github.com/prittt/YACCLAB/workflows/macos/badge.svg?branch=master" alt="Build Status"/></a></td> <td align="center">N/A</td> </tr> <tr> <td align="center">Ubuntu<br/>16.04 LTS</td> <td align="center">x64</td> <td align="center">gcc 5.4.0</td> <td align="center">4.4</td> <td align="center">3.10.3</td> <td align="center">2080Ti, CUDA 9.2</td> <td align="center">N/A</td> <td align="center"><a href="https://jenkins-master-deephealth-unix01.ing.unimore.it/job/YACCLAB/job/master/"><img src="https://jenkins-master-deephealth-unix01.ing.unimore.it/badge/job/YACCLAB/job/master/ubuntu16_gpu_end?" alt="Action Status"/></a></td> </tr> <tr> <td align="center">Ubuntu<br/>20.04.02 LTS</td> <td align="center">x64</td> <td align="center">gcc 9.3.0</td> <td align="center">4.4</td> <td align="center">3.10.3</td> <td align="center">2080Ti, CUDA 11.4</td> <td align="center">N/A</td> <td align="center"><a href="https://jenkins-master-deephealth-unix01.ing.unimore.it/job/YACCLAB/job/master/"><img src="https://jenkins-master-deephealth-unix01.ing.unimore.it/badge/job/YACCLAB/job/master/ubuntu20_gpu_end?" alt="Action Status"/></a></td> </tr> </tbody> </table> <p align="justify">Please include the following references when citing the YACCLAB project/dataset:</p>
  • <p align="justify"> Allegretti, Stefano; Bolelli, Federico; Grana, Costantino "Optimized Block-Based Algorithms to Label Connected Components on GPUs." IEEE Transactions on Parallel and Distributed Systems, 2019. <a title="BibTex" href="https://federicobolelli.it/pub_files/2019tpds.html">BibTex</a>. <a title="Download" href="https://federicobolelli.it/pub_files/2019tpds.pdf">PDF</a>.</p>
  • <p align="justify"> Bolelli, Federico; Cancilla, Michele; Baraldi, Lorenzo; Grana, Costantino "Towards Reliable Experiments on the Performance of Connected Components Labeling Algorithms" Journal of Real-Time Image Processing, 2018. <a title="BibTex" href="https://federicobolelli.it/pub_files/2018jrtip.html">BibTex</a>. <a title="Download" href="https://federicobolelli.it/pub_files/2018jrtip.pdf">PDF</a>.</p>
  • <p align="justify"> Grana, Costantino; Bolelli, Federico; Baraldi, Lorenzo; Vezzani, Roberto "YACCLAB - Yet Another Connected Components Labeling Benchmark" Proceedings of the 23rd International Conference on Pattern Recognition, Cancun, Mexico, 4-8 Dec 2016. <a title="BibTex" href="https://federicobolelli.it/pub_files/2016icpr.html">BibTex</a>. <a title="Download" href="https://federicobolelli.it/pub_files/2016icpr.pdf">PDF</a>.</p>
<p align="justify"> YACCLAB is an open source <i>C++</i> project that enables researchers to test CCL algorithms under extremely variable points of view, running and testing algorithms on a collection of datasets described below. The benchmark performs the following tests which will be described later in this readme: <i>correctness</i>, average run-time (<i>average</i>), average run-time with steps (<i>average_ws</i>), <i>density</i>, <i>size</i>, <i>granularity</i> and memory accesses (<i>memory</i>).

Notice that 8-connectivity is always used in the project.

</p>

Reproducible Research

<p align="justify">This project follows the Reproducible Research paradigms and received the <a href="https://github.com/RLPR">Reproducible Label in Pattern Recognition (RLPR)</a>.</p><img style="float: right;" src="/doc/EPDT/RRLPR.png">

Requirements

<p align="justify"> To correctly install and run YACCLAB following packages, libraries and utilities are needed:
  • CMake 3.18 or higher (https://cmake.org);
  • OpenCV 3.0 or higher (http://opencv.org), required packages are core, imgcodecs, imgproc;
  • Gnuplot (http://www.gnuplot.info/);
  • One of your favourite IDE/compiler with C++14 support.

GPU algorithms also require:

  • CUDA Toolkit 9.2 or higher (https://developer.nvidia.com/cuda-toolkit) and OpenCV cudafeatures2d package (as of OpenCV 4.5.3, package dependencies entail that required packages for CUDA algorithms are core, cudafeatures2d, cudaarithm, cudafilters, cudaimgproc, cudawarping, cudev, features2d, imgcodecs, imgproc).

Notes for gnuplot:

  • on Windows system: be sure add gnuplot to system path if you want YACCLAB automatically generates charts.
  • on MacOS system: 'pdf terminal' seems to be not available due to old version of cairo, 'postscript' is used instead.
</p>

Installation (refer to the image below)

  • <p align="justify">Clone the GitHub repository (HTTPS clone URL: https://github.com/prittt/YACCLAB.git) or simply download the full master branch zip file and extract it (e.g YACCLAB folder).</p>
  • <p align="justify">Install software in YACCLAB/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 YACCLAB Dataset (be sure to check the box if you want to download it (4a) and (4b) or to select the correct path if the dataset is already on your file system (7)), and create a C++ project for the selected IDE/compiler (9-10). Moreover, if you want to test 3D or GPU algorithms tick the corresponding boxes (5) and (6). </p>

Cmake

  • <p align="justify">Set the <a href="#conf">configuration file (config.yaml)</a> placed in the installation folder (bin in this example) in order to select desired tests.</p>
  • <p align="justify">Open the project, compile and run it: the work is done!</p>

CMake Configuration Variables

| Name | Meaning | Default | | ------------------------------------ |-----------------------------| --------| | YACCLAB_DOWNLOAD_DATASET | whether to automatically download the 2D YACCLAB dataset or not | OFF | | YACCLAB_DOWNLOAD_DATASET_3D | whether to automatically download the 3D YACCLAB dataset or not | OFF | | YACCLAB_ENABLE_3D | enable/disable the support for 3D algorithms | OFF | | YACCLAB_ENABLE_CUDA | enable/disable CUDA support | OFF | | YACCLAB_ENABLE_EPDT_19C | enable/disable the EPDT_19C 3D algorithm which is based on a heuristic decision tree generated from a 3D mask with 19 conditions (may noticeably increase compilation time), it has no effect when YACCLAB_ENABLE_3D is OFF | OFF | | YACCLAB_ENABLE_EPDT_22C | enable/disable the EPDT_22C 3D algorithm which is based on a heuristic decision tree generated from a 3D mask with 22 conditions (may noticeably increase compilation time), it has no effect when YACCLAB_ENABLE_3D is OFF | OFF | | YACCLAB_ENABLE_EPDT_26C | enable/disable the EPDT_26C 3D algorithm which is based on a heuristic decision tree generated from a 3D mask with 26 conditions (may noticeably increase compilation time), it has no effect when YACCLAB_ENABLE_3D is OFF | OFF | | YACCLAB_FORCE_CONFIG_GENERATION | whether to force the generation of the default configuration file (config.yaml) or not. When this flag is turned OFF any existing configuration file will not be overwritten | OFF | | YACCLAB_INPUT_DATASET_PATH | path to the input dataset folder, where to find test datasets | ${CMAKE_INSTALL_PREFIX}/input | | YACCLAB_OUTPUT_RESULTS_PATH | path to the output folder, where to save output results | ${CMAKE_INSTALL_PREFIX}/output | | OpenCV_DIR | OpenCV installation path | - |

How to include a YACCLAB algorithm into your own project?

<p align="justify">If your project requires a Connected Components Labeling algorithm and you are not interested in the whole YACCLAB benchmark you can use the <i>connectedComponent</i> function of the OpenCV library which implements the BBDT and SAUF algorithms since version 3.2., Spaghetti Labeling algorithm and BKE (for GPU only) since version 4.6.</p> <
View on GitHub
GitHub Stars246
CategoryDevelopment
Updated20d ago
Forks42

Languages

C

Security Score

100/100

Audited on Mar 7, 2026

No findings