Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Structure From Motion

Structure from motion (SfM) is the process of estimating the 3-D structure of a scene from a set of 2-D images. SfM is used in many applications, such as 3-D scanning, augmented reality, and visual simultaneous localization and mapping (vSLAM).

How to use

Clone the repository
ls ./ # you should see index.html and README.md showup in the terminal
code ./ # open this folder via vscode locally
# open and right click on the index.html
# select "Open With Live Server" to run the code over localhost.

Introduction

Structure from motion (SFM) is a technique used to reconstruct the 3D structure of a scene from a sequence of 2D images or video frames. It involves estimating the camera poses and the 3D positions of the scene points.

The goal of SFM is to recover the 3D structure of the scene and the camera motion from a set of 2D image correspondences. This can be achieved by solving a bundle adjustment problem, which involves minimizing the reprojection error between the observed 2D points and the projected 3D points.

This repository contains the implementation of Structure from Motion, which is coded from scratch using Python numpy and OpenCV.

To implement SFM, the following steps are performed:

  1. Feature extraction: Extract distinctive features from the input images.
  2. Feature matching: Match the features across different images to establish correspondences.
  3. Camera pose estimation: Estimate the camera poses for each image.
  4. Triangulation: Compute the 3D positions of the scene points using the camera poses and the corresponding image points.
  5. Bundle adjustment: Refine the camera poses and the 3D points to minimize the reprojection error.

By implementing SFM, you will gain hands-on experience with fundamental computer vision techniques and learn how to reconstruct 3D scenes from 2D images. This assignment will provide you with a solid foundation for further studies in computer vision and related fields.

The following files are used:

  • assignments/assignment2/assignment2.py

  • assignments/assignment2/feat_match.py

  • assignments/assignment2/sfm.py

  • assignments/assignment2/utils.py

  • html/assignment2.html

  • js/assignment2.js

    result_sfm.mp4

About

Implemented StrucFromMotion from scratch using numpy and opencv

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages