2 view structure from motion (From scratch)
 

How to run
  - You can directly go to result folder to see all results
- 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. .plyfiles will be saved to result folder, which you can be opened with meshlab.
 main;
- 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.
Features
  - dense matching.
- MSAC instead of RANSAC.
main steps of my code
  - get camera intrinsic matrix.
- features detection and points matching.
- 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.
- dense matching.
- 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

You can set parameters except \alpha_x and \alpha_y can be default value: zero,
 ,
,  , 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.
, 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.mto point to the images