A reference mask generating part, inspecting mask generating part, defect
detecting part are disposed in a control part of a defect detection
apparatus. Based on a captured image of an inspection object substrate
(an inspecting image data), the inspecting mask generating part performs
a contour smoothing processing of a pad pattern to be inspected, and
generates an inspecting mask data by carrying out the logical OR with a
reference mask data generated by the reference mask generating part.
Based on the inspecting mask data so generated, the inspecting image data
is inspected. Further, the defect detecting part performs region join
processing of a certain defect previously detected. In the case that
micro defects are gathered so as to form a defect, the defect detecting
part detects them as a defect, and then generates a defect data.
Therefore, a miss of defect on the substrate is suppressed, while the
image processing is performed at a high speed.