PURPOSE: To enable correct detection of each defect from an image wherein defects of different brightness exist mixedly, by removing overlapping by detecting the defects which are discriminated commonly by two kinds of parameters.
CONSTITUTION: An image is inputted from a camera and binary-coded with a threshold value of a level 1, noise is removed therefrom and labeling is made. Next, images 2 and 3 binary-coded with the threshold value of the level 1 are subjected to a discriminating processing and the results are stored in a buffer I. Subsequently, they are binary-coded with a threshold value of a level 2, noise is removed therefrom and labeling is made. The images binary-coded with the threshold value of the level 2 are subjected to the discriminating processing and the results are stored in a buffer II. Then, a common defect out of ones detected in the two processings is detected, so as to prevent a double count. By this method, each defect can be detected correctly from the image wherein the defects of different brightness exist mixedly.