Method and device for optically inspecting object

By using angle offset and/or illumination angle offset to capture images of different viewing angles in optical inspection, identifying abnormalities and applying masks, the problem of false rejection in transparent drug container inspection is solved, and the reliability of the inspection is improved.

CN120028341APending Publication Date: 2025-05-23KERR PHARMACEUTICAL TECHNOLOGY INSPECTION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411696342.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-11-23
Filing Date
2024-11-25
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

When optically checking the transparent drug container, it is difficult to accurately distinguish whether the abnormalities on the container are located on the lower side of the plug or the side wall of the glass, resulting in the phenomenon of mistaken rejection of qualified products.

Method used

By taking the first and second images of the object to be inspected under different conditions, using angle offsets and/or illumination angle offsets, abnormalities in the second image are identified and a mask is calculated to generate a masked image to ensure that only abnormalities in the inspection area are analyzed.

Benefits of technology

Improves the reliability of optical inspections, reduces the number of rejected qualified products, and ensures accurate identification of abnormalities in the inspection area.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120028341A_ABST
    Figure CN120028341A_ABST
Patent Text Reader

Abstract

The invention relates to a method for optically inspecting an at least partially transparent object, in particular a drug container, in which a first image and a second image of the object to be inspected are recorded, the object being recorded and / or illuminated from different angles for this purpose, the images differing from one another on the basis of an angular offset, wherein anomalies in the second image are identified, a mask is calculated based on the identified anomalies and applied to the first image in order to obtain a masked image of the object, and wherein the masked image is analyzed to identify anomalies in an inspection region of the object. The invention also relates to a corresponding inspection device and to a kit for retrofitting an existing inspection device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method and a device for optically inspecting at least partially transparent objects, in particular pharmaceutical containers, and to a kit for retrofitting existing inspection devices. Background Art

[0002] Fully automated optical inspection systems are used in many areas of technology, such as the pharmaceutical industry, the beverage industry or the semiconductor industry, in order to identify defective objects and reject them in the further production process. When inspecting pharmaceutical containers such as vials, cartridges, syringes or ampoules, it is very important to have a high inspection quality in terms of identifying anomalies (e.g. defects or contaminants in or on the container) while rejecting as few good products as possible ("false rejects").

[0003] When inspecting such objects, it is known to successively check different parts of the object to be inspected (e.g. plugs, shoulders, blocks, etc.) at different stations, wherein the test process and the test stations are designed for the parts to be inspected there. In the process, defects and contaminants or splashes may impair or distort the inspection of the part actually to be inspected in an area of ​​no interest at a specific station.

[0004] An example of this is the optical inspection of stoppers of transparent pharmaceutical containers, which is usually performed using a standard camera. In known devices, for example, an image of the underside of the stopper is taken with the aid of a camera when the container is illuminated by background light and / or incident light. Since the transparent side wall of the container is located between the underside of the stopper and the camera, it is impossible to determine whether a detected anomaly (e.g., a defect or contaminant) is located on the side wall or shoulder or on the stopper due to the lack of depth information. Therefore, all anomalies of similar size and similar contrast will be detected, whether they are small external contaminants (e.g., on the outside of the glass) or anomalies in the area to be inspected (here, the underside of the stopper). Similar problems arise, for example, when inspecting the surface of lyophilized material in a container.

[0005] Against this background, the problem addressed by the present invention is to improve the reliability of the inspection of such products and to reduce the number of rejected good products ("false rejects"). Summary of the invention

[0006] According to the invention, this problem is solved by a method according to one aspect of the invention and an inspection device according to another aspect of the invention. Advantageous embodiments of the invention can be seen in the following description.

[0007] Therefore, firstly, a method for optically inspecting at least partially transparent objects, in particular pharmaceutical containers such as vials, cartridges, syringes or ampoules, is proposed. In the method according to the invention, a first image and a second image of the object to be inspected are taken under different conditions.

[0008] In the process, images of the object are captured at different angles, i.e. from different viewing directions (angular offset of the captured images), wherein the illumination of the object can remain the same or different for the different captures or images. Alternatively or additionally, the object is illuminated from different angles. Preferably, not only the illumination angles (angular offset of the illumination) are different here, but also the illumination characteristics of the object are different when performed from different angles. The images can be captured here from a single viewing angle or from different angles.

[0009] Thus, the two images of the object to be inspected differ due to an angular offset of the shooting or viewing direction and / or due to an angular offset of the illumination. According to the invention, anomalies are identified in the second image. Anomalies are preferably identified automatically with the aid of a suitable algorithm. Anomalies identified in the second image are particularly located in the control area of ​​the object.

[0010] In the present case, any irregularity in or on an object, i.e. any feature not found in a flawless object, is referred to as an anomaly. These anomalies may therefore also be referred to as irregularities or flaws. In the present case, defects or contaminants in / on an object are particularly regarded as anomalies. In a transparent container, a defect may be, for example, a crack or inclusion in the glass wall, a crack on the underside of the stopper, a contaminant on the inner glass wall (because the stored contents are contained therein) or a contaminant on or in the contents of the container. A pure contaminant may be, for example, a splash on the outer glass wall.

[0011] In the present case, the control area is peculiar in that it constitutes an area of ​​the object to be inspected that is intended to be ignored in the anomaly inspection performed as part of the method according to the invention. The actual inspection, i.e. the search for relevant anomalies, is instead intended to be limited to an inspection area of ​​the object that is specifically different from or does not overlap with the control area. In other words, the purpose of the method according to the invention is to identify anomalies in the inspection area and not to erroneously interpret anomalies in the control area as anomalies in the inspection area. The method according to the invention masks anomalies in the control area that would impair the identification of anomalies in the inspection area (or would erroneously identify anomalies in the inspection area) during the actual inspection. For example, the inspection area may be the underside of the stopper of a vial and the control area may be the glass side wall (or a portion thereof) of the vial.

[0012] It should be emphasized here that, only within the scope of the method according to the invention, the control area is not intended to be included in the actual inspection. However, in a previous or subsequent step, the control area can of course be an inspection area to be checked (for example, inspection of the outer glass wall or shoulder), in which case the method ignores this inspection area or, where appropriate, this inspection area only constitutes the control area.

[0013] According to the invention, a mask is calculated based on the anomalies identified in the second image and applied to the first image. Preferably, the first image and the generated mask, optionally also the second image, have the same size or the same dimensions (e.g., m by n pixels). By applying the mask to the first image, a masked image is generated, which contains a masked representation of the object to be inspected in the view of the first image.

[0014] In the present case, for example, masking or applying a mask may be understood to mean in particular a change of pixel values ​​of the first image, for example by multiplying or subtracting pixel values ​​of the first image with pixel values ​​of the mask, wherein alternatively or additionally other functions such as AND or OR may be envisaged. Thus, masking may comprise completely hiding (e.g. minimum / maximum pixel value) specific image areas of the first image. The mask may be a binary mask.

[0015] According to the invention, the masked image thus obtained is the subject of the actual inspection of the presence of anomalies. Therefore, the masked image is analyzed in order to identify anomalies in the inspection area of ​​the object, such as defects or contaminants. Here, the application of a mask ensures that in this analysis, anomalies in the control area are not mistakenly identified as anomalies in the inspection area. By masking them, such "false rejections" can be reliably avoided. Anomalies that are not located in the inspection area but in the control area are masked (in the simplest case, completely hidden) and are therefore not taken into account in the actual analysis. This can be achieved by means of an angular offset introduced according to the invention in the shooting direction and / or in the illumination of the object to be inspected.

[0016] In the present case, the term "image" generally refers to an optical recording of an object by means of an imaging method. This can be, for example, a photograph produced by means of a color camera or a black and white camera. The image is in particular a digital image, i.e. a data set comprising image information in the form of numerical values. In principle, however, the image can also be an analog image.

[0017] Furthermore, in the present case, the control region and the inspection region relate to regions or parts of the object, whereas the image comprises an optical representation of a region of the object.

[0018] The object can be illuminated in particular with visible light, but in principle also with electromagnetic radiation outside the visible range (for example, the infrared, UV or X-ray range) or a combination of radiation from different spectral ranges.

[0019] In the case of an angular offset of the recording direction, the angular offset can be less than 90°, wherein in principle, any angle is conceivable depending on the geometry of the object to be inspected. Preferably, the angular offset lies in a plane which also contains the longitudinal axis of the object to be inspected. If the object is rotated during the inspection, the longitudinal axis can be the axis of rotation.

[0020] The anomalies in the second image may be identified by means of known object recognition algorithms, such as edge detection and / or threshold methods. Alternatively or additionally, algorithms based on machine learning (particularly based on deep learning) may be used to automatically identify anomalies.

[0021] In a possible embodiment, it is provided that at least one masked region of the masked image is excluded from further analysis for identifying anomalies. The at least one masked region is preferably at least partially in the representation of the examination region, so that the examination region is cleaned by masking out external anomalies, i.e. anomalies that are not in the examination region of the object.

[0022] In another possible embodiment, it is provided that the first and second images are recorded simultaneously by means of a recording device. Here, the two images can preferably be generated by at least two separate capture units of the recording device, in particular using an angular offset of the recording directions. This results in a particularly fast inspection method. Exactly two or more than two recording units can be used.

[0023] Alternatively, in principle, the first image and the second image can also be generated with the aid of a single recording unit with an angular offset, for example, by successively recording the two images from different viewing angles and moving the recording unit from the first recording position to the second recording position. It is also conceivable to move the object between the two recordings while the recording unit is stationary. It is also possible to simultaneously record the first image and the second image with the aid of a single recording unit using corresponding optics (for example, by means of a plurality of mirrors and / or prisms).

[0024] In a configuration variant in which no angular shift of the shooting direction is used to generate different images but only an angular shift of the illumination, the first image and the second image can also be generated by a simple shooting unit, for example, by using a color camera comprising a plurality of color channels (in this case, each color channel in particular uses a different color filter in order to filter out the associated spectral range (e.g., red, green, blue, wherein spectral ranges outside the optical range (such as UV or IR) are of course also possible). Alternatively, the images can be captured by means of a single shooting unit by continuous shooting with different color filters and / or polarization filters. Alternatively, a plurality of separate shooting units can be used, for example in combination with respectively assigned different color filters and / or polarization filters, to generate the first image and the second image.

[0025] The recording unit is in particular a camera, which is optionally combined with one or more color filters and / or polarization filters. The at least one camera can be, for example, a black and white camera or a color camera. A combination of different cameras (e.g., a black and white camera and a color camera) can also be used.

[0026] Illuminations from different angles may differ from each other in their properties, in particular wavelength and / or polarization. Alternatively, the first image and the second image may also be generated using the same illumination, wherein the illumination is performed successively from different angles, ie at different points in time.

[0027] In another possible embodiment, it is provided that the control region and the inspection region constitute different and in particular non-overlapping parts of the object to be inspected, wherein the control region is formed in particular by a transparent part of the object which is located in front of the inspection region in the viewing direction of the first image. In other words, from the perspective of the recording unit recording the first image, the control region is located in front of the inspection region. For this reason, anomalies in the control region can be regarded as anomalies in the actual inspection region of interest and this can be cleaned up by applying a mask.

[0028] In another possible embodiment, it is provided that the first image comprises a representation of the inspection area and a representation of the control area. The control area represented in the first image can be a part or a detail of the entire control area of ​​the object (e.g., a glass side wall of a vial photographed from the side, wherein the entire cylindrical glass wall constitutes the actual control area, the entire cylindrical glass wall optionally including the base and / or the shoulder). However, for the sake of simplicity, the representation of "the" control area will be used hereinafter. The first image preferably contains a representation of the entire inspection area (e.g., a representation of the entire underside of a stopper photographed at a specific angle).

[0029] The second image likewise comprises a representation of the control region which in particular differs from that in the first image (in particular, the representation of the examination region may be recorded at a different angle and / or the control region may be displayed in a different color in one image than in the other image).

[0030] Since both images include a representation of the control region, depending on the angular offset of the shooting direction and / or the lighting, a statement can be made as to whether an anomaly that appears in the inspection region represented by the first image is actually in the control region. In particular, under an angular offset of the shooting direction, the position of the anomaly in the control region also changes.

[0031] When using an angular offset of the shooting directions, the representations of the control area in the first and second images may relate to slightly different details of the actual control area of ​​the object. Preferably, however, the respective detected parts of the control area overlap to a large extent.

[0032] In another possible embodiment, it is provided that the object to be inspected is recorded from different angles, wherein in particular the second image is recorded at such an angle that the second image does not include a representation of the inspection area. In other words, the second image detects only anomalies in the control area (they can also be referred to as external anomalies) and thus not any anomalies in the inspection area, since the inspection area is not even recorded or represented. Therefore, the recording unit recording the second image in particular only "sees" the control area (or details thereof) and not the inspection area.

[0033] In another possible embodiment, it is provided that the transformed image is generated from the second image by means of a coordinate transformation. In this case, the transformation makes the representation of the object in the second image, in particular the representation of the control area in the second image, consistent with the representation of the object in the first image, in particular the representation of the control area in the first image. In other words, the second image is transformed onto the view in the first image. The coordinate transformation can also optionally transform any distortions that may be present due to an angular offset of the recording direction. Image registration algorithms known per se can be used for the transformation.

[0034] If two separate recording units are used to record the two images, at least one of the recording units can optionally be calibrated so that a planar image and / or a transformed image is automatically generated. The calibration can be performed before the inspection method by means of corresponding calibration measurements, for example, by recording a defined geometric pattern (for example, a grid composed of lines and / or points) with an angular offset. The angular offset used for the calibration measurement then preferably corresponds to the angular offset between the recording directions of the method according to the invention. The distortion of the geometric pattern generated in the test image thus obtained can be used by means of a calibration algorithm so that the original geometric pattern or the planar image generates a calibration image. The calibration or the calculation of the distortion caused by the angular offset can optionally be performed as part of the above-mentioned transformation.

[0035] Besides the angular offset, the transformation depends in particular on the properties of the object to be inspected (eg diameter, height, etc.).

[0036] For different objects to be inspected (eg vials of different sizes), different transformations (or optionally calibrations) may be used. They may preferably be stored as existing files and may be used depending on the object geometry.

[0037] A mask for masking the first image is calculated based on the transformed second image. In this case, in particular, the mask is generated using those image areas or pixels in the transformed image that correspond to the anomalies identified in the second image. In this case, those pixels in the transformed image that were identified as anomalies in the second image by means of object recognition can correspond to pixels of the image mask associated with their arrangement. In the simplest case, a binary image mask is generated in which the transformed pixels of the identified anomaly / anomalies are hidden or set to a specific value.

[0038] Since the mask is specifically generated from the second image transformed onto a representation of the first image, the mask can be directly applied to the first image and corresponding image areas or pixels in the first image are altered (in the simplest case, hidden).

[0039] In another possible embodiment, it is provided that a plurality of pairs of first and second images of the object to be inspected are recorded and analyzed, wherein the object is moved, in particular rotated, between the recording of the image pairs. Thus, the inspection area can be inspected from different directions and / or a larger inspection area can be inspected. The object is preferably rotated continuously, wherein the first and second images are recorded during the rotation of the object. Alternatively, a discontinuous rotation can be used, i.e. a rotation in successive, discrete steps, wherein after each rotation through a specified angle (e.g. 90°), the first and second images are recorded and the images are analyzed, as described above.

[0040] In general, it can be provided that during the inspection, the object moves past the preferably fixed recording device, in particular in a translational manner. At the same time, the object can be rotated, as described above. In this case, the object is preferably illuminated by means of a line light source, so that an object moving over a certain distance can be adequately illuminated.

[0041] In another possible embodiment, it can be provided that the object is illuminated differently from different angles, wherein a first illumination of the object is performed at a first angle and a second illumination of the object is performed at a second angle. The angular offset can be greater than 90°, wherein any angle is conceivable per se depending on the geometry of the object to be examined.

[0042] In addition to the illumination angle, the first illumination and the second illumination preferably also differ in their wavelength and / or their polarization. The latter can be achieved by corresponding polarization filters located between the relevant illumination unit and the object. Alternatively or additionally, the same illumination can be performed from different angles at different points in time (temporal shift of the illumination).

[0043] The first illumination and the second illumination may also come from a single illumination unit at different points in time, i.e., the object is first illuminated from a first direction and then illuminated at a second angle with a different wavelength and / or polarization. Alternatively, a plurality of separate illumination units may be provided that illuminate the object simultaneously from different directions.

[0044] In a preferred embodiment, certain properties, in particular at least the wavelength, of the first and / or second illumination can be changed in a targeted manner. Thus, the illumination properties can be adapted to the object to be inspected, for example, to the color of the liquid contained in the container or the color of the stopper to be inspected.

[0045] In another possible embodiment, it is provided that the inspection region and at least a part of the control region of the object are illuminated by the first illumination. Therefore, both the corresponding part of the control region and the inspection region are represented in the first image. In contrast, at least a part of the control region of the object is illuminated by the second illumination, in particular without illuminating the inspection region. Therefore, if only the second illumination is recorded in the second image, the inspection region is not visible in the second image (even though in principle it would be located in the image area of ​​the recording unit recording the second image). Analogously to the above-described case of an angularly offset recording direction, the inspection region is therefore not represented in the second image because it is not illuminated.

[0046] In another possible embodiment, it is provided that the second image includes representations of objects generated only by the second illumination, but not by the first illumination (which also detects the examination region). Thus, in the second image, only anomalies that are located in the control region and not in the examination region are visible. If the two images are recorded from the same recording direction with angularly offset illumination, a mask can be generated directly from the image regions or pixels that are identified as anomalies in the second image.

[0047] The recording unit may be a color camera. In this case, the first image and the second image may be recorded simultaneously by means of the same camera (i.e., different illuminations are performed simultaneously at different wavelengths). Therefore, the information represented in the relevant illumination is stored in different color channels (e.g., green and red) or encoded by different colors, so that the second image can be "generated" or selected by selecting the associated color channel.

[0048] The spectrally different representations are preferably separated by means of filters (e.g. low-pass, high-pass, band-pass filters) and two images are thus generated (when the second image is taken, the first illumination is blocked by the filter). The latter also applies to the case of illuminations of different polarization, whose associated representations can be separated by polarization filters.

[0049] The use of angularly offset recording directions and the use of angularly offset and different illumination can also be combined with one another. In this case, the first image and the second image are each recorded with different illumination and different viewing angles, preferably using two separate recording units. These can be combined with corresponding color filters in order to let through only the relevant illumination.

[0050] By combining these two principles, external anomalies can be eliminated more accurately and reliably.

[0051] It can be provided that the object can be illuminated by a third illumination or even more than three different illuminations. To this end, the inspection device can include three or more illumination units, which preferably all illuminate the object from different directions or angles. They can realize a combination of transmitted light and incident light illumination. Here, the first image can optionally be generated by illuminating the object with two or more colors at the same time. Alternatively or additionally, the second image can also be generated by illuminating the object with two or more colors at the same time (at appropriate angles).

[0052] The invention also relates to an inspection device for optically inspecting at least partially transparent objects, in particular pharmaceutical containers, by means of the method according to the invention. The inspection device according to the invention comprises a recording device for generating a first image and a second image of the object to be inspected, an illumination device, and an analysis component. The object can be recorded from different angles by means of the recording device and / or the object can be illuminated from different angles by means of the illumination device, as has already been described above for the method according to the invention.

[0053] The analysis means is configured to analyze the generated images that differ from each other based on an angular offset to identify anomalies in the second image, to calculate a mask based thereon, to apply the mask to the first image, and to analyze the masked image thus obtained for the presence of anomalies in the inspection area of ​​the object, as has been described above for the method according to the invention. The analysis means may be a software module that can be executed by a computer unit, in particular a computer unit of the inspection device. Alternatively, the analysis means itself may constitute the computer unit.

[0054] This clearly results in the same properties and advantages as the method according to the invention, and these are therefore mostly not described again.All of the above comments on possible embodiments of the method according to the invention also apply to the inspection device according to the invention.

[0055] The inspection device can preferably include a device for rotating the object in order to enable the object to be filmed and / or illuminated from different sides and thus inspected. In this case, the object can preferably be rotated continuously. Alternatively or additionally, the inspection device can include a device for moving the object in a translational manner in order to move the object past the in particular fixed filming and illumination device.

[0056] In another possible embodiment, it is provided that the recording device comprises two separate recording units, in particular cameras, by means of which two images can be recorded simultaneously from different angles. The inspection device preferably comprises an adjustment device, by means of which at least one recording unit can be moved relative to the object. Thus, images can be recorded from different distances and / or angles and / or the arrangement of the recording units can be adapted to the object to be inspected. Thus, the inspection device can be used flexibly for objects of different types and / or sizes.

[0057] In another possible embodiment, it is provided that the lighting device comprises at least two separate lighting units, by means of which the object can be illuminated simultaneously from different angles. In particular, the illuminations generated by the lighting units differ from one another in their wavelength and / or polarization at least at the location of the object. This can be achieved, for example, by means of an arrangement of color filters and / or polarization filters, which can likewise be part of the inspection device. The inspection device preferably comprises an adjustment device, by means of which at least one lighting unit can be moved relative to the object.

[0058] At least one lighting unit, preferably all lighting units can be LED lamps that each emit light in one or more selectable colors. One lighting unit, multiple lighting units or all lighting units can be configured as point light sources or "spotlight sources", line light sources or area light sources. Combinations of point light sources, line light sources and / or area light sources are also conceivable. When the object to be inspected moves past a fixed lighting device, preferably a line officer is used to ensure that there is sufficient lighting over a relatively long distance.

[0059] The invention also relates to a kit for retrofitting existing inspection devices, the kit comprising the analysis means and the recording device and / or the lighting device of the above-mentioned inspection device. Thus, existing inspection devices can be retrofitted in a simple and cost-effective manner so that they can perform the inspection method according to the invention. The above comments on the embodiments of the various components of the method or the inspection device according to the invention also apply to the kit according to the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Further features, details and advantages of the invention can be seen in the following exemplary embodiments which are explained with reference to the accompanying drawings, in which:

[0061] Figure 1 is a schematic side view of an inspection device according to a first exemplary embodiment of the present invention;

[0062] Figure 2a to Figure 2c Shown by Figure 1 An example of an anomaly indicated by the inspection device in the control area and the anomaly is masked;

[0063] Figure 3 is a schematic side view of an inspection device according to a second exemplary embodiment of the present invention; and

[0064] Figures 4a to 4f Shown by Figure 3 Examples of anomalies indicated by the inspection device in the control area and these anomalies are masked. DETAILED DESCRIPTION

[0065] Figure 1is a schematic side view of a first exemplary embodiment of an inspection device 100 according to the invention. In the exemplary embodiment shown here, the object 40 to be inspected is an inspection bottle or vial 40, wherein it is emphasized that the inspection method according to the invention can be used for any at least partially transparent object, such as an ampoule, a syringe, a cartridge or other container.

[0066] The vial 40 includes a transparent side wall 44 including a base and a shoulder that tapers to a neck. A stopper 42 is disposed at the neck of the vial 40, which tightly seals the vial 40. Figure 1 In the embodiment, the contents of vial 40 are indicated by reference numeral 46 (this may be, for example, a liquid, a powder or a lyophilisate).

[0067] In the present exemplary embodiment, an inspection of stoppers is intended to be performed, wherein the underside 43 of the stopper 42 is intended to be inspected for anomalies, i.e. in particular defects and contaminants. This is done with the aid of an optical recording device 20, which in the exemplary embodiment shown comprises two cameras 21, 22, wherein the recording or viewing directions 23, 24 are angularly offset from one another. Thus, images of the vial 40 are recorded from different viewing angles and then analyzed, for example, by a computer unit (not shown) of the inspection device 100. In this case, the first camera 21 is directed obliquely from below to the side of the vial 40, so that it "sees" the underside 43 of the stopper. Thus, the first image generated by the first camera 21 comprises a representation of the underside 43 of the stopper, making it possible to inspect this underside of the stopper for anomalies. In this inspection, the underside 43 of the stopper thus constitutes the inspection region 10 of interest.

[0068] In such an optical inspection, the problem arises that the transparent glass wall 44 of the vial 40 (which in the case shown includes a shoulder) is located between the stopper underside 43 or the inspection area 10 and the first camera 21. Therefore, due to the lack of depth information, an optical inspection based solely on the image from the first camera 21 will not be able to provide reliable statements about the presence of anomalies in the inspection area 10, since anomalies identified in the first image may also be on or in the glass sidewall 44. However, in the inspection considered here, the glass sidewall 44 of the vial 40 constitutes only a control area 12, which (at least in the inspection considered here) is not intended to be inspected for anomalies, but is always in the field of view of the filming device 20 during the inspection of the stopper.

[0069] exist Figure 1In the exemplary embodiment of the embodiment of the present invention, anomalies in the control area 12 can be reliably identified because the second camera 22 observes or represents the vial 40 at an offset angle. In the exemplary embodiment shown, the angular offset is selected so that the second camera 22 does not "see" the stopper underside 43, but only represents the control area 12, i.e., the glass side wall 44. For this purpose, the second camera 22 can be pointed at the vial 40 from the side (i.e., at about 90° to the longitudinal axis of the vial 40). During the stopper inspection, an angular offset of less than 90° can be advantageous, but other angles are not excluded. In addition, the angular offset is also conveniently selected depending on the type and geometry of the object to be inspected and, in principle, is not limited to a specific value. In the exemplary embodiment shown, the angular offset is located in a plane that also contains the longitudinal axis or rotation axis 41 of the vial 40 (rather than being approximately transverse to the longitudinal axis or rotation axis 41).

[0070] The second camera 22 generates a second image in which the inspection area 10 is therefore not represented and the control area 12 is represented at a different angle than in the first image. Therefore, the position of the anomaly in the control area 12 is also changed, so that this anomaly can be identified as an external anomaly, i.e., not in the inspection area. More specifically, since the second camera 22 does not represent the inspection area 10, the anomaly identified in the second image must be such an external anomaly. Therefore, a "false rejection" is possible (at least based on the stopper inspection; however, depending on the type of anomaly, at another inspection station that inspects the glass sidewall for anomalies, the anomaly can indeed be identified with certainty and the vial 40 can ultimately be rejected).

[0071] In principle, the object 40 can be illuminated in any manner. In the exemplary embodiment shown, a combination of transmitted light illumination (in particular by means of an area light source 38) and incident light illumination (in particular by means of an LED line light source 39) is used, wherein the latter provides the illumination required by the first camera 21 for representing the stopper underside 43. However, other illuminations (for example, transmitted light illumination for the stopper underside 43) can also be used. In principle, the illuminations used can be of the same color or of different colors.

[0072] In order to identify anomalies on the glass side wall 44 that affect the plug inspection and eliminate them from the analysis of the inspection area 10, according to the invention, a mask is calculated that is applied to the first image from the first camera 21. Figure 1 In the method (3D method or angle offset of shooting direction), the mask is calculated based on the second image because the second camera 22 can only detect abnormalities in the control area 12. The abnormalities in the second image can be identified based on known object recognition algorithms (e.g., edge detection, threshold methods, and / or machine learning-based methods).

[0073] Since the calculated mask is intended to be applied to the first image showing the inspection area 10, it is necessary to transform the second image onto the representation of the first image and vice versa. Thus, for example, the anomaly captured by the second camera 22 is transformed into the coordinate system of the first image so that image areas or pixels belonging to the anomaly identified in the second image can be masked in the first image. In this case, the mask is generated from the transformed second image. In the transformation, possible distortions, for example due to angular offsets, can be taken into account.

[0074] Alternatively, the first image is also transformed onto a representation of the second image, and the mask can be generated directly from the untransformed second image. Figure 1 In the example of , the first camera 21 is positioned obliquely relative to the vial 40 , so that the transformation can also be performed by a corresponding calibration of the first camera 21 , wherein in particular the first camera 21 is calibrated such that a planar first image is generated in which distortions caused by the oblique position are equalized.

[0075] The calculated mask is then applied to the first image. This may involve multiplying the first image and the image mask, but preferably subtracting them, wherein a logical function (e.g., AND or OR) may also be used. The masked first image thus obtained then comprises masked image regions 60 corresponding to the locations of the external anomalies 50 in the control region 12. This masked first image may then be analyzed for anomalies in a conventional manner, in particular with the aid of the object recognition algorithm. The anomalies identified in the following analysis are located in the examination region 10 and are therefore relevant to the current examination.

[0076] Figure 2a to Figure 2c Is used according to Figure 1 The inspection device of the exemplary embodiment in FIG. 1 inspects and has different views of an image of a vial 40 with an anomaly 50 located on the glass sidewall 44 . Figure 2a An image recorded by the second camera 22 (= second image 2 ) is shown, in which the anomaly 50 is visible as a light grey spot in the glass side wall 44 (see arrow). Figure 2b A corresponding first image 1 is shown, taken by the first camera 21. It is evident that the external anomaly 50 is located on the stopper underside 43 and thus in the middle of the inspection area 10. Therefore, based on the first image 1 alone, this anomaly 50 could be wrongly identified as an anomaly on the stopper underside 43.

[0077] Figure 2c A detail of the masked first image 4 is shown, wherein pixels corresponding to external anomalies 50 identified in the second image 2 are masked as black image areas 60 .

[0078] As in Figure 1As indicated by line 41 , the vial 40 can optionally be rotated by means of a rotation device about the longitudinal axis 41 in order to take the first image 1 and the second image 2 from different sides.

[0079] Figure 3 , a second exemplary embodiment of an inspection device 100 according to the invention is also schematically shown in FIG. 1 , based on a vial 40 for stopper inspection. The principle for creating the mask is not an angular offset of the recording unit here, but an angular offset of the illumination and the use of differently coded illuminations 34, 35, 36. In this exemplary embodiment, the recording device 20 comprises only one single camera 26, which records the vial 40 obliquely from below and thus represents both the control area 12 and the inspection area 10, i.e. the stopper underside 43.

[0080] In this exemplary embodiment, the lighting device 30 includes a plurality of lighting units 31, 32, 33 that can be configured as LED line light sources. However, other lighting units (eg, area light sources, point light sources, or a combination of the lighting units) can be used depending on the object 40 to be inspected and the inspection method.

[0081] The first lighting unit 31 illuminates the vial 40 obliquely from below with a first color (e.g., blue), so that the stopper underside 43 is illuminated by the first lighting 43 and detected by the camera 26. The second lighting unit 33 illuminates the vial 40 at an offset angle, so that the second lighting 36 does not reach the stopper underside 43, but only reaches the glass sidewall 44, i.e., illuminates the control area 12. The second lighting 36 is a different color from the first lighting 34 (e.g., green).

[0082] The camera 26 is in particular a color camera comprising at least two sensors and corresponding color filters and beam splitters associated with the respective sensors, so that the camera 26 provides at least two (three in the exemplary embodiment shown) images or color channels corresponding to the number of different illuminations.

[0083] For example, only the areas of the vial 40 illuminated by means of the first illumination 34 (i.e. the control area 12 and the inspection area 10) can be represented in the first image 1, and only the areas of the vial 40 illuminated by means of the second illumination 36 (i.e. the control area 12) can be represented in the second image 2. The difference in the representation of the first image 1 and the second image 2 therefore results from the angular offset of the first illumination unit 31 and the second illumination unit 33 and the different colors of the first illumination 34 and the second illumination 36. As an alternative or in addition to the difference in spectral color, the illuminations 34, 36 can also differ in their polarization, wherein for this purpose it would be necessary to use corresponding polarization filters.

[0084] Based on a specific example, Figure 4a(first image 1', in the example described the blue channel) and Figure 4b The image thus obtained is shown in (second image 2, in the example in question the green channel). The underside 43 of the stopper is represented in the first image 1', wherein an anomaly 50 drawn in light grey is visible in the image field (see also Figure 4c ). They are clearly visible in the second image 2. They are therefore external anomalies 50 on the glass side wall 44.

[0085] exist Figure 3 In the exemplary embodiment shown, there is a third lighting unit 32 which illuminates the vial 40 obliquely from below in a third color (e.g. red) (= third lighting 32), but is located on the side of the vial 40 opposite to the first lighting unit 31. This generates a third color channel and thus another first image 1 (see Figure 4c ), which also shows the stopper underside 43. This additional lighting unit 32 is not necessary, but can improve the inspection result (depending on the color of the stopper 42 and the vial content 46, the desired color or lighting unit 31, 32 can be selected; however, alternatively, the lighting units 31, 33 can also be configured so that they emit light with an adjustable color). The lighting 34, 35 of the first lighting unit 31 and the third lighting unit 32 can also be collectively referred to as first lighting. It goes without saying that there can be more than three lighting units.

[0086] Alternatively or additionally, two or more images of the control area, ie a plurality of second images, can also be generated using different illuminations, for example in order to be able to optimally detect anomalies with different absorption properties.

[0087] Instead of different illumination (different wavelength and / or polarization), the same illumination can also be performed from different angles but with a certain time offset. Thus, the first image and the second image can be separated by the time offset. In this case, a simpler recording unit can then be used, for example a black and white camera or a camera comprising a single sensor.

[0088] In the principle considered here (angular offset of illumination), no transformation between the first image 1 ′ and the second image 2 is necessary, since the images 1 ′, 1 ″, 2 are taken by the same camera 26 . Therefore, the mask can be calculated directly from the second image 2 . Figure 4e It is shown that once the anomaly 50 represented in the second image 2 has been identified by means of object recognition, the mask generated from the second image is used as a binary image mask.

[0089] Figure 4d An image 4 ′ is shown which is masked and used for further searching for anomalies in the examination region 10 after application of the mask 3 to the first image 1 ′. Figure 4fThe corresponding masked image of the other color channel is shown in 4" Figure 4c The first image in 1”).

[0090] The first image may also constitute a superposition of different color channels (in the specific example, thus a superposition of images 4a and 4c).

[0091] it goes without saying, Figure 1 and Figure 3 The principles of the two exemplary embodiments in can be combined with each other, ie for example two cameras 21 , 22 with different viewing angles combined with illumination from different angles by means of different colors and / or polarizations.

[0092] List of reference numerals:

[0093] 1, 1', 1" first image

[0094] 2, 2', 2" Second Image

[0095] 3 Mask

[0096] 4 Masked image

[0097] 10. Inspection Area

[0098] 12 Control Area

[0099] 20 Filming Equipment

[0100] 21. First shooting unit (camera)

[0101] 22 Second shooting unit (camera)

[0102] 23 Shooting direction of the first shooting unit

[0103] 24 Shooting direction of the second shooting unit

[0104] 26 Shooting unit (camera)

[0105] 30 Lighting units

[0106] 31 First lighting unit

[0107] 32 Second lighting unit

[0108] 33 Third lighting unit

[0109] 34 First Lighting

[0110] 35 Second Lighting

[0111] 36 Third Lighting

[0112] 38 lighting units (area light sources)

[0113] 39 Lighting unit (line light source)

[0114] 40 Objects to be inspected

[0115] 41 Axis of rotation / longitudinal axis of object

[0116] 42 plug

[0117] 43 Plug bottom

[0118] 44 Glass Wall

[0119] 46 Contents

[0120] 50 Anomalies in Control Area

[0121] 60 Masked area.

Claims

1. A method for optically inspecting an at least partially transparent object (40), in particular a pharmaceutical container, comprising the following steps: - taking a first image (1) and a second image (2) of an object (40) to be inspected, wherein for this purpose the object (40) is taken and / or illuminated from different angles and the images (1, 2) differ from one another due to an angular offset, - identifying anomalies (50) in said second image (2), - calculating a mask (3) based on said identified anomalies (50), - applying said mask (3) to said first image (1) to obtain a masked image (4) of said object (40), and - analyzing the masked image (4) to identify anomalies in the inspection region (10) of the object (40).

2. The method according to claim 1, wherein at least one masked area (60) of the masked image (4) is excluded from further analysis for identifying anomalies, wherein the masked area (60) is preferably at least partially in the representation of the examination area (10).

3. The method according to claim 1 or 2, wherein the first image (1) and the second image (2) are captured simultaneously by means of a recording device (20), wherein the recording device (20) preferably comprises at least two separate recording units (21, 22), in particular cameras.

4. A method according to any of the preceding claims, wherein the control area (12) and the inspection area (10) constitute different and preferably non-overlapping parts of the object to be inspected (40), wherein the control area (12) is particularly formed by a transparent part (44) of the object (40) located in front of the inspection area (10) in the viewing direction (23) of the first image (1).

5. A method according to any one of the preceding claims, wherein the first image (1) comprises a representation of the inspection area (10) and a representation of the control area (12), wherein the second image (2) also comprises a representation of the control area (12), which is in particular different from the first image (1).

6. The method according to claim 5, wherein the object (40) is recorded from different angles, wherein in particular the second image (2) is recorded at an angle such that the second image (2) does not include a representation of the examination region (10).

7. The method according to any one of the preceding claims, comprising the steps of: - generating a transformed image from the second image (2) by means of a coordinate transformation, the coordinate transformation making the representation of the object (40), in particular the representation of the control area (12), in the second image (2) consistent with the representation of the object (40), in particular the representation of the control area (12), in the first image (1), and - calculating said mask (3) based on said transformed image, wherein this step preferably comprises identifying areas in said transformed image corresponding to said identified anomalies (50) in said second image (2).

8. A method according to any one of the preceding claims, wherein a plurality of first image (1) and second image (2) pairs of the object to be inspected (40) are captured and analyzed, wherein between the capturing of the first image (1) and second image (2) pairs the object (40) is moved, preferably rotated, particularly preferably continuously rotated.

9. The method according to claim 1 , wherein the object (40) is illuminated from different angles, wherein a first illumination (34, 35) of the object (40) is performed at a first angle and a second illumination (36) of the object (40) is performed at a second angle, wherein the first illumination (34, 35) and the second illumination (36) preferably differ in their wavelength and / or polarization, wherein The first illumination (34, 35) and the second illumination (36) originate in particular from a single illumination unit at different points in time, or originate from different illumination units (31, 32, 33) simultaneously.

10. A method according to claim 9, wherein the inspection area (10) and at least part of the control area (12) of the object (40) are illuminated by the first illumination (34, 35), and at least part of the control area (12) of the object (40) is illuminated by the second illumination (36), but in particular the inspection area (10) is not illuminated.

11. A method according to claim 9 or 10, wherein the second image (2) comprises a representation of the object (40) generated only by the second illumination (36), wherein the second image (2) is preferably generated using at least one filter that blocks the first illumination (34, 35).

12. An inspection device (100) for optically inspecting an at least partially transparent object (40), in particular a pharmaceutical container, by means of a method according to any of the preceding claims, comprising a photographing device (20) for generating a first image (1) and a second image (2) of the object (40) to be inspected, an illumination device (30), an analysis component and preferably a device for rotating the object (40), wherein the object (40) can be photographed from different angles by means of the photographing device (20) and / or the object can be illuminated from different angles by means of the illumination device (30), wherein the analysis component is configured to analyze the generated images (1, 2) that differ from each other based on an angular offset to identify anomalies (50) in the second image (2), to calculate a mask (3) based on the identified anomalies (50), to apply the mask (3) to the first image (1) and to analyze the masked image (4) obtained thereby for the presence of anomalies in the inspection area (10) of the object (40).

13. An inspection device (100) according to claim 12, wherein the photographing device (20) comprises two separate photographing units (21, 22), in particular cameras, by means of which two images (1, 2) can be simultaneously photographed from different angles, wherein at least one of the photographing units (21, 22) can preferably be moved relative to the object (40) by means of an adjustment device.

14. An inspection device (100) according to claim 12 or 13, wherein the lighting device (30) comprises at least two separate lighting units (31, 32, 33), preferably LED lamps, by means of which the object (40) can be illuminated simultaneously from different angles, wherein the illumination (34, 35, 36) generated on the object (40) by the lighting units (31, 32, 33) differ from each other in particular in terms of their wavelength and / or polarization, wherein at least one lighting unit (31, 32, 33) can preferably be moved relative to the object (40) by means of an adjustment device.

15. A kit for retrofitting an existing inspection device, comprising a photographing device (20) and / or a lighting device (30) of the inspection device (100) according to any one of claims 12 to 14.