Giter Club home page Giter Club logo

homographyestimation's Introduction

HomographyEstimation

Jordan Hughes

UC Santa Barbara

hughesj919 at gmail.com

This is a Python 2 based robust homography estimation that uses RANSAC -- a statistical approach for curbing outliers. In computer vision, a homography is a matrix that maps coordinates from one plane to the same plane that has been rotated or translated or transformed in any other way in space. There are many applications of homographies, ranging from motion estimation to creation of panoramic images.

My script uses OpenCV to first calculate the SIFT keypoints. Those keypoints in each images are then matched using a Nearest Neighbor, or Brute Force matcher. Four of the correspondences are passed into a function that then calculates a homography. RANSAC will choose four random correspondences, calculate a homography, count the number of inliers, and keep the homography if it is better than any homography yet found. There is also a threshold parameter which for the script which takes a floating point number that sets a minimum percentage of image points that must be accounted for by the current best homography estimation before RANSAC can stop. The threshold is defaulted at 60% of correspondence points accounted for. If the threshold isn’t met, the function will loop 1000 times.

Usage example is as follows:

python homography.py --threshold 0.60 img4.pgm img1.pmg

Script will run and output the number of inliers, max inliers found via RANSAC. When done looping, the final estimated homography will be output as well. File output will be:

  • homography.txt - final estimation of homography parameters
  • Matches.png - shows all points and matches between the two images.
  • InlierMatches.png. - draws all matches and colors them based on whether they are inliers in the final homography or not.
  • sift_keypoints.png - all the keypoints found by the SIFT
These are the original images:

Original Image 4 Original Image 1

Finding our keypoints using SIFT:

Keypoints

Bruteforce Matching:

Matches

Final inliers using our homography matrix:

Inliers

homographyestimation's People

Contributors

hughesj919 avatar

Watchers

James Cloos avatar

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.