METHOD AND SYSTEM FOR DETECTING TOP SURFACE NON-UNIFORMITY OF
FASTENERS
BACKGROUND OF THE INVENTION
The present invention relates generally to inspecting fasteners for defects.
In assembly operations where fasteners such as screws are automatically installed by a machine, defective fasteners cause damage to the product being assembled, resulting in costly repairs. Thus, it is crucial for quality control to inspect fasteners for surface flaws. In the past, the fasteners have been visually inspected by machine operators or other workers. This type of approach, however, has inherent problems. Visually inspecting thousands of fasteners is a tedious task that is difficult to perform efficiently. Furthermore, some surface flaws are so small that it is virtually impossible to detect by visual inspection. There are known optical inspection methods for detecting surface flaws on fasteners that eliminate the problems associated with manual inspection.
U.S. Patent no. 4,598,998 issued to Kamei et al. discloses an inspection method in which light is projected onto the surface of a fastener, and the surface flaws are detected based on the variation of the intensity of the reflected light. The surface flaws detected are those on the screw thread.
U.S. Patent no. 4, 823,396 issued to Thompson discloses an inspection method for automatically inspecting a fastener for defects, which includes capturing a video image of a fastener and comparing the dimensions of the actual fastener with the desired dimensions.
Japanese Patent No. 10-160678 discloses a device and method for detecting crack on screw and rivet. Crack is detected by irradiating a laser beam to the surface of a rotating screw and determining when the reflected beam is interrupted temporarily.
The aforementioned prior art inspection methods are still slow and require mechanism for manipulating the position of the fastener during inspection. Another shortcoming of these inspection systems is that they are appropriate for inspecting large screws but not smaller screws. Furthermore, the flaws detected by the prior art systems are limited. Many fasteners, such as screws, have recessed heads. Often, the recess is deformed and the driver bit cannot be fitted properly therein to fasten the screw. These screws with deformed recesses must be rejected. None of the above prior art inspection systems is appropriate for detecting defects in the recess of a fastener.
SUMMARY OF THE INVENTION
The present invention is directed to a process and system for non-contact inspection of fasteners that provide extremely fast and accurate inspection. The process for inspecting surface flaws on fasteners in accordance with the invention comprises the steps of: illuminating a fastener with a light source, capturing the top surface image of the fastener, and analyzing the top surface image to determine whether or not there is a defect. The analysis comprises one or more of the following steps:
(a) forming an idealized polygon and searching for best-matching polygon on actual top surface image;
(b) generating one or more regions of interest on the top surface image and performing grey value histogram analysis for each region of interest;
(c) identifying a defect region, imposing boundary over defect region, and determining whether the dimensional characteristics of the boundary are within acceptable tolerances;
(d) creating value contrast in the top surface image, locating blobs of predetermined grey value pixels, and comparing blobs against a user's criteria.
The inspection system of the present invention comprises: a support table for holding one or more fasteners; an illumination source operable to project light over the support table so as to illuminate one or more fasteners; a scanning camera for capturing the top surface image of a fastener; an image processing system coupled to the scanning camera for receiving and analyzing the top surface image to determine if there is any surface flaw.
The advantages and novel features of the present invention will become apparent from the following detailed description of the invention when considered in conjunction with the accompanying drawings.
BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 is a schematic view of the inspection system in accordance with the preferred embodiment of the present invention.
FIG. 2 illustrates a flowchart of the process for analyzing the top surface image for recess deformation.
FIG. 3 shows the top surface image of a screw with best-fit outer polygon boundary and idealized inner polygon boundary.
FIG. 4 illustrates how the top surface image in FIG. 3 is analyzed for recess deformation.
FIG. 5 illustrates the flowchart showing the process for analyzing the top surface image for recess depth defect.
FIG. 6 illustrates how the top surface image is analyzed for recess depth defect.
FIG. 7 illustrates the flowchart showing the process for analyzing the top surface image for crack.
FIG. 8 illustrates how the top surface image is analyzed for crack.
FIG. 9 illustrates the flowchart showing the process for analyzing the top surface image for contamination.
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
FIG. 1 illustrates the inspection system in according to the preferred embodiment of the present invention. The top inspection system comprises a rotatable support table 1 with means for receiving and supporting a plurality of fasteners, an illumination device 2, a scan camera 5 with an attached lens 6, an image processing system 7, a quality control module 8, and a sorter 9. The illumination device 2 comprises a ring of light emitting diodes (LED) 3 and a reflector 4 positioned above the ring LED 3. The ring LED 3 directs light upwardly at an angle onto the reflector 4 and the reflector 4 redirects the light toward the fastener being inspected. The image processing system 7 comprises an input/output device 10, an analog-to-digital (A/D) converter 11, a memory 12 such as random access memory, and a CPU 13. The quality control module 8 is operable to receive the data from the image processing system and to send a signal to the sorter 9 for classifying the inspected fastener as rejected or acceptable. The image processing system 7 is adapted
to receive the top surface image data from the camera 5 and to analyze the captured image to determine whether there is any defect.
The inspection process according to the preferred embodiment of the present invention could evaluate the top surface image of a fastener, such as a screw, for at least four types of defects: recess deformation, recess depth defect, crack and contamination. FIG. 2 illustrates a flowchart of the process of evaluating the top surface image for recess deformation. Recess deformation is an irregularity in the top view of the recess. The image of the top surface of a fastener is captured at step 100. A best-fit outer polygonal boundary is identified for the top surface image at step 101. FIG. 3 shows an example of the top image of an ideal fastener 10 with a recess 13. When the top surface image of the fastener is circular, the best-fit outer polygonal boundary 11 is a square. It should be understood by one skilled in the art that the best-fit outer polygonal boundary can take on any predetermined shape of the fastener. The center of the outer polygonal boundary is then estimated at step 102, thereby estimating the center of the screw's top surface. Next at step 103, the dominant points of the recess image are estimated. Based on the outer or inner dominant points, an idealized inner polygon for the recess is formed at step 104. Referring again to FIG. 3, the recess 13 has outer dominant points 14 and inner dominant points 15. The idealized inner polygon 16 can be formed based on outer dominant points 14. The idealized inner polygon 17 can also be formed based on the inner dominant points 15. The best-matching inner polygon is searched in actual image at step 105. When there is a deformation in the recess as shown in FIG. 4, a best-matching polygon will not be found; i.e., not all of the dominant points will match. It
should be understood that the best-matching polygon can be searched using the polygon 16 or polygon 17 shown in FIG. 3. A decision whether to reject the fastener for severe recess deformation is made at step 106. If no best-matching inner polygon can be found, then the fastener is rejected. If a best-matching inner polygon is found, then the fastener is sent to stage A for further inspection. It is advantageous to eliminate recess deformation first in the inspection process because it is the most severe type of defect. Once the idealized inner polygon is formed, the recess deformation can be detected very quickly.
Even if no recess deformation is found in the top view of the recess, defects inside the recess may still exist; this type of recess is called recess depth defect. Recess depth defect occurs when the recess in the screw is not punched or stamped properly. Referring to FIG. 5, a region-of-interest at the center of the recess is determined based on the inner dominant points of the recess image at step 107. FIG. 6 shows the region-of-interest 19 being formed by inner dominant points 15. When there are defects inside the recess, blobs of predetermined grey value pixels will appear on the dark image of the recess. A grey value histogram analysis is then performed for the region-of-interest at step 108. The grey value histogram describes the statistical distribution of grey levels of an image in terms of the number of pixels at each grey level; i.e., the number of pixels within an image that are associated with a certain grey level. A decision is made at step 109 whether to reject the fastener for recess deformation. If the grey value for the region-of-interest is not within the acceptable tolerances, then the screw is rejected. If the grey value is within the acceptable tolerances, then the fastener is further inspected for recess depth defect at the outer areas of the recess. Based on the outer dominant points of the recess image, a plurality of outer
regions-of-interest are formed at 110. FIG. 6 shows a plurality of triangular regions-of- interests 18 being formed by outer dominant points 14 and inner dominant points 15. It should be understood that, although FIG. 6 shows the shape of each region-of-interest as a triangle, other geometric shape is possible. The grey value for each region-of-interest is determined at step 111. At step 112, a decision whether or not to reject the fastener for defect is made. If the grey value in each region-of-interest is not within acceptable tolerances, then the fastener is rejected. If not rejected, the fastener goes through further inspection at B.
The screw at B goes through the process for detecting crack as illustrated by the flowchart in FIG. 7. Referring to FIG. 7, masking is performed at step 113 to determine the inspection area. Referring to FIG. 8, the area outside of the outer boundary 19 of the screw and the area defined by the best-fit boundary 20 of the recess are masked, thereby forming a doughnut shape inspection area 21 as shown. At step 114, a search at the outer boundary 19 is conducted to find possible crack pattern. Whether a crack pattern exists is determined at step 115. If a crack pattern exists at the outer boundary, then a search for the crack is carried out and the crack image is highlighted at step 116. A bounding box is imposed over the crack at 117. FIG. 8 shows a rectangle bounding 24 being imposed over crack 23. The rectangle bounding box extends from the outer boundary 19 to the recess boundary 20. The width of the rectangle is approximately equal to the widest width of the crack. The dimensions, e.g. length and width, of the bounding box and the number of predetermined grey value pixels within the bounding box are analyzed to see if they are within acceptable tolerances. A decision whether to reject the fastener for crack based is
made at step 118. If the fastener is not rejected for crack, the process follows path C for inspection of contamination.
If no crack pattern at the outer boundary is found at step 115, then preprocessing of the image is carried out to enhance the image at step 119. The image is searched at step 120 for grey value deviation that indicates a crack defect. A bounding box is imposed over the deviation at step 121. Referring to FIG. 8, rectangular bounding box 26 is imposed over deviation 25. An optional radiality check is performed at step 122. Radiality is determined by the direction of the crack relative to the center of the screw. Referring to FIG. 8, the crack is considered radial when it points toward the center as shown by arrow 27. If the crack is not radial, then the dimensions, e.g. length and width, of the bounding box and the number of grey value pixels within the bounding box are analyzed at step 123 to see if they are within acceptable tolerances. The process then determines whether to reject the fastener for crack at step 123. If the fastener is not rejected, then the process follows path C to inspect the fastener for contamination. If the crack is determined to be radial at step 122, then the non-radial blobs are filtered out at step 124. From step 124, the radial crack is analyzed at step 123 to determine whether it should be rejected as described above.
FIG. 9 illustrates a flowchart showing a process for detecting contamination on the top surface of the fastener. Contamination includes stains, oil, defective coating, foreign particles etc. Starting with the masked top image as described for FIG. 7 at step 113, the grey value histogram analysis is performed for the unmasked area at step 125. The optimum threshold is determined and light intensity contrast on image is generated at step
126. The image at this stage is basically binary in value; e.g., black and white. The image is then pre-processed to eliminate irrelevant features at step 127. Blob analysis is subsequently performed to locate blob(s) of predetermined grey value pixels at step 128. The blob is compared with user's criteria at step 129. At step 130, the process determines whether the blob is contamination. If there is no contamination, then the fastener is accepted. Otherwise, the fastener is rejected.
Even though the four defects (recess deformation, recess depth defect, crack and contamination) are inspected in a sequenced described above, it should be understood that, after the idealized inner polygon is formed at step 104, the defects may be inspected in any other sequence. Furthermore, the process of the present invention is not limited to the four defects described above, but is capable of detecting other surface defects using the disclosed techniques. Once the idealized inner polygon is formed at step 104, all of the defects could be detected very quickly, e.g. in a matter of seconds.
The inspection process and system of the present invention are capable of automatically detecting minute surface flaws on a fastener at high operating speed and with high accuracy. The inspection system of the present invention is also capable of inspecting very small fasteners. The process and system of the present invention provide the ability to detect defects in the fastener's recess, which ability is not possible by other prior art inspection systems. Another advantage of the invention is the ability to inspect at least four different types of defects within a short period of time. Other prior art systems also lack this ability. Furthermore, the inspection system of the invention is very versatile
because it is adaptable to inspect defects on fasteners of various shapes, sizes and designs.
Although the preferred embodiment of the present invention has been described herein, it is not confined to the details and drawings described above but may be modified within the scope of the appended claims.