Skip to content

Herusyahputra/Mono_odometry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mono Visual Odometry using Kitti dataset

Algorithm

Steps of the algorithm are taken from Avi Singh's blog post mentioned above.

  1. Capture images: It and It + 1
  2. Undistort the captured images (not necessary for KITTI dataset)
  3. Use FAST algorithm to detect features in image It. Track these features using an optical flow methodology, remove points that fall out of frame or are not visible in It + 1. Trigger a new detection of points if the number of tracked points falls behind a threshold. Set to 2000 in this implementation.
  4. Apply Nister's 5-point algorithm with RANSAC to find the essential matrix.
  5. Estimate R, t from the essential matrix that was computed from Nister's algorithm.
  6. Obtain scale information from an external source and concatenate translation vectors t and rotation matrices R.

For each of the steps above, the line of code is provided to the exact location where this step is preformed in the code for easy understanding. Steps 1 and 2 are skipped as they are not necessary in the KITTI dataset.

The dataset used is: KITTI Visual Odometry

Or you can use this link to download this dataset link

  1. image sequence
  2. pose image

Requirement

  1. Python 3.**
  2. opencv-python
  3. numpy

Running Program

  1. First clone repository
$ git clone https://github.com/aji-ptn/Mono_odometry.git
  1. In main.py change img_path and pose_path to correct image sequences and pose file paths in line 7 and 8
img_path = '/home/aji/Documents/Dataset/data_odometry_gray/dataset/sequences/00/image_0/'
pose_path = '/home/aji/Documents/Dataset/data_odometry_poses/dataset/poses/00.txt'
  1. Ensure focal length and principal point information is correct
focal = 718.8560  # focal length
pp = (607.1928, 185.2157)  # principal point
  1. Adjust Lucas Kanade Parameters as needed (line 16 in main.py)
lk_params = dict(winSize=(21, 21), criteria=(cv.TERM_CRITERIA_EPS | cv.TERM_CRITERIA_COUNT, 30, 0.01))
  1. Run command
main.py

Result

img.png img_1.png

You can click this video

video

Reference

An invaluable resource I used in building the visual odometry system was Avi Singh's blog post: http://avisingh599.github.io/vision/monocular-vo/ as well as his C++ implementation found here.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages