Giter Club home page Giter Club logo

patchmatch-matlab's Introduction

PatchMatch Stereo Matlab implementation

This code implementents PatchMatch stereo with a direct interface to Matlab. I just wrote the Matlab wrapper; most of the heavy lifting was done by the actual C++ implementation.

Required packages:

  1. Linux: I have only tested it on Linux 18.04, but other linux versions should work
  2. Matlab: I tried on R2018a
  3. OpenCV
  4. OpenMP: For parallelization at some places

Compiling

  1. From command-line: Run make from command line to compile the program. The output should be pm_mex.mexa64.
  2. From matlab prompt: Run make.m

Testing

This repo has left.png and right.png from Middlebury dataset (Baby doll, 2009) for testing the code. Run test.m to test the code with representative parameters.

Usage:

[left_disparity, right_disparity] = patchmatch_stereo(left_img, right_img, opts); where,

  1. left_img: Image captured with left camera (uint8, RGB)
  2. right_img: Image captured with right camera (uint8, RGB)
  3. opts (optional): Structure with options for patchmatch algorithm with the following entries:
  • alpha (0.9): Penalty term for balance between gradient and color fidelity
  • gamma (10.0): Controls how similar the colors should be in two views
  • tau_c (10.0): Tolerance term for color similarity
  • tau_g (2.0): Tolerance term for gradient similarity
  • winsize: Window size for computing disparity
  • max_disparity: Maximum allowable disparity
  • niters: Number of patchmatch iterations

Some common problems:

  1. When running the code, Matlab throws an error about libTiff. See this for a solution. Essentially you need to ask Matlab to look for libraries elsewhere.

patchmatch-matlab's People

Contributors

vishwa91 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.