1. A method of matching an input image with a reference image by determining the positions of various portions in said input image corresponding to various portions of said reference image, comprising the steps of: (a) dividing in advance said reference image into a plurality of small blocks; (b) determining for each small block a search range over which the input image is to be searched for a portion corresponding thereto in said input image; (c) storing said small blocks together with the search range for each small block; and (d) searching said input image within said search ranges for portions corresponding to said small blocks, to determine the positions, in said input image, of the portions corresponding to said small blocks, a search priority of each small block being determined based on a count of pixels of a specified type contained in the small block.