Assignment I

Write a small program that takes two image files as arguments and displays them on two windows on the screen. Then when the user clicks on a point in the first image the program locates the same point in the image in the other window. Of course the two images have to be from the same scene taken from slightly different angles.

The way the corresponding point is computed in the other image is as follows. When the user clicks on the image the user effectively selects a small patch (say 5x5 or 9x9, make it selectable at the beginning). Say the point selected was [ x0, y0]. The program then tries to find a patch in the other image centered around [ x1, y1] such that the sum of squared diffrences is minimal. For this the program should search an area (±10 or 30 or whatever around [ x0, y0] in each direction; make it selectable too).

The program marks the point selected by the user and the corresponding point selected by this least squares method with a small cross. It laso prints the square root of the average squared difference.