predetermined error rate in the case where the pattern of the design data and the pattern to be measured do not match is obtained by repeating a large number of experiments subject to u201c yes u201d at the step s 9 it has been found that the calculated error rate is within the predetermined error rate and hence the routine proceeds to a step s 11 subject to u201c no u201d the routine proceeds to a step s 10 at which the pattern matching operations of both the images at the steps s 7 and s 8 are repeated a predetermined number of times while positions for matching are shifted within a predetermined region so as to calculate the error rates on those occasions when the error rate does not fall within the predetermined error rate in spite of repeating the pattern matching operations the predetermined number of times a message is displayed for an operator and the operator is prompted to designate a pattern to be measured when the operator has designated the pattern to be measured the routine can proceed to a step s 11 at the step s 11 the length of the pattern to be measured is measured at this step the length is measured on the basis of the length measurement information for.