CN-122023365-A - Online identification method for surface defects of packaging pull line based on machine vision
Abstract
The invention belongs to the technical field of image processing, and particularly relates to a machine vision-based online identification method for surface defects of a packaging stay wire; dynamically constructing background mask strength based on the calculated texture flow direction consistency and the real-time running speed of a production line, generating a defect significance map according to the background mask strength so as to highlight real defects while inhibiting inherent longitudinal texture interference, segmenting suspected defect areas, extracting multi-dimensional features such as LBP, gray level co-occurrence matrix, hu moment and the like, and inputting the multi-dimensional features into a support vector machine classifier for recognition. The invention can adapt to visual characteristic drift caused by speed change in a high-speed production line, avoids the problem that normal stretching textures and longitudinal scratches are difficult to distinguish by a traditional algorithm, and improves the accuracy and the robustness of high-reflection and transparent material defect detection.
Inventors
- GAO NING
- HUANG LEI
Assignees
- 广州聚合包装材料科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260204
Claims (10)
- 1. The online identification method for the surface defects of the package pull lines based on machine vision is characterized by comprising the following steps: Preprocessing the image data to obtain a preprocessed image, wherein the preprocessing comprises brightness correction and limited contrast self-adaptive histogram equalization processing; acquiring the real-time running speed of a production line, and acquiring the background mask strength of each pixel point based on the texture flow direction consistency and the real-time running speed of the production line, wherein the background mask strength is positively correlated with the texture flow direction consistency and the real-time running speed of the production line; And inputting the multidimensional feature vectors into a classifier for recognition, and responding to the existence of surface defects when the recognition result is defects and the confidence coefficient is greater than a set threshold value.
- 2. The machine vision based packaging pull wire surface defect online identification method of claim 1, wherein the brightness correction comprises: the method comprises the steps of calculating an average gray level distribution curve of image data along a horizontal axis, constructing a reverse illumination compensation gain matrix, wherein the value of each element in the gain matrix is inversely proportional to the average gray level value of a corresponding position, and performing dot multiplication operation on the image data and the gain matrix to obtain a corrected image.
- 3. The machine vision based packaging pull line surface defect online identification method of claim 1, wherein the texture flow direction consistency satisfies the expression: ; In the formula, Representing pixel points Texture flow direction consistency of (2); expressed in pixels A local neighborhood window that is a center; expressed in pixels The coordinates in the local neighborhood window which is the center are Is a pixel of (1); Representing pixel points Is a vertical gradient of (2); Representing pixel points Is a horizontal gradient of (2); Representing a distance weight decay function; Representing a first small positive value; representing absolute value symbols.
- 4. The machine vision based packaging pull line surface defect online identification method according to claim 1, wherein the background mask strength satisfies an expression: ; In the formula, Representing pixel points Background mask intensity of (a); is a texture gain coefficient; Representing pixel points Texture flow direction consistency of (2); Representing the real-time running speed of the production line; Is a baseline reference speed; is the base noise bias.
- 5. The machine vision based packaging pull wire surface defect online identification method of claim 1, wherein the defect significance coefficient satisfies the expression: ; In the formula, Representing pixel points Defect significance coefficients of (2); Representing pixel points Gray values of (2); And Representing pixel points The gray average value and the gray standard deviation of the local neighborhood window are the center; representing a second slightly positive value; Is a sensitivity adjustment coefficient; Representing pixel points Background mask intensity of (a); Representing a linear rectification function.
- 6. The machine vision based packaging pull line surface defect online identification method of claim 1, wherein the multidimensional feature vector comprises: The system comprises an LBP histogram, energy, entropy, contrast and correlation based on a gray level co-occurrence matrix, HU invariant moment characteristics, average defect significance coefficients in the suspected defect area and gray level variance.
- 7. The machine vision based on-line identification method of surface defects of a packaging pull wire of claim 1, wherein the classifier is a support vector machine classifier; The support vector machine classifier uses a radial basis function as a kernel function and is obtained by training through collecting historical production data.
- 8. The machine vision based packaging pull wire surface defect online identification method of claim 1, further comprising: in response to the presence of a surface defect, an audible and visual alarm is triggered and an instruction is sent to the line control system to reject the defective package pull line section.
- 9. The machine vision based packaging pull line surface defect online identification method according to claim 3, wherein the distance weight attenuation function adopts a two-dimensional gaussian distribution function.
- 10. The machine vision based packaging pull wire surface defect online identification method of claim 5, wherein the linear rectification function comprises: When (when) Time output When (1) Time output 。
Description
Online identification method for surface defects of packaging pull line based on machine vision Technical Field The invention relates to the technical field of image processing. More particularly, the invention relates to a machine vision based method for on-line identification of surface defects of a packaging pull line. Background The packing stay wire is an indispensable component in the outer package of products such as cigarettes, foods, medicines and the like, and the quality of the packing stay wire is directly related to the tightness, opening experience and brand image of the products. The material is typically made of biaxially oriented polypropylene or PET. In terms of optical characteristics, the light source has high light transmittance and high specular reflectivity, and because the physical form of the light source is in a slender micro-arc cylindrical shape, complex light spots and refraction phenomena are easy to generate under the irradiation of the light source. In the production and manufacturing process, the pull wire is continuously transmitted on the production line at a speed of several meters per second, which puts certain demands on the real-time response speed and imaging stability of the detection system. Image processing algorithms face a great challenge in surface defect detection for such high-speed moving objects with special optical properties. Existing online identification techniques typically employ machine vision based gray threshold segmentation, edge detection, or conventional texture analysis algorithms, aimed at locating defects through abrupt changes in pixel gray scale. However, since the package pull wire forms inherent longitudinal stretch textures during manufacturing, these textures appear as streaks in the image along the direction of motion, which are highly similar in morphology to real defects such as longitudinal scratches. The conventional threshold segmentation or edge detection algorithm is difficult to effectively inhibit background texture interference while maintaining a true defect signal, and normal texture stripes and longitudinal scratches cannot be distinguished. In addition, the change of the production line speed can cause the change of the motion blurring degree, so that the visual characteristics of textures are dynamically changed, the traditional algorithm based on fixed parameters or static models is lack of self-adaptability, and false alarm or missing detection micro defects are easily generated due to the interference of strong textures. Disclosure of Invention In order to solve the technical problem that the surface defect detection process of the packaging pull wire is easy to generate false alarm or missing detection of tiny defects, the invention provides a machine vision-based on-line recognition method for the surface defect of the packaging pull wire, which comprises the following steps: The method comprises the steps of collecting image data on the surface of a packaging pull line, preprocessing the image data to obtain a preprocessed image, wherein the preprocessing comprises brightness correction and limiting contrast self-adaptive histogram equalization processing, obtaining texture flow direction consistency of the preprocessed image based on gradient distribution in horizontal and vertical directions of the preprocessed image, obtaining real-time running speed of a production line, obtaining background mask strength of each pixel point based on the texture flow direction consistency and the real-time running speed of the production line, wherein the background mask strength is positively correlated with the texture flow direction consistency and the real-time running speed of the production line, obtaining defect significance coefficients of each pixel point based on products of gray values of each pixel point in the preprocessed image and local neighborhood mean values and the background mask strength, constructing a defect significance map, dividing the defect significance map to extract suspected defect areas, obtaining multidimensional feature vectors of the suspected defect areas, inputting the multidimensional feature vectors into a classifier, and identifying the multidimensional feature vectors, and responding to the existence of surface defects when the identification result is that the defect and the confidence is larger than a set threshold. Compared with the traditional fixed threshold or static template matching method, the method can adaptively adjust the background suppression force according to the order degree and the motion blur level of the current texture, effectively filter the normal texture background with high consistency in the generated defect saliency map, and simultaneously retain the real defect signal, thereby remarkably improving the accuracy and the robustness of detecting the surface defects of the cylindrical object with high reflection, transparency and high speed. Preferably, the brightn