The following reposiroty contains a benchmark which compares different implementations of the Statistical Region Merging algorithm.
Given that many image processing and computer vision algorithms are frequently utilized in their 'Pythonic' form, which introduces a notable performance overhead, implementing the algorithm in a highly efficient and fast programming language like `C++` was an obvious choice. However, considering the well-known challenges associated with memory management in `C++`, implementing the algorithm in the `Rust` programming language presents a compelling alternative, as it offers both high performance and strong memory safety guarantees.
The implementations are benchmarked against the [Berkely Image Segmentation Dataset 500 (BSDS500)](https://www.kaggle.com/datasets/balraj98/berkeley-segmentation-dataset-500-bsds500), a widely used dataset for image segmentation (even if for Deep Learning and Computer Vision models), and then I measure the resource consumption of each implementation.
| Component | Version |
|---|---|
| OpenCV | 4.5.1 |
| C++ | 10.2.1 |
| Clang | 14.0.6 |
| Clang-Dev | 14.0-55.7 |
| Rust | 1.81.0 |
| Python | 3.12.4 |
| pip | 24.2 |
| CMake | 3.18.4 |
| Make | 4.3 |
This repo is meant to contain a benchmark, each directory however contains a standalone implementation.
SRM-Benchmark
├── assets
├── BSDS500-Benchmark
├── libsrm_cpp
├── libsrm_py
└── libsrm_rustEvery directory aside from the assets one, contains a specific implementation wich detailed README.md regarding the benchmark, and the BSDS500-Benchmark contains the benchmark on the BSDS500 dataset.
The BSDS500 dataset can be found here.
The hardware specs of the machine on which the benchmark was run are:
Model name: Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
CPU MHz: 3998.428The software specs are:
Operating System Information:
Description: Debian GNU/Linux 11 (bullseye)
Release: 11