Giter Site home page Giter Site logo

anuragsahu / stereo-dense-reconstruction Goto Github PK

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

This repo contains the code for Stereo Dense Reconstruction, Given the Stereo image pairs find the deapth of map of images and from that generate the point cloud of scene.

Python 100.00%
stereo-vision stereo-matching stereo-algorithms stereo-dense-reconstruction point-cloud

stereo-dense-reconstruction's Introduction

Stereo-Dense-Reconstruction

Task

We are given 21 pairs of stereo images with calibration matrix and their Respective ground truth values, and also the baseline values from this data we have to reconstruct a 3d Point cloud representing all the points from the images.

Steps to get the Point clouds:

Get the Disparity Map from stereo image pair.

Math :
D = x1 - x2
Where x1 is the location of a point in the left image and x2 is the location of the point in the right Image.

Code :
Using the inbuilt function of Open CV, StereoSGBM_create using the tuning parameters of inspired by the blog post : http://timosam.com/python_opencv_depthimage.
And then using stereo.compute we calculate the disparity values.

Get the point cloud for a pair of images:

Math :
The 3d Point cloud of the images can be obtained by using these disparity values. The formula will be

Z = (bf)/(x1-x2)
X = (Z
x) / f
Y = (Z * y) / f

Where:
b = baseline parameter provided in the question
f = Focal Length obtained from the K matrix
x = (x1+x2 /2)
y = (y1+y2 /2)

Code :
We do this operation using the Q matrix way, Were the Q matrix as defined in the Slides Q matrix. And Multiplied the Q matrix using Disparity_map with is [x,y,d,1]

Register the generated points and into world frame using the given ground truth values (poses.txt)

Math :
We have 3d point [wx,wy,w*z,w], and using the Projection matrices in ground truth we get the registered 3d point in the point cloud of a single world frame.

Code:
For each of the point in the point cloud multiply the point from the respective projection matrix and get and append these points into a single point cloud. And then visualize them.

OutPut:

Output Image

stereo-dense-reconstruction's People

Contributors

anuragsahu avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

leongoman

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.