Skip to content

Python implementation of Structure-based visual localization using SIFT matches. A sparse 3D reconstruction, from monocular image data is initially created. 2D-3D matches are established from new query images. Finally the camera pose is estimated using PnP inside a RANSAC loop.

Notifications You must be signed in to change notification settings

nadiawangberg/structure-based-visual-localization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Structure-based visual localization

Python implementation of Structure-based visual localization. Features were detected and matched using SIFT. Triangulation was used to create a sparse 3D reconstruction, as is visualized below. 2D-3D matches are established from new query images. Finally, the camera pose is estimated using PnP inside a RANSAC loop.

3d_reconstruction

SIFT vs ORB features

A comparison between SIFT and ORB features were initially performed to choose which feature detector and descriptor to go with. Although ORB was significantly faster, too few matches were found in comparison to SIFT, which caused a very sparse 3D reconstruction.

ORB_SIFT

Localization

Below is an example showing a sequence of 2D images. The second image shows the 3d reconstruction and the pose of the camera relative to the book in each frame. sequence VO_book_sequence

How to run

Add dataset

Change the images and camera calibration files in the /data folder. Change im1.png, im2.png to consecutive images in your dataset. Change K1.txt, K2.txt to be the camera calibration matrix of the camera that captured im1.png and im2.png.

Feature detection and matching

python3 feat_matcher.py

This script outputs the data/matches_sift.txt file needed for 3D reconstruction and pose estimation.

3D reconstruction and pose estimation

cd soln_python
python3 estimatepose.py

About

Python implementation of Structure-based visual localization using SIFT matches. A sparse 3D reconstruction, from monocular image data is initially created. 2D-3D matches are established from new query images. Finally the camera pose is estimated using PnP inside a RANSAC loop.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 3

  •  
  •  
  •  

Languages