Glass defect visual detection device and detection method thereof

By dividing the glass bottle into multiple areas and using specific detection units and models to extract defect features, the problem of insufficient detection in the existing technology is solved, a comprehensive detection of each area of ​​the glass bottle is achieved, and the accuracy of detection is improved. and comprehensiveness.

CN118209492BActive Publication Date: 2024-09-27SHENZHEN ZHISHENGTENG TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410634477.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-22
Publication Date
2024-09-27
Estimated Expiration
2044-05-22

AI Technical Summary

Technical Problem

Existing glass bottle defect detection methods fail to comprehensively detect all areas of the glass bottle, resulting in inaccurate detection. In particular, the defect detection of the bottle mouth, bottle neck, bottle shoulder, bottle body and bottle bottom is not detailed enough, which affects the overall quality of the glass bottle. Test quality.

Method used

A glass defect visual inspection device is designed. The glass bottle is divided into five areas (bottle mouth, bottle neck, bottle shoulder, bottle body, bottle bottom) through the glass bottle segmentation unit, and a specific inspection unit is used to obtain the information of each area. Image features, use the side bottleneck detection model and other feature extraction models to extract defect features in each area, and combine vertical and side bottleneck detection to obtain comprehensive defect detection values.

Benefits of technology

It achieves comprehensive detection of defects in various areas of glass bottles, improves the accuracy and comprehensiveness of detection, can more accurately judge the qualification of glass bottles, and classifies defects according to detection values, improving the reliability and accuracy of detection. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118209492B
    Figure CN118209492B
Patent Text Reader

Abstract

The present invention relates to the technical field of visual inspection of glass defects, and specifically to a visual inspection device for glass defects and a method for inspection thereof. First, the present invention utilizes a glass segmentation unit to segment a glass bottle to be inspected, obtains the bottle mouth area, the bottle neck area, the bottle shoulder area, the bottle body area and the bottle bottom area, and obtains images of the five areas; secondly, the present invention performs defect inspection on different areas of the glass bottle to be inspected through five defect detection units, obtains bottle mouth defect detection values, bottle neck defect detection values, bottle shoulder defect detection values, bottle body defect detection values ​​and bottle bottom defect detection values; finally, the present invention fuses the five defect detection values ​​through a glass bottle comprehensive defect output unit, obtains a comprehensive defect detection value of the glass bottle, and outputs the inspection result. The present invention can comprehensively and accurately perform defect inspection on glass bottles through a visual inspection device for glass defects and a method for inspection thereof.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of glass defect visual detection, and in particular to a glass defect visual detection device and a detection method thereof. Background Art

[0002] In the process of glass manufacturing, various defects often appear, such as bubbles, foreign matter and cracks. These defects not only affect the appearance quality of the product, but also may affect its functional performance and even endanger its safety. Therefore, it is very important to detect defects in glass products.

[0003] Defect detection for glass products includes visual inspection, acoustic inspection, and thermal inspection. Compared with other inspection methods, visual inspection does not require contact with the inspected object, so it will not cause any damage or impact to the inspected object. In addition, visual inspection can flexibly adapt to objects of different shapes, sizes, and surface characteristics without the need for additional customized equipment.

[0004] Glass products are widely used in daily life and various industries, covering many different product categories, including glass bottles, glass jars and glass doors. Among them, glass bottles do not chemically react with food or beverages, do not affect their taste or quality, and can also provide good barrier properties to maintain the freshness and quality of food and beverages. Therefore, glass bottles are often used as packaging containers for food and beverages, such as juice, beer, alcoholic beverages, salad dressings and seasonings.

[0005] Existing defect detection for glass bottles includes a Chinese patent with application number CN202010773562.5, which proposes a glass bottle bottom defect detection method and system based on machine vision. This method divides the bottle bottom into a central circular plane area, an annular plane area, and annular texture area; and uses three different methods to perform different defect detections on these three areas, and the obtained central circular plane area, annular plane area, and annular texture area with defects marked are fused to obtain a bottle bottom image marked with all defects. This method only performs defect detection on the bottom of the glass bottle, but does not perform defect detection on other areas of the glass bottle. The detection is not comprehensive, which will reduce the accuracy of glass bottle defect detection. For example, the literature ("Glass Bottle Mouth Defect Detection Based on Convolutional Neural Network", "Manufacturing Automation", Xie Zeqi et al., 2022-06-25) collects and preprocesses images of glass bottle mouths, uses the preprocessed defect map as a data set, and uses the image recognition model of the nested residual neural network to detect and classify defects in the glass bottle mouth. This method only detects defects at the mouth of the glass bottle, but does not detect defects in other areas of the glass bottle. The detection is not comprehensive, which will reduce the accuracy of glass bottle defect detection. In addition, the Chinese patent application number CN202110050012.5 proposes a glass bottle defect detection method and device based on deep learning and straight line detection, which uses artificial intelligence to establish a correspondence between the detection image features of the detection target and the quality classification of the detection target; and then determines the current quality classification corresponding to the current image features through the corresponding relationship. However, this method only classifies defects and loses specific detailed information about the defects, which will reduce the accuracy of glass bottle defect detection.

[0006] To this end, a glass defect visual detection device and a detection method thereof are proposed. Summary of the invention

[0007] The object of the present invention is to provide a glass defect visual inspection device and a method thereof. First, the present invention uses a glass segmentation unit to segment a glass bottle to be inspected, obtains a bottle mouth area, a bottle neck area, a bottle shoulder area, a bottle body area and a bottle bottom area, and obtains images of the five areas; secondly, the present invention performs defect detection on different areas of the glass bottle to be inspected through five defect detection units, obtains a bottle mouth defect detection value, a bottle neck defect detection value, a bottle shoulder defect detection value, a bottle body defect detection value and a bottle bottom defect detection value; finally, the present invention fuses the five defect detection values ​​through a glass bottle comprehensive defect output unit, obtains a comprehensive defect detection value of the glass bottle, and outputs the detection result.

[0008] To achieve the above object, the present invention provides the following technical solutions:

[0009] A glass defect visual inspection device comprises: a glass bottle segmentation unit, a bottle mouth defect detection unit, a bottle neck defect detection unit, a bottle shoulder defect detection unit, a bottle body defect detection unit, a bottle bottom defect detection unit and a glass bottle comprehensive defect output unit.

[0010] The glass bottle segmentation unit is used to segment the glass bottle to be inspected, obtain the bottle mouth area, bottleneck area, bottle shoulder area, bottle body area and bottle bottom area, and obtain images of the five areas.

[0011] The bottle mouth defect detection unit is used to obtain a bottle mouth defect detection value according to the image of the bottle mouth area.

[0012] Furthermore, the step of obtaining the bottle mouth defect detection value includes:

[0013] Acquire a bottle mouth image of the glass bottle to be detected, wherein the bottle mouth image includes a vertical bottle mouth image perpendicular to the glass bottle to be detected and a plurality of partial side bottle mouth images parallel to the glass bottle to be detected; splice the plurality of partial side bottle mouth images to obtain a side bottle mouth image of the glass bottle to be detected; input the side bottle mouth image of the glass bottle to be detected into a side bottle mouth detection model to obtain a side bottle mouth feature vector;

[0014] The side mouth detection model is used to obtain a standard side mouth feature vector of the side mouth template image; the side mouth defect detection value is obtained through the side mouth feature vector and the standard side mouth feature vector, and the calculation formula is:

[0015] ;

[0016] in, It is expressed as the side mouth defect detection value; Expressed as a normalized function; It is represented by the dimension of the side mouth feature vector and the standard side mouth feature vector; It is represented as the i-th element value of the side mouth feature vector; It is represented by the i-th element value of the standard side mouth feature vector; It is represented by the number of different values ​​of the elements at corresponding positions in the side mouth feature vector and the standard side mouth feature vector; It is expressed as the first side mouth defect detection coefficient; It is expressed as the second side mouth defect detection coefficient;

[0017] The bottle mouth parameters are obtained through the vertical bottle mouth image; the bottle mouth parameters include the inner diameter, outer diameter, maximum thickness and thickness uniformity of the bottle mouth; the bottle mouth parameters are compared with the standard bottle mouth parameters to obtain the vertical bottle mouth defect detection value; the side bottle mouth defect detection value and the vertical bottle mouth defect detection value are weighted to obtain the bottle mouth defect detection value.

[0018] Furthermore, the side mouth detection model includes an input layer, a side mouth feature map extraction layer, a side mouth feature map fusion layer and a side mouth feature vector output layer; the input layer is used to input the side mouth image into the side mouth detection model; the side mouth feature map fusion layer is used to obtain multiple side mouth feature maps according to the side mouth image;

[0019] The side mouth feature map fusion layer is used to fuse multiple side mouth feature maps to obtain a side mouth feature vector;

[0020] The side mouth feature vector includes the bubble feature, foreign matter feature, crack feature, depression feature, burr feature, color feature, notch feature and thread feature of the side mouth; the bubble feature includes the number of bubbles and the area of ​​each bubble; the foreign matter feature includes the number of foreign matter and the area of ​​each foreign matter; the crack feature includes the number of cracks and the area of ​​each crack; the depression feature includes the number of depressions and the area of ​​each depression; the burr feature includes the number of burrs and the length of each burr; the color feature includes color uniformity; the notch feature includes the number of notches and the area of ​​each notch; the thread feature includes the pitch and thread angle of the mouth thread;

[0021] The side mouth feature vector output layer is used to output the side mouth feature vector.

[0022] Furthermore, the bottleneck defect detection unit comprises: obtaining a bottleneck image of the glass bottle to be detected; performing bottleneck feature extraction on the bottleneck image to obtain a bottleneck feature vector; the bottleneck feature vector comprises bubble features, foreign matter features, crack features, depression features, color features and size features of the bottleneck area;

[0023] The size characteristics include the length of the bottleneck area, the average diameter and the diameter uniformity; the diameter uniformity is expressed as:

[0024] ;

[0025] in, It is expressed as the diameter uniformity of the bottleneck area; It is expressed as the maximum diameter of the bottleneck area; It is expressed as the minimum diameter of the bottleneck area; It is expressed as the average diameter of the bottleneck area;

[0026] Obtain a standard bottleneck feature vector of the bottleneck template image; obtain a bottleneck defect detection value through the bottleneck feature vector and the standard bottleneck feature vector. The specific calculation formula can refer to the calculation formula of the side bottle mouth defect detection value.

[0027] Furthermore, the shoulder defect detection unit includes: acquiring a shoulder image of the glass bottle to be detected; performing shoulder feature extraction on the shoulder image to acquire a shoulder feature vector; the shoulder feature vector includes bubble features, foreign matter features, crack features, depression features, color features and size features in the shoulder area; the size features include the edge curvature, height, top diameter and bottom diameter of the shoulder area; acquiring a standard shoulder feature vector of the shoulder template image; acquiring a shoulder defect detection value through the shoulder feature vector and the standard shoulder feature vector, and the specific calculation formula can refer to the calculation formula of the side bottle mouth defect detection value.

[0028] Furthermore, the bottle body defect detection unit includes: the bottle body defect detection unit is used to obtain a bottle body defect detection value according to the image of the bottle body area, and the specific acquisition process can refer to the acquisition process of the bottleneck defect detection value.

[0029] Furthermore, the bottle bottom defect detection unit includes: acquiring a bottle bottom image of the glass bottle to be detected; performing bottle bottom feature extraction on the bottle bottom image to acquire a bottle bottom feature vector; the bottle bottom feature vector includes bubble features, foreign matter features, crack features, depression features, color features, texture features, shape features and size features of the bottle bottom area; acquiring a standard bottle bottom feature vector of the bottle bottom template image; acquiring a bottle bottom defect detection value through the bottle bottom feature vector and the standard bottle bottom feature vector, and the specific calculation formula can refer to the calculation formula of the side bottle mouth defect detection value.

[0030] A glass defect visual detection method, comprising:

[0031] Segment the glass bottle to be inspected to obtain the bottle mouth area, the bottle neck area, the bottle shoulder area, the bottle body area and the bottle bottom area, and obtain images of the five areas;

[0032] Perform defect detection on different areas of the glass bottle to be detected to obtain a bottle mouth defect detection value, a bottle neck defect detection value, a bottle shoulder defect detection value, a bottle body defect detection value, and a bottle bottom defect detection value;

[0033] The comprehensive defect detection value of the glass bottle is obtained according to the five defect detection values, and the detection result is output.

[0034] Furthermore, the process of obtaining the bottle mouth defect detection value includes:

[0035] Acquire a bottle mouth image of the glass bottle to be detected, wherein the bottle mouth image includes a vertical bottle mouth image perpendicular to the glass bottle to be detected and a plurality of partial side bottle mouth images parallel to the glass bottle to be detected; splice the plurality of partial side bottle mouth images to obtain a side bottle mouth image of the glass bottle to be detected; input the side bottle mouth image of the glass bottle to be detected into a side bottle mouth detection model to obtain a side bottle mouth feature vector;

[0036] The side mouth detection model is used to obtain a standard side mouth feature vector of the side mouth template image; the side mouth defect detection value is obtained through the side mouth feature vector and the standard side mouth feature vector, and the calculation formula is:

[0037] ;

[0038] in, It is expressed as the side mouth defect detection value; Expressed as a normalized function; It is represented by the dimension of the side mouth feature vector and the standard side mouth feature vector; It is represented as the i-th element value of the side mouth feature vector; It is represented by the i-th element value of the standard side mouth feature vector; It is represented by the number of different values ​​of the elements at corresponding positions in the side mouth feature vector and the standard side mouth feature vector; It is expressed as the first side mouth defect detection coefficient; It is expressed as the second side mouth defect detection coefficient;

[0039] Obtaining bottle mouth parameters through the vertical bottle mouth image; the bottle mouth parameters include the inner diameter, outer diameter, maximum thickness and thickness uniformity of the bottle mouth; comparing the bottle mouth parameters with standard bottle mouth parameters to obtain vertical bottle mouth defect detection values;

[0040] The side bottle mouth defect detection value and the vertical bottle mouth defect detection value are weighted to obtain the bottle mouth defect detection value.

[0041] Furthermore, the side mouth detection model includes an input layer, a side mouth feature map extraction layer, a side mouth feature map fusion layer and a side mouth feature vector output layer; the input layer is used to input the side mouth image into the side mouth detection model; the side mouth feature map fusion layer is used to obtain multiple side mouth feature maps according to the side mouth image;

[0042] The side mouth feature map fusion layer is used to fuse multiple side mouth feature maps to obtain a side mouth feature vector;

[0043] The side mouth feature vector includes the bubble feature, foreign matter feature, crack feature, depression feature, burr feature, color feature, notch feature and thread feature of the side mouth; the bubble feature includes the number of bubbles and the area of ​​each bubble; the foreign matter feature includes the number of foreign matter and the area of ​​each foreign matter; the crack feature includes the number of cracks and the area of ​​each crack; the depression feature includes the number of depressions and the area of ​​each depression; the burr feature includes the number of burrs and the length of each burr; the color feature includes color uniformity; the notch feature includes the number of notches and the area of ​​each notch; the thread feature includes the pitch and thread angle of the mouth thread;

[0044] The side mouth feature vector output layer is used to output the side mouth feature vector.

[0045] Compared with the prior art, the present invention has the following beneficial effects:

[0046] 1. The present invention provides a side mouth detection model, which obtains the bubble features, foreign body features, crack features, dent features, burr features, color features, notch features and thread features of the side mouth, and constructs the side mouth feature vector. This model can comprehensively obtain various defect features in the side mouth image, and then more accurately obtain the bottle mouth defect detection value.

[0047] 2. The present invention divides the bottle mouth defect detection into two regions: the vertical bottle mouth and the side bottle mouth, and extracts the feature vectors and parameters of the bottle mouths in different regions respectively. The present invention obtains the side bottle mouth defect detection value and the vertical bottle mouth defect detection value according to the feature vectors and parameters of the bottle mouths in different regions, and performs weighting to obtain the bottle mouth defect detection value. This method takes into account the defect characteristics of different regions of the bottle mouth, and can accurately obtain the bottle mouth defect detection value, and then accurately obtain the comprehensive defect detection value.

[0048] 3. The present invention divides the glass bottle into five areas: bottle mouth, bottle neck, bottle shoulder, bottle body and bottle bottom, and performs defect detection on the five areas to obtain the defect detection value of each area. The present invention obtains the comprehensive defect detection value of the glass bottle based on the defect detection value of each area, and judges whether the glass bottle is qualified according to the comprehensive defect detection value. This method integrates various areas of the glass bottle and can comprehensively and accurately perform defect detection on the glass bottle. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A schematic diagram of the structure of a glass defect visual detection device provided by an embodiment of the present invention;

[0050] Figure 2 A schematic diagram of a flow chart of a glass defect visual detection method provided by an embodiment of the present invention;

[0051] Figure 3 A schematic diagram of five regions of the first type of glass bottles produced by Factory A provided in an embodiment of the present invention;

[0052] Figure 4 A schematic diagram of five regions of the second type of glass bottles produced by Factory A provided in an embodiment of the present invention;

[0053] Figure 5 A schematic diagram of a vertical bottle mouth image provided by an embodiment of the present invention;

[0054] Figure 6 A schematic diagram of a partial side bottle mouth image provided by an embodiment of the present invention;

[0055] Figure 7 A schematic diagram of the structure of a side bottle mouth detection model provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0056] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0057] In the process of glass manufacturing, various defects often appear, such as bubbles, stones and cracks. These defects not only affect the appearance quality of the product, but also may affect its functional performance and even endanger its safety. Therefore, it is very important to detect defects in glass products.

[0058] Defect detection for glass products includes visual inspection, acoustic inspection, and thermal inspection. Compared with other inspection methods, visual inspection does not require contact with the inspected object, so it will not cause any damage or impact to the inspected object. In addition, visual inspection can flexibly adapt to objects of different shapes, sizes, and surface characteristics without the need for additional customized equipment.

[0059] The present invention provides a glass defect visual detection device, which is applied to a glass defect visual detection method. For a specific device structure diagram and method flow chart, see Figure 1 and Figure 2 .

[0060] A glass defect visual inspection device comprises a glass bottle segmentation unit, a bottle mouth defect inspection unit, a bottle neck defect inspection unit, a bottle shoulder defect inspection unit, a bottle body defect inspection unit, a bottle bottom defect inspection unit and a glass bottle comprehensive defect output unit.

[0061] Embodiment 1

[0062] In this example, two glass bottles produced by Factory A were selected for testing. Figure 1 A glass bottle segmentation unit is provided, wherein the glass bottle segmentation unit is applied to S10 of a glass defect visual detection method.

[0063] Furthermore, the glass bottle segmentation unit is used to segment the glass bottle to be detected, obtain the bottle mouth area, the bottleneck area, the bottle shoulder area, the bottle body area and the bottle bottom area, and obtain images of the five areas. The specific five areas are referred to Figure 3 and Figure 4 , Figure 3 Schematic representation of the five regions of the first type of glass bottle; Figure 4 Schematic diagram showing the five regions of the second type of glass bottle.

[0064] Reference Figure 1 The bottle mouth defect detection unit, the bottle neck defect detection unit, the bottle shoulder defect detection unit, the bottle body defect detection unit and the bottle bottom defect detection unit, the five defect detection units are applied to S20 of a glass defect visual detection method.

[0065] Furthermore, the bottle mouth defect detection unit is used to obtain a bottle mouth defect detection value according to the image of the bottle mouth area, and the specific steps include:

[0066] The mouth image of the glass bottle to be detected is collected, and the mouth image includes a vertical mouth image perpendicular to the glass bottle to be detected and a plurality of partial side mouth images parallel to the glass bottle to be detected; the vertical mouth image and the partial side mouth image are referenced Figure 5 and Figure 6 ; stitching the plurality of partial side mouth images to obtain a side mouth image of the glass bottle to be detected; inputting the side mouth image of the glass bottle to be detected into a side mouth detection model to obtain a side mouth feature vector;

[0067] Further, refer to Figure 7 The side mouth detection model includes an input layer, a side mouth feature map extraction layer, a side mouth feature map fusion layer and a side mouth feature vector output layer; the input layer is used to input the side mouth image into the side mouth detection model; the side mouth feature map fusion layer is used to perform a series of convolution operations on the side mouth image to obtain multiple side mouth feature maps;

[0068] The side mouth feature map fusion layer is used to fuse multiple side mouth feature maps to obtain a side mouth feature vector;

[0069] The side mouth feature vector includes the bubble feature, foreign matter feature, crack feature, depression feature, burr feature, color feature, notch feature and thread feature of the side mouth; the bubble feature includes the number of bubbles and the area of ​​each bubble; the foreign matter feature includes the number of foreign matter and the area of ​​each foreign matter; the crack feature includes the number of cracks and the area of ​​each crack; the depression feature includes the number of depressions and the area of ​​each depression; the burr feature includes the number of burrs and the length of each burr; the color feature includes color uniformity; the color uniformity is the standard deviation of the pixel value of the side mouth image; the notch feature includes the number of notches and the area of ​​each notch; the thread feature includes the pitch and thread angle of the bottle mouth thread; the side mouth feature vector output layer is used to output the side mouth feature vector.

[0070] This step of the present embodiment provides a side mouth detection model, which obtains the bubble features, foreign body features, crack features, dent features, burr features, color features, notch features and thread features of the side mouth, and constructs the side mouth feature vector. This model can comprehensively obtain various defect features in the side mouth image, and thus more accurately obtain the mouth defect detection value.

[0071] Furthermore, the side mouth detection model is used to obtain a standard side mouth feature vector of the side mouth template image; and a side mouth defect detection value is obtained through the side mouth feature vector and the standard side mouth feature vector, and the calculation formula is:

[0072] ;

[0073] in, It is expressed as the side mouth defect detection value; Expressed as a normalized function; It is represented by the dimension of the side mouth feature vector and the standard side mouth feature vector; It is represented as the i-th element value of the side mouth feature vector; It is represented by the i-th element value of the standard side mouth feature vector; It is represented by the number of different values ​​of the elements at corresponding positions in the side mouth feature vector and the standard side mouth feature vector; It is expressed as the first side mouth defect detection coefficient; It is expressed as the second side mouth defect detection coefficient; the first side mouth defect detection coefficient and the second side mouth defect detection coefficient are obtained by training with multiple historical data.

[0074] The bottle mouth parameters are obtained through the vertical bottle mouth image; the bottle mouth parameters include the inner diameter, outer diameter, maximum thickness and thickness uniformity of the bottle mouth; meanwhile, the standard bottle mouth parameters of the vertical bottle mouth template image are obtained; the bottle mouth parameters are compared with the standard bottle mouth parameters to obtain the vertical bottle mouth defect detection value, and the calculation formula is:

[0075] ;

[0076] in, It is expressed as the vertical bottle mouth defect detection value; It is represented by the inner diameter of the mouth of the glass bottle to be tested; It is represented by the outer diameter of the mouth of the glass bottle to be tested; It is expressed as the maximum thickness of the mouth of the glass bottle to be tested; It is expressed as the uniformity of the thickness of the mouth of the glass bottle to be tested; Expressed as the inner diameter of the bottle mouth in the standard bottle mouth parameters; Expressed as the outer diameter of the bottle mouth in the standard bottle mouth parameters; It is expressed as the maximum thickness of the bottle mouth in the standard bottle mouth parameters; It is expressed as the uniformity of bottle mouth thickness in the standard bottle mouth parameters;

[0077] The calculation formula for the thickness uniformity is:

[0078] ;

[0079] in, Expressed as the thickness uniformity of the bottle mouth; Expressed as the maximum thickness of the bottle mouth; It is expressed as the minimum thickness of the bottleneck; Expressed as the average thickness of the bottleneck;

[0080] The side bottle mouth defect detection value and the vertical bottle mouth defect detection value are weighted to obtain the bottle mouth defect detection value.

[0081] This step of the present embodiment divides the bottle mouth defect detection into two regions, the vertical bottle mouth and the side bottle mouth, and extracts the feature vectors and parameters of the bottle mouths in different regions respectively. This embodiment obtains the side bottle mouth defect detection value and the vertical bottle mouth defect detection value according to the feature vectors and parameters of the bottle mouths in different regions, and performs weighting to obtain the bottle mouth defect detection value. This method takes into account the defect characteristics of different regions of the bottle mouth, and can accurately obtain the bottle mouth defect detection value, and then accurately obtain the comprehensive defect detection value.

[0082] Furthermore, the bottleneck defect detection unit is used to obtain a bottleneck defect detection value according to the image of the bottleneck area, and the specific steps include:

[0083] Obtain a bottleneck image of a glass bottle to be detected; input the bottleneck image into a bottleneck defect detection model to obtain a bottleneck feature vector; the bottleneck defect detection model includes an input layer, a bottleneck feature map acquisition layer, a bottleneck feature fusion layer and a bottleneck feature vector output layer; the bottleneck feature map acquisition layer is used to perform a series of convolution operations on the bottleneck image to obtain multiple bottleneck feature maps; the bottleneck feature fusion layer is used to obtain a bottleneck feature vector based on the multiple bottleneck feature maps;

[0084] The bottleneck feature vector includes bubble features, foreign matter features, crack features, depression features, color features and size features of the bottleneck area;

[0085] The size characteristics include the length of the bottleneck area, the average diameter and the diameter uniformity; the diameter uniformity is expressed as:

[0086] ;

[0087] in, It is expressed as the diameter uniformity of the bottleneck area; It is expressed as the maximum diameter of the bottleneck area; It is expressed as the minimum diameter of the bottleneck area; It is expressed as the average diameter of the bottleneck area;

[0088] Obtain a bottleneck template image, and input the bottleneck template image into a bottleneck defect detection model to obtain a standard bottleneck feature vector; obtain a bottleneck defect detection value through the bottleneck feature vector and the standard bottleneck feature vector. The specific calculation formula can refer to the calculation formula of the side bottle mouth defect detection value.

[0089] This step of the present embodiment performs defect detection on the bottleneck area, and obtains the bubble features, foreign matter features, crack features, depression features, color features and size features of the bottleneck area based on the image of the bottleneck area, wherein the size features include the length, average diameter and diameter uniformity of the bottleneck area. This embodiment compares these features with the features in the bottleneck template image to obtain the bottleneck defect detection value. This method can fully extract the defect features of the bottleneck area, can accurately obtain the bottleneck defect detection value, and then accurately obtain the comprehensive defect detection value.

[0090] Furthermore, the bottle shoulder defect detection unit is used to obtain a bottle shoulder defect detection value according to the image of the bottle shoulder area, and the specific steps include:

[0091] Acquire a shoulder image of the glass bottle to be detected; input the shoulder image into a shoulder defect detection model to acquire a shoulder feature vector; the shoulder defect detection model comprises an input layer, a shoulder feature map acquisition layer, a shoulder feature fusion layer and a shoulder feature vector output layer; the shoulder feature map acquisition layer is used to perform a series of convolution operations on the shoulder image to obtain a plurality of shoulder feature maps; the shoulder feature fusion layer is used to acquire a shoulder feature vector based on the plurality of shoulder feature maps;

[0092] The shoulder feature vector includes bubble feature, foreign body feature, crack feature, depression feature, color feature and size feature of the shoulder area; the size feature includes the edge curvature, height, top diameter and bottom diameter of the shoulder area;

[0093] A bottle shoulder template image is obtained, and the bottle shoulder template image is input into a bottle shoulder defect detection model to obtain a standard bottle shoulder feature vector; a bottle shoulder defect detection value is obtained through the bottle shoulder feature vector and the standard bottle shoulder feature vector. The specific calculation formula can refer to the calculation formula of the side bottle mouth defect detection value.

[0094] In this step of the present embodiment, defect detection is performed on the bottle shoulder area. Based on the image of the bottle shoulder area, bubble features, foreign matter features, crack features, depression features, color features and size features of the bottle shoulder area are obtained, wherein the size features include the edge arc, height, top diameter and bottom diameter of the bottle shoulder area. In this embodiment, these features are compared with the features in the bottle shoulder template image to obtain the bottle shoulder defect detection value. This method can fully extract the defect features of the bottle shoulder area, can accurately obtain the bottle shoulder defect detection value, and then accurately obtain the comprehensive defect detection value.

[0095] Furthermore, the bottle body defect detection unit is used to obtain a bottle body defect detection value according to the image of the bottle body area, and the specific steps include:

[0096] Acquire a bottle body image of a glass bottle to be detected; input the bottle body image into a bottle body defect detection model to acquire a bottle body feature vector; the bottle body defect detection model comprises an input layer, a bottle body feature map acquisition layer, a bottle body feature fusion layer and a bottle body feature vector output layer; the bottle body feature map acquisition layer is used to perform a series of convolution operations on the bottle body image to obtain a plurality of bottle body feature maps; the bottle body feature fusion layer is used to acquire a bottle body feature vector according to the plurality of bottle body feature maps;

[0097] The bottle body feature vector includes the bubble feature, foreign body feature, crack feature, dent feature, color feature and size feature of the bottle body area; the size feature includes the length, average diameter and diameter uniformity of the bottle body area; the diameter uniformity is expressed as:

[0098] ;

[0099] in, It is expressed as the diameter uniformity of the bottleneck area; It is expressed as the maximum diameter of the bottleneck area; It is expressed as the minimum diameter of the bottleneck area; It is expressed as the average diameter of the bottleneck area;

[0100] Obtain a bottle body template image, and input the bottle body template image into a bottle body defect detection model to obtain a standard bottle body feature vector; obtain a bottle body defect detection value through the bottle body feature vector and the standard bottle body feature vector. The specific calculation formula can refer to the calculation formula of the side bottle mouth defect detection value.

[0101] This step of the present embodiment performs defect detection on the bottle body area, and obtains the bubble features, foreign matter features, crack features, depression features, color features and size features of the bottle body area based on the image of the bottle body area, wherein the size features include the length, average diameter and diameter uniformity of the bottle body area. This embodiment compares these features with the features in the bottle body template image to obtain the bottle body defect detection value. This method can fully extract the defect features of the bottle body area, can accurately obtain the bottle body defect detection value, and then accurately obtain the comprehensive defect detection value.

[0102] Furthermore, the bottle bottom defect detection unit is used to obtain a bottle bottom defect detection value according to the image of the bottle bottom area, and the specific steps include:

[0103] Acquire a bottle bottom image of the glass bottle to be detected; input the bottle bottom image into a bottle bottom defect detection model to acquire a bottle bottom feature vector; the bottle bottom defect detection model comprises an input layer, a bottle bottom feature map acquisition layer, a bottle bottom feature fusion layer and a bottle bottom feature vector output layer; the bottle bottom feature map acquisition layer is used to perform a series of convolution operations on the bottle bottom image to obtain a plurality of bottle bottom feature maps; the bottle bottom feature fusion layer is used to acquire a bottle bottom feature vector according to the plurality of the bottle bottom feature maps; the bottle bottom feature vector comprises bubble features, foreign matter features, crack features, concave features, color features, texture features, shape features and size features of the bottle bottom area;

[0104] Acquire a bottle bottom template image, and input the bottle bottom template image into a bottle bottom defect detection model to obtain a standard bottle bottom feature vector; obtain a bottle bottom defect detection value through the bottle bottom feature vector and the standard bottle bottom feature vector. The specific calculation formula can refer to the calculation formula of the side bottle mouth defect detection value.

[0105] In this step of the present embodiment, defect detection is performed on the bottle bottom area. Based on the image of the bottle bottom area, bubble features, foreign matter features, crack features, depression features, color features, texture features, shape features and size features of the bottle bottom area are obtained. In this embodiment, these features are compared with the features in the bottle bottom template image to obtain the bottle bottom defect detection value. This method can fully extract the defect features of the bottle bottom area, can accurately obtain the bottle bottom defect detection value, and then accurately obtain the comprehensive defect detection value.

[0106] Reference Figure 1 The glass bottle comprehensive defect output unit is applied to S30 of a glass defect visual detection method.

[0107] Furthermore, the glass bottle comprehensive defect output unit is used to obtain the comprehensive defect detection value of the glass bottle according to the five defect detection values, and output the detection result. The specific process includes:

[0108] Get the comprehensive defect detection value, the calculation formula is:

[0109] ;

[0110] in, Expressed as comprehensive defect detection value; It is expressed as the bottle mouth defect detection value; It is expressed as the bottleneck defect detection value; It is expressed as the detection value of bottle shoulder defect; It is expressed as the bottle body defect detection value; It is expressed as the bottle bottom defect detection value; It is expressed as the bottle mouth defect coefficient; It is expressed as the bottleneck defect coefficient; Expressed as bottle shoulder defect coefficient; Expressed as bottle defect coefficient; It is expressed as the bottle bottom defect coefficient; It is expressed as an exponential function with e as the base; the mouth defect coefficient, the neck defect coefficient, the shoulder defect coefficient, the body defect coefficient and the bottom defect coefficient are obtained through training with a large amount of historical data.

[0111] When the comprehensive defect detection value is lower than the set threshold, it indicates that the defect detection result of the glass bottle to be detected is qualified; otherwise, it indicates that the defect detection result of the glass bottle to be detected is unqualified, and the threshold is obtained through training with a large amount of historical data; the defect detection result is output; the output also includes, when the defect detection result is unqualified, judging the defect level of the glass bottle according to the set first threshold and second threshold, and the first threshold and the second threshold are obtained according to the historical experience of experts; the defect level includes minor defects, moderate defects and severe defects; when the comprehensive defect detection value is less than the first threshold, the glass bottle to be detected has a minor defect; when the comprehensive defect detection value is between the first threshold and the second threshold, the glass bottle to be detected has a moderate defect; when the comprehensive defect detection value is greater than the second threshold, the glass bottle to be detected has a severe defect.

[0112] In this implementation, 300 samples of both types of glass bottles produced by Factory A were selected for defect detection. The test results showed that the qualified samples of the two types of glass bottles detected by the device were 284 and 279 respectively, and the unqualified samples were 16 and 21 respectively. Among them, the number of false detections of the two types of glass bottles was 10 and 13 respectively, and the detection accuracy was 96.67% and 95.67% respectively.

[0113] In this step of the present embodiment, the comprehensive defect detection value of the glass bottle is obtained based on the defect detection value of each area, and the comprehensive defect detection value is used to determine whether the glass bottle is qualified, and the unqualified glass bottles to be tested are classified into defect levels. This method integrates various areas of the glass bottle and can comprehensively and accurately perform defect detection on the glass bottle.

[0114] Embodiment 2

[0115] In this example, two glass bottles produced by Factory B were selected for testing. Figure 1 A glass bottle segmentation unit is provided, wherein the glass bottle segmentation unit is applied to S10 of a glass defect visual detection method.

[0116] Furthermore, the glass bottle segmentation unit is used to segment the glass bottle to be inspected, obtain the bottle mouth area, bottleneck area, bottle shoulder area, bottle body area and bottle bottom area, and obtain images of the five areas.

[0117] Reference Figure 1 The bottle mouth defect detection unit, the bottle neck defect detection unit, the bottle shoulder defect detection unit, the bottle body defect detection unit and the bottle bottom defect detection unit, the five defect detection units are applied to S20 of a glass defect visual detection method.

[0118] Furthermore, the bottle mouth defect detection unit is used to obtain a bottle mouth defect detection value according to the image of the bottle mouth area, and the specific steps include:

[0119] Acquire a bottle mouth image of the glass bottle to be detected, wherein the bottle mouth image includes a vertical bottle mouth image perpendicular to the glass bottle to be detected and a plurality of partial side bottle mouth images parallel to the glass bottle to be detected; splice the plurality of partial side bottle mouth images to obtain a side bottle mouth image of the glass bottle to be detected; input the side bottle mouth image of the glass bottle to be detected into a side bottle mouth detection model to obtain a side bottle mouth feature vector;

[0120] Further, refer to Figure 7 The side mouth detection model includes an input layer, a side mouth feature map extraction layer, a side mouth feature map fusion layer and a side mouth feature vector output layer; the input layer is used to input the side mouth image into the side mouth detection model; the side mouth feature map fusion layer is used to obtain multiple side mouth feature maps according to the side mouth image;

[0121] The side mouth feature map fusion layer is used to fuse multiple side mouth feature maps to obtain a side mouth feature vector;

[0122] The side mouth feature vector includes the bubble feature, foreign matter feature, crack feature, depression feature, burr feature, color feature, notch feature and thread feature of the side mouth; the bubble feature includes the number of bubbles and the area of ​​each bubble; the foreign matter feature includes the number of foreign matter and the area of ​​each foreign matter; the crack feature includes the number of cracks and the area of ​​each crack; the depression feature includes the number of depressions and the area of ​​each depression; the burr feature includes the number of burrs and the length of each burr; the color feature includes color uniformity; the notch feature includes the number of notches and the area of ​​each notch; the thread feature includes the pitch and thread angle of the mouth thread;

[0123] The side mouth feature vector output layer is used to output the side mouth feature vector.

[0124] Furthermore, the side mouth detection model is used to obtain a standard side mouth feature vector of the side mouth template image; and a side mouth defect detection value is obtained through the side mouth feature vector and the standard side mouth feature vector, and the calculation formula is:

[0125] ;

[0126] in, It is expressed as the side mouth defect detection value; Expressed as a normalized function; It is represented by the dimension of the side mouth feature vector and the standard side mouth feature vector; It is represented as the i-th element value of the side mouth feature vector; It is represented by the i-th element value of the standard side mouth feature vector; It is represented by the number of different values ​​of the elements at corresponding positions in the side mouth feature vector and the standard side mouth feature vector; It is expressed as the first side mouth defect detection coefficient; It is expressed as the second side mouth defect detection coefficient;

[0127] The bottle mouth parameters are obtained through the vertical bottle mouth image; the bottle mouth parameters include the inner diameter, outer diameter, maximum thickness and thickness uniformity of the bottle mouth; meanwhile, the standard bottle mouth parameters of the vertical bottle mouth template image are obtained; the bottle mouth parameters are compared with the standard bottle mouth parameters to obtain the vertical bottle mouth defect detection value, and the calculation formula is:

[0128] ;

[0129] in, It is expressed as the vertical bottle mouth defect detection value; It is represented by the inner diameter of the mouth of the glass bottle to be tested; It is represented by the outer diameter of the mouth of the glass bottle to be tested; It is expressed as the maximum thickness of the mouth of the glass bottle to be tested; It is expressed as the uniformity of the thickness of the mouth of the glass bottle to be tested; Expressed as the inner diameter of the bottle mouth in the standard bottle mouth parameters; Expressed as the outer diameter of the bottle mouth in the standard bottle mouth parameters; It is expressed as the maximum thickness of the bottle mouth in the standard bottle mouth parameters; It is expressed as the uniformity of bottle mouth thickness in the standard bottle mouth parameters;

[0130] The calculation formula for the thickness uniformity is:

[0131] ;

[0132] in, Expressed as the thickness uniformity of the bottle mouth; Expressed as the maximum thickness of the bottle mouth; It is expressed as the minimum thickness of the bottleneck; Expressed as the average thickness of the bottleneck;

[0133] The side bottle mouth defect detection value and the vertical bottle mouth defect detection value are weighted to obtain the bottle mouth defect detection value.

[0134] Furthermore, the bottleneck defect detection unit is used to obtain a bottleneck defect detection value according to the image of the bottleneck area, and the specific steps include:

[0135] Acquire a bottleneck image of the glass bottle to be inspected; perform bottleneck feature extraction on the bottleneck image to obtain a bottleneck feature vector; the bottleneck feature vector includes bubble features, foreign matter features, crack features, depression features, color features and size features of the bottleneck area;

[0136] The size characteristics include the length of the bottleneck area, the average diameter and the diameter uniformity; the diameter uniformity is expressed as:

[0137] ;

[0138] in, It is expressed as the diameter uniformity of the bottleneck area; It is expressed as the maximum diameter of the bottleneck area; It is expressed as the minimum diameter of the bottleneck area; It is expressed as the average diameter of the bottleneck area;

[0139] Obtain a standard bottleneck feature vector of the bottleneck template image; obtain a bottleneck defect detection value through the bottleneck feature vector and the standard bottleneck feature vector. The specific calculation formula can refer to the calculation formula of the side bottle mouth defect detection value.

[0140] Furthermore, the bottle shoulder defect detection unit is used to obtain a bottle shoulder defect detection value according to the image of the bottle shoulder area, and the specific steps include:

[0141] Acquire a shoulder image of the glass bottle to be inspected; perform shoulder feature extraction on the shoulder image to acquire a shoulder feature vector; the shoulder feature vector includes bubble features, foreign matter features, crack features, depression features, color features and size features in the shoulder area; the size features include the edge curvature, height, top diameter and bottom diameter of the shoulder area; acquire a standard shoulder feature vector of the shoulder template image; acquire a shoulder defect detection value through the shoulder feature vector and the standard shoulder feature vector, and the specific calculation formula can refer to the calculation formula of the side bottle mouth defect detection value.

[0142] Furthermore, the bottle body defect detection unit is used to obtain a bottle body defect detection value according to the image of the bottle body area, and the specific steps include:

[0143] Acquire a bottle body image of a glass bottle to be inspected; extract bottleneck features from the bottle body image to acquire a bottle body feature vector; the bottle body feature vector includes bubble features, foreign matter features, crack features, dent features, color features, and size features of the bottle body area;

[0144] The dimensional characteristics include the length, average diameter and diameter uniformity of the bottle body area; the diameter uniformity is expressed as:

[0145] ;

[0146] in, It is expressed as the diameter uniformity of the bottleneck area; It is expressed as the maximum diameter of the bottleneck area; It is expressed as the minimum diameter of the bottleneck area; It is expressed as the average diameter of the bottleneck area;

[0147] Obtain a standard bottle body feature vector of the bottle body template image; obtain a bottle body defect detection value through the bottle body feature vector and the standard bottle body feature vector. The specific calculation formula can refer to the calculation formula of the side bottle mouth defect detection value.

[0148] Furthermore, the bottle bottom defect detection unit is used to obtain a bottle bottom defect detection value according to the image of the bottle bottom area, and the specific steps include:

[0149] Acquire a bottle bottom image of the glass bottle to be inspected; perform bottle bottom feature extraction on the bottle bottom image to acquire a bottle bottom feature vector; the bottle bottom feature vector includes bubble features, foreign matter features, crack features, depression features, color features, texture features, shape features and size features of the bottle bottom area; acquire a standard bottle bottom feature vector of the bottle bottom template image; acquire a bottle bottom defect detection value through the bottle bottom feature vector and the standard bottle bottom feature vector, and the specific calculation formula can refer to the calculation formula of the side bottle mouth defect detection value.

[0150] Reference Figure 1 The glass bottle comprehensive defect output unit is applied to S30 of a glass defect visual detection method.

[0151] Furthermore, the glass bottle comprehensive defect output unit is used to obtain the comprehensive defect detection value of the glass bottle according to the five defect detection values, and output the detection result. The specific process includes:

[0152] Get the comprehensive defect detection value, the calculation formula is:

[0153] ;

[0154] in, Expressed as comprehensive defect detection value; It is expressed as the bottle mouth defect detection value; It is expressed as the bottleneck defect detection value; It is expressed as the detection value of bottle shoulder defect; It is expressed as the bottle body defect detection value; It is expressed as the bottle bottom defect detection value; It is expressed as the bottle mouth defect coefficient; It is expressed as the bottleneck defect coefficient; Expressed as bottle shoulder defect coefficient; Expressed as bottle defect coefficient; It is expressed as the bottle bottom defect coefficient; Expressed as an exponential function with base e;

[0155] When the comprehensive defect detection value is lower than the set threshold, it indicates that the defect detection result of the glass bottle to be detected is qualified; otherwise, it indicates that the defect detection result of the glass bottle to be detected is unqualified; and the defect detection result is output.

[0156] In this implementation, 400 samples of both types of glass bottles produced by Factory B were selected for defect detection. The test results showed that the qualified samples of the two types of glass bottles detected by the device were 386 and 381 respectively, and the unqualified samples were 14 and 19 respectively. Among them, the number of false detections of the two types of glass bottles was 17 and 19 respectively, and the detection accuracy was 95.75% and 95.25% respectively.

[0157] The present embodiment provides a side mouth detection model, which obtains the bubble features, foreign matter features, crack features, depression features, burr features, color features, notch features and thread features of the side mouth, and constructs the side mouth feature vector. This model can comprehensively obtain various defect features in the side mouth image, and then more accurately obtain the mouth defect detection value. The present embodiment divides the mouth defect detection into two regions, the vertical mouth and the side mouth, and extracts the feature vectors and parameters of the mouths in different regions respectively. The present embodiment obtains the side mouth defect detection value and the vertical mouth defect detection value according to the feature vectors and parameters of the mouths in different regions, and performs weighting to obtain the mouth defect detection value. This method takes into account the defect features of different regions of the mouth, and can accurately obtain the mouth defect detection value, and then accurately obtain the comprehensive defect detection value. The present embodiment divides the glass bottle into five regions, namely the mouth, bottleneck, shoulder, body and bottom, and performs defect detection on the five regions to obtain the defect detection value of each region. This embodiment obtains the comprehensive defect detection value of the glass bottle based on the defect detection value of each area, and determines whether the glass bottle is qualified based on the comprehensive defect detection value. This method integrates various areas of the glass bottle and can comprehensively and accurately perform defect detection on the glass bottle.

[0158] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A glass defect visual detection device, characterized in that: include: A glass bottle segmentation unit, a bottle mouth defect detection unit, a bottle neck defect detection unit, a bottle shoulder defect detection unit, a bottle body defect detection unit, a bottle bottom defect detection unit and a glass bottle comprehensive defect output unit; the glass bottle segmentation unit is used to segment the glass bottle to be detected, obtain the bottle mouth area, the bottle neck area, the bottle shoulder area, the bottle body area and the bottle bottom area, and obtain images of the five areas; The five defect detection units are used to perform defect detection on the five areas to obtain a bottle mouth defect detection value, a bottle neck defect detection value, a bottle shoulder defect detection value, a bottle body defect detection value and a bottle bottom defect detection value; The glass bottle comprehensive defect output unit is used to obtain the comprehensive defect detection value of the glass bottle according to the five defect detection values ​​and output the detection result. The specific process includes: obtaining the comprehensive defect detection value, and the calculation formula is: Among them, zhqx represents the comprehensive defect detection value; pkqx represents the bottle mouth defect detection value; pjqx represents the bottleneck defect detection value; It is represented by the bottle shoulder defect detection value; psqx is represented by the bottle body defect detection value; pdqx is represented by the bottle bottom defect detection value; β1 is represented by the bottle mouth defect coefficient; β2 is represented by the bottle neck defect coefficient; β3 is represented by the bottle shoulder defect coefficient; β4 is represented by the bottle body defect coefficient; β5 is represented by the bottle bottom defect coefficient; exp() is represented by an exponential function with e as the base; When the comprehensive defect detection value is lower than the set threshold, it indicates that the defect detection result of the glass bottle to be detected is qualified; otherwise, it indicates that the defect detection result of the glass bottle to be detected is unqualified; the defect detection result is output; The bottle mouth defect detection unit is used to obtain the bottle mouth defect detection value according to the image of the bottle mouth area, and the specific steps include: Collecting a bottle mouth image of a glass bottle to be detected, the bottle mouth image includes a vertical bottle mouth image perpendicular to the glass bottle to be detected and a plurality of partial side bottle mouth images parallel to the glass bottle to be detected; splicing the plurality of partial side bottle mouth images to obtain a side bottle mouth image of the glass bottle to be detected; inputting the side bottle mouth image of the glass bottle to be detected into a side bottle mouth detection model to obtain a side bottle mouth feature vector; The side mouth detection model is used to obtain a standard side mouth feature vector of the side mouth template image; the side mouth defect detection value is obtained through the side mouth feature vector and the standard side mouth feature vector, and the calculation formula is: Wherein, cfpk represents the side mouth defect detection value; norm() represents the normalization function; K represents the dimension of the side mouth feature vector and the standard side mouth feature vector; cfxl i It is represented by the i-th element value of the side mouth feature vector; bzcf i It is represented by the i-th element value of the standard side mouth feature vector; cfbt is represented by the number of different element values ​​of the corresponding positions in the side mouth feature vector and the standard side mouth feature vector; α1 is represented by the first side mouth defect detection coefficient; α2 is represented by the second side mouth defect detection coefficient; The bottle mouth parameters are obtained through the vertical bottle mouth image; the bottle mouth parameters include the inner diameter, outer diameter, maximum thickness and thickness uniformity of the bottle mouth; the bottle mouth parameters are compared with the standard bottle mouth parameters to obtain the vertical bottle mouth defect detection value; the side bottle mouth defect detection value and the vertical bottle mouth defect detection value are weighted to obtain the bottle mouth defect detection value.

2. A glass defect visual inspection device according to claim 1, characterized in that: The side mouth detection model includes an input layer, a side mouth feature map extraction layer, a side mouth feature map fusion layer and a side mouth feature vector output layer; the input layer is used to input the side mouth image into the side mouth detection model; the side mouth feature map fusion layer is used to obtain multiple side mouth feature maps according to the side mouth image; The side mouth feature map fusion layer is used to fuse multiple side mouth feature maps to obtain a side mouth feature vector; The side mouth feature vector includes the bubble feature, foreign matter feature, crack feature, depression feature, burr feature, color feature, notch feature and thread feature of the side mouth; the bubble feature includes the number of bubbles and the area of ​​each bubble; the foreign matter feature includes the number of foreign matter and the area of ​​each foreign matter; the crack feature includes the number of cracks and the area of ​​each crack; the depression feature includes the number of depressions and the area of ​​each depression; the burr feature includes the number of burrs and the length of each burr; the color feature includes color uniformity; the notch feature includes the number of notches and the area of ​​each notch; the thread feature includes the pitch and thread angle of the bottle mouth thread; The side mouth feature vector output layer is used to output the side mouth feature vector.

3. The glass defect visual inspection device according to claim 1, characterized in that: The bottleneck defect detection unit comprises: obtaining a bottleneck image of a glass bottle to be detected; performing bottleneck feature extraction on the bottleneck image to obtain a bottleneck feature vector; the bottleneck feature vector comprises bubble features, foreign matter features, crack features, depression features, color features and size features of the bottleneck area; The size characteristics include the length of the bottleneck area, the average diameter and the diameter uniformity; the diameter uniformity is expressed as: Among them, zjjy pj Expressed as the diameter uniformity of the bottleneck area; maxzj pj It is expressed as the maximum diameter of the bottleneck area; minzj pj Expressed as the minimum diameter of the bottleneck area; pjzj pj It is expressed as the average diameter of the bottleneck area; Obtain a standard bottleneck feature vector of the bottleneck template image; obtain a bottleneck defect detection value through the bottleneck feature vector and the standard bottleneck feature vector, and the specific calculation formula is the same as the calculation formula of the side bottle mouth defect detection value.

4. The glass defect visual inspection device according to claim 1, characterized in that: The shoulder defect detection unit includes: acquiring a shoulder image of the glass bottle to be detected; performing shoulder feature extraction on the shoulder image to acquire a shoulder feature vector; the shoulder feature vector includes bubble features, foreign matter features, crack features, depression features, color features and size features in the shoulder area; the size features include the edge curvature, height, top diameter and bottom diameter of the shoulder area; acquiring a standard shoulder feature vector of the shoulder template image; acquiring a shoulder defect detection value through the shoulder feature vector and the standard shoulder feature vector, and the specific calculation formula is the same as the calculation formula of the side bottle mouth defect detection value.

5. The glass defect visual inspection device according to claim 3, characterized in that: The bottle body defect detection unit includes: the bottle body defect detection unit is used to obtain a bottle body defect detection value according to the image of the bottle body area, and the specific acquisition process is the same as the acquisition process of the bottleneck defect detection value.

6. The glass defect visual inspection device according to claim 1, characterized in that: The bottle bottom defect detection unit includes: acquiring a bottle bottom image of the glass bottle to be detected; performing bottle bottom feature extraction on the bottle bottom image to acquire a bottle bottom feature vector; the bottle bottom feature vector includes bubble features, foreign matter features, crack features, depression features, color features, texture features, shape features and size features of the bottle bottom area; acquiring a standard bottle bottom feature vector of the bottle bottom template image; acquiring a bottle bottom defect detection value through the bottle bottom feature vector and the standard bottle bottom feature vector, and the specific calculation formula is the same as the calculation formula of the side bottle mouth defect detection value.

7. A method for visually detecting glass defects, characterized in that: The glass defect visual detection device according to any one of claims 1 to 6 is used for detection, comprising: Segment the glass bottle to be inspected to obtain the bottle mouth area, the bottle neck area, the bottle shoulder area, the bottle body area and the bottle bottom area, and obtain images of the five areas; Perform defect detection on different areas of the glass bottle to be detected to obtain a bottle mouth defect detection value, a bottle neck defect detection value, a bottle shoulder defect detection value, a bottle body defect detection value, and a bottle bottom defect detection value; Obtaining a comprehensive defect detection value of the glass bottle according to the five defect detection values, and outputting the detection result; The calculation formula of the comprehensive defect detection value is: Among them, zhqx represents the comprehensive defect detection value; pkqx represents the bottle mouth defect detection value; pjqx represents the bottleneck defect detection value; It is represented as the detection value of bottle shoulder defect; psqx is represented as the detection value of bottle body defect; pdqx is represented as the detection value of bottle bottom defect; β1 is represented as the bottle mouth defect coefficient; β2 is represented as the bottleneck defect coefficient; β3 is represented as the bottle shoulder defect coefficient; β4 is represented as the bottle body defect coefficient; β5 is represented as the bottle bottom defect coefficient; exp() is represented as an exponential function with e as the base.

8. A glass defect visual detection method according to claim 7, characterized in that: The process of obtaining the bottle mouth defect detection value includes: Acquire a bottle mouth image of the glass bottle to be detected, wherein the bottle mouth image includes a vertical bottle mouth image perpendicular to the glass bottle to be detected and a plurality of partial side bottle mouth images parallel to the glass bottle to be detected; splice the plurality of partial side bottle mouth images to obtain a side bottle mouth image of the glass bottle to be detected; input the side bottle mouth image of the glass bottle to be detected into a side bottle mouth detection model to obtain a side bottle mouth feature vector; The side mouth detection model is used to obtain a standard side mouth feature vector of the side mouth template image; the side mouth defect detection value is obtained through the side mouth feature vector and the standard side mouth feature vector, and the calculation formula is: Wherein, cfpk represents the side mouth defect detection value; norm() represents the normalization function; K represents the dimension of the side mouth feature vector and the standard side mouth feature vector; cfxl i It is represented by the i-th element value of the side mouth feature vector; bzcf i It is represented by the i-th element value of the standard side mouth feature vector; cfbt is represented by the number of different element values ​​of the corresponding positions in the side mouth feature vector and the standard side mouth feature vector; α1 is represented by the first side mouth defect detection coefficient; α2 is represented by the second side mouth defect detection coefficient; Obtaining bottle mouth parameters through the vertical bottle mouth image; the bottle mouth parameters include the inner diameter, outer diameter, maximum thickness and thickness uniformity of the bottle mouth; comparing the bottle mouth parameters with standard bottle mouth parameters to obtain vertical bottle mouth defect detection values; The side bottle mouth defect detection value and the vertical bottle mouth defect detection value are weighted to obtain the bottle mouth defect detection value.

9. A glass defect visual detection method according to claim 8, characterized in that: The side mouth detection model includes an input layer, a side mouth feature map extraction layer, a side mouth feature map fusion layer and a side mouth feature vector output layer; the input layer is used to input the side mouth image into the side mouth detection model; the side mouth feature map fusion layer is used to obtain multiple side mouth feature maps according to the side mouth image; The side mouth feature map fusion layer is used to fuse multiple side mouth feature maps to obtain a side mouth feature vector; The side mouth feature vector includes the bubble feature, foreign matter feature, crack feature, depression feature, burr feature, color feature, notch feature and thread feature of the side mouth; the bubble feature includes the number of bubbles and the area of ​​each bubble; the foreign matter feature includes the number of foreign matter and the area of ​​each foreign matter; the crack feature includes the number of cracks and the area of ​​each crack; the depression feature includes the number of depressions and the area of ​​each depression; the burr feature includes the number of burrs and the length of each burr; the color feature includes color uniformity; the notch feature includes the number of notches and the area of ​​each notch; the thread feature includes the pitch and thread angle of the mouth thread; The side mouth feature vector output layer is used to output the side mouth feature vector.