Container inspection with field programmable gate array logic

Abstract: In a system for inspecting containers, a container is held in stationary position and rotated about its axis. Light energy is directed onto the container as it is rotated, and a camera obtains an image of the container illuminated by the light energy. The container image, consisting of a plurality of pixel data bytes each forming a portion of the image, is directed serially and in sequence to a programmable logic device, in which an array of hardware logic elements is configured such that the elements of the array operate on a plurality of sequential pixel data bytes simultaneously and in real time. The pixel data is analyzed to obtain inspection information as a function of optical characteristics of the container.

Description: The present invention is directed to a machine vision system according to the preamble of claim 1, to a system for inspecting containers according to the preamble of claim 5, and to a method of inspecting optical characteristics of a container according to the preamble of claim 9. Background and Objects of the Invention A high-speed image acquisiton system for robotics is known from an article by J. S. Smith et al. in "Transactions of the Institute of Measurements and Control", 14 (1992), 196-203, and discloses how to reduce image capture time. A preprocessor in the meaning of invention is not described. A programmable image processing system using FGPAs is known from C. S. Cham et al. "International Journal of Electronics", 75 (1993), pages 725-730, yet not for inspecting systems for containers and similar objects. Conventional technology for mass production of glass or plastic containers involves forming the containers in a multiplicity of blow molds. Various types of faults or checks, termed "commercial variations" in the art, may occur. It has heretofore been proposed to employ optical scanning techniques for inspecting such containers for variations that affect optical transmission characteristics of the containers. In US-A-4,378,493, 4,378,494 and 4,378,495, there are disclosed methods and apparatus in which glass containers are conveyed through a plurality of stations in which they are physically and optically inspected. At one inspection station, a glass container is held in vertical orientation and rotated about its vertical axis. An illumination source directs diffused light energy through the container sidewall. A camera, which includes a plurality of light sensitive elements or pixels oriented in a linear array parallel to the vertical axis of container rotation, is positioned to view light transmitted through a vertical strip of the container sidewall. The output of each pixel element is sampled at increments of container rotation, and event signals are generated when adjacent pixel signals differ by more than a preselected threshold level. An appropriate reject signal is produced and the rejected container is sorted from the conveyor line. U.S. Patent No. 4,958,223, also assigned to the assignee hereof, discloses apparatus for inspecting the finish of a container as the container is rotated about its central axis. A light source is positioned to direct diffused light energy onto the container finish, and a camera is positioned across the axis of the container from the light source. The camera comprises a CCD image array sensor having a matrix of image sensing elements arranged in a row-and-column array with transport registers and gating electronics on the sensor for selectively reading image data at the sensing elements sequentially by row and column. Image processing electronics is coupled to the array and generates camera control signals for selectively integrating data from adjacent columns and/or rows on the image array sensor, and for downloading data from the sensor to the image processing electronics only from image data areas of interest. Such data compression not only improves signal-to-noise ratio by performing data processing on the sensor itself, but also saves image processor memory by downloading data only from image areas of interest.. U.S. Patent No. 5,214,713, also assigned to the assignee hereof, discloses a system for inspecting containers in which a camera obtains an image of the container that consists of a plurality of pixels each forming a portion of the image, and a memory receives and stores the image pixel data from the camera. A systolic array processor includes a plurality of one-bit data processors configured in a rectangular array, and a microcoded controller for controlling operation of the plurality of one-bit data processors to process data simultaneously and in parallel. A data-dependent processor separate from the systolic array processor is adapted to perform non-sequential and/or data-dependent processing of image data. A master computer is connected to the camera control electronics, memory, systolic array processor and data-dependent processor. By controlling operation of these electronics, the master computer obtains pixel data from the camera and stores such data by pixel in memory, retrieves pixel data from memory and loads such data by pixel into the systolic array processor such that each of the plurality of one-bit processors receives and operates on one byte of pixel data, returns data from the systolic array processor to the memory, and retrieves pixel data from memory for loading such data into the data-dependent processor for non-sequential or data-dependent image processing. Although the systems and techniques disclosed in the above-noted patents represent significant advances in previous inspection technology, improvements remain desirable. In particular, it is highly desirable for machine vision systems employed in manufacturing inspection applications, such as in container inspection for manufacturing process control, to process the container image data rapidly and in real time as the data is read from the camera, as distinguished from storing all camera image data in memory for subsequent non-real time processing. It is a general object of the present invention to provide a machine vision system and method that addresses this need in the art. A more specific object of the present invention is to provide a system and method of the described character that employs programmable logic hardware for preprocessing image data sequentially and in real time, and in which the preprocessing hardware may be readily reprogrammed or reconfigured for performing differing preprocessing operations on the image data. Summary of the Invention A machine vision system in accordance with the present invention includes a camera for obtaining an image that comprises a plurality of pixel data each forming a portion of the image, a preprocessor for receiving and performing selected preprocessing operations on pixel data from the camera, and a main processor for performing image analysis on preprocessed pixel data received from the preprocessor. The preprocessor comprises an array of hardware logic elements variably configurable to process pixel data serially and in real time in a manner determined by configuration of the hardware logic elements. The preprocessor is responsive to controls from the main processor for selectively varying configuration of the hardware logic elements to preprocess pixel data from the camera in a preselected manner controlled by the main processor. In the presently preferred implementation of the invention in a system for inspecting containers, a container is held in stationary position and rotated about its axis. Light energy is directed onto the container as it is rotated, and a camera obtains an image of the container illuminated by the light energy. The container image, consisting of a plurality of pixel data bytes each forming a portion of the image, is directed serially and in sequence to a programmable logic device, in which an array of hardware logic elements is preconfigured such that the elements of the array operate on a plurality of sequential pixel data bytes simultaneously and in real time. The pixel data is analyzed to obtain inspection information as a function of optical characteristics of the container. A digital memory contains prestored configuration programs for the programmable logic device. Electronics is responsive to the main processor for selecting among the configuration programs prestored in memory, and selectively configuring or reconfiguring the array of hardware logic elements in the programmable logic device for performing the selected preprocessing operation(s) on image pixel data from the camera. Operation of the camera and the programmable logic device is synchronized to increments of container rotation in the preferred embodiment of the invention. Brief Description of the Drawings The invention, together with additional objects, features and advantages thereof, will be best understood from the following description, the appended claims and the accompanying drawings in which: FIG. 1 is a functional block diagram of a system for inspecting the bottom and heel portions of a container in accordance with one presently preferred implementation of the invention; FIG. 2 is a functional block diagram of the preprocessor in FIG. 1; FIG. 3 is a more detailed functional block diagram of the FPGA in FIG. 2 configured to perform bottom and heel analysis in the implementation of FIG. 1; FIGS. 4A and 4B together comprise a schematic illustration of the bottom and heel of a container inspected in FIG. 1 (FIG. 4A) and the resulting electronic image thereof (FIG. 4B); and FIGS. 5A and 5B are schematic illustrations of a container bottom and heel with various commercial variations (FIG. 5A) and the resulting image (FIG. 5B). Detailed Description of the Preferred Embodiment FIG. 1 illustrates a machine vision system 10 in accordance with the present invention configured for inspecting the bottom and heel of a container 12. A conveyor 14, typically including a starwheel (not shown) and a slide plate 16, is so disposed and connected to a source of molded containers as to bring successive containers 12 into position at the inspection station illustrated in FIG. 1. Conveyor 14 may be of any suitable type, such as those shown in U.S. Patent Nos. 4,230,219 and 4,378,493, and would typically include a rotatable starwheel for bringing successive containers into position and holding the containers in fixed position during the inspection operation. A container rotating device 19, such as a drive roller, is positioned to engage container 12 at the inspection station and to rotate the container about its central axis. In the preferred implementation of the invention herein discussed, container 12 is illustrated as a molded glass bottle having a container body 20, a generally cylindrical neck 22 that projects upwardly from a body shoulder 24, and a bottom 26 that is blended by a heel 28 into the body portion 20 of the container. Inspection system 10 is configured in FIG. 1 to inspect bottom 26 and heel 28 of container 12. However, as will be apparent from the following discussion, the present invention is by no means limited to this specific implementation. A light source 30 is positioned beneath slide plate 16, and directs light energy upwardly through an opening 32 in slide plate 16 into the container through bottom 26 and heel 28. A camera 34 is disposed above and in alignment with slide plate opening 32 for viewing container bottom 26 and heel 28 downwardly through the container mouth as the container is held in stationary position, rotated about its central axis, and illuminated from beneath by light source 30. Thus, the camera obtains an image of at least that portion of the container under inspection. An image of the illuminated bottom and heel of container 12 is focused by a lens 36 within camera 34 onto a CCD linear array sensor 38. Thus, a linear or one-dimensional image of the bottom and heel portions of container 12 is developed at camera sensor 38 that consists of a plurality of pixel data bytes sequentially readable or scannable from sensor 38. Camera 34 is controlled by an information processor 40 for downloading image data serially by byte to a preprocessor 42. Within preprocessor 42, the image data is processed in a selected manner, and then fed to information processor 40 for obtaining inspection information as a function of optical characteristics of container 12. Information for processor 40 can provide a reject signal for separation of a container 12 having undesirable or unacceptable checks or variations, or can provide an image of all or a portion of the inspected portion of the container at a display 44. Operation of information processor 40 and preprocessor 42 is synchronized to increments of container rotation, either directly by an encoder 45 as a function of actual container rotation, or indirectly by increments of time with the container being rotated at constant velocity. FIG. 2 is a functional block diagram of preprocessor 42. A field programmable gate array or FPGA 46 receives camera image data serially by byte through an image buffer 48. FPGA 46 is a conventional programmable logic device that contains an array of hardware logic elements variably configurable to process pixel data from camera 34 serially and in real time in a manner determined by configuration of the hardware logic elements. A presently preferred programmable logic device or FPGA 46 is the FLEX 8000 programmable logic device family marketed by Altera Corporation of San Jose, California. FPGA 46 is connected to a RAM 50 and a ROM 52, both for receiving configuration program information and performing image analysis, as will be described. FPGA 46 receives a control input from information processor 40 through a programmable logic array or PLA 54 for selectively programming or reprogramming FPGA 46, and provides output image information to information processor 40 through an image buffer 56. ROM 52 contains at least one and preferably a plurality of programs for selectively configuring FPGA 46 to perform differing preprocessing operations on input image pixel data. These programs are selectable by information processor 40 depending upon the inspection operation to be performed - e.g., bottom and heel inspection in the implementation of FIG. 1 - and the desired preprocessing algorithm. One preprocessing algorithm for bottom and heel inspection will be discussed in detail in connection with FIG. 3. PLA 54 is preprogrammable in association with command signals from information processor 40 for selectively commanding FPGA 46 to download configuration programs from ROM 52, either on power-up of the overall system, or selectively under control of information processor 40 through PLA 54 in the event that a different preprocessing algorithm is desired. FIG. 3 is a functional block diagram of FPGA 46 in FIG. 2 configured to preprocess image pixel data for bottom and heel inspection in the implementation of FIG. 1. Camera pixel data is received serially by pixel byte at a synchronizer 60 controlled by a processor clock 62. The synchronizer also drives a pixel counter 64 for tracking pixel data received from the camera within each scan. The synchronized pixel input data is fed through sequential shift registers 66,68,70. The outputs of synchronizer 60 and of each register 66,68,70 are fed to a corresponding input of a multiplexer 72. Thus, four sequential bytes of pixel data, representing the outputs of four sequential elements of linear-array sensor 38 (FIG. 1), appear at the four inputs of multiplexer 72. A pair of logic gates 74,76 are selectively set by the programming for determining separation between pixel data bytes to be compared within a camera scan line (logic 74) and the number of scan lines between pixel data bytes to be compared (logic 76). That is, the analysis is performed in this exemplary implementation by comparing pixel data bytes within a camera scan line, either adjacent to each other or separated by a number of bytes determined by programming of logic 74, and by comparing the same byte number within two scan lines, either adjacent scan lines or scan lines separated from each other by the programing of logic 76. Logic elements 74,76 are driven by processor clock 62. Pixel counter 64 and logic element 74 are connected to a subtraction circuit 78, which subtracts from the setting of logic 74 from the pixel count within each scan line. This generates an address that addresses a scan data RAM 80 (part of RAM 50 in FIG. 2). Subtractor 78 generates the pixel portion of the address and subtractor 84 generates the scan portion of the address. Together they can generate the address for any previous pixel in the current scan line or a previous scan line. Current pixel data is continuously being stored in scan data RAM 80. Therefore, the pixel data from a previous pixel in the same scan line or from a previous scan line can be retrieved by addressing the proper location in the RAM. A multiplexer 86 receives the output of multiplexer 72 and the output of scan data element 80. Thus, multiplexer 86 can select among the most recent pixel data byte and three immediately preceding pixel data bytes (through multiplexer 72), and a preselected previous pixel data byte (through scan data element 80) either within the same scan line or in a selected preceding scan line. The output of multiplexer 86 is fed to one input of a ratio computation element 88, which receives a second input from synchronizer 60, which is of course the most recent pixel data input byte. Thus, at ratio element 84, the current input data byte may be compared with any one of the three immediately previous bytes at the output of shift registers 66,68,70, with any previous byte from within the same scan line as determined by subtraction element 78 and scan data element 80, or with the same pixel data byte from any previous scan line as determined by subtraction element 84 and scan element 80. Ratio element 88 preferably is formed by a portion of ROM 52 (FIG. 2) for receiving the two input bytes as the two ROM address inputs, and providing an output as a function of the ratio therebetween. Such ratios are, of course, prestored in ROM 52. The output of ratio element 88 is fed to a comparator 90, at which the computed ratio is compared to a threshold 92 prestored in RAM 50 (FIG. 2). There is a threshold 92 stored in RAM 50 for each pixel, and pixel counter 64 addresses the RAM to read the appropriate threshold. When this comparison indicates that the ratio of the image pixel bytes developed at 88 exceeds threshold 92, a "hit" counter 94 is incremented. A predetermined number of sequential hits indicates detection of a "blob," and increments a blob counter 96. Blob counter 96 is incremental at the end of each string of consecutive hits. Each hit developed at comparator 90 functions through element 98 to signal an output multiplexer 100 to transmit data to main information processor 40 (FIG. 1). On sequential hits, the output of multiplexer 100 is developed from blob counter 96, hit counter 94, ratio 88, sync 60, counter 64 and counter 82. Thus, sequential hits resulting from image data byte comparisons effectively download image information to the main information processor. The main information processor can develop quality control information from the number and frequency of these data. In this way, the main processor need not process all image data, but only data of interest for detection of unacceptable commercial variations. Alternatively, of course, main processor 40 may command download of all pixel data from RAM 50 for processing and/or display at 44. FIG. 4A illustrates a container bottom and heel 102 having an inner ring 104, a start ring 106 and raised wear ridges 108. Scan lines 110,114 and 116 are illustrated in phantom. Also illustrated in FIG. 4A for purposes of understanding is an image 38a that represents the portion of the total container bottom and heel 102 viewed by camera sensor 38 at scan increment 110. As noted above, sensor 38 in this embodiment is a linear array sensor having a plurality of sensor elements - e.g., 512 sensor elements. Six of these elements 38b,38c,38d,38e,38f and 38g are illustrated in FIG. 4A at ring 104, the container axis, ring 104, ring 106, the inside edge of ridge 108 and the outside edge of ridge 108 respectively. Camera sensor 38 is scanned at increments of container rotation to develop a two-dimensional electronic image 120 of the container bottom and heel, as illustrated in FIG. 4B. The ridges 108 appear adjacent to the bottom of image 120, with start ring 106 appearing immediately above, inner ring 104 above the start ring, and a line 122 representing the center of the container above start ring 104. An image 106' of inner ring 106 is repeated at the top of the image. Scan lines 110,114,116 are again represented in phantom, as is image 38a and sensor elements 38b-38g in scan 110. FIGS. 5A and 5B illustrate a container having both wobble and opaque stone variations in the container bottom 124. Stones 126,128,130 and 132 are illustrated in container bottom 124 in FIG. 5A, and the corresponding images are illustrated in FIG. 5B. Note that on scan line 134 stone 126 adjacent to the container center and stone 128 at inner ring 104 repeat, but on the opposite side of the container center 122. Stone 126 smears because of the lesser angular velocity at the container center. There have thus been disclosed a method and system that full satisfy all of the objects and aims previously set forth. It will be appreciated, of course, that although the invention has been disclosed in conjunction with a presently preferred implementation for bottom and heel analysis, the invention could be readily employed for other types of container inspection and analysis, such as container sidewall inspection as disclosed in U.S. Patent No. 4,601,395, container finish inspection as disclosed in U.S. Patent No. 4,701,612, container sealing surface inspection as disclosed in U.S. Patent No. 4,945,228, or container mold identification as disclosed in U.S. Patent No. 4,644,151. It will also be appreciated that, although the invention has been described in conjunction with a data compression preprocessing application - i.e., an application in which the preprocessing locates "hits" indicative of commercial variations and passes only this information to the main processor for further further analysis - the programmable logic device that characterizes the invention could as readily be used for other preprocessing applications, such as data filtering, convolution filtering, FIR filtering, Z transform filtering, erode analysis or dilation analysis. Indeed, a particularly important advantage of the present invention lies in the fact that algorithms for performing any or all of these preprocessing functions may be prestored in ROM 52 (FIG. 2) and selectively activated by main information processor 40 (FIG. 1) as desired. The image preprocessor in accordance with the invention operates on pixel data in real time serially as received from the camera. The system is highly pipelined, which is to say that at any point in time, sequential elements of the preprocessor are operating on sequential bytes of pixel data. The system can therefore complete the preprocessing operation in the time required by the slowest single component, rather than the sum of times of all processing components. In effect, all of the pipeline elements are processing pixel data in parallel. As more processing is required, additional pipelined stages may be added without in any way slowing the preprocessing operation. Elements such as adders, accumulators, counters, multiplexers and comparators can be implemented in the programmable logic device. Multipliers and dividers preferably are implemented as look-up tables in an external ROM or RAM. Data from previous scans is stored in and retrieved from external RAM, and parameters such as thresholds can be stored on a per-pixel basis in external RAM.

Claims: A machine vision system that includes: camera means (34) for vision of an object which has relative movement to the camera (34) so as to obtain consecutive images that comprise a plurality of pixel data bytes each forming a portion of a single image, preprocessing means (42) for receiving pixel data from said camera means (34) and performing selected preprocessing operations thereon, main processing means (40) for receiving preprocessed pixel data from said camera means (34) and performing image analysis on said pixel data, characterized in that said preprocessing means (42) comprises a field programmable gate array (46) of hardware logic elements (66, 68, 70) variably configurable to process pixel data bytes of said single image portion serially in a real time in a manner determined by configuration of said hardware logic elements (66, 68, 70), and means (50, 52) coupled to said main processing means (40) for selectively varying configuration of said hardware logic elements (66, 68, 70) to process pixel data bytes from said camera means (34) in preselected manner controlled by said main processing means (40). The system set forth in claim 1 wherein said selectively varying means (50, 52) comprises digital memory means having prestored therein a plurality of configuration programs, means responsive to said main processing means (40) for selecting among said plurality of configuration programs in said digital memory means, and means for configuring said array (46) of hardware logic elements (66, 68, 70) as a function of the configuration program selected from said digital memory means (50, 52). The system set forth in claim 1 wherein said array (46) of hardware logic elements (66, 68, 70) is configurable such that elements of said array in sequence operate on a different byte of pixel data in such a way that said array operates on a plurality of sequential pixel data bytes simultaneously. The system set forth in claim 1, 2 or 3 wherein said array (46) of hardware logic elements (66, 68, 70) comprises a programmable logic device. A system for inspecting containers that comprises: means (16, 18) for holding a container (12) in stationary position and rotating the container about its axis, means (30) for directing light energy into the container (12) in said holding and rotating means (16, 18), camera means (34) for obtaining an image of the container (12) in said holding and rotating means (16, 18) illuminated by said light energy, said image consisting of a plurality of pixels each forming a portion of said image, and information processor means (40) for providing pixel data bytes to be stored and compared, characterized in that said camera means (34) is adapted to deliver pixel data bytes serially and in sequence for single image portions, that programmable logic means (42) is coupled to said camera means (34) as a preprocessing means for receiving said pixel data bytes serially and in sequence, said programmable logic means (42) comprising a field programmable gate array (46) of hardware logic elements (66, 68, 70) configured such that elements of said array (46) operate on a plurality of sequential pixel data bytes simultaneously and in real time, and in that said information processor means (40) is responsive to pixel data processed by said programmable logic means (42) for obtaining inspection information as a function of optical characteristics of the container (12). The system set forth in claim 5 further comprising means (50, 52) for selectively varying configuration of said hardware logic elements (66, 68, 70) in said programmable logic means (42) for performing differing processing operations on pixel data received from said camera means. The system set forth in claim 6 wherein said selectively varying means (50, 52) comprises digital memory means (52) having prestored therein a plurality of configuration programs, means (40) for selecting among said plurality of configuration programs in said digital memory means, and means (54) for configuring said array (40) of hardware logic elements as a function of the configuration program selected from said digital memory means. The system set forth in claim 5 further comprising means (45) responsive to said holding and rotating means (16, 18) for synchronizing operation of said programmable logic means (42) to increments of container rotation. A method of inspecting optical characteristics of a container, comprising the steps of: (a) obtaining an image of the container (12), (b) converting image information into a plurality of pixel data bytes, each forming a portion of said image, and (c) processing said pixel data bytes so as to obtain inspection information as a function of optical characteristics of the container, characterized in that in step (a) said image of the container (12) is obtained serially and in sequence for single image portions; in step (b) said plurality of pixel data bytes is received by a field programmable gate array (46) of configurated hardware logic elements (66, 68, 70), each logic element forming a sequential section of the array (46) which carries a respective single image portion; in step (c) processing is for sequential pixel data bytes simultaneously in said sequential sections of said array (46). The method set forth in claim 9 further comprising the steps of: (d) rotating the container (12) about its axis, and (e) synchronizing operation of said steps (a) and (b) to increments of container rotation.

Inventors: JUVINALL JOHN W, JUVINALL, JOHN W.
Applicants: OWENS BROCKWAY GLASS CONTAINER, OWENS-BROCKWAY GLASS CONTAINER INC.
Application year: 1996
Main classification: G01N21
IPC codes: B65B57, G01N21, G06T1