An opaque defect is processed by scanning with a high load or height fixed
mode using a probe harder than a pattern material of a photomask at the
time of going scanning, and is observed by scanning with a low load or
intermittent contact mode at the time of returning scanning so as to
detect an ending point of the opaque defect by the height information.
When there is a portion reaching to a glass substrate as an ending point,
this portion is not scanned by the high load or height fixed mode in the
next processing, and only a portion not reaching to the ending point is
scanned by the high load or height fixed mode.