Search

CN-122023348-A - Rapid detection method for defects of woven bags

CN122023348ACN 122023348 ACN122023348 ACN 122023348ACN-122023348-A

Abstract

The invention belongs to the technical field of industrial machine vision detection, and particularly relates to an image segmentation and identification method for surface defects of flexible packaging materials such as woven bags, paper-plastic composite bags and the like, which provides a self-adaptive multi-parent genetic algorithm (AOTPX-GA) and realizes quick and stable search of an optimal threshold value of a woven bag defect image by introducing defect type perception factors and a dynamic parameter scheduling mechanism. The method comprises the steps of generating and improving auxiliary individuals of an original AITPX operator into optimal individuals to be directly guided, establishing a dynamic cross probability model based on iteration algebra and historical segmentation quality to realize parameter self-adaptive scheduling, introducing defect region strengthening coefficients into a two-dimensional maximum entropy function, dynamically activating through an indication function to solve the problem of small-area defect omission, overcoming the technical bottlenecks that the prior art is difficult to meet real-time requirements, sensitive to periodic texture interference, high small-target defect omission ratio and the like in a high-speed production environment, and providing an efficient, accurate and robust online quality detection algorithm solution for woven bag production enterprises.

Inventors

  • Yang Lianglei

Assignees

  • 温州润发包装有限公司

Dates

Publication Date
20260512
Application Date
20260131

Claims (10)

  1. 1. The quick detection method for the defects of the woven bags is characterized by comprising the following steps of: step 1, performing texture suppression and defect enhancement pretreatment on an acquired woven bag image to obtain an enhanced image; step 2, optimizing the image segmentation threshold by adopting a self-adaptive optimal three-father cross genetic algorithm AOTPX-GA to obtain an optimal threshold for two-dimensional maximum entropy segmentation ; Step 3, performing two-dimensional maximum entropy rapid calculation by utilizing histogram compression and integral diagram, and using an optimal threshold value Dividing to obtain binary image ; Step 4, for the binary image And executing multi-scale connected domain analysis, and extracting feature vectors for defect classification recognition based on the connected domain analysis result.
  2. 2. The method for rapidly detecting defects of woven bags according to claim 1, wherein in the optimizing process of the step 2, a defect type perception factor is introduced into an fitness function Calculating individual fitness, specifically: ; In the formula, As the entropy value of the foreground, Entropy value of background; 、 the pixel duty ratios of the foreground and the background respectively; To indicate the function when In the time-course of which the first and second contact surfaces, 1, Triggering small target compensation, otherwise For 0, the entropy value is calculated normally.
  3. 3. The method for rapidly detecting defects of woven bags according to claim 1, wherein in the optimizing process of the step 2, dynamically adjusted cross probabilities are adopted The genetic iteration is performed and the number of the genetic iterations, With iteration algebra Historical feedback The changes are as follows: ; Wherein, the Is a weight coefficient; the maximum iteration number; generating offspring by utilizing elite father X, leading father Z and exploring father Y, specifically: ; Wherein, the In order to explore the step size, Is a disturbance term.
  4. 4. The method for rapidly detecting defects of woven bags according to claim 1, wherein, in the optimizing process of the step 2, Probability of variation By means of sinusoidal wave strategy related to iteration algebra and combined with history feedback The adjustment is specifically as follows: ; Wherein, the Is a weight coefficient, and the strategy makes the variation probability show periodic fluctuation in the iterative process, and simultaneously And when the variation probability is low, the algorithm is prevented from falling into local optimum.
  5. 5. The method for rapidly detecting defects of woven bags according to claim 1, wherein the step 1 specifically comprises the following substeps: Step 11, firstly, carrying out morphological open operation on an original gray level image I raw , and firstly corroding and then expanding by utilizing a square structural element SE of 3 multiplied by 3; Step 12, constructing an adaptive window mean filter to estimate background textures, wherein an adaptive window k is dynamically calculated according to the resolution DPI of an image; step 13, calculating local mean value based on the self-adaptive window size ; Step 14, after obtaining the background texture, removing the background texture by calculating the difference between the open operation image and the mean image, and introducing a texture suppression coefficient And brightness compensation The formula is: ; Step 15, outputting enhanced image by performing double-threshold linear transformation on the differential image Further pulling the gap between the defect and the background.
  6. 6. The method for rapidly detecting defects of woven bags according to claim 1, wherein the step 3 specifically comprises the following sub-steps: step 31, calculating an enhanced image And compressing the gray level histogram H to obtain ; Step 32, constructing an integral graph to accelerate local summation operation, first, aiming at the compressed simplified histogram Building a two-dimensional integral map Wherein each pixel point on the map is integrated Is represented by the value of The sum of probabilities of all pixels in a rectangular area formed from the upper left corner (0, 0) to the current point (i, j), namely the sum of the numbers of pixels corresponding to all gray levels in the area, secondly, solving the sum of probabilities of any gray level intervals by utilizing the characteristic of 'the sum of probabilities of the rectangular area = the integral value of the lower right corner-the integral value of the related area of the upper left corner' And background entropy Is calculated; Step 33, enhancing the image with an optimal threshold (s, t) for two-dimensional maximum entropy segmentation Performing binary segmentation to output binary image 。
  7. 7. The rapid detection method of woven bag defects according to claim 6, wherein the compression is specifically as follows: 。
  8. 8. the method for rapidly detecting defects of woven bags according to claim 6, wherein the step 33 specifically comprises: When (when) ≤ When the color is determined to be background, the color 0 is assigned to black (x,y)≥ When the defect is judged to be a defect, 255 is assigned, and when < < When the probability distribution of the compressed histogram is supplemented and judged, the probability ratio of the foreground/background is preferentially matched, and finally the binary image is output 。
  9. 9. The method for rapidly detecting defects of woven bags according to claim 1, wherein the step 4 specifically comprises the following steps: Step 41, connected domain extraction and preliminary screening, wherein the connected domain in the binary image is extracted by adopting a two-time scanning method; Step 42, extracting multi-dimensional feature vectors for each connected domain passing through the preliminary screening; And 43, classifying and quantitatively outputting the defects, and inputting the normalized feature vectors into an RBF kernel support vector machine classifier for identifying various defects of the woven bag.
  10. 10. The method for rapidly detecting defects of woven bags according to claim 9, wherein the multi-dimensional features comprise two core features, namely geometric features and texture features; Geometric shape characteristics include area, circumference, circularity, aspect ratio, eccentricity, principal axis direction, 7 Hu invariant moments; texture features include contrast, energy, entropy, correlation, inverse moment extracted based on gray level co-occurrence matrix, and uniformity, variance, peak extracted based on local binary pattern.

Description

Rapid detection method for defects of woven bags Technical Field The invention relates to the technical field of industrial machine vision detection, in particular to an image segmentation and identification method for surface defects of flexible packaging materials such as woven bags, paper-plastic composite bags and the like. Background The woven bags are used as important packaging materials in the fields of chemical industry, building materials, agriculture and the like, the annual output of the woven bags is over 500 hundred million, but the quality detection of the woven bags still depends on manual naked eye observation, and the problems of high subjectivity, low efficiency, non-traceability of data and the like exist. The industrial machine vision detection is widely studied, but the existing image segmentation technology is difficult to meet actual requirements, for example, a two-dimensional maximum entropy threshold method is required to traverse 65536 combinations, single calculation takes more than 30 seconds frequently, real-time requirements of a high-speed production line cannot be met, an improved genetic algorithm is good in performance on a standard test image, an auxiliary individual generation mechanism consumes resources, cross probability is fixed, interference of periodic textures (typical period is 8-12 pixels) of woven bags is not considered, wire drawing defects are low in detection rate, the recognition capability on elongated wire drawing defects (aspect ratio is more than 8 and area occupied ratio is less than 1%) is insufficient, the deep learning method is good in performance in a general scene, the fixed cross probability and the segmentation variation strategy are lack of self-adaptability, the crease defect area is excessively large, the woven bags of different materials (PP, PE and paper-plastic composite), gram weights and weaving densities are required to be retrained, and engineering cost is high. The defects of the prior art are concentrated on the aspects of real-time bottleneck, insufficient precision and robustness and self-adaptability, and how to realize the real-time defect detection, the detection performance improvement and the key of the woven bag. Disclosure of Invention In order to overcome the defects in the prior art, the invention provides a rapid detection method for defects of a woven bag, which comprises the following steps: and step 1, performing texture inhibition and defect enhancement pretreatment on the acquired woven bag image to obtain an enhanced image. Step 2, optimizing the image segmentation threshold by adopting a self-adaptive optimal three-father cross genetic algorithm AOTPX-GA to obtain an optimal threshold for two-dimensional maximum entropy segmentation。 Step 3, performing two-dimensional maximum entropy rapid calculation by utilizing histogram compression and integral graph, and performing segmentation by using an optimal threshold value to obtain a binary image。 Step 4, for the binary imageAnd executing multi-scale connected domain analysis, and extracting feature vectors for defect classification recognition based on the connected domain analysis result. Wherein, the step 1 specifically comprises the following substeps: Step 11, firstly, carrying out morphological open operation on an original gray level image I raw, and firstly corroding and then expanding by utilizing a square structural element SE of 3 multiplied by 3; Step 12, constructing an adaptive window mean filter to estimate background textures, wherein an adaptive window k is dynamically calculated according to the resolution DPI of an image; step 13, calculating local mean value based on the self-adaptive window size ; Step 14, after obtaining the background texture, removing the background texture by calculating the difference between the open operation image and the mean image, and introducing a texture suppression coefficientAnd brightness compensationThe formula is: ; Step 15, outputting enhanced image by performing double-threshold linear transformation on the differential image Further pulling the gap between the defect and the background. Wherein, the step 2 specifically comprises the following substeps: step 21, initializing a population, and based on the continuity of the video stream of the production line, optimizing the threshold of the previous frame Injecting the elite individuals into the current population, and adding Gaussian disturbance to avoid local optimum; Step 22, fitness function design, introducing defect type perception factors Calculating individual fitness, specifically: ; In the formula, As the entropy value of the foreground,Entropy value of background;、 the pixel duty ratios of the foreground and the background respectively; To indicate the function when In the time-course of which the first and second contact surfaces,1, Triggering small target compensation, otherwiseFor 0, the entropy value is calculated normally. The fitness function