To decide the degree of matching irrelevantly to the thickness of a thin film on a substrate by performing a matching process using a template image of multi-colored lighting if a template image does not match an object image of isochromatic lighting.
For example, white light is used to pick up an image of an object area on a semiconductor wafer (S11). Then a pattern search for the object image is made by using a white template image Tw and the degree of matching between an image in a window set in the object image and the template image Tw is calculated (S12). Then it is judged whether or not the degree of matching is larger than a specific threshold value (S13) and when the degree of matching is less than the threshold value at all positions in the object image, a pattern search is made by using three template images Tr, Tg, and Tb picked up with red light, green light, and blue light (S14). When there are positions where the degree of matching is larger than the threshold (S15), it is judged that the position where the largest degree of matching is obtained among them is a matching position (S16).
KONDO NORIYUKI
ATSUTA HITOSHI