PURPOSE: To decrease the calculation quantity for obtaining a degree of matching by calculating the number of pixels generated from an input image positioned in a matching area set within a predetermined distance from the outline of an area image.
CONSTITUTION: An expanding process part 101 outputs an expanded area image to a difference process part 103 and a degenerating process part 102 outputs a degenerated area image, respectively. The difference process part 103 finds the difference area between those images as the matching area and outputs the obtained matching area to a counting process part 104. This part 104 once inputting a line drawing as the calculation figure for an illustration matching degree counts pixels which are pixels on the line drawing and positioned in the matching area outputted from the difference process part 103. The counting result outputted from the counting process part 104 is larger and larger as the area image matches the input image more and more, so this result is regarded as the matching degree. Consequently, the shortest distance from each pixel on the outline to a pixel on the line drawing need not be calculated and the matching degree can be found fast.