Computing Homography | Image Stitching

Computing Homography | Image Stitching

Introduction to Homography

In this section, the instructor introduces the concept of homography and its relevance to image stitching.

What is Homography?

  • A transformation matrix that takes you from one plane to another plane through a point of projection.
  • Relevant in image stitching as it allows mapping multiple images to a single plane by computing homographies between them.

Image Stitching with Homography

In this section, the instructor explains how homography can be used for image stitching.

Image Stitching Process

  • Take multiple images of a three-dimensional scene from different orientations.
  • Compute homographies between each pair of images using shared central projection.
  • Map all images to a single plane using computed homographies.
  • Useful for stitching panoramas.

Computing Homography

In this section, the instructor explains how to compute homography.

Computing Homography for Two Images

  • Given two images, apply SIFT feature detector and match features between them.
  • Find the homography that best agrees with matches and takes you from one image to another.
  • Can warp one image to coordinate frame of other after computing homography.
  • Minimum number of matching points needed is four.

Validity of Homography

In this section, the instructor discusses when homography is valid.

Validity Conditions

Homography is valid:

  • If capturing images of any three-dimensional scene from same viewpoint
  • If imaging a plane in 3D world and taking images from any viewpoint
  • If capturing panorama assuming scene is far away (scene itself is a plane at infinity)

Solving for Homography

In this section, the instructor explains how to solve for homography.

Solving for Homography

  • Homography has nine unknowns but can only be computed up to a scale factor, so eight degrees of freedom.
  • Minimum number of matching points needed is four.

Homography Estimation

In this section, the speaker explains how to estimate homography using matching pairs of points between two images.

Homography Estimation Steps

  • Multiply vector with matrix and write down equations for xd and yd.
  • Take denominator to left-hand side in each equation.
  • Write equations in matrix notation with all known x's and y's and unknown h's.
  • Stack up rows corresponding to different pairs of matching points to get a large matrix. This is an overdetermined system of equations.
  • Add constraint that h squared is equal to 1. Solve using constrained least squares.
  • Define loss function L as Ah squared minus lambda times h squared. Find derivative of L with respect to h and set it equal to 0. This gives us A transpose Ah equals lambda h, which is the classical eigenvalue problem.
  • Find eigenvectors and eigenvalues of A transpose A. The eigenvector corresponding to the smallest eigenvalue is the h we're looking for. Rearrange elements of vector h into a 3 by 3 matrix, which is our homography.

Overall, we can estimate homography by finding matching pairs of points between two images, constructing a matrix from these pairs, solving an overdetermined system of equations using constrained least squares, defining a loss function L, finding the eigenvector corresponding to the smallest eigenvalue of A transpose A, rearranging its elements into a 3 by 3 matrix which represents our homography.

Video description

First Principles of Computer Vision is a lecture series presented by Shree Nayar who is faculty in the Computer Science Department, School of Engineering and Applied Sciences, Columbia University. Computer Vision is the enterprise of building machines that “see.” This series focuses on the physical and mathematical underpinnings of vision and has been designed for students, practitioners, and enthusiasts who have no prior knowledge of computer vision.

Computing Homography | Image Stitching | YouTube Video Summary | Video Highlight