BOTTLE THREAD INSPECTION SYSTEM AND METHOD OF OPERATING SAME

Abstract: A method of inspecting a bottle (14) having a threaded section (104) for thread defects as the bottle moves along a production line (10) requires video images (100) of the bottle to be taken as the bottle moves into the fields of view of video cameras (22). Each video image encompasses a general region of interest (108) which contains at least a portion of the threaded section of the bottle. The position of the bottle (14) within the video image is then determined based on the location of the top rim (110) of the bottle within the video image. A portion of the general region of interest which encompasses at least a portion of the threaded section of the bottle is segmented into a plurality of specific regions of interest (120, 122). Pixels of the video image wihtin the specific regions of interest are then examined to detect thread defects.

Description: BOTTLE THREAD INSPECTION SYSTEM AND METHOD OF OPERATING SAME FIELD OF THE INVENTION The present invention relates to bottle inspection systems and in particular to an inspection system and method for detecting thread defects in bottles. BACKGROUND OF THE INVENTION Conventional bottle processing equipment moves bottles at high speed along a production line. It is important to inspect the bottles to detect bottles having defects. These defects include, but are not limited to, cracks or chips within the thread area around the neck ofthe bottle. When necessary, bottles with defects are rejected, i.e., removed from the production line. Because ofthe speed at which the production lines operate, very fast defect detection is required. Computerized video image analysis is well suited for this purpose due to its non-contact nature, high speed, decision-making capability, and ability to analyze a large bottle area with each video image. Inspection systems to detect thread defects in bottles moving along a production line have been developed. For example, U.S. Patent No. 3,848,742 to Krenmayr discloses a system for detecting various types of defects inside the glass at the bottle neck. During operation of this system, the bottle is rotated in-place 360 degrees about its central vertical axis and must be accurately positioned in the inspection area. These requirements slow the inspection speed ofthe system allowing the system to inspect only a small number of bottles per minute (for example, 200 90- gram bottles per minute). U.S. Patent No. 4,701,612 to Strurgil and U.S. Patent No. 4,958,223 to Juvinall, both of which have the same assignee, disclose inspection systems which require glass or plastic containers to be held in vertical orientations and rotated 360 degrees about their central axes. Furthermore, the systems require gray-level pattem matching, that is, the gray-level image ofthe area ofthe bottle under inspection must be compared with a standard image indicative of an acceptable container. To implement patte matching of this nature, pre-processing is required to achieve standard orientation before the pattem matching process can be carried out. All these requirements result in an overall low inspection rate deficiency. U.S. Patent No. 5,126,556 to Domenico et al. discloses three methods for inspecting bottles to detect thread defects. The first two methods are based on precise positioning of a bottle in the inspection area. Specifically, the central vertical axis of a bottle must coincide with the optical axis ofthe imaging system. The third method, however, requires a bottle to be rotated 90 degrees about its central vertical axis while the bottle is moving along a conveyor. In all three methods, defect detection is based on gray-level pattem matching. As mentioned above, initial pre¬ processing is required before pattem matching can be implemented. U.S. Patent No. 5,444,535 to Axelrod discloses a high signal-to-noise optical apparatus and method for glass bottle thread damage detection. The apparatus includes a source for directing light against a glass target surface. The source is selected to emit light at wavelengths substantially overlapping a target glass absorption bandwidth. A first optical polarizer polarizes light emitted from the light source prior to the light impinging on the target glass surface. A light detector in the form of a photodetector and a second optical polarizer arranged in cross-polarized relation to the first optical polarizer are aligned in a scattered light beam detecting relation relative to the incident beam on the glass target surface. The light detector is at an angle in the Brewster range and generates a detected signal in response to light scattered through defects in the target glass surface. Although the above references disclose inspection systems for detecting thread defects in bottles, improved systems to detect thread defects in bottles more quickly and accurately are continually being sought. It is therefore an object ofthe present invention to provide a novel method and system for inspecting bottles to detect thread defects. SUMMARY OF THE INVENTION According to one aspect ofthe present invention there is provided a method of inspecting a bottle having a threaded section for thread defects as said bottle moves along a production line comprising the steps of: (i) capturing a video image of said bottle with a video camera as said bottle moves into the field of view of said video camera without requiring said bottle to be at a specific position within said field of view, said video image encompassing a general region of interest containing at least a portion ofthe threaded section of said bottle; (ii) determining the position of said bottle within said general region of interest based on the location of a feature of said bottle within said general region of interest; (iii) segmenting a portion of said general region of interest which encompasses said at least a portion of said threaded section into a plurality of specific regions of interest; and (iv) examining pixels of said video image in said specific regions of interest to detect thread defects. In the preferred embodiment, the feature ofthe bottle determined at step (ii) is the top rim ofthe bottle. Once the top rim ofthe bottle is established, a reference location based on the position ofthe bottle is then determined. The portion ofthe general region of interest and the positions ofthe specific regions of interest are then determined based on the position ofthe reference location. In one embodiment, the reference location is positioned at the center of the top rim and a central specific region of interest is determined relative to the reference location. The positions ofthe other specific regions of interest on opposite sides ofthe central specific region of interest are then determined relative to the position ofthe central specific region of interest. Preferably, the other specific regions of interest are increasingly offset in a Y-direction the further they are from the central specific region of interest to follow the threaded section ofthe bottle in the video image. It is also preferred that the other specific regions of interest decrease in width (i.e. in an X-direction) the further they are from the central specific region of interest to compensate for perspective effects. In a preferred embodiment, during step (iv), a black white pixel threshold value is determined for the specific regions of interest. The pixels ofthe video image within the specific regions of interest are compared with the pixel threshold value and the pixels are binarized as white or black depending on the results ofthe comparisons. Groups of contiguous white pixels larger than a threshold number are filtered and if the shapes ofthe groups of contiguous white pixels do not resemble bottle threads, the groups of contiguous white pixels are determined to be thread defects. According to another aspect ofthe present invention there is provided a system for inspecting bottles having a threaded section as said bottles are moved along a production line comprising: a plurality of video imaging sections disposed along said production line at spaced locations, each video imaging section being oriented with respect to said production line to take a video image of each bottle at a different circumferential region thereof as each bottle moves into the field of view of said video imaging section without requiring said bottle to be at a specific location in said field of view, said video images encompassing a general region of interest containing at least a portion ofthe threaded section of each bottle; and processing means in communication with said video imaging sections and receiving the video images taken thereby, said processing means processing each video image to determine the position of said bottle within said general region of interest based on the location of a feature of said bottle within said general region of interest; segmenting a portion of said general region of interest which encompasses said at least a portion of said threaded section into a plurality of specific regions of interest; and examining pixels in said specific regions of interest to detect thread defects. In a preferred embodiment, each video imaging section includes a video camera and a light source. The light source and the video camera are positioned on opposite sides ofthe production line and are oriented so that video images ofthe entire circumference of each bottle are taken. In one embodiment, the processing means signals a bottle reject mechanism downstream ofthe inspection system when a defective bottle is detected so that the defective bottle can be removed from the production line. According to yet another aspect ofthe present invention there is provided a system for inspecting bottles having a threaded section as said bottles are moved along a production line comprising: a plurality of video imaging sections disposed along said production line at spaced locations, each video imaging section being oriented with respect to said production line to take a video image of each bottle at a different circumferential region thereof as each bottle moves into the field of view of said video imaging section without requiring said bottles to be at a specific location in said field of view, said video imaging sections being arranged to reduce spacing therebetween; and processing means in communication with said video imaging sections and receiving the video images taken thereby, said processing means processing said video images to detect thread defects in said bottle. In a preferred embodiment, each video imaging section includes a video camera and a light source. The light source and the video camera are positioned on opposite sides ofthe production line and are laterally offset so that the optical axes ofthe video imaging sections form oblique angles with respect to the direction of travel ofthe bottles. It is also preferred that the video imaging sections are arranged in an upstream pair and a downstream pair with the optical axes ofthe upstream pair forming obtuse angles with respect to the direction of travel ofthe bottles and with the optical axes ofthe downstream pair forming acute angles with respect to the direction of travel ofthe bottles. According to yet another aspect ofthe present invention there is provided a method of locating the position of a bottle within a video image comprising the steps of: capturing a video image of at least a portion of said bottle with a video camera; digitizing said video image; comparing pixels in said video image with a threshold value and binarizing said pixels as white or black depending on the results of said comparisons; and determining the position of said bottle relative to the boundaries of said video image based on the location ofthe largest group of contiguous white pixels within said video image. In still yet another aspect ofthe present invention there is provided method of detecting defects in bottle threads comprising the steps of: capturing a video image of said bottle threads; segmenting at least a portion of said video image into a plurality of specific regions of interest; and video processing each specific region of interest independently to determine defects in each of said specific regions of interest based on the existence of white areas larger than a prescribed threshold area size within said specific regions of interest. According to still yet another aspect ofthe present invention there is provided a system for locating the position of a bottle within a video image comprising: means for backlighting said bottle with a light source; a video camera for capturing a video image of at least a portion of said bottle within the field of view thereof; means for digitizing said video image; and means for determining the position of said bottle within said video image based on the location ofthe largest white area within said video image. According to still yet another aspect ofthe present invention there is provided a system for detecting defects in bottle threads comprising: means for capturing a video image of said bottle threads; means for segmenting at least a portion of said video image into a plurality of specific regions of interest; and means for video processing each specific region of interest independently to determine defects in each of said specific regions of interest based on the existence of white areas larger than a prescribed threshold area size within said specific region of interest. The present invention provides advantages in that thread defects in bottles can be detected without requiring handling ofthe bottles and while the bottles are moving at a high rate of speed along the production line. When a defective bottle is detected, the inspection system signals a bottle reject mechanism to allow the defective bottle to be removed from the production line without slowing movement of the bottles along the production line. BRIEF DESCRIPTION OF THE DRAWINGS Embodiments ofthe present invention will now be described more fully with reference to the accompanying drawings in which: Figure 1 is a schematic side elevational view of a portion of a bottle production line including an inspection system for detecting bottle defects in accordance with the present invention; Figure 2 is a schematic block diagram ofthe inspection system illustrated in Figure 1; Figure 3 is a top plan view of a portion ofthe inspection system illustrated in Figure 1; Figure 4 is a side elevational view of a portion ofthe inspection system illustrated in Figure 1 ; Figure 5 is an illustration of a video image of a bottle taken by the inspection system of Figure 1; Figure 6 is an illustration of a binarized video image and showing specific regions of interest within the video image; Figure 7a is an illustration ofthe specific regions of interest within the video image after being binarized to show thread defects; Figure 7b is an illustration of specific regions of interest containing significant thread defects; Figure 8 is an illustration of a binarized video image and showing an altemative embodiment of specific regions of interest within the video image; Figure 9 is an illustration of grouped specific regions of interest shown in Figure 8; Figure 10 is a plan view of an altemative embodiment of a bottle production line including an inspection system for detecting bottle defects; Figure 11 is a schematic block diagram ofthe inspection system illustrated in Figure 10; Figure 12 is a perspective view showing a portion ofthe inspection system illustrated in Figure 11; and Figure 13 is an illustration of a binarized video image taken by the inspection system of Figure 10 showing specific regions of interest and thread defects therein. DESCRIPTION OF THE PREFERRED EMBODIMENTS Referring now to Figure 1, a portion of a line in a bottling facility is shown and is generally indicated to by reference numeral 10. The production line includes a conveyor system 12 to move glass bottles 14 along a path indicated by reference numeral 15 at a high rate of speed typically in the range of 800 to 1350 bottles per minute between various stations located along the production line. Positioned along the production line is an inspection system 16 to inspect the threaded section of each glass bottle 14 for defects as the bottles move along the conveyor system 12 without requiring the bottles 14 to be handled. Downstream ofthe inspection system 16 is a bottle reject mechanism 18. Bottle reject mechanism 18 is responsive to the inspection system 16 and removes defective bottles from the production line so that these bottles do not travel downstream to the other stations in the bottling facility. Referring now to Figure 2, the inspection system 16 is better illustrated. As can be seen, the inspection system includes a plurality of video imaging sections 20 positioned above the conveyor system 12 at spaced locations. Each video imaging section 20 includes a Pulnix CCD camera 22 and a halogen lamp 24. A bottle detection sensor 26 is associated with each video imaging section 20. The bottle detection sensors are positioned along the conveyor system 12 adjacent their associated video imaging section 20. An additional bottle detection sensor 28 is positioned along the conveyor system 12 downstream ofthe video imaging sections 20 to detect bottles as they exit the inspection system 16. The bottle detection sensors 26 and 28 are preferably photoelectric such as those manufactured by Omron. The bottle detection sensors 26 and 28, CCD cameras 22 and halogen lamps 24 are connected to a junction board 30. A temperature sensor 32, an encoder 34 and a lamp power supply 36 are also connected to the junction board 30. Encoder 34 is located along the conveyor system 12 and detects the speed ofthe bottles 14 as they move along the conveyor system 12. The junction board 30 is also connected to an alarm 38 in the form of a beacon and to the bottle reject mechanism 18. Also connected to the junction board 30 is a computer 40. Computer 40 includes a plurality of video image processors 42, each video image processor of which is associated with one ofthe CCD cameras 22. Each video image processor 42 includes an ARTVC daughterboard to capture video images output by the CCD cameras 22 and a motherboard to process and analyze the video images captured by the daughterboard to detect bottle thread defects as will be described. The video image processors 42 capture and process video images output by the CCD cameras 22 in response to the bottle detection sensors 26. A production line board 44 within the computer 40 is also responsive to the bottle detection sensors 26 and 28 and to the encoder 34 and keeps track ofthe positions of bottles as they move through the inspection system 16 to allow detected defective bottles to be tracked and removed from the conveyor system 12 by the bottle reject mechanism 18. A PCOM board 46 within the computer 40 monitors and tests the inspection system 16 to detect alarm conditions as will be described. An operator monitor 48 and an associated touch screen 50 are also connected to the computer 40 to allow an operator to input commands to the inspection system 16 and to view the results ofthe bottle inspections. A live monitor 52 is also connected to the computer 40 by way of the junction board 30 and displays a video image ofthe last defective bottle to pass a video imaging section 20. Input devices such as a mouse 54 and keyboard 56 are also connected to the computer 40 to allow the inspection system to be initialized and reprogrammed if required. The components ofthe inspection system 16 with the exception ofthe bottle detection sensors 26 and 28 are accommodated in a cabinet 60 which straddles the conveyor system 12. Fans 62 are mounted in the cabinet 60 to moderate the temperature therein. A switchable power supply module 64 is connected to AC mains and supplies power to the fans 62, the lamp power supply 54, the live and operator monitors 52 and 48 respectively and the computer 40. Referring now to Figure 3, the video imaging sections 20 are better illustrated. As can be seen, the CCD camera 22 and halogen lamp 24 of each video imaging section are positioned on opposite sides ofthe conveyor system 12. The CCD cameras and halogen lamps are also arranged in interlocking, upstream and downstream shielded pairs 66 and 68 respectively to reduce the length ofthe inspection system 16 along the conveyor system 12 and to reduce interference between adjacent video imaging sections 20. Specifically, the CCD camera 22 and halogen lamp 24 in each ofthe video imaging sections 20 are positioned on opposite sides ofthe conveyor system 12 and are laterally offset so that the optical axis OA of each video imaging section forms an oblique angle with respect to the path 15 ofthe bottles as they travel along the conveyor system 12. In particular, the optical axes of the upstream pair 66 of video imaging sections 20 form obtuse angles with respect to the path 15 while the optical axes ofthe downstream pair 68 of video imaging sections 20 form acute angles with respect to the path 15. The positions ofthe CCD cameras 22 and halogen lamps 24 with respect to the sides ofthe conveyor system 12 alternate in successive video imaging sections 20. The field of view of each CCD camera 22 includes approximately 110 degrees ofthe circumference ofthe threaded section of a bottle 14. The alternating positions ofthe CCD cameras 22 and halogen lamps 24 in successive video imaging sections 20 and the orientation ofthe CCD cameras and halogen lamps in the video imaging sections 20 ensure that the fields of view ofthe CCD cameras 22 overlap and encompass the entire circumference of a bottle 14 as it travels through the inspection system 16. The reduced spacing between successive video imaging sections 20 and the overlapping fields of view ofthe CCD cameras 22 minimize the likelihood of a bottle rotating on the conveyor system 12 about its central longitudinal axis as it travels between the successive video image sections by an amount which results in a region ofthe threaded section ofthe bottle not being captured in a video image taken by any ofthe video imaging sections 20. In this manner, multiple video images ofthe bottle can be taken asynchronously by the video imaging sections 20 while ensuring that the video images encompass the entire circumference ofthe threaded section of the bottle. Figure 4 best illustrates the orientation ofthe CCD camera 22 and halogen lamp 24 in one ofthe video imaging sections 20. Those of skill in the art will appreciate that the orientation ofthe CCD cameras 22 and halogen lamps 24 is the same in each ofthe video imaging sections. As can be seen, the halogen lamp 24 is suspended from the cabinet 60 and oriented to direct light 70 downwardly towards a bottle 14 at about a 45 degree angle to backlight the bottle. A double pane window 72 is positioned in front ofthe halogen lamp 24 and is oriented so that the beam of light 70 is generally normal to the plane ofthe pane window 72. One ofthe panes ofthe window 72 is slidable relative to the other ofthe panes to allow the window 72 to be cleaned. The CCD camera 22 is suspended from the cabinet 60 and is oriented with its lens 74 pointing down in a direction parallel to the longitudinal axis ofthe bottle 14. An angled mirror 76, positioned below the CCD camera 22, is also suspended from the cabinet and directs light reflected from the bottle 14 towards the CCD camera 22. The mirror is angled such that it forms about a 65 degree angle with respect to the plane ofthe lens 74 ofthe CCD camera 22. A double pane window 78 is positioned between the mirror 76 and the bottle 14 and is oriented so that its plane is normal to light reflected from the bottle and directed towards the mirror 76. One of the panes ofthe window 78 is slidable relative to the other ofthe panes to allow the window 78 to be cleaned. The windows 72 and 78 may be coated with an anti¬ reflection coating if desired. The angled direction ofthe light 70 generated by the halogen lamp 24 and the orientation ofthe mirror 76 and windows 72 and 78 have been found to allow thread defects to be consistently detected while reducing total intemal reflection. Although not illustrated, the windows 72 and 78 are mounted on an inverted zigzag-shaped support that extends across the cabinet 60. This allows the support to accommodate the windows 72 and 78 of each video imaging section 20 at spaced locations along its length. During operation, when a bottle 14 moves along the conveyor system 12 and passes a bottle detection sensor 26, the bottle detection sensor 26 detects the presence ofthe bottle 14 and outputs a bottle detection signal. Bottle detection signal is received by the junction board 30 and is passed to the associated CCD camera 22 as well as to the computer 40. The CCD camera 22 responds to the bottle detection signal by opening its shutter so that a video image 100 ofthe rim 102 and threads 104 ofthe bottle 14 is taken, as shown in Figure 5. The computer 40 uses the bottle detection signal to activate the video image processor 42 associated with the CCD camera 22 so that the video image taken by the CCD camera 22 is captured by the daughterboard therein. The computer 40 also conveys the bottle detection signal to the production line board 44 so that the bottle 14 can be counted and its position as it travels through the inspection system 16 tracked. The video image 100 captured by the daughterboard in the video image processor 42 is then analysed by the CPU in the motherboard ofthe video image processor 42 to detect thread defects as will be described. Since the inspection system 16 includes four bottle detection sensors 26 and associated CCD cameras 22 and video image processors 42, the above process is performed four times as each bottle travels through the inspection system 16. If no significant defects are found in the threads 104 ofthe bottle 14 as the video images 100 are analysed, the bottle is allowed to continue along the conveyor system 12. However, if a significant defect in the threads 104 ofthe bottle 14 is detected, the production line board 44 signals the bottle reject mechanism 18 via the junction board 30 to allow the bottle reject mechanism to remove the defective bottle from the conveyor system 12 when the defective bottle reaches the bottle reject mechanism. Specifics ofthe manner in which the captured video images are analysed by the CPUs in the video image processor motherboards to detect bottle thread defects will now be described. When a video image 100 is captured by a video image processor 42, the video image is digitized and is stored in memory as a two-dimensional matrix of pixels, typically 512 * 480 pixels, covering a field of view of about 50mm * 50mm, so that each pixel represents about 0.1mm x 0.1mm ofthe video image. Following this, the CPU in the motherboard collects a histogram on the pixels in a rectangular window 108 within the video image 100. The rectangular window 108 may include between 75% to 100% ofthe pixels within the video image 100. A black/white threshold value is then calculated for the video image 100 using the Otsu Method, as described in an article entitled "A Threshold Selection Method From Gray-level Histogram" by H. Otsu, in IEEE Transactions on Systems, Man and Cybernetics, Vol. SMC-9, pp. 62-69, 1979, the content of which is incorporated herein by reference. The calculated threshold value is then offset by an empirically determined amount. The actual threshold value used is based on a running average ofthe offset Otsu threshold values calculated above for the video images captured by the video image capture board 42. This allows the inspection system 16 to compensate for aging, dirt accumulation etc. which typically results in darker video images. The pixels in each scan line within the window 108 are then run length coded. In particular, initially the pixels in each scan line are assumed to have a grey- level value below the actual threshold value. Adjacent pixels in each scan line are then compared. During each comparison, the addresses ofthe pixels which change from below the actual threshold value to above the actual threshold value and which change from above the actual threshold value to below the actual threshold value are recorded. Pixels which change from below the actual threshold value to above the actual threshold value are designated as white, while pixels which change from above the actual threshold value to below the actual threshold value are designated as black. Thus, pairs of pixel addresses are stored for each scan line with the first address of each pair representing the beginning of a segment of white pixels and the second address of each pair representing the end ofthe segment of white pixels. Following the above, the CPU examines the run length coded data to locate a reference feature ofthe captured video image. In the present embodiment, the reference feature is the top rim 102 ofthe bottle 104 and appears as a torus of contiguous white pixels. Specifically, the CPU performs blob detection on the run length coded data to locate the segments of white pixels which resemble the torus. Figure 6 is a negative ofthe pixels in the window 108 forming the torus (generally indicated to by reference numeral 110). Once the torus 110 of white pixels is located, an enclosing rectangle 112 aligned with the scan lines which encompasses the torus 110 is defined. The center ofthe rectangle 112 is calculated and is used as a reference location Xref, Yref. After the reference location Xref, Yref is established, a rectangular, central specific region of interest 120 within the window 108 which encompasses a portion ofthe threads 104 ofthe bottle 14 is determined by moving downwardly from the reference location in the Y-direction by a predetermined number of pixels. Once, the central specific region of interest 120 is determined, ten other rectangular specific regions of interest 122 on both sides of central specific region of interest 120 are also determined giving a total of 21 specific regions of interest. The specific regions of interest 122 are increasingly offset in the Y-direction the further they are away from the central specific region of interest 120 so that they follow the threads ofthe bottle about its circumference. The dimensions ofthe specific regions of interest 122 also decrease in the X-direction the further they are from the central specific region of interest 120 to compensate for the perspective effects. Thus, the numbers of pixels within the specific regions of interest 120 and 122 vary, although each specific region of interest has approximately 1000 pixels (50 x 20 pixels). Following the above, the CPU calculates a black/white threshold value for each ofthe specific regions of interest 120 and 122. The black white threshold value calculated for each ofthe specific regions of interest is based on the actual threshold value determined previously. However, the actual threshold value is scaled for each specific region of interest by subtracting an empirical offset. The empirical offset increases for specific regions of interest 122 further from the central specific region of interest 120. Thus, the black/white threshold values decrease in magnitude the further the specific region of interest is from the central specific region of interest. With the threshold values established for the specific regions of interest, the CPU compares the pixels in the specific regions of interest within the window 108 with the threshold value and designates the pixels as white or black depending on the results of the comparisons to generate binarized pixels. Blob detection is then performed on the binarized pixels in each ofthe specific regions of interest to locate groups of contiguous white pixels in each specific region of interest. The CPU then collects a histogram for each specific region of interest by counting the number of pixels in the various groups. The areas ofthe groups of contiguous pixels detected in the specific regions of interest 122 are then scaled according to their positions relative to the central specific region of interest 120 to correct for perspective effects which make a given defect appear smaller in the outer specific regions of interest 122 than it would appear in the central specific region of interest 120. Groups of pixels having five or fewer contiguous binarized pixels are discarded. The binarized pixels ofthe remaining groups are then summed and the sum is compared with a threshold area value. If the sum exceeds the threshold area value, the groups of contiguous white pixels are filtered to reduce false detection of thread defects. In particular, the shape and area characteristics ofthe contiguous white pixels are examined to determine if they resemble the threads of a bottle. If a match is determined, the CPU determines that the generated white pixels are not a result of a thread defect but rather a result of a well defined thread. However, if a match is not determined, a defect 126 is considered to be located in the threads ofthe bottle (see Figures 7a and 7b). During the above process, the torus 110 and the outlines ofthe specific areas of interest are displayed on the operator monitor 48 superimposed on the video image. Groups of contiguous white pixels are also displayed on the operator monitor 48 within the appropriate outline ofthe specific area of interest. Once a thread defect is detected, the CPU outputs the captured image to the live monitor 52 via the junction board 30 so that the defective bottle is displayed. The CPU also signals the production line board 44 so that the defective bottle can be tracked. When the defective bottle reaches the bottle detection sensor 28 and is detected, the production line board 44 signals the bottle reject mechanism 18 via the junction board 30 so that the bottle reject mechanism can track the defective bottle and remove it from the conveyor system 12 when the defective bottle reaches the bottle reject mechanism. The above described process is performed for the video images captured by each ofthe video image processors 42. Thus, as each bottle 14 travels along the inspection system 16, four video images ofthe rim and threads ofthe bottle are taken. Since these video images encompass approximately 110 degrees ofthe bottle circumference and are taken about the circumference ofthe bottle at approximately 90 degree spacings, the entire threaded section of each bottle is examined for defects. In addition to the above, the PCOM board 46 in the computer 40 monitors the output ofthe temperature sensor 32 by way of the junction board 30. If the detected temperature exceeds a threshold value, the PCOM board 40 activates the beacon 38 via the junction board 30. The PCOM board 46 also monitors the junction board 30 to determine if the halogen lamps 24 are drawing current. If any one ofthe halogen lamps 24 is determined not to be drawing current, the PCOM board 46 activates the beacon 38 via the junction board 30. Since the inspection system 16 typically operates unattended, the activation ofthe beacon 38 allows fault conditions in the operation ofthe inspection system 16 to be detected by an operator. Although a particular example of blob detection has been described to detect contiguous white pixels, those of skill in the art will appreciate that other methods can be employed such as the method as described in an article by G. Hirzinger and K. Landzattel entitled "A Fast Technique for Segmentation and Recognition of Binary Pattems", IEEE Conference on Pattem Recognition and Image Processing, 1981, Run-Length Connectivity Analysis as described in an article by I. Kabir, entitled "A Computer Vision System Using Fast One Pass Algorithms", M. S. Thesis, University of California, Davis, 1983, the Clustering Method as described in an article by R. C. Smith and A. Rosenfeld, entitled "Threshold Using Relaxation", IEEE Trans, on Pattem Analysis and Machine Intelligence, Vol. 3, pp. 598-605, 1981, the Region Growing Method as described in an article by C. R. Brice and C. L. Fenneman, entitled "Scene Analysis Using Regions", Artificial Intelligence, Vol. 1, pp. 205-226, 1970, and the Split and Merge Method as described in an article by D. M. Mark and D. J. Abel entitled "Linear Quadtrees from Vector Representation of Polygons", IEEE Trans, on Pattem Analysis and Machine Intelligence, Vol. PAMI-7, No. 3, pp. 344-349, 1985. As shown, the present invention provides a computerized video analysis method of detecting thread defects in glass bottles without requiring the bottles to be handled or requiring the conveyor system 12 to slow down. Moreover, by using computerized video analysis, the bottles need not be positioned precisely prior to analysis. Since the bottles do not need to be handled, damage to and contamination ofthe bottles is reduced. Although Figure 6 illustrates 21 side-by-side specific regions of interest, each of which is processed individually to detect thread defects, those of skill in the art will appreciate that the number and orientation ofthe specific regions of interest within the video image can be varied. For example, Figures 8 and 9 show an altemative arrangement of specific regions of interest within the video image. In this embodiment, the CPU binarizes the pixels within the window to locate the reference feature (i.e. the bottle rim 210) in the same manner previously described. An enclosing rectangle 212 aligned with the scan lines which encompasses the bottle rim 210 is defined and the top-left comer ofthe enclosing rectangle is used as the reference location Xref, Yref. A central specific region of interest 220 is then determined. Once the central specific region of interest has been determined, nniine other rectangular specific regions of interest 222 on both sides ofthe central specifi ic regions of interest are determined giving a total of nineteen specific regions of interest. The specific regions of interest slightly overlap with adjacent specific regions of interest and as in previous embodiment, are increasingly offset in the Y- direction the further they are from the central specific region of interest to follow the threads of a bottle in the video image. Once the specific regions of interest 220, 222 have been determined, the CPU calculates a threshold value for each ofthe specific regions of interest. With the threshold values established for the specific regions of interest, the CPU compares the pixels in the specific regions of interest with the threshold values to create binarized pixels in a similar manner to that previously described. Following this and unlike the previous embodiment, the CPU groups the nineteen specific regions of interest into five groups 225 depending on the relative positions ofthe specific regions of interest with respect to the central region of interest. Blob detection is then performed on the groups 225 of binarized pixels to locate contiguous white pixels in each group 225. The CPU then collects a histogram for each group 225 by counting the number of contiguous white pixels. The histograms collected for the groups 225 are then scaled according to their positions relative to the central specific region of interest to correct for perspective effects. Once scaled, the number of contiguous white pixels in the groups are compared with a threshold area value. If the numbers of contiguous white pixels are greater than the threshold area value, the contiguous white pixels are filtered in the manner described previously before the contiguous white pixels are determined to represent thread defects. Referring now to Figures 10 to 13, an altemative embodiment of a bottle production line 310 including an inspection system 316 for detecting bottle defects is shown. As can be seen, the inspection system 316 includes a starwheel 400 which receives a stream of separated bottles 314 from a feedscrew 402 at the output end of an inlet conveyor 404. The starwheel 400 delivers the bottles to the pockets of a main starwheel 406 which incoφorates backrest gripers 408 to secure the bottles to the main starwheel and prevent the bottles from rotating or vibrating. The main starwheel 406 in turn delivers the bottles to the pockets of another starwheel 410 which delivers the bottles either to an outlet conveyor 412 or to a bottle rejection conveyor 414. Video imaging sections 320 are disposed about the periphery ofthe main starwheel 408 at circumferentially spaced locations to inspect a different portion of each bottle as it is moved by the main starwheel. Each video image section includes a photoelectric bottle detection sensor 326 which detects the arrival of a bottle. The bottle detection sensor 326 when triggered signals a computer 340 which in turn triggers a strobe light 324 . A CCD camera 322 is associated with each strobe light to take an image ofthe backlit bottle when the strobe light is triggered. Video image processors 342 capture and process the video images taken by the CCD cameras 332 when the strobe lights are operated. The computer 340 is connected to an operator monitor 348 and to a central control system 426 so that the operation ofthe inspection system can be co¬ ordinated with the operation ofthe remainder ofthe bottle facility. The computer 340 also communicates with a programmable logic controller (PLC) 428. PLC 428 communicates with drive controllers 430 associated with the starwheels 400, 406 and 410, backrest grippers 408, inlet feedscrew 402 and starwheel clamps 411. Referring now to Figure 12, the orientation ofthe CCD camera 322 and strobe light 324 in one ofthe video imaging sections is better illustrated. As can be seen, the CCD camera 322 is oriented so that its optical axis points downwardly towards the bottle at an angle equal to about 45 ° with respect to the horizontal H. The strobe light 324 is similarly oriented so that it directs light towards the bottle at an inclined angle with respect to the horizontal H equal to about 30°. The captured video images are processed by the video image processors 342 in a similar manner to that previously described to detect bottle thread defects as illustrated in Figure 13. As can be seen, in this embodiment, the CPU determines five side-by-side specific regions of interest 440 following the bottle threads in the video image. In this embodiment, when a defective bottle is detected by the CPU within the computer 340, the computer 340 controls the starwheel 410 so that a bottle is delivered to the defective bottle conveyor 414 rather than the outlet conveyor 412. In this manner, defective bottles are removed from the bottle production line 310. Although the inspection systems have been described as including four video imaging sections, those of skill in the art will appreciate that additional or fewer video imaging sections can be used depending on the desired accuracy. Also, although each video imaging processor has been described as having a dedicated CPU to process the captured video images, it should be realized that the number of motherboards may be decreased with each motherboard processing video images captured by more than one daughterboard. Also, although a bottle detection sensor is shown for each video imaging section, it should be realized that a single bottle detection sensor can be used to detect each bottle as it approaches the inspection system. In this case, the output ofthe encoder is used to determine the speed ofthe bottles and the triggering ofthe CCD cameras is based on the determined bottle speed and the spacing between successive video imaging sections. Although specific embodiments ofthe present invention have been described, those of skill in the art will appreciate that variations and/ or modifications may be made without departing from the scope thereof as defined by the appended claims.

Claims: I claim: 1. A method of inspecting a bottle having a threaded section for thread defects as said bottle moves along a production line comprising the steps of: (i) capturing a video image of said bottle with a video camera as said bottle moves into the field of view of said video camera without requiring said bottle to be at a specific position within said field of view, said video image encompassing a general region of interest containing at least a portion ofthe threaded section of said bottle; (ii) deterrnining the position of said bottle within said general region of interest based on the location of a feature of said bottle within said general region of interest; (iii) segmenting a portion of said general region of interest which encompasses said at least a portion of said threaded section into a plurality of specific regions of interest; and (iv) examining pixels ofthe video image in said specific regions of interest to detect thread defects. 2. The method of claim 1 wherein said feature is the top rim of said bottle. 3. The method of claim 2 further comprising the steps of establishing a reference location based on the location of said top rim; and detecting said portion of said general region of interest and the positions of said specific regions of interest based on the position of said reference location. 4. The method of claim 3 wherein the position ofthe central specific region of interest is determined relative to said reference location and wherein the positions of other specific regions of interest on opposite sides of said central specific region of interest are determined relative to the position of said central specific region of interest. 5. The method of claim 4 wherein said other specific regions of interest are increasingly offset in a Y-direction the further they are from said central specific region of interest to follow the threaded section of said bottle in said video image. 6. The method of claim 5 wherein said specific regions of interest decrease in an X-direction the further they are from said central specific region of interest to compensate for perspective effects. 7. The method of claim 6 wherein said specific regions of interest are positioned side-by-side. 8. The method of claim 6 wherein said specific regions of interest overlap adjacent specific regions of interest. 9. The method of claim 3 wherein said step of examining said pixels includes the steps of: determining a black white pixel threshold value for said specific regions of interest; comparing said pixels with said threshold value and binarizing said pixels as white or black depending on the results of said comparison; and determining groups of contiguous white pixels larger than a threshold value thereby to detect thread defects. 10. The method of claim 9 wherein during the step of determining groups of contiguous white pixels, the groups of contiguous white pixels are filtered to reduce false detection of bottle thread defects. 11. The method of claim 1 wherein steps (i) to (iv) are performed at a plurality of circumferentially spaced locations about said bottle to detect thread defects in the entire threaded section of said bottle. 12. A system for inspecting bottles having a threaded section as said bottles are moved along a production line comprising: a plurality of video imaging sections disposed along said production line at spaced locations, each video imaging section being oriented with respect to said production line to take a video image of each bottle at a different circumferential region thereof as each bottle moves into the field of view of said video imaging section without requiring said bottle to be at a specific location in said field of view, said video images encompassing a general region of interest containing at least a portion ofthe threaded section of each bottle; and processing means in communication with said video imaging sections and receiving the video images taken thereby, said processing means processing each video image to determine the position of said bottle within said general region of interest based on the location of a feature of said bottle within said general region of interest; segmenting a portion of said general region of interest which encompasses said at least a portion of said threaded section into a plurality of specific regions of interest; and examining pixels in said specific regions of interest to detect thread defects. 13. A system for inspecting bottles as defined in claim 12 wherein each video imaging section includes a video imaging camera and a light source, said light source and said video imaging camera being located on opposite sides of said production Une, the video imaging cameras and light sources in said video imaging sections being oriented so that video images ofthe entire circumference of each bottle are taken by said video imaging sections. 14. A system for inspecting bottles as defined in claim 13 further comprising at least one bottle detection sensor for detecting the presence of a bottle, said processing means being responsive to said at least one bottle detection sensor and triggering said video imaging sections to take video images of said bottle. 15. A system for inspecting bottles as defined in claim 14 wherein said light sources remain illuminated and wherein said processing means triggers the video imaging camera to take an image of said bottle in response to the associated bottle detection sensor. 16. A system for inspecting bottles as defined in claim 15 wherein said processing means signals a bottle reject mechanism along said production line upon detection of a bottle having a thread defect. 17. A system for inspecting bottles as defined in claim 13 wherein said video imaging sections are arranged in interlocking pairs to reduce spacing and interference therebetween. 18. A system for inspecting bottles having a threaded section as said bottles are moved along a production line comprising: a plurality of video imaging sections disposed along said production line at spaced locations, each video imaging section being oriented with respect to said production line to take a video image of each bottle at a different circumferential region thereof as each bottle moves into the field of view of said video imaging section without requiring said bottles to be at a specific location in said field of view, said video imaging sections being arranged to reduce spacing therebetween; and processing means in communication with said video imaging sections and receiving the video images taken thereby, said processing means processing said video images to detect thread defects in said bottle. 19. A system for inspecting bottles as defined in claim 18 wherein each video imaging section includes a video imaging camera and a light source, the video imaging camera and light source being positioned on opposite sides of said production line and being laterally offset so that the optical axis of each video imaging section forms an oblique angle with respect to said production line. 20. A system for inspecting bottles as defined in claim 19 wherein said system includes four video imaging sections arranged in an upstream pair and a downstream pair, the video imaging cameras and light sources in said upstream pair forming an obtuse angle with respect to said production line and the video imaging cameras and light sources in said downstream pair forming acute angles with respect to said production line. 21. A system for inspecting bottles defined in claim 20 wherein the positions of said video imaging cameras and light sources with respect to said production line alternate in successive video imaging sections. 22. A method of locating the position of a bottle within a video image comprising the steps of: capturing a video image of at least a portion of said bottle with a video camera; digitizing said video image; comparing pixels in said video image with a threshold value and binarizing said pixels as white or black depending on the results of said comparisons; and determining the position of said bottle relative to the boundaries of said video image based on the location ofthe largest group of contiguous white pixels within said video image. 23. A method of detecting defects in bottle threads comprising the steps of: capturing a video image of said bottle threads; segmenting at least a portion of said video image into a plurality of specific regions of interest; and video processing each specific region of interest independently to determine defects in each of said specific regions of interest based on the existence of white areas larger than a prescribed threshold area size within said specific regions of interest. 24. A system for locating the position of a bottle within a video image comprising: means for backlighting said bottle with a light source; a video camera for capturing a video image of at least a portion of said bottle within the field of view thereof; means for digitizing said video image; and means for determining the position of said bottle within said video image based on the location ofthe largest white area within said video image. 25. A system for detecting defects in bottle threads, comprising: means for capturing a video image of said bottle threads; means for segmenting at least a portion of said video image into a plurality of specific regions of interest; and means for video processing each specific region of interest independently to determine defects in each of said specific regions of interest based on the existence of white areas larger than a prescribed threshold area size within said specific region of interest.

Inventors: SAFAEE-RAD REZA, SAFAEE-RAD, REZA
Applicants: IMAGE PROCESSING SYSTEMS INC, SAFAEE RAD REZA, IMAGE PROCESSING SYSTEMS, INC., SAFAEE-RAD, REZA
Application year: 1996
Main classification: G01N21
IPC codes: B07C5, G01B11, G01N21