EECE 5554 Robotics Sensing and Navigation  /  Interactive demo

Feature matches and RANSAC

A feature matcher finds the same points in two photos, but some of its matches are always wrong. Fit the homography between two views of a flat scene with least squares, then with RANSAC, and see how many wrong matches each one can take.

Runs features_ransac.pyLecture 13
Starting...

Matches

Wrong matches
Pixel noise on the right ones

Fit H with

60 matches between two photos of a flat scene, so one homography relates them. Dashed: where image 1 truly lands in image 2. Solid: where your H puts it.

Try this

  1. Press Least squares. With 30% wrong matches, the red frame lands hundreds of pixels from the dashed true one: every error is squared, so the worst matches pull hardest.
  2. Press RANSAC. The blue frame lands on the dashed one within a pixel or two, after only a few dozen tries.
  3. Slide the wrong matches to 70%. RANSAC still finds the model, but the tries jump to hundreds. Compare with the table under the plot.
  4. Add pixel noise. The threshold grows with it, and the RANSAC error grows slowly: noise is handled by the final refit, wrong matches by the sampling.

Notebook

Work with the same script in cells, like Jupyter, right here in the browser. Edit any cell and run it. Nothing is saved: Reset brings a cell back, and Download .ipynb keeps your edited version for VS Code or Jupyter.

Loading Python...
The Python script: features_ransac.py

This is the script the page runs. Run it yourself with python3 features_ransac.py.

features_ransac.py