Projective transformation - a map and an aerial photo

Below, you find a map and an aerial photo. By moving the arrow on the map, the corresponding arrow moves on the aerial photo.

You can move the arrow also with the keyboard arrow keys.

If you are interested, see the explanation on the mathematical background.

Mathematical background

An aerial photo is an image of the landscape/map in a projective map. Projective maps can be handled as linear maps via homogenous coordintes.

A projective map is fully determined, if four points and their images are known. For example, if you know four cross-roads or land marks on a map and a aerial photo, you obtain the map from one to another.

Linear mappings are easy to handle. A position is described by a vector. The new position is obtained by multiplying the vector with a matrix. You find the inverse mapping, by calculating the inverse mapping. Calculating an inverse matrix is quite easy, unless the determinant of the matrix is zero or close to zero.

In this example, the matrix is

Transformation matrix

You can also see the site (unfortunately in Finnish) Photos on a map.

Maps

The maps are from OpenStreetMap, who is the owner of the copyright of these maps. This web site is still under development.

I don't own the aerial photo. This website is under development and aims to give mathematical visualizations for students. All the materials are released under GNU GPL v3, for example. This website is free-of-cost and does not aim to give financial revenue.

You can download the source code and use the code in your own project.

Links

You can take the ready made code from here.

You can find a solution, calculated by hand from this pdf.

A related discussion is here.