Method and system for detecting surface defects of glass wine bottles

By employing intelligent detection methods, utilizing high-resolution cameras and image processing technology, and combining machine learning, the problems of low efficiency and low accuracy in glass bottle inspection have been solved, achieving efficient and accurate defect identification and classification.

CN119438210BActive Publication Date: 2025-12-19SICHUAN YIBIN GLOBAL GRP CO LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411414987.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-11
Publication Date
2025-12-19
Estimated Expiration
2044-10-11

AI Technical Summary

Technical Problem

Existing glass bottle manufacturers lack standardized and systematic testing procedures, relying mainly on experience-based judgment or manual observation, resulting in low testing efficiency and accuracy.

Method used

An intelligent detection method based on visual observation is adopted. By selecting a high-resolution camera and a suitable light source system, and combining image processing technologies such as edge detection, texture analysis and color recognition, a trigger mechanism is designed to realize automated image acquisition, and image preprocessing, feature extraction and fusion are performed. Finally, machine learning is used for defect identification and classification.

Benefits of technology

It improves the efficiency and accuracy of glass bottle inspection, realizes automated and intelligent defect identification, and reduces human error.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119438210B_ABST
    Figure CN119438210B_ABST
Patent Text Reader

Abstract

The application provides a kind of glass wine bottle surface defect detection system, comprising the following steps: S1: the step of image acquisition;S2: the step of image processing;S3: the step of defect identification and classification;The step S1 specifically includes: S11: equipment selection and configuration, according to the size, shape and surface characteristics of glass wine bottle, select industrial-grade high-definition camera, camera has high resolution, low noise, high dynamic range characteristics, to ensure that clear images are captured, while configuring LED backlight or ring light source system, to eliminate shadows and reflections, highlight the details of the bottle surface, the brightness and color temperature of the light source are adjusted according to the scene;This method solves the problem of low efficiency and low accuracy of existing glass bottle detection by using experience judgment or manual visual observation, and proposes an intelligent detection method based on visual observation to improve detection efficiency and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to a glass bottle surface defect detection method and system. BACKGROUND

[0002] At present, the glass bottle manufacturers lack standardized, systematic and scientific detection process and method when detecting the wine bottle products, mostly using experience judgment or manual visual observation method, which is not only low in efficiency but also low in detection accuracy, therefore, an intelligent detection method based on visual observation is proposed to solve the above problems. SUMMARY

[0003] The present application aims at the deficiencies of the prior art, and provides a glass bottle surface defect detection system, which can well solve the above problems.

[0004] To achieve the above requirements, the technical scheme adopted by the present application is as follows: a glass bottle surface defect detection method comprises the following steps: S1: an image acquisition step; S2: an image processing step; S3: a defect recognition and classification step; the step S1 specifically comprises: S11: equipment selection and configuration, according to the size, shape and surface characteristics of the glass bottle, an industrial-grade high-definition camera is selected, the camera has high resolution, low noise and high dynamic range characteristics to ensure that clear images are captured, and an LED backlight or ring light source system is configured to eliminate shadows and reflections and highlight the details of the bottle surface, the brightness and color temperature of the light source are adjusted according to the scene; S12: installation and debugging, the camera and the light source system are installed on the conveyor belt or rotating table on the production line, the distance and angle between the camera and the bottle are adjusted to capture the image of the entire bottle surface, and the focal length, exposure time and white balance parameters of the camera are debugged to obtain the best image quality; S13: trigger mechanism setting, the trigger mechanism is set through a photoelectric sensor, an encoder or an image recognition algorithm, when the bottle enters the shooting area, the trigger mechanism sends a signal to the camera to start shooting; S14: real-time preview and adjustment, before formal acquisition, real-time preview is performed to check the image quality, whether the details of the bottle surface are clear, whether the light source is uniform, whether there are shadow or reflection problems are observed through the preview image, and the parameters of the camera and the light source are adjusted according to the preview result; S15: image saving and transmission, the collected images are saved to the local hard disk or transmitted to the server through the network, and the shooting time and bottle number information of each image are recorded when saving the images for subsequent tracing and analysis.

[0005] The glass bottle surface defect detection system has the following advantages:

[0006] The method solves the problems of low efficiency and low accuracy caused by experience judgment or manual visual observation in the detection of existing glass bottles, and proposes an intelligent detection method based on visual observation to improve the detection efficiency and accuracy. BRIEF DESCRIPTION OF DRAWINGS

[0007] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:

[0008] Figure 1 The flowchart of the glass bottle surface defect detection method according to an embodiment of the application is schematically shown. DETAILED DESCRIPTION

[0009] To make the objects, technical solutions and advantages of the application clearer, the application will be further described in detail below with reference to the drawings and specific embodiments.

[0010] In the following description, the references to "one embodiment", "an embodiment", "one example", "an example", etc. mean that a particular feature, structure, characteristic, property, element or limitation described in connection with the embodiment or example can be included in at least one embodiment or example of the application, but not necessarily every embodiment or example. In addition, repeated use of the phrase "according to an embodiment of the application" does not necessarily refer to the same embodiment, although it can.

[0011] For simplicity, some technical features known to those skilled in the art are omitted in the following description.

[0012] According to an embodiment of the application, the detection method used by the glass bottle surface defect detection system includes the following steps:

[0013] I. Image acquisition

[0014] Substep 1: Equipment selection and configuration

[0015] Explanation: First, according to the size, shape and surface characteristics of the glass bottle, select a suitable industrial-grade high-definition camera. The camera should have high resolution, low noise, high dynamic range and other characteristics to ensure that clear images are captured. At the same time, configure a suitable light source system, such as LED backlight or ring light, to eliminate shadows and reflections and highlight the details of the bottle surface. The brightness and color temperature of the light source need to be adjusted according to the specific scene to achieve the best shooting effect.

[0016] Substep 2: Installation and debugging

[0017] Explanation: Install the camera and light source system at an appropriate location on the production line, usually on a conveyor belt or rotating table. Ensure that the camera maintains an appropriate distance and angle from the wine bottle to capture the entire bottle surface. Adjust the camera through the software interface, including focus, exposure time, white balance, and other parameters to achieve optimal image quality.

[0018] Sub-step three: Trigger mechanism setup

[0019] Explanation: To achieve automated acquisition, a trigger mechanism needs to be set up. This can be achieved through photoelectric sensors, encoders, or image recognition algorithms. When a wine bottle enters the shooting area, the trigger mechanism sends a signal to the camera, causing it to start shooting. The accuracy and response speed of the trigger mechanism are crucial for improving acquisition efficiency.

[0020] Sub-step four: Real-time preview and adjustment

[0021] Explanation: Before formal acquisition, conduct a real-time preview to check image quality. Observe the details of the wine bottle surface through the preview screen, whether the light source is uniform, whether there are shadows or reflections, etc. Adjust the camera and light source parameters according to the preview results until satisfactory image quality is achieved.

[0022] Sub-step five: Image saving and transmission

[0023] Explanation: Save the collected images to the local hard disk or transmit them to the server through the network. When saving images, record the shooting time, wine bottle number, and other information for subsequent tracing and analysis. At the same time, ensure the stability and security of image transmission to avoid data loss or leakage.

[0024] II. Image processing

[0025] Sub-step one: Image preprocessing

[0026] Explanation: Preprocess the collected raw images, including denoising, contrast enhancement, brightness adjustment, etc. Denoising removes random noise points in the image, improving the signal-to-noise ratio of the image; contrast enhancement enhances the brightness difference between different regions in the image, making details clearer; brightness adjustment makes the overall brightness of the image reach an appropriate observation level. These operations help improve the accuracy and efficiency of subsequent processing.

[0027] Sub-step two: Edge detection

[0028] Note: Use edge detection algorithms to extract the contour and edge information of the wine bottle surface. Edges are the places where brightness changes most sharply in an image, and are often potential locations of defects. Common edge detection algorithms include Sobel operator, Canny operator, etc. Through edge detection, we can preliminarily screen out areas that may contain defects.

[0029] Sub-step three: texture analysis

[0030] Note: Analyze the texture of the wine bottle surface in detail to identify areas that do not conform to normal texture. Texture analysis can be achieved by calculating the local statistical features of the image using the gray level co-occurrence matrix, using texture filters, or deep learning-based texture recognition algorithms. Through texture analysis, we can further confirm whether the areas screened out in edge detection are indeed defects.

[0031] The specific method of calculating the local statistical features of the image through the gray level co-occurrence matrix is as follows:

[0032] Step 1: Set up a gray level co-occurrence matrix with multiple directions and distances

[0033] The value of the gray level co-occurrence matrix: P d,θ (i,j), represents the co-occurrence frequency of pixel pairs with gray values i and j at distance d and direction θ;

[0034] d is the distance between two pixels;

[0035] θ is the angle between two pixels;

[0036] i and j represent the gray values of two pixels, ranging from 0 to L-1, where L is the number of gray levels.

[0037] Step 2: Normalize the gray level co-occurrence matrix, normalize the gray level co-occurrence matrix for each direction and distance:

[0038]

[0039] Step 3: Extract advanced statistical features, combine multiple directions and distances of the gray level co-occurrence matrix to extract more complex statistical features.

[0040] Energy:

[0041]

[0042] Contrast:

[0043]

[0044] Entropy:

[0045]

[0046] Homogeneity:

[0047]

[0048] Correlation:

[0049]

[0050] Inverse Difference:

[0051]

[0052] Difference Entropy:

[0053]

[0054] where p(k) = ∑ |i-j|=k P′ d,θ (i, j) is the probability of the gray level difference k.

[0055] The final feature is calculated by weighting all the features of different directions and distances:

[0056] Feature = ∑ d ∑ θ w d,θ · Feature d,θ ;

[0057] w d,θ is the weight corresponding to the direction and distance, which can be adjusted according to application requirements.

[0058] In the above formula:

[0059] P d,θ (i, j) is the value of the gray level co-occurrence matrix, representing the co-occurrence frequency of pixel pairs with gray levels i and j at a distance d and angle θ.

[0060] P′ d,θ (i, j) is the normalized gray level co-occurrence matrix.

[0061] i, j: Gray level of pixels, ranging from 0 to L-1.

[0062] d: Distance between pixels.

[0063] θ: Angle between pixels.

[0064] μ i , μ i : Mean of gray levels i and j.

[0065] σ i , σ j : Standard deviation of gray levels i and j.

[0066] p(k): probability of gray level difference k.

[0067] w d,θ : weight at distance d and angle θ.

[0068] Sub-step four: color recognition

[0069] Explanation: For color abnormal defects (such as stains), color recognition is needed. First, convert the image from RGB color space to HSV color space, which is more suitable for color analysis. Then, use a color segmentation algorithm to segment different color regions in the image. Finally, by comparing the segmented color regions with the pre-set color templates or samples in the database, identify the color abnormal defects.

[0070] The method of using a color segmentation algorithm to segment different color regions in the image is as follows:

[0071] (1) Convert the image from RGB color space to HSV color space. The advantage of HSV color space is that it separates color information into three independent components: hue (Hue), saturation (Saturation) and brightness (Value), making it easier to perform color segmentation. The conversion formula is as follows:

[0072]

[0073] Wherein, the calculation of hue θ is as follows:

[0074]

[0075] Wherein:

[0076] R, G, B are the values of red, green and blue channels respectively.

[0077] V is the maximum brightness.

[0078] θ is the hue (range 0 to 360 degrees).

[0079] S is the saturation (range 0 to 1)

[0080] (2) Define color range

[0081] Define the color range to be segmented. In HSV color space, it is more intuitive to specify the color range:

[0082] Lower = (Hmin, Smin, Vmin);

[0083] Upper = (Hmax, Smax, Vmax);

[0084] Wherein:

[0085] Hmin and Hmax are the lower and upper limits of hue, respectively.

[0086] Smin and Smax are the lower and upper limits of saturation, respectively.

[0087] Vmin and Vmax are the lower and upper limits of lightness, respectively.

[0088] (3) Threshold segmentation of HSV image using the defined color range to generate a binary mask. In the mask, pixels that meet the color range are marked as white (255), and other pixels are marked as black (0);

[0089] (4) To remove noise, morphological operations are performed on the mask, including dilation and erosion. This helps to fill small holes and remove isolated noise points. The specific calculation formula is as follows:

[0090] Dilation:

[0091] M dilated (i, j) = max (i′,j′)∈kernel M(i+i', j+j');

[0092] Erosion:

[0093] M eroded (i, j) = min (i′,j′)∈kernel M(i+i', j+j');

[0094] Where: M dilated (i, j) and M eroded (i, j) are the mask images after dilation and erosion, respectively, and kernel is the structural element of morphological operation.

[0095] (5) Display the original image and the segmented image for comparison and verification of the segmentation effect.

[0096] Sub-step five: feature extraction and fusion

[0097] Explanation: The feature information extracted in the steps of edge detection and color recognition is fused. Feature fusion can be achieved through weighted fusion, which can obtain a feature vector containing multiple dimensional information for subsequent defect recognition and classification.

[0098] The specific weighted fusion formula is as follows:

[0099] F = w E ·f(E) + w C ·g(C) + w EC ·h(E, C) - λR(E, C);

[0100] Where:

[0101] F is the fused feature vector;

[0102] f(E) is a non-linear transformation of the edge feature, and f(E) = log(l + E);

[0103] g(C) is a non-linear transformation of the color feature, and

[0104] h(E, C) is an interaction function between the edge feature and the color feature, and h(E, C) = E · C;

[0105] w E , w C , and w EC are the weight coefficients of the edge feature, the color feature, and the feature interaction, respectively;

[0106] λ is the weight coefficient of the regularization term;

[0107] R(E, C) is the regularization term, and

[0108] III. Defect identification and classification

[0109] Sub-step one: feature matching and comparison

[0110] Description: The fused feature vector is compared and matched with the pre-set defect template or the sample in the database. The matching algorithm can be a statistical-based matching. Whether there is a defect in the image and the type of the defect are determined by comparison and matching.

[0111] The specific matching algorithm is as follows:

[0112] D combined (F, T) = a · (1 - D P (F, T)) + β · D E (F, T) + γ · D M (F, T) + λ · R(F, T);

[0113] Wherein:

[0114] D combined (F, T) is the comprehensive matching measure between the feature vector F and the template vector T.

[0115] D P (F, T) is the Pearson correlation coefficient between the feature vector F and the template vector T.

[0116] D E (F, T) is the Euclidean distance between the feature vector F and the template vector T.

[0117] D M(F, T) is the Manhattan distance between the feature vector F and the template vector T.

[0118] a, b and g are the weight coefficients of Pearson correlation coefficient, Euclidean distance and Manhattan distance respectively, satisfying a+b+g=1.

[0119] l is the weight coefficient of the regularization term.

[0120] R(F, T) is the regularization term.

[0121] Sub-step two: classifier design and training

[0122] Note: If machine learning method is used for defect recognition and classification, a suitable classifier needs to be designed and trained. The design of the classifier includes selecting a suitable algorithm (such as support vector machine, neural network, decision tree, etc.), determining the input features, setting the algorithm parameters, etc. The training process is to use the training data with labels (i.e. images with known defect types and positions) to optimize the parameters of the classifier, so that it can accurately identify different types of defects.

[0123] Sub-step three: classification decision and post-processing

[0124] Note: Make a classification decision according to the output of the classifier. If the classifier outputs multiple possible defect types, certain rules need to be followed.

[0125] The above-described embodiments only represent several embodiments of the present application, which are described in detail and in detail, but cannot be understood as limiting the scope of the present application. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the claims.

Claims

1. A method of detecting surface defects of a glass wine bottle, characterized by, Comprise the following steps: S1: the step of image acquisition; S2: the step of image processing; S3: the step of defect identification and classification; The step S1 specifically comprises: S11: device selection and configuration, according to the size, shape and surface characteristics of glass wine bottle, select industrial-grade high-definition camera, the camera has high resolution, low noise, high dynamic range characteristics, to ensure that the clear image is captured, at the same time, configure LED backlight or ring light source system, to eliminate shadows and reflections, highlight the details of the bottle surface, the brightness and color temperature of the light source are adjusted according to the scene; S12: installation and debugging, install the camera and light source system on the conveyor belt or rotating table on the production line, adjust the distance and angle between the camera and the bottle to capture the image of the entire bottle surface, debug the camera focal length, exposure time and white balance parameters to obtain the best image quality; S13: trigger mechanism setting, set the trigger mechanism through photoelectric sensor, encoder or image recognition algorithm, when the bottle enters the shooting area, the trigger mechanism will send a signal to the camera, so that it starts shooting; S14: real-time preview and adjustment, before formal acquisition, real-time preview is carried out to check the image quality, through the preview picture to observe whether the details of the bottle surface are clear, whether the light source is uniform, whether there are shadow or reflection problems, adjust the parameters of the camera and light source according to the preview result; S15: image saving and transmission, save the collected images to local hard disk or transmit to server through network, record the shooting time and bottle number information of each image when saving the image, for subsequent tracing and analysis; The step S2 specifically comprises: S21: image preprocessing, pre-process the collected original image, including denoising, contrast enhancement, brightness adjustment; S22: edge detection, use edge detection algorithm to extract the contour and edge information of the bottle surface, the edge is the place where the brightness changes most sharply in the image, which is usually the potential position of defects, through edge detection, the area that may contain defects is preliminarily screened out; S23: texture analysis, analyze the texture of the bottle surface to identify the area that does not conform to the normal texture, texture analysis calculates the local statistical characteristics of the image through gray level co-occurrence matrix, uses texture filter or deep learning-based texture recognition algorithm to realize, through texture analysis, whether the area screened out in the edge detection is indeed a defect is further confirmed; S24: color recognition, color recognition is needed for color abnormal defects, first convert the image from RGB color space to HSV color space which is more suitable for color analysis, then use color segmentation algorithm to segment different color regions in the image, finally compare the segmented color regions with the preset color template or samples in the database to identify color abnormal defects; S25: feature extraction and fusion, fuse the feature information extracted in the edge detection and color recognition steps, feature fusion gets a feature vector containing multiple dimensional information through weighted fusion, which is used for subsequent defect identification and classification; The specific method for calculating the local statistical features of the image in step S23 by the gray level co-occurrence matrix is as follows: S231: Set the gray level co-occurrence matrix of multiple directions and distances; The value of the gray level co-occurrence matrix: represents the co-occurrence frequency of pixel pairs with gray values i and j at distance d and direction θ. d is the distance between two pixels; θ is the angle between two pixels; i and j respectively represent the gray values of two pixels, ranging from 0 to L−1, where L is the number of gray levels; S242: Normalize the gray level co-occurrence matrix, normalize the gray level co-occurrence matrix of each direction and distance: ; S233: Extract advanced statistical features, combine the gray level co-occurrence matrices of multiple directions and distances, and extract more complex statistical features; Energy: ; Contrast: ; Entropy: ; Homogeneity: ; Relevance: ; Inverse variance: ; Differential entropy: ; wherein is the probability of a gray level difference of k; Synthesis of features, all directional and distance features Feature d,θ Weighted to get the final features: ; are weights corresponding to the direction and distance, adjusted according to the application requirements; wherein: Gd,θ(i,j) is the value of the gray level co-occurrence matrix, representing the co-occurrence frequency of pixel pairs with gray values i and j at a distance d and an angle θ; : normalized gray level co-occurrence matrix i, j: gray values of pixels, ranging from 0 to L−1; d: distance between pixels; θ: angle between pixels; : mean value of the gray levels i and j; : standard deviation of gray levels i and j; p(k): probability of gray difference k; : weight at distance d and angle Θ; The method for segmenting different color regions in the image by using the color segmentation algorithm in step S23 is as follows: S241 : Convert the image from RGB color space to HSV color space with the conversion formula as follows: ; wherein the calculation of the hue θ is as follows: ; Wherein: R, G, and B are the values of the red, green, and blue channels respectively; V is the maximum brightness; θ is the hue, ranging from 0 to 360 degrees; S is the saturation, ranging from 0 to 1; S242: Define the color range, define the color range to be segmented in the HSV color space: Lower =(Hmin,Smin,Vmin); Upper =(Hmax,Smax,Vmax); Wherein: Hmin and Hmax are the lower and upper limits of the hue respectively; Smin and Smax are the lower and upper limits of the saturation respectively; Vmin and Vmax are the lower and upper limits of the brightness respectively; S243: Use the defined color range to perform threshold segmentation on the HSV image, generate a binary mask, and mark the pixels in the mask that meet the color range as white, and mark the other pixels as black; S244: Perform morphological operations on the mask, including dilation and erosion, and the specific calculation formula is as follows: Expansion: ; corrosion: ; where: and are the dilated and eroded mask images, respectively, and kernel is the structuring element for the morphological operation. S245: Display the original image and the segmented image for comparison and verification of the segmentation effect; The specific weighted fusion formula in step S24 is as follows: ; Wherein: F is the fused feature vector; f(E) is a non-linear transformation of the edge features, and ; g(C) is a non-linear transformation of the color feature, and ; h(E,C) is an interaction function between edge feature and color feature, and ; , , , are weight coefficients of edge feature, color feature and feature interaction, respectively; λ is the weight coefficient of the regularization term; R(E,C) is a regularization term, and ; The step S3 specifically includes: S31: Feature matching and comparison, compare and match the fused feature vector with the pre-set defect template or the samples in the database, the matching algorithm is a statistical-based matching, and whether there is a defect in the image and the type of the defect are determined by comparison and matching; S32: Classifier design and training, use machine learning method for defect recognition and classification, design and train a suitable classifier, the design of the classifier includes selecting algorithm, determining input features, and setting algorithm parameters, and the training process is to use training data with labels, i.e., images with known defect types and positions, to optimize the parameters of the classifier, so that it can accurately identify different types of defects; S33: Classification decision and post-processing, make a classification decision according to the output result of the classifier.

Citation Information

Patent Citations

  • Device and method for detecting foreign matters on inner wall of glass bottle

    CN103743757A

  • Defect classification method based on multi-feature fusion

    CN111965197A

  • Abnormal recognition method and device, storage medium and electronic equipment

    CN117788918A

  • Online visual inspection method for glass tube

    CN118624645A