EECE 5554 Robotics Sensing and Navigation  /  Interactive demo

Four points to a bird’s-eye view

Every point on the flat ground maps to the image through one 3 × 3 matrix, the homography H. Drag four corners of a parking stall in the roof camera image; the script fits H with the direct linear transform (DLT) and redraws the lot from above. Corners not used for the fit show how good your H really is.

Runs homography_dlt.pyLecture 11
Starting...

The fit

Drag the four red corners onto the parking stall in the camera image. The script fits H with the DLT and redraws the lot from above.

Experiment

Fits H from 4 to 20 noisy clicks, many times, and measures the error at corners not used for the fit.

Camera image, 1616 × 1240 px. Drag corners 1 to 4.

From above, in meters. Gray dashes: the true lines. Red: the lines through your H.

Try this

  1. Press Add click noise a few times. A few pixels of error on four clicks moves far-away corners by tens of centimeters.
  2. Drag corner 3 slowly away from the stall. The four-point fit always passes through your clicks, so only the check corners reveal the error.
  3. Run the noise experiment. Going from 4 to 20 points cuts the error several times: least squares averages the noise.
  4. Turn off normalization and compare. On this small problem it barely matters; on image-to-image fits in pixel units it can.

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: homography_dlt.py

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

homography_dlt.py