Git Product home page Git Product logo

stereo-matching's Introduction

Stereo matching

Author: Tobit Flatscher (January 2020)

Dockerhub Tests Python 3.8.10 License: MIT

Overview

Left image Right image Depth image
Left image Right image Depth image

This small tool is a manual implementation of simple stereo-matching in Python 3. Two rectified images taken from different views are combined to a depth image by means of two matching algorithms:

  • a simple winner-takes-it-all (WTA) or
  • a more sophisticated semi-global matching (SGM)

with several matching costs:

  • Sum of Absolute Differences (SAD),
  • Sum of Squared Differences (SSD) or
  • Normalized Cross-Correlation (NCC).

The results are compared to a ground-truth using the accX accuracy measure excluding occluded pixels with a mask.

For the precise details of the involved formulas (matching cost, matching algorithms and accuracy measure) refer to doc/Theory.pdf.

The repository is structured as follows:

.
├── data/                  # Directory for the input images (left and right eye)
├── doc/                   # Further documentation, in particular the computational approach
├── docker/                # contains a Docker container as well as a Docker-Compose configuration file
├── output/                # contains the resulting depth-image output
├── src/
│   ├── main.ipynb         # The Jupyter notebook that allows a convenient access to the underlying Python functions
│   └── stereo_matching.py # The Python3 implementation of the core functions with Scipy, Scimage, Numba, Numpy and Matplotlib
├── test/                  # contains parametrized unit tests for the implementations
├── .devcontainer/         # contains configuration files for containers in Visual Studio Code
└── .vscode/               # contains configuration files for Visual Studio Code

1. Download it

Either download and copy this folder manually or directly clone this repository by typing

$ git clone https://github.com/2b-t/stereo-matching.git

2. Launch it

Now you have two options for launching the code. Either you can install all libraries on your system and launch the code there or you can use the Docker container located in docker/.

2.1 On your system

For launching the code directly on your system make sure Scipy, Numba, Numpy and potentially also Jupyter are installed on your system by typing. If they are not installed on your system yet, install them - ideally with Anaconda or use the supplied Docker as described below.

2.1.1 Jupyter notebook

For debugging purposes it can be pretty helpful to launch the Jupyter notebook by typing

$ jupyter notebook

Browse and open the Jupyter notebook src/main.ipynb and run it by pressing the play-button.

2.1.2 Command line interface

Alternatively you can also edit the Python-file src/main.py in your editor of choice (e.g. Visual Studio Code) and launch it from there or from the console. When launching it with $ python3 main.py -h it will tell you the available options that you can set.

2.1.3 Library

Finally you can also use this package as a library. For this purpose have a look at src/main.py, src/main.ipynb as well as at the unit tests located in test/ for a reference.

2.2 Run from Docker

This is discussed in detail in the document doc/Docker.md.

stereo-matching's People

Contributors

2b-t avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

stereo-matching's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.