https://github.com/codspeedhq/opencv-benches
OpenCV benchmarks written in C++
https://github.com/codspeedhq/opencv-benches
benchmarks cpp opencv
Last synced: 20 days ago
JSON representation
OpenCV benchmarks written in C++
- Host: GitHub
- URL: https://github.com/codspeedhq/opencv-benches
- Owner: CodSpeedHQ
- License: mit
- Created: 2025-03-13T08:20:56.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-23T17:29:25.000Z (about 1 year ago)
- Last Synced: 2025-06-18T20:48:01.469Z (12 months ago)
- Topics: benchmarks, cpp, opencv
- Language: C++
- Homepage: https://codspeed.io/CodSpeedHQ/opencv-benches
- Size: 62.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# opencv-benches
A benchmarking suite for comparing performance of various opencv library components using Google Benchmark.
## Requirements
- CMake 3.14+
- C++14 compiler
- OpenCV 4.x
- [Just](https://github.com/casey/just) command runner
- Ninja
## Build
Using the just command runner:
```bash
just clean # Make sure that there's no 'build/' dir
just build
just run
```
Or by doing it manually:
```bash
mkdir build && cd build
# Without codspeed
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
# With Codspeed instrumentation
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCODSPEED_MODE=instrumentation ..
# With regular timing based benchmarks
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCODSPEED_MODE=walltime ..
make
```
## Run
```bash
cp -r assets/ build/
# Run individual component benchmarks
./build/classifier
./build/color
./build/filter
./build/image
./build/transform
# Run all benchmarks with a single command
cmake --build ./build --target run_all_benchmarks
# Pass arguments to all benchmarks
cmake --build . --target run_all_benchmarks -- --benchmark_filter=BM_Boost
# Run with regex filter
./build/transform --benchmark_filter="BM_Rotate"
# List available benchmarks
./build/transform --benchmark_list_tests
```
## Benchmark Categories
- **Classifier**: Detects objects in images.
- **Color**: Converts colors between different color spaces.
- **Image**: Everything related to image processing
- **Filter**: Applies various image filters (e.g. blur, sharpen, edge detection).
- **Transform**: Performs image transformations (e.g. rotation, scaling, cropping, ...)
## References
- https://docs.opencv.org/4.x/db/df5/tutorial_linux_gcc_cmake.html
- https://docs.opencv.org/4.x/d7/d9f/tutorial_linux_install.html
- https://docs.opencv.org/4.x/index.html