Auto scale and rotate images

Posted by Dave Jarvis on Stack Overflow See other posts from Stack Overflow or by Dave Jarvis
Published on 2009-07-04T20:49:39Z Indexed on 2010/05/08 9:18 UTC
Read the original article Hit count: 224

Given:

  • two images of the same subject matter;
  • the images have the same resolution, colour depth, and file format;
  • the images differ in size and rotation; and
  • two lists of (x, y) co-ordinates that correlate the images.

I would like to know:

  • How do you transform the larger image so that it visually aligns to the second image?
  • (Optional.) What are the minimum number of points needed to get an accurate transformation?
  • (Optional.) How far apart do the points need to be to get an accurate transformation?

The transformation would need to rotate, scale, and possibly shear the larger image. Essentially, I want to create (or find) a program that does the following:

  1. Input two images (e.g., TIFFs).
  2. Click several anchor points on the small image.
  3. Click the several corresponding anchor points on the large image.
  4. Transform the large image such that it maps to the small image by aligning the anchor points.

This would help align pictures of the same stellar object. (For example, a hand-drawn picture from 1855 mapped to a photograph taken by Hubble in 2000.)

Many thanks in advance for any algorithms (preferably Java or similar pseudo-code), ideas or links to related open-source software packages.

© Stack Overflow or respective owner

Related posts about algorithm-design

Related posts about transform