GithubHelp home page GithubHelp logo

abhijitmahalle / stereo-vision Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 73.19 MB

Project to find disparity and depth maps for given two image sequences of a subject

Python 100.00%
correspondence depth-map disparity-map epipolar-constraint epipolar-geometry epipolar-lines essential-matrix fundamental-matrix rectification ssd

stereo-vision's Introduction

Stereo-Vision

This repository contains code to find disparity and depth map of two image sequences of a given subject by leveraging the concepts of epipolar geometry, Fundamental Matrix, Essential Matrix and its decomposition to get Rotation and Translation matrices, epipolar lines, rectification correspondence using SSD, and triangulation. Note that no OpenCV inbuilt function was used while implementing these concepts and they were coded from scratch.

Pipeline

1. Calibration

  • Compare the two images and select the set of matching feature. Tune the Lowe's ration to reject the outliers
  • Estimate the Fundamental matrix using the obtained matching feature. Use the RANSAC to make your estimation more robust. Enforce the rank 2 condition for the fundamental matrix.
  • Estimate the Essential matrix(E) from the Fundamental matrix(F) and instrinsic camera parameter.
  • Decompose the E into a translation T and rotation R
  • Disambugiate the T and R using triangulation.

2. Rectification

  • Apply perspective transfomation to make sure that the epipolar lines are horizontal for both the images. This will limit the search space to horizontal line during the corrospondace matching process in the later stage.

3. Correspondence

  • For each epipolar line, apply the sliding window with SSD to find the corrospondence and calulate disparity.
  • Rescale the disparity to be from 0-255 for visualization

4. Compute Depth Image

  • Using the disparity calculated above, compute the depth map. The resultant image has a depth image instead of disparity.

Dataset

MiddleBury Stereo Dataset

Requirement:

  • Python 2.0 or above

Dependencies:

  • OpenCV
  • NumPy

Instructions to run the code:

python project3.py

Results

  • Epipolar line corrosponding to the obtained matching features

  • Rectified epipolar lines

  • Disparity and Depth heat map

stereo-vision's People

Contributors

abhijitmahalle avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

3dalgolab

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.