BInary COrrespondence Search for multi-shot stereo imaging, with optional CUDA acceleration.
This is the implementation of the corresponding paper to appear in Optical 3D Metrology. BibTeX will appear here when available.
Dependencies:
gcc
or equivalent C compiler with C++20 (C++17 experimental) support (build)meson
>= 1.1.0 (build)opencv 4.x
with cuda supportcuda 12.x
including toolkitfmt
(C++17)cxxopts
(optional, for cli)benchmark
(optional, for executing benchmarks)
# recommended: clone the most recent release
$ git clone --depth 1 --branch v1.2.1 https://github.com/JMUWRobotics/libBICOS
$ cd libBICOS
$ meson setup builddir --buildtype release
# optional but recommended if you have access to a CUDA-capable GPU
$ meson configure -Dimplementation=cuda builddir
$ meson install -C builddir
The versioning scheme of the library is Semantic Versioning.
After installing, you can include /usr/local/include/BICOS/*
and link against /usr/local/lib/libBICOS.so
.
Alternatively, this project builds bicos-cli
. To give you a feel for the parameters of BICOS, you can download an example dataset with data/prepare.sh
that contains rectified imagery from a stereo camera, where images per side only differ in the projected light pattern.
Calling:
$ bicos-cli data/{left,right} -q data/Q.yaml --threshold 0.96 --stacksize 33 --limited --variance 2.0 --step 0.1 -o /tmp/result.png
will get you:
While only requiring ~110ms (RTX4090) and ~1.6GB VRAM for matching on two stacks of 33 images each.
The most significant parameters can be summarized:
--threshold
: increasing this reduces match-outliers. High values rely on a reliable pattern.--variance
: high values reduce coarse outliers, e.g. pixels where no pattern was projected. May reduce correct matches on low pattern contrast.--step
: optional value for subpixel-interpolation around matches.
Other settings are available; Try bicos-cli -h
for details.
$ meson test --benchmark -C builddir --interactive
For starters, you may find https://github.com/Sir-Photch/VRRTest useful for projecting a light pattern using an aftermarket projector.
This library is licensed under the GNU Lesser General Public License v3.0 (or later). Please see COPYING and COPYING.LESSER for details.