To easily obtain the amount of position deviation between a multiple-gradation image to be inspected and a multiple-gradation reference image.
A defect detector comprises a part 6 for acquiring the relative amount of position deviation between a multiple-gradation image to be inspected and a multiple-gradation reference image, and a coding circuit 62 at the part 6 for acquiring the amount of position deviation performs processing for replacing each pixel of the image to be inspected and the reference image by 2-bit conversion values b1, b2 derived from a code for indicating a relation in a level with a pixel value in a plurality of pixels that are adjacent in different directions, thus generating essentially new reference images and images to be inspected as images that are subjected to two-dimensional incremental coding. Then, the amount of position deviation between the reference image and the image to be inspected is determined, based on the new reference images and images to be inspected at a part 60 for calculating the amount of deviation. As a result, the part 6 for acquiring the amount of deviation can easily obtain the appropriate amount of position deviation between the image to be inspected and the reference image, by reducing the amount of operation.
ONISHI HIROYUKI
Next Patent: POLARIZATION MEASURING DEVICE