Giter VIP home page Giter VIP logo

pyelas's Introduction

PyElas

This is the Python version of libelas (LIBrary for Efficient LArge-scale Stereo matching) by Andreas Geiger.

Apart from fixing warnings reported by GCC on Linux, almost nothing has been changed on the original code.

This library depends on numpy, as it returns numpy, because the disparity maps are returned as numpy array.

The original library was released under the GNU General Public License, so this is as well.

Usage

import cv2
from elas import Elas

# Images can be loaded with any library, as long as they can be accessed with buffer protocol
left = cv2.imread('left.jpg')
right = cv2.imread('right.jpg')
# Images must be grayscale
# In particular, they must be 2D buffers, stored in row-major/C order
left = cv2.cvtColor(left, cv2.COLOR_BGR2GRAY)
right = cv2.cvtColor(right, cv2.COLOR_BGR2GRAY)

# Construct the Elas object. You can pass your customized parameters...
e = Elas()
# ...or, optionally, you can set parameters as object members.
# Then compute the disparities. The results will be returned as numpy arrays
disp_left, disp_right = e.process(left, right)

Parameters

Parameter Type Description Default value (robotics) Defult value (Middlebury)
disp_min int Min disparity 0 0
disp_max int Max disparity 255 255
support_threshold float Max uniqueness ratio (best vs. second best support match) 0.85 0.95
support_texture int Min texture for support points 10 10
candidate_stepsize int Step size of regular grid on which support points are matched 5 5
incon_window_size int Window size of inconsistent support point check 5 5
incon_threshold int Disparity similarity threshold for support point to be considered consistent 5 5
incon_min_support int Minimum number of consistent support points 5 5
add_corners bool Add support points at image corners with nearest neighbor disparities False True
grid_size int Size of neighborhood for additional support point extrapolation 20 20
beta float Image likelihood parameter 0.02 0.02
gamma float Prior constant 3 5
sigma float Prior sigma 1 1
sradius float Prior sigma radius 2 3
match_texture int Min texture for dense matching 1 0
lr_threshold int Disparity threshold for left/right consistency check 2 2
speckle_sim_threshold float Similarity threshold for speckle segmentation 1 1
speckle_size int Maximal size of a speckle (small speckles get removed) 200 200
ipol_gap_width int Interpolate small gaps (left<->right, top<->bottom) 3 5000
filter_median bool Optional median filter (approximated) False True
filter_adaptive_mean bool Optional adaptive mean filter (approximated) True False
postprocess_only_left bool Save time by not postprocessing the right image True False
subsampling bool Save time by only computing disparities for each 2nd pixel False False

pyelas's People

Contributors

pierov avatar kou1okada avatar

Stargazers

Shantanu Kodgirwar avatar  avatar  avatar Siqin Tao avatar Yanhao Zhang avatar  avatar Void Soul avatar

Watchers

James Cloos avatar

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.