PURPOSE:To restrain occurrence of artificial defect at the corner parts and to permit defect detection with high accuracy by a method wherein a reference pattern signal having its corner parts rounded through pre-processing is compared with a video signal obtained by scanning the actual mask. CONSTITUTION:A circuit for performing the pre-processing of a pattern is provided in a comparator in a control unit, and digital data from a PG tape which is used as a reference for comparison is rounded at its corners based on the principle of decision by majority. 3X3 windows are take into account with the central picture element P(i,j) being as a picture element subjected to the amied processing. Now assuming that black and white are represented by 1 and 0, respectively, it is judged as black if the value of the formula P(i,j) is not less than 5 and as white if the value is not greater than 4. In Figs. A, B and C, the values of the P(i,j) are 2, 4 and 2, respectively, and the corner part is changed from black to white, so that the corner is rounded. In case the desired picture element P(i,j) is not at the corner, the data is invariable through processing. Further, the pre-processing is carried out for the entire picture by varying (i) and (j) alternately.