PURPOSE: To precisely detect only pattern defect even when its coordinates are deviated between inspection image data and reference image data by a method wherein the reference image data and the inspection image data are differentiated and processed respectively on the basis of the edge direction of the reference image data and the pattern defect is detected on the basis of their difference.
CONSTITUTION: A plurality-of-directions differentiation circuit 20 is provided with a four- direction differentiation function at X, Y, +45° and -45°, inspection image data which has been imaged by a sensor 1 is differentiated and processed, and its maximum-value direction is detected by a circuit 21 and sent to a selector 22. In addition, reference image data based on a design is generated by a circuit 23 in synchronization with the inspection image data, the edge direction of a pattern is detected by a circuit 24, and it is sent to the selector 22. The selector 22 selects, as the edge direction of the pattern, a differentiation direction detected by the circuit 24 in an ordinary case and that detected by the circuit 21 when the direction is indefinite. An inspection image is differentiated and processed by an edge-direction differentiation circuit 26, a reference image is differentiated and processed by an edge-direction differentiation circuit 26, and their absolute value is found. An operation circuit 33 finds the difference between individual picture elements, and a circuit 34 judges the picture element exceeding a threshold value as a defect.
OKUDA KENTARO