Giter VIP home page Giter VIP logo

3d-reconstruction's Introduction

structure from motion with MatLab

GitHub - yihui-he/3D-reconstruction: two view structure from motion

https://raw.githubusercontent.com/yihui-he/3D-reconstruction/master/result/Screenshot%20from%202016-05-20%2022-02-50.png

https://raw.githubusercontent.com/yihui-he/3D-reconstruction/master/result/selfff.png

How to run

  1. You can directly go to result folder to see all results

  2. To make it easier to view all results , I selected two images for each imageset. You can reproduce all 3D models using main.m. All 8 pclouds will show up together after program finished. .ply files will be saved to result folder, which you can be opened with meshlab. main;

  3. You can specify two images(intrinsic.new must be in the same folder):

SfM2('imgFolder/img1.JPG','imgFolder/img2.JPG');

will not show model after finished, only save .ply to result.

SfM2('imgFolder/img1.JPG','imgFolder/img2.JPG',true);

will show model after finished, and save .ply to result.

⚠️ This system has been tested under Matlab 2016a and Ubuntu 16.04. please make sure your matlab have vision toolkit

Features

  • dense matching.
  • MSAC instead of RANSAC.

main steps of my code

  1. get camera intrinsic matrix.
  2. features detection and points matching.
  3. estimate fundamental matrix using feature pairs in two images. Then compute essential matrix using K and F. Decompose E to R and t. Get P using E.
  4. dense matching.
  5. put pairs of points onto 3D(triangulate).

How to use your own images

  • prepare 2 images taken from two different views
  • get the intrinsic matrix and write it to intrinsic.new

https://wikimedia.org/api/rest_v1/media/math/render/svg/a73c022621ea3e7546d2a95c22a74fb22a3b3b7c

You can set parameters except $\alpha_x$ and $\alpha_y$ can be default value: zero,

https://wikimedia.org/api/rest_v1/media/math/render/svg/3f0b99ce362b84c94a603bca45c11454cb95f6f1

,

https://wikimedia.org/api/rest_v1/media/math/render/svg/eb5fb4f7aef1abe7c21500f0486677fec1e2ceca

, represent focal length in terms of pixels, where $m_x$, $m_y$ are the scale factors relating pixels to distance and f is the focal length in terms of distance. They can be obtained by looking into your camera info or the jpeg meta info. You can google the way to get them.

  • Put them into the same folder, then modify main.m to point to the images

3d-reconstruction's People

Contributors

ethanhe42 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

3d-reconstruction's Issues

motionFromF报错

师兄你好, 我导入了自己的intrinsic matrix, 图片的长宽和radial distortion的两个数到intrinsic.new文件, 然后用我的USB摄像头拍摄了一对图片, 但是一运行就显示In motionFromF (line 46) In SFM22 (line 44)
警告: 矩阵接近奇异值,或者缩放错误。结果可能不准确。RCOND = 1.149867e-07。
我看了match features里输出的图片, 特征点对应的很好, 但是最后点云输出就很少几个点, 完全看不出来原来是个什么图, 请问你有遇到这样的情况吗?谢谢!

cannot download

I have tried many times,but every time ending with false

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.