the y coordinate ay at the maximum point a denotes the intensity of the edge in this embodiment in order to distinguish the edge from noises it is assumed that the edge has an intensity which is equal to or greater than a predetermined value as shown in fig6 e the x coordinate ax at the maximum point a denotes the x coordinate of an edge point of the pattern to be evaluated in order to exactly detect the position of the edge point an offset is added on the basis of the edge point defined by the pattern edge model by the above described processing the coordinates of the position corresponding to the position defined by the edge point ep of the pattern edge model are obtained as the coordinates of the edge point of the line pattern p 2 step s 4 the image matching processing may include positive negative reversal of the reference image intensity adjustment to the edge of the reference image and rotation enlargement and or reduction of the reference image as an alternative reference image scanning method other than the above described method the center of the line pattern p 2 is first detected a horizontal direction outward from the center of the line pattern p 2 and a horizontal direction inward to the center of the line pattern p 2 are set as scanning directions and the image for measurement is scanned with a reference image according to each of outward and inward direction arrows ds 5 ds 6 as shown in fig5 b thus the time required to carry out the image matching can be shortened referring to fig2 again after the edge.