Liquid beverage can foreign object visual inspection method
By collecting forward and reverse images and reflected light information from glass bottled products and combining them with comparison technology, the problem of insufficient accuracy in detecting foreign objects inside glass bottled products in existing technologies has been solved, and accurate identification and judgment of foreign objects have been achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ANHUI XIANGZHISU BIOTECHNOLOGY CO LTD
- Filing Date
- 2026-04-22
- Publication Date
- 2026-07-24
AI Technical Summary
Existing visual inspection technologies are not accurate enough in detecting foreign objects inside glass bottled products, especially in complex environments where it is difficult to accurately identify foreign objects.
The same visible light camera and multispectral camera were used to collect image information and reflected light information of the glass bottle in both the front and back directions. Abnormal areas were identified by comparing the images and the reflected light. Combined with the characteristic that the front and back states of the jarred glass bottle are consistent, the interference of ambient light and other variables was eliminated, and foreign objects were identified by utilizing the unique spectral characteristics of the substance.
It enables accurate detection of foreign objects inside glass bottled products, and can identify foreign objects that cannot be seen by ordinary cameras, thus improving the accuracy and reliability of detection.
Smart Images

Figure CN122448867A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of visual inspection of packaging, and in particular to a method for visual inspection of foreign objects in liquid beverage cans. Background Technology
[0002] With the application of visual inspection technology in packaging, it has become a core link in modern manufacturing, especially in the food and beverage and pharmaceutical industries, to ensure product quality, improve efficiency, and avoid recall losses. Visual inspection uses computer vision systems to replace human eyes and perform high-speed and accurate "physical examinations" on the packaging of each product on the production line. When inspecting products packaged in glass bottles for liquid beverages, it is necessary not only to identify foreign objects on the outer surface of the glass bottle, but also to judge impurities and foreign objects inside the bottle to ensure the product meets the qualification requirements.
[0003] In existing technologies, high-definition cameras are primarily used to inspect glass-bottled products. By acquiring image information of the glass-bottled products, preset models or AI deep learning algorithms are used to distinguish between genuine defects and harmless interference, thereby enabling the identification of surface impurities in glass-bottled products even in complex environments. However, due to the influence of ambient light and the obstruction caused by the glass bottle, existing visual inspection technologies suffer from insufficient accuracy in detecting foreign objects inside glass-bottled products. Therefore, how to achieve more accurate and comprehensive foreign object detection in glass-bottled products is the fundamental problem that this invention aims to solve. Summary of the Invention
[0004] To achieve more accurate and comprehensive foreign object detection in glass bottled products, this application provides a visual inspection method for foreign objects in liquid beverage cans, employing the following technical solution:
[0005] A visual inspection method for foreign objects in liquid beverage cans includes:
[0006] Step 1: Sequentially acquire image information of the front and back of the glass bottle using the same visible light camera; sequentially acquire reflected light information of the front and back of the glass bottle using the same multispectral camera.
[0007] Step 2: Determine the first abnormal region by comparing the forward and reverse image information; determine the second abnormal region by comparing the forward and reverse reflected light information; perform the first foreign object visual detection process for the jarred glass bottle based on the first and second abnormal regions.
[0008] Step 3: After the labeling process is completed on the glass jars, the label image information of the glass jars is acquired by a visible light camera, and the second foreign object visual detection process of the glass jars is carried out by using the label image information.
[0009] Optionally, the process of determining the first abnormal region includes:
[0010] The image information in the forward and reverse directions is preprocessed separately. The preprocessing process includes grayscale conversion, filtering and noise reduction, and image enhancement.
[0011] The preprocessed image is segmented and features are extracted to obtain forward edge contour groups and reverse edge contour groups. The forward edge contour groups and reverse edge contour groups are then compared for overlap, and the first abnormal region is determined based on the comparison results.
[0012] Optionally, the process of performing overlap comparison includes:
[0013] S1. Using the positive edge contour group as a reference, overlap the negative edge contour group with the positive edge contour group;
[0014] S2. Obtain the reverse edge contour in the reverse edge contour group that is closest to the centroid of each positive edge contour in the positive edge contour group, and pair the reverse edge contour with the positive edge contour.
[0015] S3. Determine if there are any unpaired positive edge contours:
[0016] If so, the positive edge contour is classified as the first abnormal region, and step S4 is performed;
[0017] If not, proceed to step S4;
[0018] S4. Determine if there are unpaired reverse edge contours:
[0019] If so, the reverse edge contour is classified as the first abnormal region, and step S5 is performed;
[0020] If not, proceed to step S5;
[0021] S5. Determine whether the same reverse edge contour is paired with multiple forward edge contours:
[0022] If so, the reverse edge contour and multiple positive edge contours are classified as the first abnormal region, and step S6 is performed.
[0023] If not, proceed to step S6;
[0024] S6. Obtain the overlapping area of the paired forward edge contour and reverse edge contour, and obtain the ratio of the overlapping area to the area of the forward edge contour and the area of the reverse edge contour respectively.
[0025] If one or more of the ratios between the overlapping area and the positive edge contour area and the overlapping area and the negative edge contour area are less than a preset ratio, then the positive edge contour and the negative edge contour are classified as the first abnormal region.
[0026] Optionally, the process of determining the second anomaly region includes:
[0027] The reflected light information in the forward and reverse directions is segmented to obtain the reflected light information of the forward and reverse bottling glass bottle areas;
[0028] The reflectivity of each pixel at different wavelengths is obtained based on the reflected light information of each pixel. The positive glass bottle filling area and the negative glass bottle filling area are mapped to each pixel. Each positive pixel is compared and analyzed with the corresponding negative pixel. The second abnormal area is determined based on the comparison and analysis results of each pixel.
[0029] Optionally, the comparative analysis process includes:
[0030] pass Calculate the similarity (similarity) between two pixels in the forward-loading and reverse-loading glass bottle regions; where x and y are the coordinates of the two pixels, f(x, y) represents the preset risk coefficient corresponding to the region where the similar point at coordinates (x, y) is located, n is the number of wavelength values selected, i is a positive integer, and i∈[1, n]. This represents the reflectance of a single pixel in the ith wavelength value of the condensing area of a forward-facing glass bottle. This represents the reflectance of a single pixel in the reverse glass bottle bottling area corresponding to the i-th wavelength value. The weighting coefficient for the i-th wavelength value. The slope value is obtained by linearly fitting a single pixel in the bottling area of a front-facing glass bottle based on different wavelengths and corresponding reflectivities. The slope value is obtained by linearly fitting a single pixel in the reverse glass bottle filling area based on different wavelengths and corresponding reflectivities. For adjustment coefficients;
[0031] The state of a pixel is determined based on its similarity, and the second abnormal region is identified based on the state of each pixel.
[0032] Optionally, the process of determining the second anomaly region also includes:
[0033] The similarity of pixels is compared with a preset similarity threshold. If the similarity is lower than the preset similarity threshold, both forward and reverse pixels are considered as abnormal pixels.
[0034] The region consisting of all consecutive abnormal pixels is designated as the second abnormal region.
[0035] Optionally, the initial foreign object visual inspection process for jarred glass bottles includes:
[0036] The first and second abnormal regions are judged:
[0037] If both the first and second abnormal regions are empty, then the visual detection result of the first foreign object is judged to be normal.
[0038] If the second abnormal region is not empty, then the visual detection result of the first foreign object is judged to be abnormal;
[0039] If the first abnormal region is not empty but the second abnormal region is empty, then the visual detection result of the first foreign object is judged to have an abnormal risk.
[0040] Optionally, the second foreign object visual inspection process for jarred glass bottles includes:
[0041] Based on OCR, text recognition is performed on the label image information, and the accuracy of the information is judged based on the text recognition content.
[0042] Based on OCV, the label image information is compared with the preset label template, and the label status is determined according to the similarity comparison results.
[0043] In summary, this application includes at least one of the following beneficial technical effects:
[0044] This invention utilizes the characteristic that the forward and reverse states of a glass bottle are consistent. By comparing the image information of the bottle itself in both forward and reverse orientations and by comparing reflected light, it can eliminate the interference of ambient light and other variables, thus achieving accurate identification of foreign objects and impurities. It can also identify foreign objects that cannot be seen by ordinary cameras by penetrating the packaging through the unique spectral characteristics of the substance. Furthermore, after obtaining the first abnormal area and the second abnormal area, it can make an accurate foreign object identification by combining the detection results of the two. Attached Figure Description
[0045] Figure 1 This is a flowchart of the steps involved in the visual inspection method for foreign objects in liquid beverage cans. Detailed Implementation
[0046] The embodiments of this application are described in detail below, and examples of the embodiments are shown in the accompanying drawings.
[0047] In the description of this specification, the references to "certain embodiments," "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples" refer to specific features, structures, materials, or characteristics described in connection with the described embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0048] This application discloses a visual detection method for foreign objects in liquid beverage cans, referring to... Figure 1 The method includes steps one through three, which involves two visual inspection processes. The first foreign object visual inspection process mainly detects foreign objects inside and on the surface of the jar to ensure that the product quality meets requirements and the outer surface meets the conditions for labeling. The second foreign object visual inspection process mainly detects the label information and label status on the surface of the jar. Through these two visual inspection processes, it is ensured that the jarring of liquid beverages complies with relevant standards. It should also be noted that the method in this embodiment is applied to jarred products with the same forward and reverse orientation, such as common cylindrical glass bottle beverages. Furthermore, the top cap of the jar is clamped by a fixture, and the forward and reverse graphic information and reflected light information are acquired by controlling the rotation of the fixture. At the same time, the foreign object visual inspection method in this embodiment is an addition rather than a replacement for existing technology.
[0049] This embodiment performs the first foreign object visual detection process through steps one and two. Step one includes sequentially acquiring image information of the front and back of the jarred glass bottle using the same visible light camera, and sequentially acquiring reflected light information of the jarred glass bottle from the front and back using the same multispectral camera. The combination of image information and reflected light information can improve the accuracy of foreign object detection in the jarred glass bottle. Step two includes determining a first abnormal region by comparing the front and back image information; determining a second abnormal region by comparing the front and back reflected light information; and performing the first foreign object visual detection process in the jarred glass bottle based on the first and second abnormal regions. This embodiment utilizes the consistent front and back states of the jarred glass bottle, and by comparing its own front and back image information and reflected light, it can eliminate the interference of ambient light and other variables, achieving accurate judgment of foreign impurities. The process of determining the second abnormal region based on the reflected light information can identify foreign objects that cannot be seen by ordinary cameras by penetrating the packaging through the unique spectral characteristics of the substance. Therefore, after acquiring the first and second abnormal regions, the detection results of both can be combined to make an accurate foreign object judgment.
[0050] In the above embodiments, the process of determining the first abnormal region includes: preprocessing the forward and reverse image information respectively. The preprocessing process includes grayscale conversion, filtering and denoising, and image enhancement. The preprocessing process can improve the feature contours in the image information and reduce noise interference. The preprocessed image is segmented and features are extracted. The segmentation process separates the image of the jarred glass bottle from the background image. The feature extraction is achieved by commonly used edge contour recognition technology, thereby obtaining the forward edge contour group and the reverse edge contour group. Since the detection time difference between the forward and reverse images of the jarred glass bottle is short and their detection environment is consistent, the forward edge contour group and the reverse edge contour group should be infinitely close. Therefore, the forward edge contour group and the reverse edge contour group are compared for overlap. The first abnormal region is determined based on the overlap comparison result, thereby realizing the judgment of the first abnormal region based on the image information.
[0051] In one embodiment, the process of performing overlap comparison includes: S1, using the positive edge contour group as a reference, overlapping the negative edge contour group with the positive edge contour group; S2, obtaining the negative edge contour in the negative edge contour group that is closest to the centroid of each positive edge contour in the positive edge contour group, and pairing this negative edge contour with the positive edge contour; if there are no foreign objects or impurities, theoretically the positive edge contour group should completely overlap with the negative edge contour, but due to the existence of error data, a process of pairing the negative edge contour with the positive edge contour one by one is used to further... To determine the outline of foreign objects or impurities, S3: Determine if there are unpaired forward edge outlines: If yes, it means the forward edge outline does not belong to the original feature, therefore the forward edge outline is classified as the first abnormal region, and proceed to step S4; if no, proceed to step S4; S4: Determine if there are unpaired reverse edge outlines: If yes, it means the reverse edge outline does not belong to the original feature, therefore the reverse edge outline is classified as the first abnormal region, and proceed to step S5; if no, proceed to step S5; S5: Determine if the same reverse edge outline is... Pairing with multiple positive edge contours: If yes, it indicates that there are redundant contours in the positive or negative edge contours. Therefore, the negative edge contour and multiple positive edge contours are classified as the first abnormal region, and step S6 is performed. If no, step S6 is also performed. S6: Obtain the overlapping area of the paired positive and negative edge contours, and obtain the ratio of the overlapping area to the area of the positive and negative edge contours respectively. Compare the overlapping area to the area of the positive and negative edge contours with the preset ratios respectively. The preset ratios are set according to the error data fitting during the test. If one or more of the ratios of the overlapping area to the area of the positive and negative edge contours are less than the preset ratio, it indicates that there is a large difference between the positive and negative edge contours. Therefore, the positive and negative edge contours are classified as the first abnormal region. Through the above process, the process of obtaining the first abnormal region is realized. Compared with the method of directly comparing the areas of the positive and negative edge contours, the method in this embodiment can better reduce the impact of errors on the accuracy of the judgment result.
[0052] In one embodiment, the process of determining the second abnormal region includes: segmenting the forward and reverse reflected light information to obtain the reflected light information of the forward and reverse bottling glass bottle regions; obtaining the reflectivity of each pixel at different wavelengths based on the reflected light information of each pixel; mapping the forward bottling glass bottle region to the reverse bottling glass bottle region pixel by pixel; since the forward bottling glass bottle region and the reverse bottling glass bottle region are the same, pixels at the same position in the bottling glass bottle region can be mapped; and comparing and analyzing each forward pixel with its corresponding reverse pixel. The comparison and analysis process includes: through... Calculate the similarity (similarity) between two pixels in the forward-facing and reverse-facing glass bottle filling regions. Here, x and y are the coordinates of the two pixels, and f(x, y) represents the preset risk coefficient corresponding to the region where the similar point at coordinates (x, y) is located. Since the glass bottles are of uniform size, they are divided into different regions based on test data. The features of different regions are affected by errors to varying degrees. For example, edge pixels in the glass bottle region may have errors due to alignment, so the preset risk coefficient can be set lower to reduce the impact of the judgment result on the overall result. Furthermore, pixel-level adjustments do not affect the accuracy of the result. Therefore, different preset risk coefficients are set, and the preset risk coefficient can be obtained based on the region where the similar point at coordinates (x, y) is located, thus adjusting the degree of error impact on the judgment result. Additionally, the number of n wavelength values selected is specified, where i is a positive integer and i∈[1, n]. This represents the reflectance of a single pixel in the ith wavelength value of the condensing area of a forward-facing glass bottle. This represents the reflectance of a single pixel in the reverse glass bottle bottling area corresponding to the i-th wavelength value. The weighting coefficient for the i-th wavelength value is set based on the material, color, and other data of the bottled glass, using test reflectance data under different spectra. Multispectral reflectance data is equivalent to setting a characteristic fingerprint for identification of the bottled glass. By setting the weighting coefficient, the significance of this characteristic fingerprint can be improved, thereby improving the accuracy of the comparison. The slope value is obtained by linearly fitting a single pixel in the bottling area of a front-facing glass bottle based on different wavelengths and corresponding reflectivities. The slope value is obtained by linearly fitting a single pixel in the reverse glass bottle filling area based on different wavelengths and corresponding reflectivities. To adjust the coefficients, they are set based on the test data. Therefore, the obtained similarity is obtained by comparing the feature fingerprints and the trend of reflectivity relative to wavelength. After adjusting the preset risk coefficient corresponding to the region where the similar points are located, the state of the pixels can be accurately and objectively determined.
[0053] After obtaining the similarity score, the state of the pixel is first determined based on the similarity score. The similarity score of the pixel is compared with a preset similarity threshold, which is set based on empirical data. If the similarity score is lower than the preset similarity threshold, both forward and reverse pixels are considered as abnormal pixels. The region composed of consecutive abnormal pixels is considered as the second abnormal region. Since a single independent pixel is more likely to be affected by error factors, and the probability that the foreign object region is only a single pixel is low, a single independent pixel is not considered as an abnormal region. Through the above process, the second abnormal region can be determined based on the state of each pixel.
[0054] After obtaining the first and second abnormal regions, the first foreign object visual inspection process for the jarred glass bottles includes: judging the first and second abnormal regions: if both the first and second abnormal regions are empty values, the first foreign object visual inspection result is judged to be normal; if the second abnormal region is not empty values, the first foreign object visual inspection result is judged to be abnormal; if the first abnormal region is not empty values but the second abnormal region is empty values, the first foreign object visual inspection result is judged to have an abnormal risk. Since the reliability of visual inspection and multispectral inspection are different, different results are defined according to different states through the above judgment logic, which facilitates the subsequent manual inspection of abnormal jarred glass bottles.
[0055] In one embodiment, the second foreign object visual detection process for jarred glass bottles includes: performing text recognition on the label image information based on OCR, and judging the accuracy of the information based on the recognized text content; performing a similarity comparison between the label image information and a preset label template based on OCV, wherein the preset label template is set according to the note content, and judging the label status based on the similarity comparison result; through the above recognition process, the appearance and content of the jarred glass bottle label can be guaranteed to be qualified; at the same time, based on the first foreign object visual detection process, the probability of abnormalities in the second foreign object visual detection process is reduced.
[0056] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A visual inspection method for foreign objects in liquid beverage cans, characterized in that, include: Step 1: Sequentially acquire image information of the front and back of the glass bottle using the same visible light camera; sequentially acquire reflected light information of the front and back of the glass bottle using the same multispectral camera. Step 2: Determine the first abnormal region by comparing the forward and reverse image information; determine the second abnormal region by comparing the forward and reverse reflected light information; perform the first foreign object visual detection process for the jarred glass bottle based on the first and second abnormal regions. Step 3: After the labeling process is completed on the glass jars, the label image information of the glass jars is acquired by a visible light camera, and the second foreign object visual detection process of the glass jars is carried out based on the label image information.
2. The method for visual inspection of foreign objects in liquid beverage cans according to claim 1, characterized in that, The process of determining the first abnormal region includes: The image information in the forward and reverse directions is preprocessed separately. The preprocessing process includes grayscale conversion, filtering and noise reduction, and image enhancement. The preprocessed image is segmented and features are extracted to obtain forward edge contour groups and reverse edge contour groups. The forward edge contour groups and reverse edge contour groups are then compared for overlap, and the first abnormal region is determined based on the comparison results.
3. The method for visual inspection of foreign objects in liquid beverage cans according to claim 2, characterized in that, The process of performing overlap comparison includes: S1. Using the positive edge contour group as a reference, overlap the negative edge contour group with the positive edge contour group; S2. Obtain the reverse edge contour in the reverse edge contour group that is closest to the centroid of each positive edge contour in the positive edge contour group, and pair the reverse edge contour with the positive edge contour. S3. Determine if there are any unpaired positive edge contours: If so, the positive edge contour is classified as the first abnormal region, and step S4 is performed; If not, proceed to step S4; S4. Determine if there are unpaired reverse edge contours: If so, the reverse edge contour is classified as the first abnormal region, and step S5 is performed; If not, proceed to step S5; S5. Determine whether the same reverse edge contour is paired with multiple forward edge contours: If so, the reverse edge contour and multiple positive edge contours are classified as the first abnormal region, and step S6 is performed. If not, proceed to step S6; S6. Obtain the overlapping area of the paired forward edge contour and reverse edge contour, and obtain the ratio of the overlapping area to the area of the forward edge contour and the area of the reverse edge contour respectively. If one or more of the ratios between the overlapping area and the area of the forward edge contour are less than a preset ratio, then the forward edge contour and the reverse edge contour are classified as the first abnormal region.
4. The method for visual inspection of foreign objects in liquid beverage cans according to claim 1, characterized in that, The process of determining the second abnormal region includes: The reflected light information in the forward and reverse directions is segmented to obtain the reflected light information of the forward and reverse bottling glass bottle areas; The reflectivity of each pixel at different wavelengths is obtained based on the reflected light information of each pixel. The positive glass bottle filling area and the negative glass bottle filling area are mapped to each pixel. Each positive pixel is compared and analyzed with the corresponding negative pixel. The second abnormal area is determined based on the comparison and analysis results of each pixel.
5. The method for visual inspection of foreign objects in liquid beverage cans according to claim 4, characterized in that, The comparative analysis process includes: pass Calculate the similarity (similarity) between two pixels in the forward-loading and reverse-loading glass bottle regions; where x and y are the coordinates of the two pixels, f(x, y) represents the preset risk coefficient corresponding to the region where the similar point at coordinates (x, y) is located, n is the number of wavelength values selected, i is a positive integer, and i∈[1, n]. This represents the reflectance of a single pixel in the ith wavelength value of the condensing area of a forward-facing glass bottle. This represents the reflectance of a single pixel in the reverse glass bottle bottling area corresponding to the i-th wavelength value. The weighting coefficient for the i-th wavelength value. The slope value is obtained by linearly fitting a single pixel in the bottling area of a front-facing glass bottle based on different wavelengths and corresponding reflectivities. The slope value is obtained by linearly fitting a single pixel in the reverse glass bottle filling area based on different wavelengths and corresponding reflectivities. For adjustment coefficients; The state of a pixel is determined based on its similarity, and the second abnormal region is identified based on the state of each pixel.
6. The method for visual inspection of foreign objects in liquid beverage cans according to claim 5, characterized in that, The process of determining the second anomaly region also includes: The similarity of pixels is compared with a preset similarity threshold. If the similarity is lower than the preset similarity threshold, both forward and reverse pixels are considered as abnormal pixels. The region consisting of all consecutive abnormal pixels is designated as the second abnormal region.
7. The method for visual inspection of foreign objects in liquid beverage cans according to claim 1, characterized in that, The first foreign object visual inspection process for jarred glass bottles includes: The first and second abnormal regions are judged: If both the first and second abnormal regions are empty, then the visual detection result of the first foreign object is judged to be normal. If the second abnormal region is not empty, then the visual detection result of the first foreign object is judged to be abnormal; If the first abnormal region is not empty but the second abnormal region is empty, then the visual detection result of the first foreign object is judged to have an abnormal risk.
8. The method for visual inspection of foreign objects in liquid beverage cans according to claim 1, characterized in that, The process of visually inspecting jars for second foreign objects includes: Based on OCR, text recognition is performed on the label image information, and the accuracy of the information is judged based on the text recognition content. Based on OCV, the label image information is compared with the preset label template, and the label status is determined according to the similarity comparison results.