A method for matching an original document image with a copy image is disclosed.
The original document image is defined as an ensemble of blocks, each of the blocks
having neighboring blocks. A mask is formed for each of the blocks by dilating
foreground pixels included in the block. A best match is searched in the copy image,
for each of the blocks, using a search window, by correlating pixels in the mask
with pixels in a corresponding portion in the copy image. Each of the best matches
has a matching score. Each of the blocks is indicated as "unmatched" when the corresponding
matching score is less than a matching threshold. A displacement vector is computed
for each of the matched blocks.