Step 1: This algorithm first compares the two coordinates at a fixed distance (in the applet set to a value of 4 blocks) in horizontal direction. This is redone until none of the new compared coordinates has a BDM value lower then the last optimal position. Then this procedure is repeated for the vertical direction, then for the and the two diagonal directions.
If after the vertical search, the coordinate with the minimum BDM value still is located at (0,0), abort the search.
Step 2: The search distance now ist set to 1. Step 1 is repeated with this new distance - but this time without the abort-criteria.


>

performs the next comparison

>>

performs the next 10 comparisons

>|

performs all comparisons


The grid:
In the lower left you will see a grid. It presents a schematic view of the search area. Each coordinate represents a block within the area.
A red circle marks position that are going to be searched.
A yellow dot marks the current optimal position
A green dot marks the current search position
A black cross marks positions that have been searched

How the comparisons of two blocks is done:
In this applet only grey scale-images are used - this means the images have only one color value per pixel (color images e.g. in RGB format have three).

The algorithm runs through every pixel of the source block and subtracts it from the pixel at the same position in the block compared to. results are squared and summed up. In the end, they are normalized,




dist = distance in color space
c(x) = color value of pixel x