Home

Awesome

libSGM


A CUDA implementation performing Semi-Global Matching.

Introduction


libSGM is library that implements in CUDA the Semi-Global Matching algorithm.
From a pair of appropriately calibrated input images, we can obtain the disparity map.

Features


Because it uses CUDA, we can compute the disparity map at high speed.

Performance

The libSGM performance obtained from benchmark sample

Settings

Results

DeviceCUDA versionProcessing Time[Milliseconds]FPS
GTX 1080 Ti10.12.0495.1
GeForce RTX 308011.11.5651.3
Tegra X210.028.535.1
Xavier(MODE_15W)10.217.357.7
Xavier(MAXN)10.29.0110.7

Requirements

Package NameMinimum RequirementsNote
CMakeversion >= 3.18
CUDA Toolkitcompute capability >= 3.5
OpenCVversion >= 3.4.8for samples
OpenCV CUDA moduleversion >= 3.4.8for OpenCV wrapper
ZED SDKversion >= 3.0for ZED sample

Build Instructions

$ git clone https://github.com/fixstars/libSGM.git
$ cd libSGM
$ git submodule update --init  # It is needed if ENABLE_TESTS option is set to ON
$ mkdir build
$ cd build
$ cmake ../  # Several options available
$ make

Sample Execution

$ pwd
.../libSGM
$ cd build
$ cmake .. -DENABLE_SAMPLES=on
$ make
$ cd sample
$ ./stereosgm_movie <left image path format> <right image path format> <disparity_size>
left image path format: the format used for the file paths to the left input images
right image path format: the format used for the file paths to the right input images
disparity_size: the maximum number of disparities (optional)

"disparity_size" is optional. By default, it is 128.

Next, we explain the meaning of the "left image path format" and "right image path format".
When provided with the following set of files, we should pass the "path formats" given below.

left_image_0000.pgm
left_image_0001.pgm
left_image_0002.pgm
left_image_0003.pgm
...

right_image_0000.pgm
right_image_0001.pgm
right_image_0002.pgm
right_image_0003.pgm
$ ./stereosgm_movie left_image_%04d.pgm right_image_%04d.pgm

The sample images available at Daimler Urban Scene Segmentation Benchmark Dataset 2014 are used to test the software.

Test Execution

libSGM uses Google Test for tests as Git submodule.
So, we need to init submodule by following command firstly.

$ pwd
.../libSGM
$ git submodule update --init

We can run tests after a build.

$ pwd
.../libSGM
$ cd build
$ cd test
$ ./sgm-test

Test code compares our implementation of each functions to naive implementation.

Author

The "adaskit Team"

The adaskit is an open-source project created by Fixstars Corporation and its subsidiary companies including Fixstars Autonomous Technologies, aimed at contributing to the ADAS industry by developing high-performance implementations for algorithms with high computational cost.

License

Apache License 2.0