CN114494210B - Plastic film production defect detection method and system based on image processing - Google Patents
Plastic film production defect detection method and system based on image processing Download PDFInfo
- Publication number
- CN114494210B CN114494210B CN202210106633.5A CN202210106633A CN114494210B CN 114494210 B CN114494210 B CN 114494210B CN 202210106633 A CN202210106633 A CN 202210106633A CN 114494210 B CN114494210 B CN 114494210B
- Authority
- CN
- China
- Prior art keywords
- gray
- feature extraction
- abnormal
- plastic film
- gaussian kernel
- 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 119
- 239000002985 plastic film Substances 0.000 title claims abstract description 109
- 229920006255 plastic film Polymers 0.000 title claims abstract description 108
- 238000001514 detection method Methods 0.000 title claims abstract description 47
- 238000004519 manufacturing process Methods 0.000 title claims abstract description 37
- 230000008859 change Effects 0.000 claims abstract description 102
- 238000000605 extraction Methods 0.000 claims abstract description 87
- 230000002159 abnormal effect Effects 0.000 claims abstract description 83
- 238000003708 edge detection Methods 0.000 claims abstract description 11
- 238000004364 calculation method Methods 0.000 claims description 7
- 238000007781 pre-processing Methods 0.000 claims description 7
- 238000009825 accumulation Methods 0.000 claims description 5
- 238000000034 method Methods 0.000 abstract description 26
- 230000008569 process Effects 0.000 description 6
- 230000002093 peripheral effect Effects 0.000 description 5
- 230000009286 beneficial effect Effects 0.000 description 4
- 230000008901 benefit Effects 0.000 description 4
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 230000000903 blocking effect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 229920003023 plastic Polymers 0.000 description 1
- 238000005498 polishing Methods 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
-
- 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/40—Image enhancement or restoration using histogram techniques
-
- 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/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20024—Filtering details
- G06T2207/20032—Median filtering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30168—Image quality inspection
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Quality & Reliability (AREA)
- Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
Abstract
The invention relates to the field of defect detection, in particular to a plastic film production defect detection method based on image processing, which comprises the following steps: acquiring a gray scale image of the plastic film; performing Gaussian kernel convolution on each feature extraction space in the gray level image to obtain each Gaussian kernel template gray level value; constructing a gradient direction histogram, and adjusting standard deviation parameters of a Gaussian convolution function according to the histogram to obtain the gray value of each Gaussian kernel template after adjustment; obtaining a gray change descriptor of each Gaussian kernel template according to each adjusted gray value, and further obtaining a gray change descriptor of the feature extraction space; obtaining an abnormal region in the feature extraction space according to the gray change descriptor of the feature extraction space; determining all defect areas by utilizing the gray level change conditions of the abnormal areas and the normal areas before and after the light source enhancement; and carrying out edge detection on the defect area to obtain a defect position. The method is used for detecting the defects of the plastic film, and the defect detection efficiency can be improved by the method.
Description
Technical Field
The application relates to the field of defect detection, in particular to a plastic film production defect detection method and system based on image processing.
Background
Plastic films are widely used in life because of their good properties. In the production process of the plastic film, various defects exist on the surface of the produced plastic film due to improper operation or process problems, and the use of the plastic film is influenced. Therefore, it is essential to perform defect detection on the produced plastic film.
In the prior art, the defect detection of the plastic film is mainly performed through manual detection, and the defect detection is also performed through combining an image recognition technology with different light beams and utilizing brightness change.
However, the problems in the prior art are: the workload of manually detecting the defects of the plastic film is large, and the omission factor is high. The method for detecting brightness change by utilizing image recognition is characterized in that due to the defect detection of the plastic film, the defect detection performed by the light source will inevitably cause reflection, so that the brightness change is influenced, and the defect detection is possibly influenced. Therefore, there is a need for a method for improving the efficiency and accuracy of defect detection of plastic films.
Disclosure of Invention
The invention provides a plastic film production defect detection method based on image processing, which comprises the following steps: acquiring a gray scale image of the plastic film; performing Gaussian kernel convolution on each feature extraction space in the gray level image to obtain each Gaussian kernel template gray level value; constructing a gradient direction histogram, and adjusting standard deviation parameters of a Gaussian convolution function according to the histogram to obtain the gray value of each Gaussian kernel template after adjustment; obtaining a gray change descriptor of each Gaussian kernel template according to each adjusted gray value, and further obtaining a gray change descriptor of the feature extraction space; obtaining an abnormal region in the feature extraction space according to the gray change descriptor of the feature extraction space; determining all defect areas by utilizing the gray level change conditions of the abnormal areas and the normal areas before and after the light source is enhanced; compared with the prior art, the method has the advantages that the characteristic extraction space is subjected to Gaussian kernel convolution, a parameter adjusting model is built through a gradient histogram inside the Gaussian kernel, parameters in a Gaussian convolution function are adjusted in a self-adaptive mode to obtain the gray change descriptor index, the gray change characteristic of the surface of the plastic film can be obtained quickly, and the rough positioning of the surface defect of the plastic film is realized according to the standard deviation parameter of dynamic change. Furthermore, the method and the device can accurately locate the defect area by performing light source enhancement on the surface of the abnormal plastic film and utilizing the gray scale change degree of the defect rough location area of the plastic film and the contrast change of the peripheral area, so that the defect position of the plastic film can be accurately obtained, and the gray scale change error caused by the vibration of the plastic film can be reduced by changing the light source intensity.
In order to achieve the purpose, the invention adopts the following technical scheme that the plastic film production defect detection method based on image processing comprises the following steps:
and acquiring a surface image and a gray scale image of the plastic film.
And carrying out region division on the gray level image to obtain all feature extraction spaces.
And performing Gaussian kernel convolution on each feature extraction space to obtain each Gaussian kernel template gray value.
And obtaining a gradient direction histogram of each feature extraction space according to the gray value of the pixel point in each Gaussian kernel template.
And adjusting the standard deviation parameters in the Gaussian convolution function according to the mean value and the variance of the gradient direction histogram of each feature extraction space, and performing Gaussian kernel convolution on each feature extraction space by using the Gaussian convolution function after the standard deviation parameters are adjusted to obtain the gray value of each adjusted Gaussian kernel template.
And taking the gray value adjusted by each Gaussian kernel template as a gray change descriptor of each Gaussian kernel template, and obtaining the gray change descriptors of all the feature extraction spaces according to the average value of the gray change descriptors of all the Gaussian kernel templates of each feature extraction space.
And obtaining abnormal regions in all the feature extraction spaces according to the gray change descriptors of the feature extraction spaces.
And determining the defect areas in all the abnormal areas by utilizing the gray level change conditions of the abnormal areas and the normal areas before and after the light source is enhanced.
And carrying out edge detection on the defect area to obtain the defect position in each abnormal area.
Further, in the method for detecting defects in plastic film production based on image processing, the histogram of gradient directions of each feature extraction space is obtained as follows:
and traversing the sliding window of each characteristic extraction space by using a Gaussian kernel template, accumulating the gradient values corresponding to all pixel points in each angle interval range by taking the central pixel point in each template as the center of a circle and taking each 20 degrees as a unit angle interval, and obtaining the accumulation result of all angle intervals.
And obtaining a gradient direction histogram of each feature extraction space according to the accumulation result of each angle interval.
Further, in the plastic film production defect detection method based on image processing, the gray values of the adjusted gaussian kernel templates are obtained as follows:
and acquiring the mean and the variance of the gradient direction histograms of all the feature extraction spaces.
And constructing an adjusting model according to the mean value and the variance of the gradient direction histogram of each feature extraction space, and adjusting the standard deviation parameters in the Gaussian convolution function to obtain the Gaussian convolution function after each standard deviation parameter is adjusted.
And performing Gaussian kernel convolution on each feature extraction space by using the Gaussian convolution function after the standard deviation parameter is adjusted to obtain the gray value of each adjusted Gaussian kernel template.
Further, in the method for detecting the production defects of the plastic film based on the image processing, the expression of the adjustment model is as follows:
where μ is the mean, σ, of the gradient direction histogram of each feature extraction space 2′ The variance of the gradient direction histogram of the space is extracted for each feature,to adjust the model parameters.
Further, according to the plastic film production defect detection method based on image processing, the abnormal regions in all the feature extraction spaces are obtained as follows:
setting a threshold value, judging the gray level change descriptors of all the feature extraction spaces, and taking the feature extraction space with the gray level change descriptors larger than the threshold value as an abnormal space.
And judging the gray level change descriptors of the Gaussian kernel templates in the abnormal space, and taking the Gaussian kernel templates of which the gray level change descriptors are larger than a threshold value as abnormal regions to obtain the abnormal regions in all the feature extraction spaces.
Further, in the method for detecting the production defects of the plastic film based on the image processing, the defect areas in all the abnormal areas are determined as follows:
and obtaining and subtracting the gray level mean values of the abnormal regions and the normal regions before the light source is enhanced to obtain the gray level mean value difference values of the abnormal regions and the normal regions before the light source is enhanced.
And obtaining and subtracting the gray level mean values of the abnormal regions and the normal regions after the light source is enhanced to obtain the gray level mean value difference values of the abnormal regions and the normal regions after the light source is enhanced.
And subtracting the gray level mean value difference value of each abnormal area and the normal area after the light source is enhanced from the gray level mean value difference value of each abnormal area and the normal area before the light source is enhanced to obtain the change of the gray level mean value difference value before and after the light source is enhanced.
Setting a threshold value, judging the change of the gray level average difference value before and after the light source is enhanced, determining the abnormal area with the gray level average difference value before and after the light source is enhanced being larger than the threshold value as the defect area, and determining the defect area in all the abnormal areas.
Further, in the method for detecting the production defects of the plastic film based on the image processing, the defect positions in the different regions are obtained as follows:
and performing Sobel operator edge detection on each defect region, and obtaining the defect position in each abnormal region through the gray gradient in different directions.
On the other hand, the invention also provides a plastic film production defect detection system based on image processing, which comprises an acquisition unit, a processing unit, a calculation unit and a control unit:
and the acquisition unit is used for acquiring the surface image of the plastic film on the production line by arranging the camera right above the inlet of the coiling machine.
The processing unit is used for preprocessing the image acquired by the acquisition unit by using the data master controller to obtain a plastic film gray image; and further extracting the characteristics of the gray level image to obtain a coarse positioning abnormal area and a coarse positioning normal area.
The calculation unit calculates the gray level change values before and after the light source enhancement of the coarse positioning abnormal area and the normal area acquired by the processing unit by using the data master controller; and further obtaining the defect position according to the gray level change value.
And the control unit and the data master controller control and adjust the plastic film production process according to the defect condition of the defect position obtained by the calculation unit.
The invention has the beneficial effects that:
according to the method, the characteristic extraction space is subjected to Gaussian kernel convolution, a parameter adjusting model is constructed through a gradient histogram in the Gaussian kernel, parameters in a Gaussian convolution function are adjusted in a self-adaptive mode, so that a gray change descriptor index is obtained, the gray change characteristic of the surface of the plastic film can be rapidly obtained, and the rough positioning of the surface defect of the plastic film is realized according to the standard deviation parameter of dynamic change.
Furthermore, the method carries out light source enhancement on the surface of the abnormal plastic film, and carries out accurate positioning on the defect area by utilizing the gray level change degree of the defect rough positioning area on the surface of the plastic film and the contrast change of the defect rough positioning area and the peripheral area, so that the defect position of the plastic film can be accurately obtained, and the gray level change error caused by the vibration of the plastic film can be reduced by changing the light source intensity.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a schematic flow chart of a method for detecting defects in the production of plastic films according to embodiment 1 of the present invention;
FIG. 2 is a schematic flow chart of a method for detecting defects in the production of plastic films according to embodiment 2 of the present invention;
fig. 3 is a block diagram of a plastic film production defect detection system provided in embodiment 3 of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1
The embodiment of the invention provides a plastic film production defect detection method based on image processing, which comprises the following steps of:
s101, obtaining a plastic film surface image and a gray scale image thereof.
The gray scale map is also called a gray scale map. The relationship between white and black is logarithmically divided into several levels, called gray scale. The gray scale is divided into 256 steps.
And S102, carrying out region division on the gray level image to obtain all feature extraction spaces.
The feature extraction space is equivalent to blocking the entire gray scale image.
S103, performing Gaussian kernel convolution on each feature extraction space to obtain each Gaussian kernel template gray value.
The convolution operation is to slide the convolution kernel from left to right and from top to bottom on the image in the form of a window, so as to obtain a new image.
And S104, obtaining a gradient direction histogram of each feature extraction space according to the gray value of the pixel point in each Gaussian kernel template.
Wherein the histogram of gradient directions is used for subsequent adjustment of the gaussian convolution function.
And S105, adjusting standard deviation parameters in the Gaussian convolution function according to the mean value and the variance of the gradient direction histogram of each feature extraction space, and performing Gaussian kernel convolution on each feature extraction space by using the Gaussian convolution function after the standard deviation parameters are adjusted to obtain the gray value of each adjusted Gaussian kernel template.
Wherein the model parameters are adjustedThe larger the standard deviation parameter σ of the corresponding gaussian convolution function.
And S106, taking the adjusted gray value of each Gaussian kernel template as a gray change descriptor of each Gaussian kernel template, and obtaining the gray change descriptors of all the feature extraction spaces according to the mean value of the gray change descriptors of all the Gaussian kernel templates of each feature extraction space.
The abnormal region can be obtained through the gray change descriptors of the feature extraction spaces.
And S107, obtaining abnormal regions in all the feature extraction spaces according to the gray change descriptors of the feature extraction spaces.
Setting a threshold value, and taking a feature extraction space with the gray change descriptor larger than the threshold value as an abnormal space.
And S108, determining the defect areas in all the abnormal areas by utilizing the gray scale change conditions of the abnormal areas and the normal areas before and after the light source is enhanced.
Wherein, the larger the gray scale change between the abnormal region and the normal region before and after the light source is enhanced, the larger the possibility of the defect existing in the abnormal region is.
And S109, carrying out edge detection on the defect area to obtain the defect position in each abnormal area.
The purpose of edge detection is to identify points in the digital image where the brightness changes are significant.
The beneficial effect of this embodiment lies in:
in the embodiment, the characteristic extraction space is subjected to Gaussian kernel convolution, a parameter adjusting model is constructed through a gradient histogram in the Gaussian kernel, parameters in a Gaussian convolution function are adaptively adjusted to obtain a gray change descriptor index, the gray change characteristic of the surface of the plastic film can be rapidly obtained, and the rough positioning of the surface defect of the plastic film is realized according to the standard deviation parameter of dynamic change.
Furthermore, in the embodiment, the light source is enhanced on the surface of the abnormal plastic film, the defect area is accurately positioned by utilizing the gray scale change degree of the defect rough positioning area on the surface of the plastic film and the contrast change of the defect rough positioning area and the peripheral area, the defect position of the plastic film can be accurately obtained, and the gray scale change error caused by the vibration of the plastic film can be reduced by changing the light source intensity.
Example 2
The main purposes of this embodiment are: and detecting the production defects existing in the production process of the plastic film through the plastic film image and the set light source.
The embodiment of the invention provides a plastic film production defect detection method based on image processing, which comprises the following steps of:
s201, adding an external light source, and acquiring a surface image of the plastic film.
By installing the image acquisition device at the coiler inlet, the image acquisition device comprises: a common RGB camera and a planar light source. A planar light source is used for polishing the surface of the plastic film, and a camera is used for collecting the surface image of the plastic film. The planar light source and the camera are fixed in position, and the light source is free from scattering influence. The detection object is a white transparent plastic film, and the main defects are as follows: gel defects.
S202, preprocessing the image.
The purpose of this step is: and preprocessing the image. The method has the advantage that the influence of noise in the image on detection can be reduced by utilizing a preprocessing method.
The input is as follows: and (3) carrying out image preprocessing on the surface image of the plastic film, and outputting: the processed image.
The method comprises the steps of collecting an image after a light source is polished by a camera, carrying out median filtering denoising processing on the image, eliminating noise with interference, carrying out graying processing on the denoised image to obtain a gray level image on the surface of the plastic film, wherein graying adopts R, G and B three-channel mean graying, and is consistent with a conversion method of a brightness (I) channel in the HSI color space conversion process, so that gray level change can be equivalently understood as brightness change.
And S203, constructing a gray change descriptor.
The purpose of this step is: and performing gray feature extraction through the surface image to construct a gray change descriptor. The method has the advantages that the gray scale change descriptor can be used for carrying out feature description on the surface of the plastic film, and the subsequent defect detection of the plastic film is facilitated.
The input is as follows: the processed image is subjected to gray change descriptor extraction, and the output is as follows: and roughly positioning an abnormal detection area.
It should be noted that, in order to improve the plastic film surface detection speed, a continuous multi-frame image acquisition mode is adopted for a moving plastic film production line, one frame of image corresponds to a plastic film image with a fixed size, no overlapping part exists between continuous multi-frame images, and the plastic film movement speed is 10 m/min.
Obtaining a gray level change descriptor through the image surface characteristics, wherein the specific obtaining process is as follows:
1. firstly, constructing a feature extraction space with a fixed size of NxN on the surface of a plastic film, wherein N is a self-adaptive adjustment parameter, performing Gaussian kernel convolution inside each feature extraction space, and a Gaussian kernel template is mxm, wherein m is<N, mn (representing m divided by N), the gaussian convolution function is:wherein, σ represents the standard deviation of the Gaussian template, g (x, y) represents the gray value of the pixel point with the coordinate (x, y), and/or>Representing the mean value of the gray scale of the gaussian template.
2. Then, a histogram of gradient directions (HOG) is obtained for the image in the feature extraction space, and the histogram of gradient directions is obtained by: in the process of sliding a window of a Gaussian kernel template, taking a central pixel point in the template as a circle center, and taking every 20 degrees as a unit angle interval, accumulating the gradient values corresponding to all pixel points in the angle interval range, wherein each angle interval corresponds to an accumulation result, and constructing a gradient direction histogram.
3. The standard deviation parameter sigma of the Gaussian convolution function is determined through the gradient value distribution of the gradient direction histogram, under the normal condition, the surface of a normal plastic film is smooth and free of defects, and light sources are uniformly distributed on the surface, so that no existence exists between pixel pointsAt gradients, the gradient direction histogram should be close to 0, and accordingly, the standard deviation of the gaussian convolution function σ → ∞. Therefore, the mean μ and variance σ of the histogram are passed through 2′ Adjusting a standard deviation parameter sigma in the Gaussian convolution function to construct an adjusting model:adjusting a model parameter->The larger the standard deviation parameter σ of the corresponding gaussian convolution function.
4. Sliding the Gaussian kernel template on the characteristic extraction space of NxN, and enabling the size Ga of the Gaussian convolution function corresponding to the Gaussian kernel template i As a grey scale change descriptor α for each gaussian kernel template i . Then, the gray scale change descriptor mean of all Gaussian kernel templates in all feature extraction spaces is calculatedAs a grey scale change descriptor of the current feature extraction space.
And S204, acquiring a coarse positioning abnormity detection area.
Gray scale change descriptor mean threshold M using feature extraction space 1 =0.2, and evaluating the defect of the feature extraction space of continuous frame images, and describing the average value mu of the gray change descriptor g >M 1 Is regarded as an abnormal space, and the descriptor alpha is described according to the gray scale change of each Gaussian kernel template in the abnormal space i Extracting abnormal region to obtain alpha i And extracting the abnormal region more than 0.2 to obtain the coarsely positioned abnormal region.
It should be noted that the gray scale change descriptor is mainly used to characterize the size and speed of the gray scale change in the current image space. The gray scale change descriptor can be used for quickly acquiring possible defect areas on the surface of the current plastic film.
And S205, performing fine detection on the surface of the plastic film.
The purpose of this step is: and acquiring the change condition of the gray change descriptor of the roughly positioned defect area through the enhanced light source. The method has the advantages that the surface defects of the plastic film can be accurately detected, and the influence caused by vibration of the plastic film is eliminated.
The input is as follows: and roughly positioning an abnormal detection area, performing enhanced light source processing, and outputting: plastic film surface defect images.
And performing light source enhancement through the roughly positioned abnormal detection area in the obtained feature extraction space, improving the overall brightness of the planar light source, and re-acquiring the feature extraction space image. The surface of a normal plastic film area is smooth, so the brightness change is obvious; due to the existence of gel defects, the abnormal plastic film area can scatter and reflect light paths, so that the brightness distribution is uneven, and the contrast with other area images is large.
Extracting a spatial image according to the re-acquired features, and performing gray feature analysis of the coarse positioning anomaly detection area, wherein the specific process comprises the following steps:
1. firstly, obtaining the gray average value of the abnormal detection area before the light source is enhancedAnd the mean value of the gray levels of other normal regions>Get the mean value difference of gray scale->Then, the mean value of the gray scale of the abnormal detection area after the light source is enhanced is obtained>And other normal areas mean value of gray level>Get the mean value difference of gray scale->
2. The variation c' -c > epsilon according to the gray average difference before and after the light source enhancement, wherein the epsilon is related to the light source enhancement, and the empirical value is 10. To determine whether gel defects are present in the abnormal inspection area.
3. And then, carrying out Sobel operator edge detection on the pixel points in the abnormal detection region, and determining the accurate positions of the gel defects in the abnormal region through the gray gradients in different directions. The Sobel operator edge detection algorithm is a known algorithm, the implementation process is not described too much, and the gray gradient direction adopted by the Sobel operator in the embodiment is perpendicular to and parallel to the horizontal axis of the image coordinate system.
4. And finally, obtaining an accurate gel defect position in the abnormal detection area, and realizing the defect detection and positioning of the surface of the plastic film.
The beneficial effect of this embodiment lies in:
in the embodiment, the characteristic extraction space is subjected to Gaussian kernel convolution, a parameter adjusting model is constructed through a gradient histogram in the Gaussian kernel, parameters in a Gaussian convolution function are adaptively adjusted to obtain a gray change descriptor index, the gray change characteristic of the surface of the plastic film can be rapidly obtained, and the rough positioning of the surface defect of the plastic film is realized according to the standard deviation parameter of dynamic change.
Furthermore, in the embodiment, the light source is enhanced on the surface of the abnormal plastic film, the defect area is accurately positioned by utilizing the gray scale change degree of the defect rough positioning area on the surface of the plastic film and the contrast change of the defect rough positioning area and the peripheral area, the defect position of the plastic film can be accurately obtained, and the gray scale change error caused by the vibration of the plastic film can be reduced by changing the light source intensity.
Example 3
The embodiment of the invention provides a plastic film production defect detection system based on image processing, which comprises an acquisition unit, a processing unit, a calculation unit and a control unit, as shown in figure 3:
the acquisition unit is used for acquiring the surface image of the plastic film on the production line, and the camera is arranged right above the inlet of the coiling machine;
the processing unit inputs the image acquired by the acquisition unit into the data master controller, and the data master controller is used for preprocessing the image to obtain a surface gray image of the plastic film; performing feature extraction on the gray level image to obtain a gray level change descriptor of the plastic film, and performing defect assessment on the plastic film according to the gray level change descriptor to obtain a coarse positioning abnormal area;
the computing unit is used for performing enhanced light source processing on the abnormal area obtained by the processing unit by using the data master controller, calculating gray level change values of the abnormal area and the normal area before and after the enhanced light source, obtaining the abnormal area with the defect according to the gray level change values, and performing edge detection on the abnormal area with the defect to obtain the defect position of the surface of the plastic film;
and the control unit adjusts the plastic film production process by using the data master controller according to the defect condition of the defect position of the surface of the plastic film obtained by the calculation unit.
The beneficial effect of this embodiment lies in:
in the embodiment, the Gaussian kernel convolution is carried out on the feature extraction space, the parameter adjusting model is constructed through the gradient histogram in the Gaussian kernel, the parameters in the Gaussian convolution function are adjusted in a self-adaptive mode to obtain the gray change descriptor indexes, the gray change features of the surface of the plastic film can be obtained quickly, and the rough positioning of the defects on the surface of the plastic film is realized according to the standard deviation parameters of dynamic change.
Furthermore, in the embodiment, the light source is enhanced on the surface of the abnormal plastic film, the defect area is accurately positioned by utilizing the gray scale change degree of the defect rough positioning area on the surface of the plastic film and the contrast change of the defect rough positioning area and the peripheral area, the defect position of the plastic film can be accurately obtained, and the gray scale change error caused by the vibration of the plastic film can be reduced by changing the light source intensity.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (8)
1. A plastic film production defect detection method based on image processing is characterized by comprising the following steps:
acquiring a surface image and a gray scale image of the plastic film;
carrying out region division on the gray level image to obtain all feature extraction spaces;
performing Gaussian kernel convolution on each feature extraction space to obtain each Gaussian kernel template gray value;
obtaining a gradient direction histogram of each feature extraction space according to the gray value of a pixel point in each Gaussian kernel template;
adjusting standard deviation parameters in the Gaussian convolution function according to the mean value and the variance of the gradient direction histogram of each feature extraction space, and performing Gaussian kernel convolution on each feature extraction space by using the Gaussian convolution function after the standard deviation parameters are adjusted to obtain the gray value after each Gaussian kernel template is adjusted;
the gray value adjusted by each Gaussian kernel template is used as a gray change descriptor of each Gaussian kernel template, and the gray change descriptors of all the feature extraction spaces are obtained according to the mean value of the gray change descriptors of all the Gaussian kernel templates of each feature extraction space;
obtaining abnormal regions in all the feature extraction spaces according to the gray change descriptors of the feature extraction spaces;
determining defect areas in all abnormal areas by utilizing gray level change conditions of the abnormal areas and the normal areas before and after light source enhancement;
and carrying out edge detection on the defect area to obtain the defect position in each abnormal area.
2. The image processing-based plastic film production defect detection method as claimed in claim 1, wherein the gradient direction histogram of each feature extraction space is obtained as follows:
performing sliding window traversal on each feature extraction space by using a Gaussian kernel template, and accumulating the gradient values corresponding to all pixel points in each angle interval range by taking a central pixel point in each template as a circle center and taking each 20 degrees as a unit angle interval to obtain the accumulation result of all angle intervals;
and obtaining a gradient direction histogram of each feature extraction space according to the accumulation result of each angle interval.
3. The image processing-based plastic film production defect detection method as claimed in claim 1, wherein the adjusted gray value of each gaussian kernel template is obtained as follows:
obtaining the mean value and the variance of the gradient direction histogram of each feature extraction space;
establishing an adjusting model according to the mean value and the variance of the gradient direction histogram of each feature extraction space, and adjusting the standard deviation parameters in the Gaussian convolution function to obtain the Gaussian convolution function after each standard deviation parameter is adjusted;
and performing Gaussian kernel convolution on each feature extraction space by using the Gaussian convolution function after the standard deviation parameter is adjusted to obtain the gray value of each adjusted Gaussian kernel template.
4. The image processing-based plastic film production defect detection method as claimed in claim 3, wherein the expression of the adjustment model is as follows:
5. The image processing-based plastic film production defect detection method according to claim 1, wherein the abnormal regions in all the feature extraction spaces are obtained as follows:
setting a threshold value, judging the gray change descriptors of all the feature extraction spaces, and taking the feature extraction space with the gray change descriptors larger than the threshold value as an abnormal space;
and judging the gray change descriptors of the Gaussian kernel templates in the abnormal space, and taking the Gaussian kernel templates with the gray change descriptors larger than a threshold value as abnormal regions to obtain the abnormal regions in all the feature extraction spaces.
6. An image processing-based plastic film production defect detection method as claimed in claim 1, wherein the defect areas in all the abnormal areas are determined as follows:
acquiring and subtracting the gray level mean values of the abnormal regions and the normal regions before the light source is enhanced to obtain the gray level mean value difference values of the abnormal regions and the normal regions before the light source is enhanced;
acquiring and subtracting the gray level mean values of the abnormal regions and the normal regions after the light source is enhanced to obtain the gray level mean value difference values of the abnormal regions and the normal regions after the light source is enhanced;
the gray level mean value difference value of each abnormal area and the normal area after the light source is enhanced is subtracted from the gray level mean value difference value of each abnormal area and the normal area before the light source is enhanced, and the change of the gray level mean value difference value before and after the light source is enhanced is obtained;
setting a threshold value, judging the change of the gray level average difference value before and after the light source is enhanced, determining the abnormal area with the gray level average difference value before and after the light source is enhanced being larger than the threshold value as the defect area, and determining the defect area in all the abnormal areas.
7. The image processing-based plastic film production defect detection method as claimed in claim 1, wherein the defect positions in the respective abnormal regions are obtained as follows:
and performing Sobel operator edge detection on each defect region, and obtaining the defect position in each abnormal region through the gray gradient in different directions.
8. The plastic film production defect detection system based on image processing is characterized by comprising an acquisition unit, a processing unit, a calculation unit and a control unit:
the acquisition unit is used for acquiring the surface image of the plastic film on the production line, and the camera is arranged right above the inlet of the coiling machine;
the processing unit is used for preprocessing the image acquired by the acquisition unit to obtain a plastic film gray scale image;
carrying out region division on the gray level image to obtain all feature extraction spaces;
performing Gaussian kernel convolution on each feature extraction space to obtain each Gaussian kernel template gray value;
obtaining a gradient direction histogram of each feature extraction space according to the gray value of a pixel point in each Gaussian kernel template;
adjusting standard deviation parameters in the Gaussian convolution function according to the mean value and the variance of the gradient direction histogram of each feature extraction space, and performing Gaussian kernel convolution on each feature extraction space by using the Gaussian convolution function after the standard deviation parameters are adjusted to obtain the gray value of each adjusted Gaussian kernel template;
the gray value adjusted by each Gaussian kernel template is used as a gray change descriptor of each Gaussian kernel template, and the gray change descriptors of all the feature extraction spaces are obtained according to the mean value of the gray change descriptors of all the Gaussian kernel templates of each feature extraction space;
obtaining abnormal regions in all the feature extraction spaces according to the gray change descriptors of the feature extraction spaces;
the computing unit is used for computing the gray scale change values before and after the light source enhancement of the abnormal region and the normal region acquired by the processing unit;
determining defect areas in all abnormal areas according to gray level change values of the abnormal areas and the normal areas before and after the light source is enhanced;
carrying out edge detection on the defect area to obtain defect positions in different abnormal areas;
and the control unit is used for controlling and adjusting the plastic film production process according to the defect condition of the defect position obtained by the calculation unit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210106633.5A CN114494210B (en) | 2022-01-28 | 2022-01-28 | Plastic film production defect detection method and system based on image processing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210106633.5A CN114494210B (en) | 2022-01-28 | 2022-01-28 | Plastic film production defect detection method and system based on image processing |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114494210A CN114494210A (en) | 2022-05-13 |
CN114494210B true CN114494210B (en) | 2023-03-24 |
Family
ID=81477441
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210106633.5A Active CN114494210B (en) | 2022-01-28 | 2022-01-28 | Plastic film production defect detection method and system based on image processing |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114494210B (en) |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114782475B (en) * | 2022-06-16 | 2022-09-02 | 南通金石包装印刷有限公司 | Corrugated carton line pressing defect detection optimization method based on artificial intelligence system |
CN114792314B (en) * | 2022-06-21 | 2022-09-02 | 南通永卓金属制品有限公司 | Laser beam-based metal mesh defect detection method and artificial intelligence system |
CN114972348B (en) * | 2022-08-01 | 2022-09-30 | 山东尚雅建材有限公司 | Seam beautifying effect detection method based on image processing |
CN114972354B (en) * | 2022-08-02 | 2022-10-28 | 济宁金筑新型建材科技有限公司 | Image processing-based autoclaved aerated concrete block production control method and system |
CN115082482B (en) * | 2022-08-23 | 2022-11-22 | 山东优奭趸泵业科技有限公司 | Metal surface defect detection method |
CN115131353B (en) * | 2022-08-30 | 2022-12-02 | 海门市元绒纺织科技有限公司 | Flat screen printing textile production abnormity identification and positioning method and system |
CN116973367B (en) * | 2023-07-05 | 2024-01-30 | 广东汇发塑业科技有限公司 | Method for inspecting degradation defect position of biodegradable film |
CN117455914B (en) * | 2023-12-25 | 2024-03-15 | 青岛海天成光伏新能源有限公司 | Intelligent control method and system for production line of photovoltaic junction box |
CN117811218B (en) * | 2024-02-29 | 2024-05-14 | 广东电网有限责任公司 | Unmanned aerial vehicle transmission and transformation and distribution integrated collaborative inspection method |
CN118196095B (en) * | 2024-05-17 | 2024-09-10 | 南通兴逸卧室用品有限公司 | Textile surface defect detection method |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108022233A (en) * | 2016-10-28 | 2018-05-11 | 沈阳高精数控智能技术股份有限公司 | A kind of edge of work extracting method based on modified Canny operators |
CN110570411A (en) * | 2019-09-05 | 2019-12-13 | 中国科学院长春光学精密机械与物理研究所 | mura detection method and device based on coefficient of variation |
CN111325728B (en) * | 2020-02-19 | 2023-05-30 | 南方科技大学 | Product defect detection method, device, equipment and storage medium |
CN112098416A (en) * | 2020-08-21 | 2020-12-18 | 深圳大学 | Fan blade defect detection method and system based on machine vision |
-
2022
- 2022-01-28 CN CN202210106633.5A patent/CN114494210B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN114494210A (en) | 2022-05-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114494210B (en) | Plastic film production defect detection method and system based on image processing | |
CN108921176B (en) | Pointer instrument positioning and identifying method based on machine vision | |
CN109507192B (en) | Magnetic core surface defect detection method based on machine vision | |
CN109490316B (en) | Surface defect detection algorithm based on machine vision | |
CN116168026B (en) | Water quality detection method and system based on computer vision | |
CN115018844B (en) | Plastic film quality evaluation method based on artificial intelligence | |
CN117237368B (en) | Bridge crack detection method and system | |
CN116596936B (en) | Solar wing sailboard quality detection method based on image data | |
WO2021109697A1 (en) | Character segmentation method and apparatus, and computer-readable storage medium | |
CN116110053B (en) | Container surface information detection method based on image recognition | |
CN115131354B (en) | Laboratory plastic film defect detection method based on optical means | |
CN101901342A (en) | Method and device for extracting image target region | |
CN114118144A (en) | Anti-interference accurate aerial remote sensing image shadow detection method | |
CN112308854B (en) | Automatic detection method and system for chip surface flaws and electronic equipment | |
CN116310845B (en) | Intelligent monitoring system for sewage treatment | |
CN110298840A (en) | A kind of yarn faults detection method based on image | |
CN117557820B (en) | Quantum dot optical film damage detection method and system based on machine vision | |
CN111179362B (en) | Test paper color uniformity detection method based on dynamic illumination correction algorithm | |
CN116664565A (en) | Hidden crack detection method and system for photovoltaic solar cell | |
CN115018785A (en) | Hoisting steel wire rope tension detection method based on visual vibration frequency identification | |
CN117541582A (en) | IGBT insulation quality detection method for high-frequency converter | |
CN116168012A (en) | Method, device and computer equipment for training color spot detection model | |
CN115187788A (en) | Crop seed automatic counting method based on machine vision | |
CN109949245B (en) | Cross laser detection positioning method and device, storage medium and computer equipment | |
CN113674180A (en) | Frosted plane low-contrast defect detection method, device, equipment and storage medium |
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 |