1. Field of the Invention
The present invention relates to a defect inspection apparatus and a defect inspection method for inspecting a to-be-inspected object to determine whether a surface of the to-be-inspected object has a defect such as a flaw, a deformation, a dent or the like.
2. Description of the Related Art
An inspection method of illuminating a to-be-inspected object such as a workpiece, photographing the to-be-inspected object using reflected light therefrom, carrying out image processing on the photographed image, and determining whether a defect exists on a surface of the to-be-inspected object, is known. Further, it is also known to photograph a to-be-inspected object using plural cameras from plural positions, or photograph a to-be-inspected object using plural light and switching a positron of illuminating the to-be-inspected object while keeping the to-be-inspected object and the photographing position unchanged, for the purpose of improving defect determination accuracy (for example, see Japanese Laid-Open Patent Application No. 8-75661 and Japanese Laid-Open Patent Application No. 2008-249568).
By photographing a to-be-inspected object by plural cameras from plural positions, relative positional relationship between the to-be-inspected object and the photographing position changes. Therefore, photographed images differ. Then, by carrying out image processing for defect determination on the thus obtained plural photographed images, it is possible to improve defect determination accuracy. Further, the same advantageous effect is also expected when using plural light sources and switching a position of illuminating a to-be-inspected object while keeping the to-be-inspected object and a photographing position unchanged.
According to one aspect of the present invention, an imaging apparatus is provided including a lens array in which plural lenses are arranged in a form of an array and an imaging device configured to image a compound-eye image that is a collection of size-reduced images (ommatidium images) of an object, which images are approximately formed by the respective plural lenses of the lens array. Further, a processing apparatus is provided which is configured to process the compound-eye image obtained from photographing the object by the imaging apparatus, and determine whether the object has a defect.
Other objects, features and advantages of the present invention will become more apparent from the following detailed description when read in conjunction with the accompanying drawings.
As mentioned above, carrying out defect inspection of a to-be-inspected object using plural cameras is advantageous. However, in this method, a problem may occur as described below. It is noted that it is assumed that two cameras (stereoscopic camera) are used.
As a defect (a flaw, a chip, a flash or the like), there is not only one having a large size but also one that cannot be determined by human eyes such as one of micrometers through millimeters, or the like. On the other hand, generally speaking, a stereoscopic camera has a large size of the camera alone, for example, centimeters or more. Therefore, when the stereoscopic camera is used for inspecting for a defect on the order of millimeters or less, it is necessary to provide a photographing condition in which the two cameras included in the stereoscopic camera are arranged in inclined states; or the two cameras are set in parallel, and a distance to a to-be-inspected object is increased so that photographing is carried out in a state like a telephotographic camera. However, when the distance to the to-be-inspected object is thus increased, it may be impossible to satisfy the customer's request of photographing a small defect in a closeup state. Therefore, the above-mentioned method using the photographing condition in which the two cameras are arranged in an inclined state may be rather used. In this case, as shown in
In a case where defect inspection is carried out using images taken using these two cameras A and B having the optical axes not parallel to each other (images of non-parallel axes), it is necessary to correct the taken images into those of parallel optical axes (images of parallel axes). Therefore, a buffer or the like for temporarily storing the images of non-parallel axes, a time required for carrying out processing to correct the images of non-parallel axes into the images of parallel axes, and so forth, are needed. However, in particular, a tact time is the most important problem in defect inspection. Therefore, the time required for carrying out processing to correct the images of non-parallel axes into the images of parallel axes may be a very serious problem.
Furthermore, generally speaking, as characteristics of a lens, a depth of field is narrow for a short distance area. Therefore, in the case where the optical axes are not parallel to each other, degrees of out-of-focus in respective images taken by the right and left cameras are very different from each other. If defect inspection is carried out using the images having different degrees of out-of-focus, accuracy may be degraded accordingly.
Using
Embodiments of the present invention have been devised in consideration of the above-mentioned problem, and an object of the embodiments is to provide a defect inspection apparatus and a defect inspection method by which it is possible to carry out defect inspection of a to-be-inspected object in a miniaturized apparatus configuration with high accuracy, in comparison to a stereoscopic camera or the like.
More specifically, an object of the embodiments of the present invention is to provide a defect inspection apparatus and a defect inspection method most suitable for inspection for a flaw, a flash or the like on the order of millimeters or less.
According to the embodiments of the present invention, an imaging apparatus is provided including a lens array in which plural lenses are arranged in a form of an array, and an imaging device configured to image a compound-eye image that is a collection of size-reduced images (ommatidium images) of an object, which images are approximately formed by the respective plural lenses of the lens array. Further, a processing apparatus is provided which is configured to process the compound-eye image obtained from photographing the object by the imaging apparatus, and determine whether the object has a defect.
More specifically, the processing apparatus has an image capture part configured to separate the compound-eye image obtained from the imaging apparatus into plural ommatidium images; and a defect determination part configured to determine whether there is a defect of the object based on the plural ommatidium images. The processing apparatus may preferably further have an image correction part configured to carry out distortion correction of the respective separated plural ommatidium images.
The defect determination part is configured to include an ommatidium image defect determination part configured to determine whether there is a defect for the respective plural ommatidium images and an integrated determination part configured to determine whether there is a defect of the object based on the respective defect determination results for the plural ommatidium images obtained from the ommatidium image defect determination part. The ommatidium image defect determination part is configured to determine, for each of the plural ommatidium images, one of “defect exists”, “no defect” and “indeterminable”. The integrated determination part is configured to determine “no defect” for the object, when the defect determination results for all the ommatidium images are “no defect”. The integrated determination part is configured to determine “defect exists” for the object, when the defect determination result for at least one of the ommatidium images is “defect exists”. In the other cases, the integrated determination part is configured to determine “indeterminable” for the object, based on the ommatidium images.
According to a first embodiment of the present invention, described later in details using figures, the ommatidium image defect determination part is configured to obtain, for each of the plural ommatidium images, a difference value between the ommatidium image and a normal ommatidium image for each pixel or each small area as an evaluation value. Then, in a case where each of the evaluation values of all the pixels or small areas is equal to or less than a first threshold, the ommatidium image defect determination part is configured to determine “no defect” for the ommatidium image. In a case where at least one of the evaluation values of the pixels or small areas is equal to or greater than a second threshold (the first threshold<the second threshold), the ommatidium image defect determination part is configured to determine “defect exists” for the ommatidium image. In the other cases, the ommatidium image defect determination part is configured to determine “indeterminable” for the ommatidium image. Then, in a case where all the ommatidium images thus has “no defect”, the integrated determination part is configured to determine “no defect” for the object. In a case where at least one of the ommatidium images has “defect exists”, the integrated determination part is configured to determine “defect exists” for the object. In the other cases, based on the ommatidium images having “indeterminable”, the integrated determination part is configured to determine “no defect” for the object in a case where the number of the ommatidium images having “indeterminable” is one. On the other hand, in a case where the number of the ommatidium images having “indeterminable” is two or more, the integrated determination part is configured to determine “defect exists” for the object in a case where pixels or small areas having the evaluation values greater than the first threshold and less than the second threshold exist at the same positions between the respective “indeterminable” ommatidium images after parallax correction is carried out on the respective “indeterminable” ommatidium images.
The integrated determination part is configured to determine “no defect” for the object in a case where pixels or small areas having the evaluation values greater than the first threshold and less than the second threshold do not exist at the same positions between the respective “indeterminable” ommatidium images after parallax correction is carried out on the respective “indeterminable” ommatidium images.
According to a second embodiment of the present invention, described later in details using figures, the ommatidium image defect determination part is configured to obtain, for each of the plural ommatidium images, a difference value between the ommatidium image and a normal ommatidium image for each pixel or each small area; obtain an evaluation value by correcting the difference value, according to an image height of the pixel or the small area; and classifying the thus obtained evaluation values into a defect degree of any one of predetermined plural levels. Then, in a case where each of the defect degrees of all the pixels or small areas has the minimum one of the predetermined plural levels, the ommatidium image defect determination part is configured to determine “no defect” for the ommatidium image. In a case where at least one of the defect degrees has the maximum one of the predetermined plural levels, the ommatidium image defect determination part is configured to determine “defect exists” for the ommatidium image. In the other cases, the ommatidium image defect determination part is configured to determine “indeterminable” for the ommatidium image.
Then, in a case where all the ommatidium images have “no defect”, the integrated determination part is configured to determine “no defect” for the object. In a case where at least one of the ommatidium images has “defect exists”, the integrated determination part is configured to determine “defect exists” for the object. In the other cases, based on the ommatidium images having “indeterminable”, the integrated determination part is configured to determine “no defect” for the object in a case where the number of the ommatidium images having “indeterminable” is one. In a case where the number of the ommatidium images having “indeterminable” is two or more, and in a case where pixels or small areas having the defect degrees greater than the minimum one and less than the maximum one of the predetermined plural levels exist at the same positions between the respective “indeterminable” ommatidium images on which parallax correction has been carried out, the corresponding defect degrees are added together. Then, in a case where the addition result is equal to or grater than the maximum one of the predetermined plural levels, the integrated determination part is configured to determine “defect exists” for the object. On the other hand, in a case where pixels or small areas having the defect degrees greater than the minimum one and less than the maximum one of the predetermined plural levels do not exist at the same positions between the respective “indeterminable” ommatidium images on which parallax correction has been carried out, the integrated determination part is configured to determine “no defect” for the object. Further, even when pixels or small areas having the defect degrees greater than the minimum one and less than the maximum one of the predetermined plural levels exist at the same positions between the respective “indeterminable” ommatidium images on which parallax correction has been carried out, the integrated determination part is configured to determine “no defect” for the object in a case where the addition result of the corresponding defect degrees is less than the maximum one of the predetermined plural levels.
According to the embodiments of the present invention, by using the imaging part having the lens array in which the plural lenses are arranged, it is possible to carry out defect inspection of the to-be-inspected object in a miniaturized configuration with high accuracy, in comparison to a stereoscopic camera or the like. Specifically, it is possible to obtain images, equal to those photographed using plural imaging parts, using the single imaging part.
Further, by carrying out defect determinations separately for the respective plural ommatidium images, and carrying out defect determination of the to-be-inspected object by combining the determination results of the separately carried out defect determinations for the respective plural ommatidium images, it is possible to carry out determination as to whether there is a defect of the to-be-inspected object with higher accuracy.
Below, the embodiments of the present invention will now be described using figures.
First, the imaging apparatus 10 will now be described. The imaging apparatus 10 includes a lens array 11, a light blocking wall 12, an aperture array 13, an imaging device 14, a substrate 15 and a housing 16.
The lens array 11 includes two sides, i.e., a side on an object side and a side on an image side. In the two sides, plural lenses are provided, and thus, the lens array 11 is a double side lens array. As shown in
The light blocking wall 12 is provided between the image side of the lens array 11 and the imaging device 14. The light blocking wall 12 provides light blocking partitions that prevent crosstalk of light beams between the adjacent lens sets of the lens array 11, and are made of material such as metal, resin or the like, which is opaque with respect to the imaging light. As shown in
On the other hand, on the object side of the lens array 11, the aperture array 13 is provided. The aperture array 13 has a structure in which circular holes (apertures) are provided corresponding to the respective lens sets 111 through 116 in a plate-shaped member, and provides aperture stops for the lenses. The aperture array 14 is fixed to the lens array 11 via respective projections 11c provided at four corners of a flat surface part of the side of the lens array 11 on the object side.
The imaging device 14 is made of, for example, a CMOS sensor. The imaging device 14 receives light having passed through the respective lens sets 111 through 116 of the lens array 11, converts respective optical images of the to-be-inspected object (workpiece) 1 into electrical signals of image data, and outputs the electrical signals of image data. The imaging device 14 is mounted on the substrate 15. On the substrate 15, also a controller that controls the imaging device is mounted. However, the controller is omitted in
A peripheral part of the side of the lens array 11 on the object side is fixed to the housing 16, and the housing 16 holds the lens array 11, the light blocking wall 12 and the aperture array 13 to unify them. The substrate 15 is fixed to the housing 16 in such a manner that the light receiving surface of the imaging device 14 on the substrate 15 faces the lens array 11. In
Thus, the configuration example of the imaging apparatus 10 has been described. However, the lens array 11 may have a structure in which plural single lenses are arranged, and also, the number of the lens sets or lenses may be other than 6. Further, plural lens arrays may be provided in a manner of superposing them together so that the imaging apparatus having higher optical performance may be provided.
Next, the processing apparatus 20 will be described. As shown in
As the imaging apparatus 10 photographs the to-be-inspected object 1, image data of a compound-eye image (that is a collection of six optical images (ommatidium images) of the to-be-inspected object 1 formed through the respective lens sets 111 through 116 of the lens array 11) is obtained in the imaging device 14. The image capture part 21 inputs the compound-eye image data from the imaging device 14 and captures the compound-eye image data, and separates the compound-eye image data into six sets of ommatidium image data (hereinafter, simply referred to as ommatidium images) I1 through I6. The ommatidium images I1 through I6 correspond to the six optical images of the to-be-inspected object formed through the lens sets 111 through 116 of the lens array 11, respectively. Since peripheries of the respective ommatidium images obtained in the imaging device 14 are blackened because of the light blocking wall 12, the respective ommatidium images I1 through I6 can be easily separated using the blackened peripheries as boundaries therebetween.
The image correction part 22 carries out distortion correction, using previously calculated distortion correction processing parameters such as internal parameters unique to the camera concerning working accuracy and assembly accuracy of the lenses, on the respective ommatidium images separated by the image capture part 22. For example, Zhang's method (“A flexible new technique for camera calibration”. IEEE Transactions on Pattern Analysis and Machine Intelligence, 22(11): 1330-1334, 2000) may be used for the distortion correction.
The defect determination part 23 inputs the ommatidium images I1 through I6, on which the distortion correction has been carried out by the image correction part 22, and determines whether there is a defect of the to-be-inspected object (workpiece) 1. Hereinafter, it is assumed that the ommatidium images I1 through I6 (on which the distortion correction has been carried out) are those photographed using the above-mentioned virtual imaging apparatus 10′ including the array of the pinhole cameras instead of the actual imaging apparatus 10, as shown in
Here, for the sake of simplifying the description, it is assumed that the six pinhole cameras of the virtual imaging apparatus 10′ have the same focal length F, the corresponding six optical axes are parallel to each other and the centers of the corresponding images can be expressed by the coordinates (x1, y1), (x1+dx, y1), (x1+2dx, y1), (x1, y1+dy) , (x1+dx, y1+dy), (x1+2dx, y1+dy), respectively (see
Before describing the defect determination part 23, difference amounts (parallax) between the ommatidium images will now be described. A difference amount in an imaging position of an object when the object at a position of a distance D from the virtual imaging apparatus is photographed can be calculated, as follows, according to
OV1=(F+D)*P/D
OV2=(F+D)*(P+dx)/D
Therefore, the difference amount (parallax) of the imaging positions when the object of the distance D is photographed by the cameras C1 and C2 is obtained by the following formula:
OV2−OV1=F/D*dx+dx
Therefore, a difference amount of a pixel in ommatidium areas when the object is photographed using the cameras C1 and C2 is F/D*dx.
Therefore, as shown in
Below, the defect determination part 23 will be described in detail.
The determination result in the defect determination part 23 is sent to the output apparatus 30. The output apparatus 30 is a general term of one or more of a sound output apparatus, a display apparatus, a printer, and so forth. In a case where the output apparatus 30 is a sound output apparatus, and in a case where the determination result is “defect exists”, the sound output apparatus outputs a beep sound, for example.
First, processing of the ommatidium defect determination part 231 in the first embodiment will be described.
First, i=1 is set (step S1001), and the first ommatidium image I1 is selected from the 6 ommatidium images I1 through I6 (step S1002). Then, for the ommatidium image I1, it is determined whether the determination result is “no defect”, “defect exists” or “indeterminable”, as follows. That is, the normal ommatidium image In corresponding to the ommatidium image I1 is read from the normal data storage part 24, template matching is carried out between the ommatidium image I1 and the normal ommatidium image I01, and an evaluation value is obtained (step S1003). A size of the template is selected appropriately. For example, a template of a size of a pixel may be prepared, or a template of a larger size of m×m pixels (a small area) may be prepared. In the case of a template of a size of a pixel, the absolute values of differences in the respective pixel values between the ommatidium image I1 and the normal ommatidium image In are obtained as the evaluation values. In the case of a template of a size of m×m pixels (a small area), the total or the sum of squares of differences in the respective pixel values in each small area between the ommatidium image I1 and the normal ommatidium image I01 is obtained as the evaluation value. Thus, template matching is carried out for each pixel or for each small area between the ommatidium image I1 and the normal ommatidium image I01, and when all of the evaluation values are equal to or less than a threshold TH1, the ommatidium image I1 is set as “no defect” (steps S1004, S1005). In a case where at least one of the evaluation values is greater than the threshold TH1, it is determined whether at least one of the evaluation values each greater than the threshold TH1 is equal to or greater than a threshold TH2 (step S1006). It is noted that TH 1<TH2. When at least one of the evaluation values each greater than the threshold TH1 is equal to or greater than the threshold TH2, the ommatidium image I1 is set as “defect exists” (step S1007). In the other cases, the ommatidium image I1 is set as “indeterminable”, and the coordinate values of all of the evaluation values each greater than the threshold TH1 and less than the threshold value TH2 are stored (step S1008). In the case of using the template of the size of a pixel, the coordinate values are the coordinate values of the corresponding pixels. In the case of using the template of the size of a small area, the coordinate values are, for example, the coordinate values at the four corners of the corresponding small areas.
Thus, the ommatidium image I1 and the normal ommatidium image I01 are compared for each pixel or for each small area, and the evaluation values are obtained. Then, as the thresholds, TH1 and TH2 (greater than TH1) are used. Then, when all of the evaluation values are equal to or less than TH1, the ommatidium image I1 is set as “no defect”. When at least one of the evaluation values is greater than TH2, the ommatidium image I1 is set as “defect exists”. In other cases (at least one of the evaluation values is greater than TH1 and all of the corresponding evaluation values are less than TH2), the ommatidium image I1 is set as “indeterminable”. In the case of “indeterminable”, the coordinate values of the corresponding evaluation values (each of which is greater than TH1 and less than TH2) are stored. Hereinafter, the pixels or the small areas, determined as “indeterminable” (each of the evaluation values of which is greater than TH1 and less than TH2), in the ommatidium image, will be referred to as “provisional defect positions”.
After that, it is determined whether “i” becomes 6 (step S1009). In a case where “i” is less than 6, “i+1” is set in “i” (step S1010), and the processing returns to step S1002. Thereafter, the processing of steps S1002 through S1008 is repeated until “i” becomes 6. That is, the same as for the above-mentioned ommatidium image II, it is determined, for the ommatidium images I2 through I6, whether each of the determination results is “no defect”, “defect exists” or “indeterminable”. Then, the determination results for the ommatidium images I1 through I6 are sent to the integrated determination part 232 (step S1011).
Next, details of processing of the integrated determination part 232 will be described.
First, it is determined whether the number of the ommatidium images of “indeterminable” is 2 or more (step S3001). When the number of the ommatidium images of “indeterminable” is only one, the to-be-inspected object is determined as “no defect” (step S3014), and the processing is finished. That is, the provisional defect position in the corresponding ommatidium image is regarded as noise.
In a case where the number of the ommatidium images of “indeterminable” is 2 or more (referred to as N, hereinafter), the ommatidium images of “indeterminable” are sorted in the ascending order (step S3002). Then, L=1 and M=L+1 (=2) are set as an initial setting (steps S3003, S3004). Here, L and M denote sort numbers (1 through N). Next, the L-th ommatidium image Ii and the M-th ommatidium image Ij are selected from the thus sorted N ommatidium images of “indeterminable” (steps S3005, S3006). Here, “i” and “j” denote the actual numbers (1 through 6) of the ommatidium images of “indeterminable”. Specifically, “i” denotes the numbers of the ommatidium images in the vertical direction in
Next, the parallax table (
Next, the coordinate sets of all of the provisional defect positions in the L-th ommatidium image Ii are compared with the coordinate sets (after the parallax correction) of all of the provisional defect positions in the M-th ommatidium image Ij, and it is determined whether the same provisional defect positions exist (step S3008). When there are at least two provisional defect positions that are the same between the ommatidium images Ii and Ij, it is determined that the to-be-inspected object has a defect (“defect exists”) (step S3009), and the processing is finished.
For example, in the case of
Returning to
It is noted that actually, even when the parallax correction is carried out, it may be difficult to obtain the configuration for causing the coordinate sets to coincide with each other between the ommatidium images for each pixel, because of an actual condition of assembling the camera or the like. Therefore, it is preferable that to determine that the provisional defect positions are the same between the ommatidium images of “indeterminable”, when the provisional defect positions coincide, within an allowable range that is appropriately set previously, with each other between the ommatidium images of “indeterminable”. Further, in a case of carrying out template matching using the template of the size of m×m pixels, the determination as to whether the provisional defect positions are the same between the ommatidium images of “indeterminable” is carried out through comparison between the small areas. Also in this case, it may be determined that the provisional defect positions (areas) are the same between the ommatidium images of “indeterminable”, when the small areas coincide, within an allowable range that is appropriately set previously, with each other between the ommatidium images of “indeterminable”.
As shown in
The second embodiment of the present invention has been devised in consideration of this point. More specifically, as described above, in the imaging apparatus having the simple structure of arranging the plural lenses in a form of an array, the degree of out-of-focus increases as the position in an image shifts to the periphery in comparison to the center of the image. Therefore, the determination accuracy may degrade as the position in the image shifts to the periphery of the image. In consideration of this point, improvement in the determination accuracy in the periphery of the image is aimed for in the second embodiment of the present invention.
The overall configuration of the second embodiment of the present invention is the same as that described above for the first embodiment using
First, the processing of the ommatidium image defect determination part 231 according to the second embodiment will be described in detail.
First, i=1 is set (step S4001), and the first ommatidium image I1 is selected from the 6 ommatidium images I1 through I6 (step S4002). Then, the normal ommatidium image In corresponding to the ommatidium image I1 is read from the normal data storage part 24, template matching is carried out between the ommatidium image I1 and the normal ommatidium image In, and the difference value is obtained (step S4003). Also in the second embodiment, a size of the template is selected appropriately. For example, a template of a size of a pixel may be prepared, or a template of a larger size of m×m pixels (a small area) may be prepared. In the case of a template of a size of a pixel, the absolute values of differences in the respective pixel values between the ommatidium image I1 and the normal ommatidium image I01 are obtained as the evaluation values. In the case of a template of a size of m×m pixels (a small area), the total or the sum of squares of differences in the respective pixel values in each small area between the ommatidium image I1 and the normal ommatidium image In is obtained as the evaluation value. Thus, the difference value is obtained for each pixel or for each small area between the ommatidium image I. and the normal ommatidium image In.
Next, an evaluation value is obtained as a result of the difference value being corrected according to the image height of the corresponding pixel or small area (step S4004). More specifically, coefficients as shown in
It is noted that in
After that, for the ommatidium image I1, based on the defect degrees, it is determined whether the determination result is “no defect”, “defect exists” or “indeterminable”. That is, when all of the defect degrees for the respective pixels or the respective small areas of the ommatidium image I1 are the level 0, the ommatidium image I1 is set as “no defect” (steps S4006, S4007). In a case where there is the defect degree of the level 100, the ommatidium image I1 is set as “defect exists” (steps S4008, S4009). In the other cases (i.e., each of the defect degrees other than the level 0 is any one of the levels 1 through 99), the ommatidium image I1 is set as “indeterminable”, and the coordinate values of all of the evaluation values of the defect degrees within the levels 1 through 99 and these defect degrees are stored (step S4010). In the case using the template of the size of a pixel, the coordinate values are the coordinate values of the corresponding pixels. In the case using the template of the size of a small area, the coordinate values are, for example, the coordinate values at the four corners of each of the corresponding small areas. Hereinafter, the pixels or the small areas having the defect degrees of the levels 1 through 99 in the ommatidium image determined as “indeterminable” will be referred to as “provisional defect positions”.
After that, it is determined whether “i” becomes 6 (step S4011). In a case where “i” is less than 6, “i” is incremented by 1 (step S4012), and the processing returns to step S4002. Thereafter, the processing of steps S4002 through S4012 is repeated until “i” becomes 6. That is, the same as for the above-mentioned ommatidium image Ii, it is determined, for the ommatidium images I2 through I6, whether each of the determination results is “no defect”, “defect exists” or “indeterminable”. Then, the determination results for the ommatidium images II through I6 are sent to the integrated determination part 232 (step S4013).
It is noted that it is also possible to determine “no defect”, “defect exists” or “indeterminable” for each of the ommatidium images in the same manner as that of the first embodiment described above using the evaluation values (the values obtained from multiplying the difference value by the coefficients, respectively). However, the reason the defect degrees are introduced, and as described above, for example, the level 0 is set as “no defect”, the level 100 is set as “defect exists”, and the levels 1 through 99 are set as “indeterminable”, is for the purpose of setting a vague zone as “indeterminable” as much as possible. Further, the reason in the case of “indeterminable”, that the defect degrees are stored together with the corresponding coordinate values, is for the purpose of using the defect degrees in parallax considering determination in the integrated determination part 232 thereafter.
Also in the second embodiment, it is noted that in
Next, details of processing of the integrated determination part 232 according to the second embodiment will be described.
On the other hand, when it has been determined that there is no ommatidium image of “defect exists” in step S5003, the processing proceeds to parallax considering determination (step S5005). That is, for example, in a case where the number of the ommatidium images of “no defect” is 5 or less and also, the number of the ommatidium images of “defect exists” is 0, all of the ommatidium images other than the ommatidium images of “no defect” are the ommatidium images of “indeterminable”. In the parallax considering determination, attention is paid to the ommatidium images of “indeterminable”, and it is finally determined whether the to-be-inspected object 1 (workpiece) has a defect.
In
First, it is determined whether the number of the ommatidium images of “indeterminable” is 2 or more (step S6001). When the number of the ommatidium images of “indeterminable” is only one, the to-be-inspected object is determined as “no defect” (step S6016), and the processing is finished. That is, the provisional defect position in the corresponding ommatidium image is regarded as noise.
In a case where the number of the ommatidium images of “indeterminable” is 2 or more (referred to as N, hereinafter), the corresponding ommatidium images of “indeterminable” are sorted in the ascending order (step S6002). Then, L=1 and M=L+1 (=2) are set as an initial setting (steps S6003, S6004). Here, L and M denote sort numbers (1 through N). Next, the L-th ommatidium image Ii and M-th ommatidium image Ij are selected from the thus sorted N ommatidium images of “indeterminable” (steps S6005, S6006). Here, “i” and “j” denote the actual numbers (1 through 6) of the ommatidium images of “indeterminable”. Specifically, “i” denotes the numbers of the ommatidium images in the vertical direction in
Next, the parallax table (
Next, the coordinate sets of all of the provisional defect positions in the L-th ommatidium image Ii are compared with the coordinate sets (after the parallax correction) of all of the provisional defect positions in the M-th ommatidium image Ij, and it is determined whether the same provisional defect positions exist (step S6008). When there are at least two provisional defect positions that are the same between the ommatidium images Ii and Ij, the defect degrees of the corresponding two provisional defect positions in both ommatidium images are added together, for each two corresponding provisional defect positions which are the same between the ommatidium images Ii and Ij (step S6009). Then, it is determined in step S6010 whether there is the addition result value equal to or greater than a certain threshold. When the addition result value is equal to or greater than the certain threshold, it is determined that the to-be-inspected object has a defect (“defect exists”) (step S6011), and the processing is finished. It is noted that as the certain threshold, according to the second embodiment, since the defect degrees are evaluated as 0 through 100, it is preferable to set the certain threshold at 100.
For example, in the case of
Returning to
As described above, actually, even when the parallax correction is carried out, it may be difficult to obtain the configuration for causing the coordinate sets to coincide with each other between the ommatidium images for each pixel, because of an actual condition of assembling the camera or the like. Therefore, it is preferable to determine that the provisional defect positions are the same between the ommatidium images of “indeterminable”, when the provisional defect positions coincide, within an allowable range that is appropriately set previously, with each other between the ommatidium images of “indeterminable”. Further, in a case of template matching using the template of the size of m×m pixels, the determination as to whether the provisional defect positions are the same between the ommatidium images of “indeterminable” is carried out through comparison between the small areas. Also in this case, it may be determined that the provisional defect positions (areas) are the same between the ommatidium images of “indeterminable”, when the small areas coincide, within an allowable range that is appropriately set previously, with each other between the ommatidium images of “indeterminable”.
The present invention is not limited to the specifically disclosed embodiments, and variations and modifications may be made without departing from the scope of the present invention.
The present application is based on Japanese Priority Application No. 2011-032219, filed Feb. 17, 2011 and Japanese Priority Application No. 2011-240980, filed Nov. 2, 2011, the entire contents of which are hereby incorporated herein by reference.
Number | Date | Country | Kind |
---|---|---|---|
2011-032219 | Feb 2011 | JP | national |
2011-240980 | Nov 2011 | JP | national |