INSPECTION OF CONTAINERS
THIS INVENTION relates to the inspection of containers. It relates in particular to a method of, and apparatus for, inspecting the contents of a container.
Often, containers include goods and/or products which define the contents of the container and which are packed uniformly within the container. The contents may be packed directly into the container or be packed or packaged into sub-containers, sub-sub- containers, or the like. When the sub-containers, or sub-sub-containers are relatively small relative to the container, it may be difficult to detect when a sub-container has been removed from the container. For example cartons of cigarettes, each defining a sub-container, are usually packed in a uniform fashion in a substantially larger container and it may be difficult to detect when a carton has been removed from the container. It is an object of this invention to offer a new method and apparatus to inspect the contents of a container.
According to the invention, there is provided inspection apparatus for inspecting the contents of a container, the apparatus including radiation means arranged to generate a beam which radiates radially outwardly in generally two-dimensional plane;
detection means for detecting radiation from the radiation means; displacement means for effecting relative displacement of the container between the radiation means and the detection means, the beam being incident upon a width of the container which is transverse to a direction of displacement; and processor means connected to the detection means and being operable iteratively to monitor intensity of the beam after passing through the container upon relative displacement and compare the intensities monitored thereby to inspect the contents of the container.
In accordance with the invention, there is provided a method of inspecting the contents of a container, the method including radiating the container by radiation means with a beam radiating outwardly in a generally two-dimensional plane; effecting relative displacement of the container between the radiation means and detection means transverse to the two-dimensional plane and; detecting at preselected positions by detection means an intensity of the beam passing through the container at a plurality of locations along the detection means in the two-dimensional plane; and monitoring the uniformity of the intensities by processor means connected to the detection means thereby to inspect the container.
The method may include feeding geometrical details of the container into the processor means and adjusting the radiation means so that opposed peripheral edges of the beam are generally aligned with upper edges of the container which lie in the two-dimensional plane. For example, when the container is box-like in shape having square corners, its upper side may be rectangular or square in outline and the opposed
peripheral edges of the beam may be aligned with opposed longitudinal edges of the upper side.
The apparatus may thus include input means for feeding the geometrical details of the container into the processor means. Preferably, the input means is in the form of reading means for reading container information and/or content information from the container. For example, the container may include a bar code including the information and the reading means may thus be in the form of a bar code reader.
Typically, the beam is an X-ray beam and the radiation means may include a collimator which produces the generally two- dimensional beam in use. In one embodiment of the invention, the radiation means includes a conventional X-ray tube producing high energy photons in the energy region of 50 to 100 keV. The tube may be connected to associated drive electronics which may be controlled by a personal computer or the like.
The apparatus preferably includes a shutter arrangement located between the radiation means and the container in use. The method may thus include selectively opening a shutter when the container is being radiated. Accordingly, saturation of the detection means prior to monitoring the intensity of the beam may be reduced. The shutter may be connected to and controlled by the processor means.
The detection means may be an X-ray detector comprising scintillators and light sensitive diodes.
The apparatus may include alignment means for aligning the container relative to the detection means. Typically, the apparatus includes a frame to which the alignment means is mounted. The frame may define a inspection chamber through which the container is displaced in use. Accordingly, the radiation means may be mounted to an upper portion of the frame and the detection means may be mounted to a lower portion of the frame. The displacement means may be in the form of a conveyor arrangement for displacing the container through the inspection chamber. Typically, the displacement means displaces the container at a generally constant speed of about 300 mm/s.
The processor means may include preprocessing circuitry for filtering signals sourced from the detection means. The preprocessing circuitry typically includes filtering means including a conventional Kuwahara filter and a conventional minimum filter. Accordingly, the method may include filtering signals sourced from the detection means using conventional Kuwahara and minimum filter techniques.
The method may include dividing the container up into sub- compartments which are uniformly distributed. In a preferred embodiment, the container is box-like having six rectangular sides defining a length ( C^ ), a width ( C y ) and a height ( CH ) . The container may include Ng |_ sub-containers along the length of the container, Ncrγj sub-containers along the width of the container and Ng sub-containers along the height of the container. Typically, information on the sub-containers, e.g. its geometry and/or configuration, is operatively sourced from the bar code on the container.
The method may thus include displacing the container through the inspection chamber and sampling the detection means in preselected segments which are equal to C|_ / g |_. Accordingly, the method may include radiating a slice or segment of the container at a preselected distance or position in each particular segment and monitoring a linear projection of the beam to monitor the contents of the container. The detection means may be divided into a plurality of regions or zones and the method may include monitoring the intensity of the beam incident on each region at each preselected position, and comparing intensity profiles of each region with associated regions at other preselected positions.
The invention is now described, by way of example, with reference to the accompanying diagrammatic drawings.
In the drawings, Figure 1 shows a three-dimensional view of inspection apparatus in accordance with the invention;
Figure 2 shows a top plan view of the apparatus of Figure 1 ; Figure 3 shows a cross-sectional view of the apparatus taken at Ill-Ill in Figure 2; Figure 4 shows a longitudinal-sectional view of the apparatus taken at IV-IV in Figure 3;
Figure 5 shows a schematic block diagram of the inspection apparatus;
Figure 6 shows a schematic block diagram of a radiation module of the apparatus;
Figure 7 shows a schematic block diagram of a detector arrangement of the apparatus;
Figure 8 shows a schematic representation of a Kuwahara filter of preprocessing circuitry of the apparatus;
Figure 9 shows a schematic rear view of the container passing through an inspection chamber of the apparatus; Figure 1 0 shows a schematic side view of the container passing through the inspection chamber;
Figure 1 1 shows a schematic representation of the geometrical layout of sub-containers packed within the container;
Figure 1 2 shows a schematic representation of the geometrical layout of sub-sub-containers packed within a sub-container;
Figure 1 3 shows a schematic representation of a top view of intensities measured by the detector as the container is displaced discreet preselected distances over the detector in use;
Figure 14 shows a schematic representation of a front view of a beam of the radiation module incident upon the detector at a preselected distance;
Figure 1 5 shows a schematic flow chart of operation of the apparatus in accordance with the invention;
Figure 1 6 shows a flow chart of software used in the apparatus; Figure 1 7 shows a flow chart of software implemented by image preprocessing circuitry of the apparatus; and
Figure 1 8 shows a flow chart of software used in feature extraction circuitry of the apparatus.
Referring to the drawings, reference numeral 1 0 generally indicates inspection apparatus in accordance with the invention. The inspection apparatus 1 0 includes a housing including a frame 1 2 for housing the various components of the apparatus 1 0. The housing includes front and rear platforms 14, 1 6 and a conveyor arrangement 1 8
(see Figure 4 in particular) transports a container 20 from the front platform 1 4 through an inspection tunnel 22 to the rear platform 1 6. Upon displacement of the container 20 through the inspection chamber or tunnel 22, the container is radiated by an X-ray beam 24 to inspect the contents of the container 20, as described in more detail below.
The apparatus 10 includes radiation means in the form of an X-ray module or source 26 which generates the beam 24 which radiates radially outwardly from a conventional X-ray tube 28 (see Figure 6) in a generally two-dimensional fashion as the container 20 passes through the inspection tunnel 22. Rays passing through the container 20 are incident upon a detector 30 (see Figure 5) which feeds intensity information sampled at about 10 KHz into signal processing circuitry 32. An output from the signal processing circuitry 32 is fed to image composition circuitry 34 whereafter it is fed into image preprocessing circuitry 36. An output from the image preprocessing circuitry 36 is fed into feature extraction circuitry 38 and thereafter into classification circuitry 40. In the embodiment depicted in the drawings, the signal processing circuitry 32, image composition circuitry 34, image preprocessing circuitry 36, feature extraction circuitry 38, and classification circuitry 40 are implemented by a conventional computing arrangement, for example, a personal computer 42. The signal processing circuitry 32 forms part of detector electronics and the image composition circuitry 34 forms part of a video frame assembler.
Referring in particular to Figure 6 of the drawings, the X-ray source 26 is connected to the personal computer 42 which controls conventional drive circuitry 44 which, in turn, is connected to the X-ray tube 28. The X-ray source 26 is mounted to a roof 44 of the frame 1 2
(see Figures 1 ,3 and 4) . The X-ray source 26 includes a shutter 21 which is aligned so that it generates the beam 24 which extends in a two-dimensional plane which is perpendicular to the direction of travel of the container 20 through the inspection tunnel 22. The inspection tunnel 22 has a protective shield 46 (see Figure 1 ) to retain the X-rays within the inspection tunnel 22.
The detector 30 (see Figure 7) includes scintillators 48 which are positioned above light-sensitive diodes 50 which, in turn, are connected to a pre-amplifier 52 and to the signal processing circuitry 32 (see Figures 5 and 7) . In use, the scintillators 48 convert X-ray energy into light which illuminates the light-sensitive diodes 50. The light- sensitive diodes 50, in turn, convert the light into electrical signals which are then fed to the signal processing circuitry 32 via the pre-amplifier 52.
As mentioned above, the container 20 is continuously displaced by the conveyor arrangement 1 8 through the inspection tunnel
22. The detector 30 is mounted below the conveyor arrangement 1 8 at a distance (S J) 54 (see Figure 9), typically about 1 ,25m below the X-ray source 26. The detector 30 further has a width 56 of typically between about 0,65m and geometrical information about the container 20 is fed into the processor means, comprising the circuitry 32, 34, 36, 38 and
40, prior to displacement of the container 20 through the inspection tunnel 22. The container 20 has a width (C y) 58, a container height (C[_|) 60 and a container length (C 61 (see Figures (9 and 1 0).
In the embodiment depicted in the drawings, the modelling of the contents of the container 20 assumes that it has fifteen sub- containers 62 (see Figure 1 1 ) which have a uniform geometry. As in the
case of the container 20 which is box-like in shape having six side panels which are rectangular in outline, each sub-container 62 is box-like in shape and also includes six side panels which are rectangular in outline. Each sub-container 62 has a height (SC|_j) 64, a length (SC|_) 66 and a width (SCy ) 68. In the embodiment depicted in the drawings, the container 20 is a box in which a plurality of cartons of cigarettes are packed. Each carton of cigarettes corresponds to a sub-container 62 and includes ten packets of cigarettes (see Figure 1 2), each packet of cigarettes defining a sub-sub-container 70 (only a few of which are referenced in Figure 1 2 of the drawings) . Accordingly, the container 20 has a uniform and repeatable geometrical layout comprising a plurality of sub-containers 62, each of which comprises a plurality of sub-containers 70. The container 20 includes fifteen sub-containers 62 or cigarette cartons which are packed in three layers, each of which includes five sub-containers 62 or cartons. The sub-containers 62 sub-divide the interior of the container 20 into fifteen regions, which each correspond with a sub-container 62.
Referring in particular to Figure 13 of the drawings, the shape and dimensions of the container 20, the sub-container 62, and the sub-sub-container 70 may be used to model the X-ray environment within the container 20. In use, the container 20 is placed on the front platform 14 and is aligned with alignment means 71 (see Figure 5) so that when it travels through the inspection tunnel 22 it is appropriately positioned below the X-ray source 26 to pass through the beam 24. The container 20 includes a bar code (not shown) which includes details of the physical dimensions of the container 20 as well as the dimensions of the sub-container 62 and the sub-sub-container 70. The apparatus 10 includes a bar code reader 72 (see Figure 1 ) which scans the bar code
and feeds the geometrical information into the processor means. The conveyor arrangement 1 8 then displaces the container 20 through the inspection tunnel 22. In particular, each sub-container 62 or carton of cigarettes includes ten sub-sub-containers 70 or packets of cigarettes as shown in Figure 1 2. Each sub-sub-compartment 70 has a height 74
(SSCH), a width (SSCW) 76, and a length (SSCL) 78. Accordingly, due to the geometrical relationship between the sub-sub-containers 70, the sub-containers 62 and the container 20 ten vertical segments or slices 80.1 to 80.1 0 may be defined. Data on the length (SSCL) and width (SSC ) of each sub-sub-container 70 is sourced from the bar code reader 72 and fed into the processor means which also controls operation of the conveyor arrangement 1 8. In use the slices or vertical segments 80 are radiated and X-rays incident upon the detector 30 are then monitored. It is however to be appreciated that the container 20 may have different shapes and dimensions in other applications and, dependent upon its contents, the vertical segments 80 may differ.
The detector 30 is a linear detector which is operable to monitor the intensity of X-rays incident upon selected regions 82.1 to 82.4 and the size of the regions 82 (see below) may be defined by the processor means dependent upon the information sourced from the bar code on the container. Dependent upon the location of a particular region 82 and upon whether a sub-container 62 and/or a sub-sub-container 70 has been removed from the container 20, the intensity of the X-rays incident upon the detector 30 varies (see Figure 14) . Further in order to avoid saturation of the detector 30, the shutter of the X-ray source 26 is only opened when the container 20 is positioned within the inspection tunnel 22.
Referring in particular to Figures 3 and 4 of the drawings, the X-ray source 26 is positioned so that the beam 24 radiates outwardly in a vertical plane perpendicular to a direction of travel of the container 20 through the inspection tunnel 22. The source 26 is controlled by the processor means so that peripheral rays 84 (see Figure 14) which extend at an angle 86 relative to perpendicular line 88 pass through upper longitudinal edges 90 of a vertical segment 80 of the container 20. In a similar fashion, rays 92 pass through lower longitudinal edges 94 of the container 20 at an angle 96 relative to the perpendicular line 88. The rays 84, 92, 88 define the regions 82.1 to 82.4 (see Figures 13 and 14) on the detector 30.
The angle 96 is provided by atan (C y ) 2 x S^) and the angle 86 is provided by atan(Cyy 12 x (S|_j - C|_|)).
From the above equations, a linear length of each selected region 82 may be calculated as follows :
Lregjon 82.1 = SH x (tan angle 86) - Cw /2;
Lregion 82-2 = CW 2;
•-region 82-3 = w /2; and Lregjon 82.4 = SH x (tan angle 86) - Cw 12.
The processing means may thus calculate the linear dimension of each selected region 82, dependent upon the physical dimensions of the container 20 which is to be inspected. As the container 20 is displaced through the inspection tunnel 22, typically at about 300 mm/s, the detector 30 is sampled at a plurality of discreet positions or distances, e.g. about every 1 .5 mm, within each vertical segment 80. An intensity profile at each of these discrete positions is
then arranged to provide an average intensity profile for a particular region 82.
In a typical image, selected regions 82.1 and 82.4 will have a relatively high intensity of X-rays, while the selected regions 82.2 and 82.3 will have substantially lower intensities of X-rays than the selected regions 82.1 and 82.4. The relatively high intensity of X-rays in the selected regions 82.1 and 82.4 is due lower absorption (the rays pass through less material of the container) compared to the absorption in the selected regions 82.2 and 82.3. The width of the detector 56 and the number of pixels in array are known and, accordingly, a mapping value can be calculated by the processor means which maps the linear distances of the selected regions 82 to physical pixel values of the detector 30.
As mentioned above, data from the detector 30 is fed into the signal processing circuitry 32 (see Figure 5) and thereafter into the image composition circuitry 34 and the image preprocessing circuitry 36.
The two-dimensional image data obtained from the detector 30 is inherently noisy which makes it difficult to extract reliable features from the image. Accordingly, signal integrity is improved by use of the Kuwahara filter algorithm followed by a minimum filter implemented by a software routine in the image preprocessing circuitry 36. The
Kuwahara filtering technique is implemented by dividing the container
20, when viewed in lateral section, into a plurality of regions (see Figure
8) . For example, the Kuwahara filtering may assume a square window of size J = K = 4L + 1 (where L is an integer) . The window is partitioned into four regions, namely region 1 , region 2, region 3 and region 4, and the mean brightness and variance in each of the four
regions is measured in use. The output value of a centre pixel 96 in the window 98 is determined and defines the mean value of the regions 1 to 4 and has the smallest variance as the container 20 is displaced through the inspection tunnel 22. The Kuwahara filtering is arranged so that the result after filtering is a smoothed image and conventional Kuwahara filtering techniques are used to obtain this. Thereafter, conventional minimum filtering techniques based on mathematical morphology for grey scale images are implemented by the preprocessing circuitry 36. The minimum filtering is implemented by assigning a minimum grey value in a region to the centre pixel 96 of that region. The minimum filtering techniques are applied to provide a more uniform image which is fed into the feature extraction circuitry 38.
In the embodiment of the invention depicted in the drawings, the processing means performs comparisons for each of the selected regions 82.1 to 82.4 in each of the vertical segments 80.1 to
80.10 in the classification circuitry 40. In particular, a rule based system determines if a particular region 82.1 to 82.4 in each vertical segment
80.1 to 80.10 is similar to an average calculated by the classification circuitry 40. The rule based system is as follows : (a) if the mean value of a particular region 82 is greater than about
1 .1 times a reference mean , the particular region 82 is rejected thereby indicating that a sub-sub-container 70 is missing;
(b) if the absolute deviation of a particular region 82 is greater than about 1 .1 5 times a reference absolute deviation or the absolute deviation is less than about 0.85 times the reference absolute deviation, the particular region 82 is also rejected.
(c) if mean value of a particular region 82 is greater than about 1 .1 2 times the reference mean and the absolute deviation is greater than
about 1 .35 the reference absolute deviation or the absolute deviation is less than about 0.65 times the reference absolute deviation, the particular region 82 is also rejected.
If a rejection is detected, a marking device 1 00 (see Figure 1 ) marks the container 20 by means of a printer 101 (see Figure 5) to indicate that it has been rejected and is optionally displaced from the front platform 14 by means of a rejection arrangement 1 03.
The operation of the apparatus 10 is broadly described in Figure 1 5 of the drawings. In use, the presence of the container 20 is sensed whereafter the barcode reader 72 (see Figure 1 ) scans the barcode and feeds the geometrical information into the processor means. The information on the barcode identifies the container 20 as well as the sub-containers 62 and sub-sub-containers 70. The shutter 21 of the X- ray source 26 is then opened and the container 20 is displaced through the inspection tunnel 22 by the conveyor arrangement 1 8. The detector
30 is then intermittently sampled to inspect the contents of the container 20. Once the container 20 has passed through the inspection tunnel 22, the shutter 21 is closed and the data source from the detector 30 is processed by the processor means. Dependent upon the outcome of the analysis, the container 20 is either accepted, whereafter it is moved through to a dispatch area, or rejected and marked accordingly by the printer 101 .
The software in the processing means initialises the frame grabber of the processor means (see Figure 1 6) and performs conventional frame grabbing techniques on the images sourced from the detector 30. A frame that has been grabbed is then fed into the image
preprocessing circuitry 36, to the feature extraction circuitry 38, and to the classification circuitry 40. The data is then analysed and a pass or fail signal is then sent to the printer 101 (see Figure 5) . The software included in the image preprocessing circuitry 36 receives information from the barcode reader 72 on the container 20 and then models the container as shown in Figures 1 1 to 14 of the drawings. The detector 30 is compensated due to decays from the top of the container 20 and data is thereafter fed into the Kuwahara and minimum filters. In the feature extraction circuitry 38, a geometrical model derived from the information on the bar code is used to determine the vertical sections 80, and the regions 82 and the mean and absolute deviation of the intensity of the beam 24 incident upon the detector 30 in each particular region 82 is then determined. After the mean and absolute deviation of each particular region 82 has been determined, a reference mean and an absolute deviation reference is then determined.
The inventors believe that the invention, as illustrated, provides effective inspection apparatus 1 0 which may remotely inspect the integrity of the contents of the container 20 using X-rays to determine whether or not a sub-container 62 or a sub-sub-container 70 has been removed from the container 20. The geometrical particulars of the container 20 and its contents are fed into the processor means which are then used to define selected regions 82 of the detector 30. As the beam 24 is radiated from a single X-ray source 26, the cost of manufacturing the apparatus 10 may be reduced.