CN115631173B - Composite film defect identification method - Google Patents
Composite film defect identification method Download PDFInfo
- Publication number
- CN115631173B CN115631173B CN202211336527.2A CN202211336527A CN115631173B CN 115631173 B CN115631173 B CN 115631173B CN 202211336527 A CN202211336527 A CN 202211336527A CN 115631173 B CN115631173 B CN 115631173B
- Authority
- CN
- China
- Prior art keywords
- gray
- composite film
- index
- pixel
- value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 230000007547 defect Effects 0.000 title claims abstract description 190
- 239000002131 composite material Substances 0.000 title claims abstract description 97
- 238000000034 method Methods 0.000 title claims abstract description 33
- 230000011218 segmentation Effects 0.000 claims description 33
- 230000037303 wrinkles Effects 0.000 description 52
- 238000009826 distribution Methods 0.000 description 18
- 241001085205 Prenanthella exigua Species 0.000 description 5
- 230000002950 deficient Effects 0.000 description 4
- 238000004458 analytical method Methods 0.000 description 3
- 238000009835 boiling Methods 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 230000009467 reduction Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 150000001875 compounds Chemical class 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 239000005021 flexible packaging material Substances 0.000 description 1
- 238000005286 illumination Methods 0.000 description 1
- 238000010191 image analysis Methods 0.000 description 1
- 238000003709 image segmentation Methods 0.000 description 1
- 238000002372 labelling Methods 0.000 description 1
- 239000010410 layer Substances 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 239000002861 polymer material Substances 0.000 description 1
- 238000000513 principal component analysis Methods 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 239000002344 surface layer Substances 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/20—Image enhancement or restoration using local operators
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/70—Denoising; Smoothing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/90—Dynamic range modification of images or parts thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/187—Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Computing Systems (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Quality & Reliability (AREA)
- Databases & Information Systems (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- Multimedia (AREA)
- Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
- Image Processing (AREA)
Abstract
The invention relates to the technical field of defect identification, in particular to a composite film defect identification method, which comprises the following steps: acquiring a surface gray level image of the composite film, and determining the composite film image suspected of having defects according to the gray level value; segmenting the image to obtain a suspected defect area; obtaining a gray scale deviation index of a pixel point according to the gray scale value difference between a central pixel point in a window with a set size and other pixel points in the window; dividing the pixel points into three grades according to the gray deviation index, determining possible defect pixel points, and performing region growth by using the possible defect pixel points to obtain possible defect regions; the method comprises the steps of obtaining end points of a line section where the principal component direction of the possible defect area is located, obtaining a non-connectivity index according to the distance between the end points corresponding to the possible defect area, determining a connected area according to the non-connectivity index and an index threshold value, and identifying the defect of the composite film according to the connected area.
Description
Technical Field
The invention relates to the technical field of defect identification, in particular to a composite film defect identification method.
Background
The composite film is a high polymer material compounded by two or more layers of films made of different materials and is mainly used for packaging. The surface wrinkle of the composite film is a common problem in the processing and application processes of the composite flexible packaging material, the surface wrinkle problem is represented by that the film on the surface layer is convex upwards, the surface wrinkle problem can influence the aesthetic property and the quality of the composite film package, and therefore, the surface defect identification needs to be carried out on the composite film processed at each production stage to identify the wrinkle defect.
The conventional identification method is to process the surface image of the composite film by using a threshold segmentation method, but because the wrinkle defect on the surface of the composite film is mainly in an approximate tunnel shape, the gray difference is not obvious, most of the composite films are white, the threshold is influenced by the reflection condition in the presence of illumination, the image segmentation result is inaccurate, and the composite film defect identification result is also inaccurate.
Disclosure of Invention
In order to solve the above technical problems, an object of the present invention is to provide a method for identifying defects of a composite film, which adopts the following technical scheme:
acquiring a surface gray image of the composite film, and determining the composite film image suspected of having defects according to the gray value of a pixel point in the surface gray image; performing threshold segmentation on the composite film image to obtain a suspected defect area;
performing sliding window processing on the pixels in the suspected defect area by using a window with a set size, and obtaining a gray level deviation index of the pixels according to the gray level value of the central pixel in the window and the gray level value difference of other pixels in the window; dividing the pixel points into three grades according to the gray deviation index, determining possible defect pixel points according to the number of different grades in a window corresponding to the pixel points, and performing region growth by using the possible defect pixel points to obtain a possible defect region;
the method comprises the steps of obtaining end points of a line section where the principal component direction of a possible defect area is located, obtaining a non-connectivity index according to the distance between the end points corresponding to the possible defect area, determining a connected area according to the non-connectivity index and an index threshold value, and identifying the defect of the composite film according to the connected area.
Preferably, the determining the composite film image suspected of having the defect according to the gray value of the pixel point in the surface gray image specifically includes:
and calculating a color second moment of the image according to the gray value of the pixel point in the surface gray image, obtaining a color characteristic value corresponding to the surface gray image according to the color second moment, and marking the surface gray image with the color characteristic value larger than a color threshold value as a composite film image suspected of having defects.
Preferably, the obtaining of the suspected defect area by performing threshold segmentation on the composite film image specifically includes:
constructing a gray histogram according to gray values of pixel points in the composite film image, acquiring gray values corresponding to two wave troughs in the gray histogram, recording a smaller gray value corresponding to the two wave troughs as a first segmentation threshold, and recording a larger gray value corresponding to the two wave troughs as a second segmentation threshold; and the area formed by the pixel points with the gray value smaller than the first segmentation threshold and the area formed by the pixel points with the gray value larger than the second segmentation threshold are suspected defect areas.
wherein,represents the gray scale deviation index corresponding to the z-th pixel point, and is based on the value of the gray scale deviation index>Represents the gray value of the z-th pixel point, and->Represents the gray value of the other first pixel point in the window where the z-th pixel point is located, and/or the gray value of the other first pixel point is greater than or equal to>Represents the gray value of the jth pixel point in the window where the jth pixel point is located, and/or the gray value of the other jth pixel point is greater than or equal to>Representing the total number of other pixels except the center point within the window, exp () represents an exponential function with a natural constant e as the base.
Preferably, the dividing the pixel points into three levels according to the gray scale deviation index specifically includes: and acquiring a difference value between the gray scale deviation indexes of any two pixel points, and dividing all the pixel points into three grades based on all the difference values.
Preferably, the determining the possible defective pixel points according to the number of different levels in the window corresponding to the pixel points specifically includes:
for any pixel point in a window, if three levels of pixel points exist in all pixel points in the window, the any pixel point is a possible defect pixel point; if the pixel points of the three grades do not exist, the window is enlarged according to the set step length, if the pixel points of the three grades exist in all the pixel points in the enlarged window, any one pixel point is a possible defect pixel point, and if the pixel points of the three grades do not exist in all the pixel points in the enlarged window, any one pixel point is a noise pixel point.
Preferably, the determining the connected region according to the non-connectivity index and the index threshold specifically includes:
when the non-connectivity indexes corresponding to the end points of the possible defect area are all smaller than the index threshold value, connecting the possible defect area with the possible defect area corresponding to the non-connectivity index smaller than the index threshold value; when the non-connectivity index corresponding to only one end point of the possible defect area is smaller than the index threshold, calculating the shortest distance from the other end point to the edge of the composite film image, if the shortest distance is smaller than the index threshold, connecting the possible defect area with the possible defect area corresponding to the non-connectivity index smaller than the index threshold, and if the shortest distance is greater than or equal to the index threshold, removing the possible defect area without connection; when the non-connectivity indexes corresponding to the end points of the possible defect areas are not less than the index threshold, the possible defect areas are discarded and are not connected; all connected regions constitute connected regions.
The embodiment of the invention at least has the following beneficial effects:
determining a composite film image suspected of having defects according to gray values of pixel points in the image, roughly analyzing the image by combining color distribution characteristics in the image, screening out the image with the defects, and carrying out subsequent further judgment; then, the composite film image is processed by using the window, the gray level deviation index of the pixel point is calculated, the possible defective pixel point is obtained according to the gray level deviation index, and the gray level difference condition of the pixel point in the neighborhood is considered by analyzing the gray level difference of the pixel point in the window range, so that more accurate defect information can be obtained; and finally, connecting all the defect areas according to the connectivity among the defect areas to further obtain a defect identification result, considering the shape characteristics of the defects of the composite film, namely the connectivity to a certain degree, further increasing the accuracy of the obtained defect areas and enabling the defect identification result to be more accurate.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions and advantages of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flow chart of a method for identifying defects of a composite film according to the present invention.
Detailed Description
To further illustrate the technical means and effects of the present invention adopted to achieve the predetermined objects, the following detailed description of the method for identifying defects of a composite film according to the present invention, its specific implementation, structure, features and effects will be given in conjunction with the accompanying drawings and the preferred embodiments. In the following description, the different references to "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The following describes a specific scheme of the composite film defect identification method provided by the invention in detail with reference to the accompanying drawings.
Examples
The main purposes of the invention are: and (3) carrying out surface defect detection on the composite film after the composite film is processed at each production stage by an image processing technology, wherein the defects are mainly wrinkle defects.
The specific scenes aimed by the invention are as follows: and (4) performing wrinkle defect detection after the compound film is processed by a machine, after curing, when the bag making processing is finished and after a period of time of placement, when the water boiling processing is finished and after a period of time of placement, when the boiling processing is finished and after a period of time of placement.
Referring to fig. 1, a flowchart of a method for identifying defects of a composite film according to an embodiment of the present invention is shown, where the method includes the following steps:
acquiring a surface gray image of a composite film, and determining the composite film image suspected of having defects according to the gray value of a pixel point in the surface gray image; and performing threshold segmentation on the composite film image to obtain a suspected defect area.
Firstly, after the composite film is processed by a machine, after curing, when bag making processing is finished and after a period of time of placement, when boiling treatment is finished and after a period of time of placement, image acquisition is carried out at each stage, and the surface image of the composite film is obtained. Because the acquisition process is influenced by mechanical noise, the acquired surface image of the composite film is subjected to noise reduction treatment. In this embodiment, a gaussian filtering method is used to perform noise reduction on the surface image, then a semantic segmentation method is used to remove the interference of the background, and finally the image obtained after the semantic segmentation is subjected to graying processing to obtain a surface grayscale image of the composite film.
It should be noted that, in order to reduce the amount of calculation, image analysis needs to be performed on the images acquired at each stage, that is, whether a wrinkle defect exists in the surface gray image of the composite film corresponding to the current stage is determined in advance according to the gray features in the images, so that only the surface gray image with the wrinkle defect is subjected to subsequent analysis.
When the composite film has a wrinkle defect, a convex tunnel-shaped wrinkle appears on the surface of the composite film, and the area where the wrinkle exists is shown in an image, the color of the convex part in the wrinkle part is bright and white, but the color of the concave parts on two sides of the convex part is dark and gray. From this, it was found that if wrinkle defects exist on the surface of the composite film, bright white and dark gray appear in the surface tone image of the composite film due to the generation of wrinkle defects.
Based on this, carry out analysis according to the grey scale characteristic of pixel in the surface gray scale image of composite film, judge the color distribution range in the surface gray scale image of composite film, when the composite film does not have the fold defect, the grey scale value in the surface gray scale image of composite film is all comparatively close, shows as a comparatively close colour value, and when the composite film has the fold defect, can increase the colour that two kinds of grey scale values are different in the surface gray scale image of composite film, shows as three colour values in the image.
Then, since the color moment is a simple and effective color feature labeling method, and the color second moment can represent the distribution range of the color in the image, in this embodiment, the color second moment of the image is calculated based on the gray value of the pixel point in the surface gray image of the composite filmIs formulated as: />;
Wherein,and expressing the gray value of the ith pixel point in the surface gray image of the composite film, and N expressing the total number of the pixel points in the surface gray image. In the formula, the difference value between the gray value of each pixel point and the image gray mean value is calculated, the deviation degree of each pixel point relative to the image gray mean value is reflected, and the deviation degrees of all the pixel points are summed and averaged to represent the size of the color distribution range of the surface gray image. When +>The larger the representation image color distribution range, the wider the representation image color distribution range, the more various color values may exist in the surface gray-scale image, and conversely when->The smaller the representative image color distribution range, the narrower the representative image color distribution range, the less color values may exist in the surface gray scale image, i.e. one color value may exist.
In this embodiment, the color second moment obtained based on the gray value of the pixel point in the surface gray image of the composite filmPerforming normalization processing, namely obtaining the color characteristic value of the surface gray level image according to the color second moment, and expressing the color characteristic value as ^ greater than or equal to>Wherein is present>In order to normalize a color secondary moment, a color characteristic value is obtained>Is the second moment of the color of the image, and e is a natural constant.
When in useIs greater, the greater the value of (A), the greater the number of the selected cells>The larger the value is, the wider the color distribution range of the image is, which indicates that more color values may exist in the surface gray image, the wrinkle defect may exist on the surface of the composite film corresponding to the image, otherwise, the value is greater than or equal to>The smaller the>The smaller the value of (a) is, that is, the narrower the distribution range of the representative image color is, it is indicated that there may be fewer color values in the surface gray image, that is, there may be one color value, and then there may be no wrinkle defect on the surface of the composite film corresponding to the image.
Setting a color threshold, in this embodiment, the value is 0.4, and when the value of the color feature value corresponding to the surface grayscale image is greater than the color threshold, that is, the color feature value is greater than the color thresholdIn the case of the composite film image, the color distribution range in the surface gray level image is large, and the wrinkle defect may exist, so that the surface gray level image is marked as the composite film image suspected of having the defect. When the value of the color characteristic value corresponding to the surface gray level image is less than or equal to the color threshold value, namely->In this embodiment, the surface gray image of the composite film with the color characteristic value less than or equal to the color threshold is not subjected to subsequent analysis.
Finally, in the area where the wrinkles exist on the composite film image, the raised parts on the wrinkles are bright white due to reflection, and the bottoms of the mountain roots at two sides of the raised parts on the wrinkles are shaded dark gray due to the shielding of the raised parts. All the areas where wrinkles exist referred to in this embodiment include a raised bright white portion and a dark gray-shaded portion at the bottom of mountain roots on both sides of the raised portion.
Based on the above, a gray histogram is constructed according to gray values of pixel points in the composite film image suspected of having the defect, and the composite film image is segmented to obtain a suspected defect area by taking the gray values corresponding to two wave troughs in the gray histogram as segmentation thresholds.
Specifically, the gray values corresponding to two troughs in the gray histogram are used as segmentation thresholds, the gray value corresponding to the two troughs is smaller and is used as a first segmentation threshold, the gray value corresponding to the two troughs is larger and is used as a second segmentation threshold, the image is segmented into three regions by using the first segmentation threshold and the second segmentation threshold, the first segmentation threshold is used as a segmentation point between a dark gray shadow part and a dominant color part of the composite film, so that a region formed by pixel points of which the gray values are smaller than the first segmentation threshold is used as a wrinkle convex region, and the second segmentation threshold is used as a segmentation point between the dominant color part of the composite film and a bright white convex part, so that a region formed by pixel points of which the gray values are larger than the second segmentation threshold is used as a wrinkle convex region. And the area formed by the pixel points of which the gray value is greater than or equal to the first segmentation threshold and less than or equal to the second segmentation threshold is a normal area, and no wrinkle defect exists in the normal area. Wherein, the fold raised area and the fold shadow area form a suspected defect area.
Performing sliding window processing on the pixels in the suspected defect area by using a window with a set size, and obtaining a gray level deviation index of the pixels according to the gray level value of the central pixel in the window and the gray level value difference of other pixels in the window; dividing the pixel points into three grades according to the gray deviation index, determining possible defect pixel points according to the quantity of different grades in a window corresponding to the pixel points, and performing region growth by using the possible defect pixel points to obtain a possible defect region.
Firstly, it should be noted that the area where the wrinkle exists includes a convex portion on the wrinkle and a root bottom shadow portion on two sides of the convex portion on the wrinkle, the composite film image is processed by using a window with a set size, sliding is started from left to right and from top to bottom from the upper left corner of the composite film image, the sliding step length is 1, when the composite film image slides to a position, the area where the pixel belongs to is judged according to the gray value of the pixel at the center position of the window, and when the pixel at the center position belongs to a possible defect area, the pixel distribution characteristics in the window are analyzed.
When the pixel point at the central position belongs to the possible defect area, namely the pixel point belongs to the wrinkle convex area or the wrinkle shadow area, the wrinkle defect exists in the window, the convex part and the shadow part in the wrinkle exist at the same time and are distributed in a centralized manner, and then in the window with a certain size, the pixel point belongs to the wrinkle convex area and the wrinkle shadow area, which is shown in color distribution, the gray value of the pixel point in the window can exist in two intervals, namely, the gray value is smaller than the first segmentation threshold value and larger than the second segmentation threshold value, namely, the bright white pixel point and the dark gray pixel point exist. After the size of the window is enlarged, the window also contains a normal area of the composite film except for the defect part, and three color distributions must exist in the window, namely, the gray values of the pixel points in the window exist in three intervals. Meanwhile, the pixel points of the three color distributions in the window are not distributed in disorder, but are distributed in three regions in a concentrated manner.
In this embodiment, the value of the set size is 3*3, which can be set by an implementer according to the actual situation.
Then, a window 3*3 is used for processing a possible defect area in the composite film image, for any pixel point, in a window 3*3 taking the pixel point as a center, if a wrinkle area exists in the window, gray value differences of the pixel point at the center position in the window and other pixel points are respectively calculated, and the pixel deviation condition of the pixel point at the center position can be obtained according to the difference between each difference.
Obtaining the gray scale deviation index of the pixel point according to the gray scale value of the central pixel point in the window and the gray scale value difference of other pixel points in the window, and expressing the gray scale deviation index by a formula as follows:;
wherein,represents the gray scale deviation index corresponding to the z-th pixel point, and is based on the value of the gray scale deviation index>Represents the gray value of the z-th pixel point, and>represents the gray value of the other first pixel point in the window where the z-th pixel point is located, and/or the gray value of the other first pixel point is greater than or equal to>Represents the gray value of the jth pixel point in the window of the jth pixel point, exp () represents an exponential function with a natural constant e as the base, and->The total number of other pixels except the center point in the representation window is 8 in this embodiment.
And calculating the deviation of the difference between the gray value of the z-th pixel point and the gray values of the j-th pixel points in the window by taking the difference between the gray value of the z-th pixel point and the gray values of the other first pixel points in the window as a reference value, and further sequentially calculating the deviation between the reference value and other differences. The difference value between the gray values of the pixels in the window can reflect the gray difference of the pixels, and the deviation degree between the gray differences is calculated by selecting any one gray difference as a reference value.
The smaller the gray value difference between the pixel points is, the smaller the corresponding gray value difference is, which indicates that there may be no wrinkle defect in the window where the pixel point is located, the smaller the deviation degree between the gray value differences is, the smaller the value of the gray value deviation index of the pixel point is, which indicates that the pixel point is more likely to belong to a normal pixel point on the composite film image. The larger the gray value difference between the pixel points is, the larger the corresponding gray value difference is, which indicates that a wrinkle defect may exist in a window where the pixel point is located, the larger the deviation degree between the gray value differences is, the larger the value of the gray value deviation index of the pixel point is, which indicates that the pixel point is more likely to belong to a pixel point in a possible defect region on the composite film image.
And finally, respectively calculating the gray scale deviation indexes of all pixel points in the possible defect area on the composite film image according to the method, acquiring the difference value between the gray scale deviation indexes of any two pixel points, and dividing all the pixel points into three grades based on all the difference values.
Specifically, any two pixel points are selected to be marked as a first pixel point and a second pixel point, the difference value of the gray scale deviation indexes corresponding to the two pixel points is calculated, if the value of the difference value is greater than a threshold value, the two pixel points are considered to be more unlikely to belong to the pixel point in the same region, and therefore the gray scale deviation indexes corresponding to the two pixel points are divided into two different levels; if the value of the difference is smaller than or equal to the threshold, the two pixel points are considered to possibly belong to the pixel points in the same region, so that the gray scale deviation indexes corresponding to the two pixel points are divided into the same grade.
And then, one other pixel point is selected arbitrarily to be marked as a third pixel point, the difference value of the gray scale deviation index corresponding to the third pixel point and the gray scale deviation index corresponding to the first pixel point is calculated respectively, and the difference value of the gray scale deviation index corresponding to the third pixel point and the gray scale deviation index corresponding to the second pixel point is calculated. If the difference value is smaller than or equal to the threshold value, namely the difference value of the gray scale deviation index corresponding to the third pixel point and the first pixel point is smaller than or equal to the threshold value, dividing the gray scale deviation index corresponding to the third pixel point into the grade of the gray scale deviation index corresponding to the first pixel point, or dividing the gray scale deviation index corresponding to the third pixel point into the grade of the gray scale deviation index corresponding to the second pixel point, wherein the difference value of the gray scale deviation index corresponding to the third pixel point and the gray scale deviation index corresponding to the second pixel point is smaller than or equal to the threshold value. And if the difference is not smaller than or equal to the threshold, namely the difference between the gray scale deviation indexes of the third pixel point and the other two pixel points is larger than the threshold, dividing the gray scale deviation index corresponding to the third pixel point into a third grade. In this embodiment, the value of the threshold is 0.2, and an implementer can set the threshold according to actual conditions.
Based on the above, by analogy, all the pixel points are divided into three levels based on all the difference values, the graded standard is that the level with the minimum gray scale deviation index is divided into a first level, the level with the larger gray scale deviation is divided into a second level, and the level with the maximum gray scale deviation is divided into a third level. If the composite film image has a wrinkle defect, the color distribution of the pixel points in the image is represented by three colors, and the gray scale deviation index corresponding to the pixel points in the image can be divided into three levels. Meanwhile, each pixel point corresponds to one gray level deviation index, each gray level deviation index corresponds to one grade, each pixel point corresponds to one grade, and the three grades can be approximately regarded as three different areas, namely a normal area, a fold convex area and a fold shadow area.
It should be noted that, in this embodiment, by considering the deviation of the gray level difference between a pixel point and a pixel point in its neighborhood, the change condition of the gray level difference in the image can be analyzed in more detail, and the pixel point is determined based on the change condition of the difference, so that more accurate defect information can be obtained.
Further, the pixel point in the window where the pixel point is located is judged, in the window with a certain size, the pixel point belongs to a fold convex area and a fold shadow area, and the result shows that the deviation of the gray difference exists, the corresponding grade of the pixel point in the window possibly has two different grades, after the size of the window is enlarged, the window also comprises a normal area of a composite film except for a defect part, three color distributions must exist in the window, and the corresponding grade of the pixel point in the enlarged window has three different grades.
Therefore, for a window where any pixel point is located, if pixel points of three grades exist in all the pixel points in the window, it is indicated that pixel points of three different areas possibly exist in the window where the pixel point is located, and then the any pixel point is a possible defect pixel point; if the pixel points with the three grades do not exist, the window is enlarged according to the set step length, if the pixel points with the three grades exist in all the pixel points in the enlarged window, any one pixel point is a possible defect pixel point, if the pixel points with the three grades do not exist in all the pixel points in the enlarged window, the fact that the current judged pixel point does not belong to a defect part and is only a possible noise point is indicated, and any one pixel point is a noise pixel point. In this embodiment, the value of the set step length is 2, that is, the size of the enlarged window is 5*5, and an implementer can set the value of the set step length according to an actual situation.
After the possible defect pixel points are obtained according to the method, the possible defect pixel points are respectively used as initial seed points for area growth, and the area obtained by the area growth is marked as a possible defect area, wherein a rule implementer for the area growth can carry out setting according to actual conditions, for example, when the difference value between the gray values of the pixel points is smaller than a set threshold value, the region can carry out growth, and the implementer needs to carry out setting according to the actual conditions.
And step three, acquiring end points of a line segment where the principal component direction of the possible defect area is located, obtaining a non-connectivity index according to the distance between the end points corresponding to the possible defect area, determining a connected area according to the non-connectivity index and an index threshold, and identifying the defect of the composite film according to the connected area.
It should be noted that the wrinkle defect existing on the surface of the composite film may also be referred to as a tunnel defect because the convex portions on the wrinkles are all around and continuously converge or diverge, so as to form complete wrinkles similar to a tunnel shape, that is, the wrinkles are all interconnected and exist on the composite film, and there is no discrete distribution of the wrinkle portions. Therefore, for any possible defect region, the connectivity between the possible defect region and other possible defect regions is analyzed respectively, and the confidence level that the possible defect region is a real defect region is judged according to the connectivity.
Specifically, PCA principal component analysis is performed on each possible defect region to obtain a principal component direction of each possible defect region, and two end points of a line segment where the principal component direction of the possible defect region is located are obtained, and then the two end points can be regarded as two end points of a wrinkle line segment in the possible defect region.
Because the wrinkle defect is in a tunnel shape in the image, the regions with the wrinkle defect are communicated with each other, and on the basis, whether the possible defect region is communicated with other possible defect regions is judged by judging the distance between two end points corresponding to the possible defect region and the distance between end points corresponding to other possible defect regions.
Based on this, a non-connectivity index is obtained according to the distance between the endpoints corresponding to the possible defect region, the non-connectivity indexes between the two endpoints corresponding to the possible defect region and the endpoints of the other possible defect regions are respectively recorded as a first non-connectivity index and a second non-connectivity index, that is, the two endpoints corresponding to the possible defect region respectively correspond to one non-connectivity index, which is expressed by a formula:
wherein,represents a first non-connectivity indicator corresponding to a first end point in the possible defect region c, and/or a function thereof>Represents a second non-connectivity index corresponding to a second end point in the possible defect region c, and min () represents a function for finding a minimum value.
And establishing a rectangular coordinate system taking pixel points as a unit by taking the upper left corner of the image as an origin, wherein the abscissa and the ordinate of the pixel points are the number of columns and the number of rows in the image respectively.And &>Respectively represents the abscissa and ordinate of the first endpoint in the possible defect area c on the image of the laminated film, and->And &>Respectively, an abscissa and an ordinate, respectively, of a first end point in the possibly defective area c on the image, and->And &>An abscissa and an ordinate, respectively, of the k-th end point representing the other possible defective area on the image, and->And &>Respectively, the abscissa and ordinate of the o-th end point of the other possible defect area on the image.
Andeach represents the minimum of the distances between the end points in the current possible defect region and the end points in the other possible defect regions. When the minimum distance between the end points corresponding to different possible defect areas is smaller than the index threshold, it indicates that certain connectivity exists between the different possible defect areas, and the different possible defect areas need to be connected. That is, the smaller the minimum value of the distance between the endpoints is, the larger the connectivity between the possible defect regions is, the smaller the non-connectivity index corresponding to the possible defect region is.
Meanwhile, considering that there may be a wrinkle portion located at an edge, the shortest distance between two end points corresponding to each possible defect region and the edge of the composite film image needs to be calculated and respectively recorded as a first non-edge index and a second non-edge index, and the smaller the shortest distance is, the closer the end points are to the edge of the image, the smaller the value of the corresponding non-edge index is.
Further, a connected region is determined according to the non-connectivity index and the index threshold, when the non-connectivity indexes corresponding to the endpoints of the possible defect region are both smaller than the index threshold, that is, the first non-connectivity index and the second non-connectivity index corresponding to the two endpoints of the region are both smaller than the index threshold, the possible defect region is connected with the possible defect region corresponding to the non-connectivity index smaller than the index threshold, that is, the region is connected with the possible defect region where the endpoint corresponding to the first non-connectivity index is located, the region is connected with the possible defect region where the endpoint corresponding to the second non-connectivity index is located, and the connected region is the connected region.
When the non-connectivity index corresponding to only one end point of the possible defect area is smaller than the threshold, calculating the shortest distance from the other end point to the edge of the composite film image, wherein the shortest distance is the non-marginal index corresponding to the end point, if the non-marginal index is smaller than the index threshold, connecting the possible defect area with the possible defect area corresponding to the non-connectivity index smaller than the threshold, and the connected area is a connected area.
For example, in two endpoints of a possible defect region, a first non-connectivity index corresponding to a first endpoint is smaller than an index threshold, and a second non-connectivity index corresponding to a second endpoint is larger than the index threshold, the second non-marginal index corresponding to the second endpoint is compared with the index threshold, if the second non-connectivity index is larger than or equal to the index threshold, the possible defect region is possibly a discrete region, and therefore the possible defect region needs to be discarded and not connected, and if the second non-connectivity index is smaller than the index threshold, one side of the possible defect region is connected with other possible defect regions, and the other side of the possible defect region is close to an image edge, and therefore the possible defect region needs to be connected with the possible defect region where the endpoint corresponding to the first non-connectivity index is located.
When the non-connectivity index corresponding to the end point of the possible defect area is not smaller than the index threshold, that is, the first non-connectivity index and the second non-connectivity index corresponding to the two end points of the area are not smaller than the index threshold, it is indicated that connectivity does not exist between the possible defect area and other possible defect areas, the possible defect area is a discrete area, the possible defect area is discarded, and connection is not performed.
In this embodiment, the value of the index threshold is 4, and the implementer can set the index threshold according to actual situations.
And judging all possible defect areas according to the method, connecting the possible defect areas needing to be connected, forming a connected area by all the connected areas, and segmenting the composite film image according to the connected area so as to identify the defects of the composite film. In this embodiment, the pixel values of the pixels in the connected region are set to 255, and the pixel values of the other pixels are set to 0, so as to segment the composite film image, and perform defect identification by using the segmented image to obtain an identification result. The method for segmenting the image and the method for identifying the defect are various, and an implementer can select the method according to the actual situation.
It should be noted that, the invention analyzes the possibility that the pixel point is the pixel point of the wrinkle region first, then grows the possible wrinkle connected domain, analyzes the possibility that the possible wrinkle connected domain forms the tunnel, thereby identifies the complete wrinkle region, and overcomes the difficulty that the threshold segmentation cannot identify the wrinkle with fine gray difference.
The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; the modifications or substitutions do not make the essence of the corresponding technical solutions deviate from the technical solutions of the embodiments of the present application, and are included in the protection scope of the present application.
Claims (6)
1. A composite film defect identification method is characterized by comprising the following steps:
acquiring a surface gray image of the composite film, and determining the composite film image suspected of having defects according to gray values of pixel points in the surface gray image; performing threshold segmentation on the composite film image to obtain a suspected defect area;
performing sliding window processing on the pixels in the suspected defect area by using a window with a set size, and obtaining a gray level deviation index of the pixels according to the gray level value of the central pixel in the window and the gray level value difference of other pixels in the window; dividing the pixel points into three grades according to the gray level deviation index, determining possible defect pixel points according to the number of different grades in a window corresponding to the pixel points, and performing region growth by using the possible defect pixel points to obtain a possible defect region;
acquiring end points of a line segment where the principal component direction of the possible defect area is located, obtaining a non-connectivity index according to the distance between the end points corresponding to the possible defect area, determining a connected area according to the non-connectivity index and an index threshold, and identifying the defect of the composite film according to the connected area;
the specific steps of determining the possible defect pixel points according to the number of different levels in the window corresponding to the pixel point are as follows:
for a window where any one pixel point is located, if pixel points of three grades exist in all the pixel points in the window, the any one pixel point is a possible defect pixel point; if the pixel points of the three grades do not exist, the window is enlarged according to the set step length, if the pixel points of the three grades exist in all the pixel points in the enlarged window, any one pixel point is a possible defect pixel point, and if the pixel points of the three grades do not exist in all the pixel points in the enlarged window, any one pixel point is a noise pixel point.
2. The method according to claim 1, wherein the determining the composite film image suspected of having the defect according to the gray-scale values of the pixels in the surface gray-scale image specifically comprises:
and calculating a color second moment of the image according to the gray value of the pixel point in the surface gray image, obtaining a color characteristic value corresponding to the surface gray image according to the color second moment, and marking the surface gray image with the color characteristic value larger than a color threshold value as a composite film image suspected of having defects.
3. The method according to claim 1, wherein the step of performing threshold segmentation on the composite film image to obtain the suspected defect area specifically comprises:
constructing a gray histogram according to gray values of pixel points in the composite film image, acquiring gray values corresponding to two wave troughs in the gray histogram, recording a smaller gray value corresponding to the two wave troughs as a first segmentation threshold, and recording a larger gray value corresponding to the two wave troughs as a second segmentation threshold; and the area formed by the pixel points with the gray value smaller than the first segmentation threshold and the area formed by the pixel points with the gray value larger than the second segmentation threshold are suspected defect areas.
4. The method for identifying the defects of the composite film according to claim 1, wherein the method for obtaining the gray scale deviation index specifically comprises the following steps:;
wherein,represents a gray scale deviation indicator corresponding to the z-th pixel point, based on the pixel value in the pixel value bin>The gray value of the z-th pixel point is represented,represents the gray value of the other first pixel point in the window where the z-th pixel point is located, and/or the gray value of the other first pixel point is greater than or equal to>Represents the gray value of the jth pixel point in the window where the jth pixel point is located, and/or the gray value of the other jth pixel point is greater than or equal to>Representing the total number of other pixels except the center point within the window, exp () represents an exponential function with a natural constant e as the base.
5. The method for identifying defects in a composite film according to claim 1, wherein the dividing of the pixels into three levels according to the gray scale deviation index specifically comprises: and acquiring a difference value between the gray level deviation indexes of any two pixel points, and dividing all the pixel points into three levels based on all the difference values.
6. The method for identifying the defects of the composite film as claimed in claim 1, wherein the determining the connected region according to the non-connectivity index and the index threshold specifically comprises:
when the non-connectivity indexes corresponding to the end points of the possible defect area are all smaller than the index threshold value, connecting the possible defect area with the possible defect area corresponding to the non-connectivity index smaller than the index threshold value; when the non-connectivity index corresponding to only one end point of the possible defect area is smaller than the index threshold, calculating the shortest distance from the other end point to the edge of the composite film image, if the shortest distance is smaller than the index threshold, connecting the possible defect area with the possible defect area corresponding to the non-connectivity index smaller than the index threshold, and if the shortest distance is greater than or equal to the index threshold, removing the possible defect area without connection; when the non-connectivity indexes corresponding to the end points of the possible defect areas are not less than the index threshold, the possible defect areas are discarded and are not connected; all connected regions constitute connected regions.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211336527.2A CN115631173B (en) | 2022-10-28 | 2022-10-28 | Composite film defect identification method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211336527.2A CN115631173B (en) | 2022-10-28 | 2022-10-28 | Composite film defect identification method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115631173A CN115631173A (en) | 2023-01-20 |
CN115631173B true CN115631173B (en) | 2023-04-18 |
Family
ID=84908719
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211336527.2A Active CN115631173B (en) | 2022-10-28 | 2022-10-28 | Composite film defect identification method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115631173B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116433623B (en) * | 2023-03-31 | 2024-07-19 | 杭州数创自动化控制技术有限公司 | Defect position marking and identifying method, system, equipment and medium |
CN116091499B (en) * | 2023-04-07 | 2023-06-20 | 山东中胜涂料有限公司 | Abnormal paint production identification system |
CN116246174B (en) * | 2023-04-26 | 2023-08-08 | 山东金诺种业有限公司 | Sweet potato variety identification method based on image processing |
CN116228775B (en) * | 2023-05-10 | 2023-07-04 | 实德电气集团有限公司 | Contactor integrity detection method based on machine vision |
CN116858854A (en) * | 2023-09-04 | 2023-10-10 | 季华实验室 | Doping concentration correction method and device, electronic equipment and storage medium |
CN116977335B (en) * | 2023-09-22 | 2023-12-12 | 山东贞元汽车车轮有限公司 | Intelligent detection method for pitting defects on surface of mechanical part |
CN118521584A (en) * | 2024-07-23 | 2024-08-20 | 惠州艺都宇正数码科技有限公司 | High-precision microscopic quality detection method for optical film |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004233222A (en) * | 2003-01-30 | 2004-08-19 | Mitsubishi Heavy Ind Ltd | Inspection device and inspection method of printed matter |
CN115100208A (en) * | 2022-08-26 | 2022-09-23 | 南通三信塑胶装备科技股份有限公司 | Film surface defect evaluation method based on histogram and dynamic light source |
CN115170576A (en) * | 2022-09-09 | 2022-10-11 | 山东中发新材料科技有限公司 | Aluminum pipe surface defect detection method based on machine vision |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3190897B2 (en) * | 1998-10-28 | 2001-07-23 | 大分日本電気株式会社 | Defect inspection device and defect inspection method |
JP4233397B2 (en) * | 2002-10-01 | 2009-03-04 | 株式会社東京精密 | Image defect inspection method, image defect inspection apparatus, and appearance inspection apparatus |
JP2006292503A (en) * | 2005-04-08 | 2006-10-26 | Sumitomo Electric Ind Ltd | Method and device for flaw inspection |
CN103499585B (en) * | 2013-10-22 | 2015-07-29 | 常州工学院 | Based on noncontinuity lithium battery film defect inspection method and the device thereof of machine vision |
CN112651923A (en) * | 2020-11-11 | 2021-04-13 | 北京平恒智能科技有限公司 | Adhesive film wrinkle defect detection method capable of removing fine residues based on area ratio |
CN115100171A (en) * | 2022-07-11 | 2022-09-23 | 常宝云 | Steel die welding defect detection method and system based on machine vision |
CN115131354B (en) * | 2022-08-31 | 2022-11-25 | 江苏森信达生物科技有限公司 | Laboratory plastic film defect detection method based on optical means |
CN115170572B (en) * | 2022-09-08 | 2022-11-08 | 山东瑞峰新材料科技有限公司 | BOPP composite film surface gluing quality monitoring method |
-
2022
- 2022-10-28 CN CN202211336527.2A patent/CN115631173B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004233222A (en) * | 2003-01-30 | 2004-08-19 | Mitsubishi Heavy Ind Ltd | Inspection device and inspection method of printed matter |
CN115100208A (en) * | 2022-08-26 | 2022-09-23 | 南通三信塑胶装备科技股份有限公司 | Film surface defect evaluation method based on histogram and dynamic light source |
CN115170576A (en) * | 2022-09-09 | 2022-10-11 | 山东中发新材料科技有限公司 | Aluminum pipe surface defect detection method based on machine vision |
Also Published As
Publication number | Publication date |
---|---|
CN115631173A (en) | 2023-01-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115631173B (en) | Composite film defect identification method | |
CN115018828B (en) | Defect detection method for electronic component | |
CN106056118B (en) | A kind of identification method of counting for cell | |
CN115578389B (en) | Defect detection method of groove MOS device | |
CN105654501B (en) | Self-adaptive image segmentation method based on fuzzy threshold | |
CN114897898B (en) | Board quality classification method based on image processing | |
CN117058147B (en) | Environment-friendly plastic product defect detection method based on computer vision | |
CN116309600B (en) | Environment-friendly textile quality detection method based on image processing | |
CN106096491B (en) | Automatic identification method for microaneurysms in fundus color photographic image | |
CN117197140B (en) | Irregular metal buckle forming detection method based on machine vision | |
CN115082451B (en) | Stainless steel soup ladle defect detection method based on image processing | |
CN114118144A (en) | Anti-interference accurate aerial remote sensing image shadow detection method | |
CN115578732B (en) | Label identification method for fertilizer production line | |
CN112435272B (en) | High-voltage transmission line connected domain removing method based on image contour analysis | |
CN114140445B (en) | Breast cancer pathological image identification method based on key attention area extraction | |
CN113034474A (en) | Test method for wafer map of OLED display | |
CN110749598A (en) | Silkworm cocoon surface defect detection method integrating color, shape and texture characteristics | |
CN116805316B (en) | Degradable plastic processing quality detection method based on image enhancement | |
CN115511907B (en) | Scratch detection method for LED screen | |
CN114037691A (en) | Carbon fiber plate crack detection method based on image processing | |
CN117495849A (en) | Image feature-based power adapter quality detection method | |
CN114299051A (en) | Leather material surface defect detection method based on feature modeling significance detection | |
CN114155202A (en) | Thyroid nodule ultrasonic image classification method based on feature fusion and transfer learning | |
CN118172380B (en) | Orthopedics leg bone intelligent recognition segmentation method based on local threshold | |
CN115880280A (en) | Detection method for quality of steel structure weld joint |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |