CN115311272B - Aluminum foil surface defect identification method - Google Patents
Aluminum foil surface defect identification method Download PDFInfo
- Publication number
- CN115311272B CN115311272B CN202211238356.XA CN202211238356A CN115311272B CN 115311272 B CN115311272 B CN 115311272B CN 202211238356 A CN202211238356 A CN 202211238356A CN 115311272 B CN115311272 B CN 115311272B
- Authority
- CN
- China
- Prior art keywords
- target
- aluminum foil
- sample
- difference
- gray
- 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
- 229910052782 aluminium Inorganic materials 0.000 title claims abstract description 366
- XAGFODPZIPBFFR-UHFFFAOYSA-N aluminium Chemical compound [Al] XAGFODPZIPBFFR-UHFFFAOYSA-N 0.000 title claims abstract description 366
- 239000011888 foil Substances 0.000 title claims abstract description 366
- 230000007547 defect Effects 0.000 title claims abstract description 153
- 238000000034 method Methods 0.000 title claims abstract description 36
- 238000004458 analytical method Methods 0.000 claims abstract description 17
- 238000007781 pre-processing Methods 0.000 claims abstract description 11
- 239000011159 matrix material Substances 0.000 claims description 68
- 238000012545 processing Methods 0.000 claims description 10
- 238000000354 decomposition reaction Methods 0.000 claims description 9
- 238000012216 screening Methods 0.000 claims description 3
- 239000000463 material Substances 0.000 abstract description 6
- 238000012360 testing method Methods 0.000 abstract description 5
- 238000004154 testing of material Methods 0.000 abstract description 2
- 230000003287 optical effect Effects 0.000 abstract 1
- 238000009826 distribution Methods 0.000 description 5
- 238000010606 normalization Methods 0.000 description 4
- 238000001914 filtration Methods 0.000 description 3
- 230000007797 corrosion Effects 0.000 description 2
- 238000005260 corrosion Methods 0.000 description 2
- 230000002950 deficient Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000005265 energy consumption Methods 0.000 description 2
- 238000005286 illumination Methods 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 239000011825 aerospace material Substances 0.000 description 1
- QVGXLLKOCUKJST-UHFFFAOYSA-N atomic oxygen Chemical compound [O] QVGXLLKOCUKJST-UHFFFAOYSA-N 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000012512 characterization method Methods 0.000 description 1
- 238000004140 cleaning Methods 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 239000002131 composite material Substances 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 239000003814 drug Substances 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 239000010687 lubricating oil Substances 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 229910052751 metal Inorganic materials 0.000 description 1
- 239000002184 metal Substances 0.000 description 1
- 229910044991 metal oxide Inorganic materials 0.000 description 1
- 150000004706 metal oxides Chemical class 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 231100000956 nontoxicity Toxicity 0.000 description 1
- 229910052760 oxygen Inorganic materials 0.000 description 1
- 239000001301 oxygen Substances 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 238000002310 reflectometry Methods 0.000 description 1
- 238000005096 rolling process Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000006467 substitution reaction 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
- G06T7/0004—Industrial image inspection
- G06T7/001—Industrial image inspection using an image reference approach
-
- 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/20—Image preprocessing
-
- 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/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
-
- 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/30108—Industrial image inspection
- G06T2207/30136—Metal
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Multimedia (AREA)
- Image Analysis (AREA)
Abstract
The invention relates to the technical field of material testing and analysis, in particular to a method for identifying surface defects of an aluminum foil, which comprises the following steps: acquiring a surface visible light image of an aluminum foil to be detected and a sample surface visible light image of a sample aluminum foil by an optical means, specifically a visible light means, and preprocessing the surface visible light image and the sample surface visible light image; performing characteristic comparison analysis on the target aluminum foil image and the sample aluminum foil image; determining the probability of the target defect corresponding to the aluminum foil to be detected according to the gray difference and the surface appearance difference; and generating target defect information corresponding to the aluminum foil to be detected according to the target defect probability and a preset defect probability threshold. The invention utilizes the visible light means to analyze and test materials, solves the technical problem of low accuracy of defect identification on the surface of the aluminum foil, improves the accuracy of defect identification on the surface of the aluminum foil, and is mainly applied to defect identification on the surface of the aluminum foil.
Description
Technical Field
The invention relates to the technical field of material testing and analysis, in particular to a method for identifying surface defects of an aluminum foil.
Background
Because the aluminum foil has the characteristics of oxygen resistance, light resistance, moisture resistance, heat resistance, corrosion resistance, no toxicity and no odor, the aluminum foil is widely applied to daily food and medicine packaging, electronic component radiators, building composite materials, aerospace materials and the like. However, in the process of manufacturing the aluminum foil, the defect of the surface of the aluminum foil is often caused due to improper parameter adjustment of electrical control equipment such as a rolling mill and a cleaning machine or improper selection of lubricating oil, so that the defect identification of the surface of the aluminum foil is very important. At present, when the defect identification is carried out on the surface of an article, the following methods are generally adopted: and adopting an image matching algorithm to identify the defects on the surface of the article.
However, when the above-described manner is adopted, there are often technical problems as follows:
because the color of the aluminum foil surface without defects is usually silvery white, if the aluminum foil surface has scratch defects, when the defect identification is carried out on the aluminum foil surface by using an image matching algorithm, the scratch defects can be inaccurately identified, and the image matching often reacts sensitively to noise points, so that the accuracy of the defect identification carried out on the aluminum foil surface is often low.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
The invention provides a method for identifying defects on the surface of an aluminum foil, which aims to solve the technical problem that the accuracy of identifying the defects on the surface of the aluminum foil is low.
The invention provides a method for identifying surface defects of an aluminum foil, which comprises the following steps:
acquiring a surface visible light image of an aluminum foil to be detected and a sample surface visible light image of a sample aluminum foil, and preprocessing the surface visible light image and the sample surface visible light image to obtain a target aluminum foil image and a sample aluminum foil image;
performing characteristic contrast analysis on the target aluminum foil image and the sample aluminum foil image to obtain a gray level difference degree and a surface appearance difference degree;
determining the probability of the target defect corresponding to the aluminum foil to be detected according to the gray difference and the surface appearance difference;
and generating target defect information corresponding to the aluminum foil to be detected according to the target defect probability and a preset defect probability threshold.
Further, the preprocessing comprises: graying;
the characteristic contrast analysis is carried out on the target aluminum foil image and the sample aluminum foil image to obtain the gray level difference degree and the surface appearance difference degree, and the method comprises the following steps:
determining an absolute value of a difference value between a target mean value and a sample mean value as a difference coefficient, wherein the target mean value is a mean value of gray values corresponding to pixel points in the target aluminum foil image, and the sample mean value is a mean value of gray values corresponding to the pixel points in the sample aluminum foil image;
combining the gray values corresponding to the pixel points in the target aluminum foil image and the sample aluminum foil image into a target gray value sequence and a sample gray value sequence respectively;
respectively carrying out standardization processing on the target gray value sequence and the sample gray value sequence to obtain a target standard value sequence and a sample standard value sequence;
determining a target distance difference between any one target standard value in the target standard value sequence and any one sample standard value in the sample standard value sequence, and generating a target distance difference matrix;
adjusting, traversing, searching and analyzing the target distance difference matrix to obtain target path information;
determining the gray level difference degree according to the target path information and the difference coefficient;
and analyzing the surface appearance of the target aluminum foil image and the sample aluminum foil image to obtain the surface appearance difference.
Further, the adjusting, traversing, searching and analyzing the target distance difference matrix to obtain target path information includes:
adjusting elements in the target distance difference matrix to obtain a difference adjustment matrix;
determining a lower left corner element in the difference adjustment matrix as a search initial point;
according to the initial searching point and a plurality of preset target directions, performing traversal search on the difference adjustment matrix to obtain a path information set, wherein path information in the path information set comprises: a plurality of difference adjustment values and difference adjustment numbers, the difference adjustment values being elements on a path formed by traversal search in the difference adjustment matrix, the difference adjustment numbers being the numbers of the difference adjustment values included in the path information;
for each path information in the path information set, determining the sum of a plurality of difference adjustment values included in the path information as a target path distance corresponding to the path information;
for each path information in the path information set, root coding is carried out on a target path distance corresponding to the path information, and an obtained root value is determined as a target root value corresponding to the path information;
for each path information in the path information set, determining a ratio of a target root number value corresponding to the path information to a difference adjustment quantity included in the path information as a target ratio corresponding to the path information;
and screening out path information corresponding to the minimum target ratio from the path information set as target path information.
Further, the determining the gray scale difference degree according to the target path information and the difference coefficient includes:
and determining the product of the target ratio corresponding to the target path information and the difference coefficient as the gray difference.
Further, the analyzing the surface appearance of the target aluminum foil image and the sample aluminum foil image to obtain the degree of difference of the surface appearance includes:
for each target aluminum foil pixel point in the target aluminum foil image, determining the sum of gray values corresponding to pixel points in a preset neighborhood corresponding to the target aluminum foil pixel point as a target neighborhood gray value corresponding to the target aluminum foil pixel point;
determining a horizontal gray average value corresponding to each target aluminum foil pixel point according to a target neighborhood gray value, a gray value and an abscissa value corresponding to each target aluminum foil pixel point in the target aluminum foil image and a gray value and an abscissa value corresponding to each pixel point in a preset neighborhood corresponding to the target aluminum foil pixel point to obtain a horizontal gray average value sequence;
determining a vertical gray mean value corresponding to each target aluminum foil pixel point according to the target neighborhood gray value, the gray value and the longitudinal coordinate value corresponding to each target aluminum foil pixel point in the target aluminum foil image and the gray value and the longitudinal coordinate value corresponding to each pixel point in the preset neighborhood corresponding to the target aluminum foil pixel point to obtain a vertical gray mean value sequence;
determining a target covariance matrix corresponding to the target aluminum foil image according to the horizontal gray mean sequence and the vertical gray mean sequence;
determining a sample covariance matrix corresponding to the sample aluminum foil image;
performing characteristic decomposition on the target covariance matrix and the sample covariance matrix respectively to obtain two target characteristic values and two sample characteristic values;
and determining the degree of difference of the surface appearance according to the two target characteristic values and the two sample characteristic values.
Further, the determining the sum of the gray values corresponding to the pixel points in the preset neighborhood corresponding to the target aluminum foil pixel point as the target neighborhood gray value corresponding to the target aluminum foil pixel point includes:
determining an integral image corresponding to the target aluminum foil image;
according to the integral image corresponding to the target aluminum foil image, determining integral values corresponding to four corner points in a preset neighborhood corresponding to the target aluminum foil pixel point;
and determining a target neighborhood gray value corresponding to the target aluminum foil pixel point according to the integral values corresponding to the four corner points in the preset neighborhood corresponding to the target aluminum foil pixel point.
Further, the determining the degree of difference in the surface appearance according to the two target feature values and the two sample feature values includes:
determining a first target characteristic value of the two target characteristic values as an abscissa of a first coordinate;
determining a second target characteristic value of the two target characteristic values as a vertical coordinate of the first coordinate;
determining a first sample characteristic value of the two sample characteristic values as an abscissa of a second coordinate;
determining a second sample characteristic value of the two sample characteristic values as a vertical coordinate of a second coordinate;
and determining one half of the Euclidean distance between the first coordinate and the second coordinate as the surface appearance difference degree.
Further, the determining the probability of the target defect corresponding to the aluminum foil to be detected according to the gray level difference and the surface appearance difference includes:
determining the sum of the gray difference and the surface appearance difference as the integral difference corresponding to the aluminum foil to be detected;
determining the sum of the overall difference degree and 1 as a reference difference degree;
and determining the ratio of the overall difference degree to the reference difference degree as the target defect probability.
Further, the generating target defect information corresponding to the aluminum foil to be detected according to the target defect probability and a preset defect probability threshold includes:
when the target defect probability is larger than the defect probability threshold, generating target defect information representing that the aluminum foil to be detected has defects;
and when the target defect probability is smaller than or equal to the defect probability threshold, the generated target defect information represents that the aluminum foil to be detected is normal and has no defects.
The invention has the following beneficial effects:
according to the method for identifying the defects on the surface of the aluminum foil, disclosed by the invention, the material analysis and test are carried out by utilizing a visible light means, the technical problem that the accuracy of identifying the defects on the surface of the aluminum foil is low is solved, and the accuracy of identifying the defects on the surface of the aluminum foil is improved. Firstly, acquiring a surface visible light image of an aluminum foil to be detected and a sample surface visible light image of a sample aluminum foil, and preprocessing the surface visible light image and the sample surface visible light image to obtain a target aluminum foil image and a sample aluminum foil image. In practical situations, there is a defect recognition method for the surface of the aluminum foil in a manual mode. When the defect identification is performed on the surface of the aluminum foil in an artificial mode, the defect identification is performed by subjective feeling of an inspector, and the identification judgment is inaccurate, so that the accuracy of defect identification performed on the surface of the aluminum foil is low when the defect identification is performed on the surface of the aluminum foil in an artificial mode. Therefore, by acquiring the surface visible light image containing the surface condition of the aluminum foil to be detected and the sample surface visible light image containing the surface condition of the sample aluminum foil, the difference between the surface of the aluminum foil to be detected and the surface of the sample aluminum foil can be conveniently compared in the follow-up process, the defect condition of the surface of the aluminum foil to be detected can be conveniently determined, and the accuracy of defect identification on the surface of the aluminum foil can be improved. Secondly, the surface visible light image and the sample surface visible light image are preprocessed, so that irrelevant information in the surface visible light image and the sample surface visible light image can be eliminated, useful real information can be recovered, the detectability of relevant information can be enhanced, data can be simplified to the maximum extent, and the defect identification of the surface of the aluminum foil can be conveniently carried out through analyzing the difference between the target aluminum foil image and the sample aluminum foil image. And then, performing characteristic comparison analysis on the target aluminum foil image and the sample aluminum foil image to obtain a gray level difference degree and a surface appearance difference degree. The method has the advantages that the gray scale difference degree and the surface appearance difference degree between the target aluminum foil image and the sample aluminum foil image can be determined with high accuracy by performing characteristic contrast analysis on the target aluminum foil image and the sample aluminum foil image from the aspects of gray scale and surface appearance. And then, determining the probability of the target defect corresponding to the aluminum foil to be detected according to the gray difference degree and the surface appearance difference degree. The gray level difference degree and the surface appearance difference degree between the target aluminum foil image and the sample aluminum foil image are comprehensively considered, and the accuracy of the determined target defect probability can be improved. And finally, generating target defect information corresponding to the aluminum foil to be detected according to the target defect probability and a preset defect probability threshold. Therefore, the invention utilizes the visible light means to analyze and test the material, solves the technical problem of low accuracy of identifying the defects on the surface of the aluminum foil, and improves the accuracy of identifying the defects on the surface of the aluminum foil.
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 surface defects of aluminum foil according to the present invention;
fig. 2 is a schematic diagram of a path formed by traversal search according to the present invention.
Detailed Description
To further explain the technical means and effects of the present invention adopted to achieve the predetermined objects, the following detailed description of the embodiments, structures, features and effects of the technical solutions according to the present invention will be given with reference to the accompanying drawings and preferred embodiments. In the following description, 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 invention provides a method for identifying surface defects of an aluminum foil, which comprises the following steps:
acquiring a surface visible light image of an aluminum foil to be detected and a sample surface visible light image of a sample aluminum foil, and preprocessing the surface visible light image and the sample surface visible light image to obtain a target aluminum foil image and a sample aluminum foil image;
performing characteristic contrast analysis on the target aluminum foil image and the sample aluminum foil image to obtain a gray level difference degree and a surface appearance difference degree;
determining the probability of the target defect corresponding to the aluminum foil to be detected according to the gray difference and the surface appearance difference;
and generating target defect information corresponding to the aluminum foil to be detected according to the target defect probability and a preset defect probability threshold.
The following steps are detailed:
referring to fig. 1, a flow of some embodiments of a method of identifying surface defects of an aluminum foil according to the present invention is shown. The method for identifying the surface defects of the aluminum foil comprises the following steps:
s1, acquiring a surface visible light image of the aluminum foil to be detected and a sample surface visible light image of the sample aluminum foil, and preprocessing the surface visible light image and the sample surface visible light image to obtain a target aluminum foil image and a sample aluminum foil image.
In some embodiments, a surface visible light image of the aluminum foil to be detected and a sample surface visible light image of the sample aluminum foil may be obtained, and the surface visible light image and the sample surface visible light image are preprocessed to obtain a target aluminum foil image and a sample aluminum foil image.
Wherein the aluminum foil to be detected may be an aluminum foil for which defect conditions are to be detected. The surface visible light image may be an image of the surface of the aluminum foil to be detected. The sample aluminum foil may be an aluminum foil which is not defective and has the same specification type as that of the aluminum foil to be detected. Defects may include, but are not limited to: scratches, corrosion, and spotting. The visible light image of the sample surface may be an image of the aluminum foil surface of the sample. Pre-processing may include, but is not limited to: image enhancement, denoising processing and graying. The target aluminum foil image may be a visible light image of the surface after the pretreatment. The sample aluminum foil image may be a visible light image of the surface of the sample after pretreatment.
As an example, this step may include the steps of:
the method comprises the following steps of firstly, acquiring a surface visible light image of an aluminum foil to be detected and a sample surface visible light image of a sample aluminum foil.
For example, the surface visible light image of the aluminum foil to be detected and the sample surface visible light image of the sample aluminum foil may be acquired by a CMOS (Complementary Metal Oxide Semiconductor) camera. When the surface visible light image and the sample surface visible light image are obtained, the shooting angle of the CMOS camera, the placing direction of the aluminum foil to be detected and the sample aluminum foil, the light source intensity and the like can be adjusted to be the same. An LED dome light source may be used to obtain both the visible light image of the surface and the visible light image of the sample surface.
In practical situations, since the aluminum foil is often a metal sheet, and has good reflectivity and no transmissivity for light, the light emitted from the light source is often reflected away from the aluminum foil in a mirror-surface emission manner when the light irradiates the surface of the aluminum foil. In order to obtain the defect characteristics which reflect the surface of the aluminum foil material more clearly, the light source and the camera for collecting the defect characteristics are required to be set. In consideration of the reflective property of the aluminum foil to the illumination, an LED (Light Emitting Diode) dome Light source can be used to reduce the influence of the strong reflection of the illumination on the quality of the acquired image. Compared with a Charge Coupled Device (CCD) camera, the CMOS camera has the characteristics of low energy consumption, low cost and high imaging speed, and simultaneously, with the rapid development of electronic components, an image acquired by the CMOS camera is closer to the CCD camera. Therefore, the CMOS camera is adopted to shoot the aluminum foil to be detected and the sample aluminum foil under the LED dome light source, so that the energy consumption and the cost can be reduced under the condition of ensuring the shooting precision, and the efficiency of acquiring the surface visible light image and the sample surface visible light image is improved.
And secondly, preprocessing the surface visible light image and the sample surface visible light image to obtain a target aluminum foil image and a sample aluminum foil image.
For example, graying and denoising processing can be performed on the surface visible light image and the sample surface visible light image to obtain a target aluminum foil image and a sample aluminum foil image. Wherein the denoising process may be median filtering.
In practical situations, in the process of collecting the surface visible light image and the sample surface visible light image, noise pollution is often generated due to the influence of the collection environment and the quality of components of the camera. In order to reduce the calculation cost and improve the identification precision of the surface defects of the aluminum foil to be detected, the collected surface visible light image and the sample surface visible light image can be subjected to denoising treatment. In order to retain the characteristic information of the aluminum foil defect as much as possible in the denoising process, a median filtering algorithm can be selected to perform filtering denoising processing on the collected surface visible light image and the sample surface visible light image, and two images obtained after denoising processing are grayed to obtain a target aluminum foil image and a sample aluminum foil image.
And S2, performing characteristic comparison analysis on the target aluminum foil image and the sample aluminum foil image to obtain a gray level difference degree and a surface appearance difference degree.
In some embodiments, the target aluminum foil image and the sample aluminum foil image may be subjected to feature contrast analysis to obtain a gray level difference degree and a surface appearance difference degree.
Wherein, the pretreatment may include: and (5) graying. The gray difference degree can represent the gray difference degree between the target aluminum foil image and the sample aluminum foil image. The degree of surface appearance difference may characterize the degree of appearance characteristic difference between the target aluminum foil image and the sample aluminum foil image.
As an example, this step may include the steps of:
in the first step, the absolute value of the difference between the target mean and the sample mean is determined as a difference coefficient.
The target mean value may be a mean value of gray values corresponding to pixel points in the target aluminum foil image. The sample mean may be the mean of the gray values corresponding to the pixel points in the sample aluminum foil image.
In practical situations, because the surface color of the aluminum foil without defects is often silvery white, when the surface of the aluminum foil to be detected is complete and has no wear, the distribution of the gray values corresponding to the pixel points in the target aluminum foil image is often consistent, and the target mean value is often approximately equal to the sample mean value. When the surface of the aluminum foil to be detected has defects, the gray values corresponding to part of the pixel points are often low or high in the distribution of the gray values corresponding to the pixel points in the target aluminum foil image, and the target mean value is often different from the sample mean value. Therefore, the larger the difference coefficient, the more likely the surface of the aluminum foil to be inspected is to be defective.
And secondly, combining the gray values corresponding to the pixel points in the target aluminum foil image and the sample aluminum foil image into a target gray value sequence and a sample gray value sequence respectively.
For example, this step may include the following sub-steps:
the first substep is to combine the gray values corresponding to the pixel points in the target aluminum foil image into a target gray value sequence.
For example, first, a pixel point at the upper left corner in the target aluminum foil image may be determined as a first pixel point included in the first row and the first column of the target aluminum foil image. Next, the gray value corresponding to the first pixel point included in the first row of the target aluminum foil image may be determined as the first target gray value in the target gray value sequence. The gray value corresponding to the second pixel point included in the first row of the target aluminum foil image can be determined as the second target gray value in the target gray value sequence, and so on until the gray value corresponding to each pixel point included in the first row of the target aluminum foil image is put into the target gray value sequence. Then, according to the sequence, the gray value corresponding to the first pixel point included in the second row of the target aluminum foil image may be placed behind the gray value corresponding to the last pixel point included in the first row of the target aluminum foil image, and the gray value corresponding to each pixel point included in the second row of the target aluminum foil image may be placed in the target gray value sequence with reference to the sequence in which the gray value corresponding to each pixel point included in the first row of the target aluminum foil image is placed in the target gray value sequence. And finally, referring to the sequence that the gray values corresponding to the pixel points included in the second row of the target aluminum foil image are put into the target gray value sequence, and putting the gray values corresponding to the pixel points included in the rows except the first row and the second row in the target aluminum foil image into the target gray value sequence.
And a second substep, combining the gray values corresponding to each pixel point in the sample aluminum foil image into a sample gray value sequence.
The specific implementation manner of this sub-step may refer to the first sub-step included in the second step included in step S2, and the sample aluminum foil image may be used as the target aluminum foil image, and the first sub-step included in the second step included in step S2 is executed, and the obtained target gray value sequence is the sample gray value sequence.
And combining the target gray value sequence and the sample gray value sequence respectively according to the gray values corresponding to the pixel points in the target aluminum foil image and the sample aluminum foil image, so that the defect condition of the surface of the aluminum foil to be detected can be conveniently preliminarily judged by comparing the difference between the target gray value sequence and the sample gray value sequence in the follow-up process. The identification precision is effectively improved, and meanwhile, the tedious process that related technicians need to set different defect feature identification methods for different defects is avoided.
And thirdly, respectively carrying out standardization processing on the target gray value sequence and the sample gray value sequence to obtain a target standard value sequence and a sample standard value sequence.
The target standard value sequence may be a target gray value sequence subjected to normalization processing. The sample standard value sequence may be a sample gray value sequence subjected to normalization processing.
For example, the target gray scale value sequence and the sample gray scale value sequence may be subjected to Z-Normalization processing to obtain a target standard value sequence and a sample standard value sequence.
And the Z-Normalization standardization treatment is carried out on the target gray value sequence and the sample gray value sequence, so that the obtained target standard value sequence and the sample standard value sequence are more stable, and the noise interference is reduced. Therefore, the accuracy of the target distance difference matrix determined by analyzing the target standard value sequence and the sample standard value sequence is improved.
And fourthly, determining the target distance difference between any one target standard value in the target standard value sequence and any one sample standard value in the sample standard value sequence, and generating a target distance difference matrix.
For example, this step may include the following sub-steps:
in the first sub-step, the formula for determining the target distance difference between any one target standard value in the target standard value sequence and any one sample standard value in the sample standard value sequence may be:
wherein,is the first in the target standard value sequenceiThe first of the target standard values and the sample standard value sequencejThe difference in target distance between the standard values of the samples.iIs the number of the target standard value in the sequence of target standard values.jIs the serial number of the sample standard value in the sample standard value sequence. />Is the first in the target standard value sequenceiAnd (4) a target standard value. />Is the first in the standard value sequence of the samplejAnd (4) standard value of each sample.
In the actual situation,can characterize theiA target standard value andjrelative deviation between standard values of individual samples. />Can characterize theiA target standard value andjthe difference between the positions of the standard values of the individual samples in the respective sequences. />Can characterize theiA target standard value andjthe difference between the standard values of the individual samples. When/is>The larger and the greater>The greater or->The larger, theiA target standard value andjtarget distance differences between sample criterion values>Often the larger, i.e. the firstiA target standard value andjthe greater the degree of difference between the standard values of the individual samples tends to be.
And a second substep of generating a target distance difference matrix based on a target distance difference between a target standard value in the target standard value sequence and a sample standard value in the sample standard value sequence.
For example, the second in the series of standard values can be targetediThe first of the target standard values and the sample standard value sequencejThe difference of the target distance between the standard values of the samples is determined as the first difference in the target distance difference matrixiLine and firstjThe elements of the column. Wherein,iit may also be the row number of the object distance difference matrix.jBut also the column number of the target distance difference matrix.
And fifthly, adjusting, traversing, searching and analyzing the target distance difference matrix to obtain target path information.
For example, this step may include the following substeps:
the first substep is to adjust the elements in the target distance difference matrix to obtain a difference adjustment matrix.
Wherein the element at the lower left corner in the difference adjustment matrix may be an element at the upper left corner in the target distance difference matrix.
For example, the last row of the target distance difference matrix may be determined as the first row of the difference adjustment matrix. The second last row of the target distance difference matrix may be determined as the second row of the difference adjustment matrix. And repeating the steps until the elements in the target distance difference matrix are adjusted, and obtaining the difference adjustment matrix.
And a second substep of determining the lower left corner element in the difference adjustment matrix as the initial point of the search.
And a third substep of performing traversal search on the difference adjustment matrix according to the search initial point and a plurality of preset target directions to obtain a path information set.
The path information in the path information set may include: a plurality of disparity adjustment values and a disparity adjustment quantity. The disparity adjustment value may be an element on a path formed by a traversal search in the disparity adjustment matrix described above. The disparity adjustment amount may be the number of disparity adjustment values included in the path information. The plurality of target directions may include: horizontal, vertical and 45 deg. direction.
For example, as shown in FIG. 2, a square grid may characterize an element in the disparity adjustment matrix. The squares with the solid dots may characterize the elements on the path formed by the traversal search. The direction pointed by the 3 arrows may be the 3 target directions for the traversal search. The path formed by each square with a solid dot in fig. 2 may be a path corresponding to one path information in the path information set. That is, when traversing and searching the difference adjustment matrix, first, a search initial point may be used as a first difference adjustment value, and a neighboring element in a target direction may be randomly selected from neighboring elements in 3 target directions of the search initial point to be used as a second difference adjustment value. The neighboring elements may be neighboring elements. Next, a neighboring element in one target direction is randomly selected from among the neighboring elements in the 3 target directions of the second difference adjustment value as a third difference adjustment value. And analogizing until no adjacent element exists at the 3 target directions, determining a plurality of difference adjustment values obtained by traversal and the number of the difference adjustment values as one path information in the path information set.
A fourth substep of determining, for each piece of path information in the set of path information, a sum of a plurality of difference adjustment values included in the piece of path information as a target path distance corresponding to the piece of path information.
A fifth substep, for each path information in the path information set, performing root coding on the target path distance corresponding to the path information, and determining the obtained root value as the target root value corresponding to the path information.
A sixth substep, determining, for each piece of path information in the set of path information, a ratio of a target root number value corresponding to the piece of path information to a difference adjustment number included in the piece of path information, as a target ratio corresponding to the piece of path information.
And a seventh substep of screening out path information corresponding to the minimum target ratio from the path information set as target path information.
And sixthly, determining the gray level difference degree according to the target path information and the difference coefficient.
For example, the gray scale difference may be determined as a product of a target ratio corresponding to the target path information and the difference coefficient.
In practical cases, when the degree of difference in gradation is larger, it is often considered that the degree of difference between the target standard value sequence and the sample standard value sequence is larger, and the surface of the aluminum foil to be detected is often more likely to have defects. When the degree of difference in gradation is smaller, it is often considered that the degree of difference between the target standard value sequence and the sample standard value sequence is smaller, and the surface of the aluminum foil to be detected is often more likely to be a normal aluminum foil surface.
And seventhly, analyzing the surface appearance of the target aluminum foil image and the sample aluminum foil image to obtain the surface appearance difference.
For example, this step may include the following sub-steps:
in the first substep, for each target aluminum foil pixel point in the target aluminum foil image, the sum of the gray values corresponding to the pixel points in the preset neighborhood corresponding to the target aluminum foil pixel point is determined as the target neighborhood gray value corresponding to the target aluminum foil pixel point.
The target aluminum foil pixel points can be pixel points in the target aluminum foil image. The preset neighborhood may be a preset neighborhood. For example, the preset neighborhood may be a 3 x 3 neighborhood.
For example, the sub-steps may include the steps of:
firstly, an integral image corresponding to the target aluminum foil image is determined.
The value of any point in the integral image can be the sum of the gray values corresponding to all pixel points in a rectangular area formed by the point from the upper left corner of the target aluminum foil image.
And then, according to the integral image corresponding to the target aluminum foil image, determining integral values corresponding to four corner points in a preset neighborhood corresponding to the target aluminum foil pixel point.
Wherein the integral value corresponding to a corner point may be a value of the corner point on the integral image.
And finally, determining a target neighborhood gray value corresponding to the target aluminum foil pixel point according to the integral values corresponding to the four corner points in the preset neighborhood corresponding to the target aluminum foil pixel point.
For example, according to the integral values corresponding to the four corner points in the preset neighborhood corresponding to the target aluminum foil pixel point, the formula for determining the target neighborhood gray-scale value corresponding to the target aluminum foil pixel point may be:
wherein,Fis the target neighborhood gray value corresponding to the target aluminum foil pixel point.The integral value corresponding to the upper left corner of the preset neighborhood corresponding to the target aluminum foil pixel point. />And the integral value corresponding to the upper right corner of the preset neighborhood corresponding to the target aluminum foil pixel point. />And the integral value corresponding to the lower right corner of the preset neighborhood corresponding to the target aluminum foil pixel point. />The integral value corresponding to the lower left corner of the preset neighborhood corresponding to the target aluminum foil pixel point.
In actual conditions, determining target neighborhood gray corresponding to target aluminum foil pixel pointAnd when the gray values are calculated, the sum of the gray values corresponding to the pixel points in the preset neighborhood corresponding to the target aluminum foil pixel point is used. And determining an integral image corresponding to the target aluminum foil image, which is equivalent to establishing a table of the sum of gray values corresponding to pixel points in the target aluminum foil image. The integral image stores the sum of the gray values corresponding to the pixel points in the target aluminum foil image, so that the target neighborhood gray value corresponding to the target aluminum foil pixel point can be determined through the integral values corresponding to the four corner points in the preset neighborhood corresponding to the target aluminum foil pixel pointFI.e. byThe sum of the gray values corresponding to the pixel points in the preset neighborhood corresponding to the target aluminum foil pixel point (target neighborhood gray value) can be represented, so that the accuracy and the efficiency of determining the target neighborhood gray value are improved. Because appearance characterization characteristics of some defects on the surface of the aluminum foil to be detected may not be obvious, a preset neighborhood corresponding to a target aluminum foil pixel point can be selected to analyze the target aluminum foil pixel point.
For another example, the gray values corresponding to each pixel point in the preset neighborhood corresponding to the target aluminum foil pixel point may be accumulated, and the obtained sum is determined as the target neighborhood gray value corresponding to the target aluminum foil pixel point.
And a second substep of determining a horizontal gray average value corresponding to each target aluminum foil pixel point according to the target neighborhood gray value, the gray value and the abscissa value corresponding to each target aluminum foil pixel point in the target aluminum foil image, and the gray value and the abscissa value corresponding to each pixel point in a preset neighborhood corresponding to the target aluminum foil pixel point, so as to obtain a horizontal gray average value sequence.
For example, the formula for determining the horizontal gray level mean value corresponding to the target aluminum foil pixel point may be:
wherein,is the average value of the horizontal gray levels corresponding to the pixel points of the target aluminum foil.xIs the abscissa of the pixel point of the target aluminum foil.yIs the vertical coordinate of the target aluminum foil pixel point. />Is that the abscissa is->On the ordinate of->Corresponding gray value of (4), based on the gray value of the pixel point, and>is the abscissa of the pixel point, and is based on the absolute value of the pixel point>Is the ordinate of the pixel. Such as whenQIs not = -1 andqwhen = -1, the abscissa is ^ 4>On the ordinate of->The pixel point of (2) can be a pixel point of the upper left corner in the preset neighborhood corresponding to the target aluminum foil pixel point.FAnd the gray value of the target neighborhood corresponding to the pixel point of the target aluminum foil.
Due to the fact thatQThe value range of (a) is { -1,0,1},qhas a value range of { -1,0,1}, so thatAnd &>The abscissa and ordinate of each pixel point in the preset neighborhood corresponding to the target aluminum foil pixel point can be covered.Therefore, the horizontal abscissa of the target aluminum foil pixel point and the neighborhood pixel point in the horizontal direction is considered>The gray value corresponding to the target aluminum foil pixel point and the neighborhood pixel point->Target neighborhood gray value corresponding to target aluminum foil pixel pointFThe accuracy of determining the horizontal gray level mean value corresponding to the target aluminum foil pixel point can be improved. The neighborhood pixels can be pixels in a preset neighborhood corresponding to the target aluminum foil pixel.
And a third substep of determining a vertical gray average value corresponding to each target aluminum foil pixel point according to the target neighborhood gray value, the gray value and the longitudinal coordinate value corresponding to each target aluminum foil pixel point in the target aluminum foil image and the gray value and the longitudinal coordinate value corresponding to each pixel point in a preset neighborhood corresponding to the target aluminum foil pixel point, so as to obtain a vertical gray average value sequence.
For example, the formula for determining the vertical gray level mean value corresponding to the target aluminum foil pixel point may be:
wherein,is the vertical gray average value corresponding to the target aluminum foil pixel point.xIs the abscissa of the pixel point of the target aluminum foil.yIs the vertical coordinate of the target aluminum foil pixel point. />Is that the abscissa is->On the ordinate of->Corresponding gray value of the pixel point of (4), (v), or (v)>Is the abscissa of the pixel point, and is based on the absolute value of the pixel point>Is the ordinate of the pixel. Such as whenQ=1 andqif =1, the abscissa is =>On the ordinate of->The pixel point of (2) can be a pixel point at the lower right corner in the preset neighborhood corresponding to the target aluminum foil pixel point.FAnd the gray value of the target neighborhood corresponding to the pixel point of the target aluminum foil.
Due to the fact thatQThe value range of (a) is { -1,0,1},qthe value range of (a) is { -1,0,1}, soAnd &>The abscissa and ordinate of each pixel point in the preset neighborhood corresponding to the target aluminum foil pixel point can be covered. Therefore, the vertical coordinate of the target aluminum foil pixel point and the neighborhood pixel point in the vertical direction is considered>The gray value corresponding to the target aluminum foil pixel point and the neighborhood pixel point->Target neighborhood gray value corresponding to target aluminum foil pixel pointFThe accuracy of determining the vertical gray level mean value corresponding to the target aluminum foil pixel point can be improved.
And a fourth substep of determining a target covariance matrix corresponding to the target aluminum foil image according to the horizontal gray mean sequence and the vertical gray mean sequence.
For example, the target covariance matrix corresponding to the target aluminum foil image may be:
wherein,Mand the target covariance matrix corresponding to the target aluminum foil image.Is the covariance between the horizontal gray mean sequence and the horizontal gray mean sequence. />Is the covariance between the horizontal gray mean sequence and the vertical gray mean sequence. />Is the covariance between the vertical and horizontal gray mean sequences. />Is the covariance between the vertical gray mean sequence and the vertical gray mean sequence. Since the horizontal direction and the vertical direction are orthogonal to each other, the。
Since the target covariance matrix includes the covariance between the horizontal gray mean sequence and the horizontal gray mean sequenceCovariance between horizontal and vertical gray mean sequences>Covariance between vertical and horizontal mean>And covariance between the vertical gray mean sequence and the vertical gray mean sequence>. Therefore, the target covariance matrix can characterize the distribution of pixel points in the target aluminum foil image.
And a fifth substep of determining a sample covariance matrix corresponding to the sample aluminum foil image.
The specific implementation manner of this sub-step may refer to the first to fourth sub-steps included in the seventh step included in step S2, and the first to fourth sub-steps included in the seventh step included in step S2 may be executed with the sample aluminum foil image as a target aluminum foil image, and the obtained target covariance matrix is the sample covariance matrix.
And a sixth substep of performing feature decomposition on the target covariance matrix and the sample covariance matrix respectively to obtain two target eigenvalues and two sample eigenvalues.
The two target eigenvalues may be two eigenvalues obtained by performing eigen decomposition on the target covariance matrix. The two sample eigenvalues may be two eigenvalues obtained by performing eigen decomposition on the sample covariance matrix.
For example, the target covariance matrix and the sample covariance matrix may be subjected to eigen Decomposition by SVD (Singular Value Decomposition), so as to obtain two target eigenvalues and two sample eigenvalues.
In practical cases, the target covariance matrix and the sample covariance matrix are both real symmetric matrices, and the target covariance matrix and the sample covariance matrix are both 2 × 2 matrices. Therefore, through SVD, the feature decomposition is carried out on the target covariance matrix and the sample covariance matrix, and two eigenvalues can be obtained. Since the target covariance matrix can represent the distribution characteristics of the pixel points in the target aluminum foil image, the sample covariance matrix can represent the distribution characteristics of the pixel points in the sample aluminum foil image. The two target feature values and the two sample feature values obtained by the feature decomposition reflect the surface appearance features of the target aluminum foil image and the sample aluminum foil image to a certain extent.
And a seventh substep of determining the degree of difference in the surface appearance based on the two target feature values and the two sample feature values.
For example, the sub-steps may include the steps of:
first, a first target feature value of the two target feature values is determined as an abscissa of a first coordinate.
Next, the second of the two target feature values is determined as the ordinate of the first coordinate.
Then, the first sample feature value of the two sample feature values is determined as the abscissa of the second coordinate.
And then, determining the second sample characteristic value of the two sample characteristic values as the ordinate of the second coordinate.
And finally, determining one half of the Euclidean distance between the first coordinate and the second coordinate as the surface appearance difference degree.
In practical cases, when the degree of difference in surface appearance is larger, the difference between the target aluminum foil image and the sample aluminum foil image tends to be larger, and the possibility that the surface of the aluminum foil to be detected has defects tends to be larger.
And S3, determining the probability of the target defect corresponding to the aluminum foil to be detected according to the gray difference and the surface appearance difference.
In some embodiments, the probability of the target defect corresponding to the aluminum foil to be detected may be determined according to the gray level difference and the surface appearance difference.
Wherein, the target defect probability can be the probability of the defect existing on the surface of the aluminum foil to be detected.
As an example, this step may include the steps of:
and step one, determining the sum of the gray difference degree and the surface appearance difference degree as the integral difference degree corresponding to the aluminum foil to be detected.
And secondly, determining the sum of the overall difference degree and 1 as a reference difference degree.
And thirdly, determining the ratio of the overall difference degree to the reference difference degree as the target defect probability.
In practical situations, the larger the probability of the target defect, i.e. the closer the probability of the target defect is to 1, the more defects are often present on the surface of the aluminum foil to be detected. The smaller the probability of the target defect, i.e. the closer the probability of the target defect is to 0, the smoother the surface of the aluminum foil to be detected tends to be, and the more the surface of the aluminum foil to be detected tends to be free of defects.
And S4, generating target defect information corresponding to the aluminum foil to be detected according to the target defect probability and a preset defect probability threshold.
In some embodiments, the target defect information corresponding to the aluminum foil to be detected may be generated according to the target defect probability and a preset defect probability threshold.
The target defect information can represent the defect condition of the surface of the aluminum foil to be detected. The defect probability threshold may be a preset maximum target defect probability allowed when the aluminum foil to be detected is normal. For example, the defect probability threshold may be 0.6.
As an example, this step may include the steps of:
step one, when the target defect probability is larger than the defect probability threshold, generating target defect information representing that the aluminum foil to be detected has defects.
And secondly, when the target defect probability is smaller than or equal to the defect probability threshold, the generated target defect information represents that the aluminum foil to be detected is normal and has no defects.
According to the method for identifying the defects on the surface of the aluminum foil, disclosed by the invention, the material analysis and test are carried out by utilizing a visible light means, the technical problem that the accuracy of identifying the defects on the surface of the aluminum foil is low is solved, and the accuracy of identifying the defects on the surface of the aluminum foil is improved. Firstly, acquiring a surface visible light image of an aluminum foil to be detected and a sample surface visible light image of a sample aluminum foil, and preprocessing the surface visible light image and the sample surface visible light image to obtain a target aluminum foil image and a sample aluminum foil image. In practical situations, there is a defect recognition method for the surface of the aluminum foil in a manual mode. When the defect identification is performed on the surface of the aluminum foil in an artificial mode, the defect identification is performed by subjective feeling of an inspector, and the identification judgment is inaccurate, so that the accuracy of defect identification performed on the surface of the aluminum foil is low when the defect identification is performed on the surface of the aluminum foil in an artificial mode. Therefore, by acquiring the surface visible light image containing the surface condition of the aluminum foil to be detected and the sample surface visible light image containing the surface condition of the sample aluminum foil, the difference between the surface of the aluminum foil to be detected and the surface of the sample aluminum foil can be conveniently compared subsequently, the defect condition of the surface of the aluminum foil to be detected can be conveniently determined, and the accuracy of defect identification of the surface of the aluminum foil can be improved. Secondly, the surface visible light image and the sample surface visible light image are preprocessed, so that irrelevant information in the surface visible light image and the sample surface visible light image can be eliminated, useful real information can be recovered, the detectability of relevant information can be enhanced, data can be simplified to the maximum extent, and the defect identification of the surface of the aluminum foil can be conveniently carried out through analyzing the difference between the target aluminum foil image and the sample aluminum foil image. And then, performing characteristic comparison analysis on the target aluminum foil image and the sample aluminum foil image to obtain a gray level difference degree and a surface appearance difference degree. The characteristic contrast analysis is carried out on the target aluminum foil image and the sample aluminum foil image from the aspects of gray scale and surface appearance, so that the accuracy of determining the gray scale difference degree and the surface appearance difference degree between the target aluminum foil image and the sample aluminum foil image can be improved. And then, determining the probability of the target defect corresponding to the aluminum foil to be detected according to the gray difference and the surface appearance difference. The gray level difference degree and the surface appearance difference degree between the target aluminum foil image and the sample aluminum foil image are comprehensively considered, and the accuracy of the determined target defect probability can be improved. And finally, generating target defect information corresponding to the aluminum foil to be detected according to the target defect probability and a preset defect probability threshold. Therefore, the invention utilizes the visible light means to analyze and test the material, solves the technical problem of low accuracy of identifying the defects on the surface of the aluminum foil, and improves the accuracy of identifying the defects on the surface of the aluminum foil.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting 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; such modifications or substitutions do not cause the essential features of the corresponding technical solutions to depart from the scope of the technical solutions of the embodiments of the present application, and are intended to be included within the scope of the present application.
Claims (8)
1. The method for identifying the surface defects of the aluminum foil is characterized by comprising the following steps of:
the method comprises the steps of obtaining a surface visible light image of an aluminum foil to be detected and a sample surface visible light image of a sample aluminum foil, and preprocessing the surface visible light image and the sample surface visible light image to obtain a target aluminum foil image and a sample aluminum foil image, wherein the preprocessing comprises the following steps: graying;
performing characteristic contrast analysis on the target aluminum foil image and the sample aluminum foil image to obtain a gray level difference degree and a surface appearance difference degree;
determining the probability of the target defect corresponding to the aluminum foil to be detected according to the gray level difference and the surface appearance difference;
generating target defect information corresponding to the aluminum foil to be detected according to the target defect probability and a preset defect probability threshold;
the characteristic contrast analysis is carried out on the target aluminum foil image and the sample aluminum foil image to obtain the gray level difference degree and the surface appearance difference degree, and the method comprises the following steps:
determining an absolute value of a difference value between a target mean value and a sample mean value as a difference coefficient, wherein the target mean value is a mean value of gray values corresponding to pixel points in the target aluminum foil image, and the sample mean value is a mean value of gray values corresponding to the pixel points in the sample aluminum foil image;
combining the gray values corresponding to the pixel points in the target aluminum foil image and the sample aluminum foil image into a target gray value sequence and a sample gray value sequence respectively;
respectively carrying out standardization processing on the target gray value sequence and the sample gray value sequence to obtain a target standard value sequence and a sample standard value sequence;
determining a target distance difference between any one target standard value in the target standard value sequence and any one sample standard value in the sample standard value sequence, and generating a target distance difference matrix;
adjusting, traversing, searching and analyzing the target distance difference matrix to obtain target path information;
determining the gray level difference degree according to the target path information and the difference coefficient;
and analyzing the surface appearance of the target aluminum foil image and the sample aluminum foil image to obtain the surface appearance difference.
2. The method for identifying the defects on the surface of the aluminum foil as claimed in claim 1, wherein the step of performing adjustment, traversal, search and analysis on the target distance difference matrix to obtain target path information comprises:
adjusting elements in the target distance difference matrix to obtain a difference adjustment matrix;
determining a lower left corner element in the difference adjustment matrix as a search initial point;
according to the initial searching point and a plurality of preset target directions, performing traversal search on the difference adjustment matrix to obtain a path information set, wherein path information in the path information set comprises: a plurality of difference adjustment values and difference adjustment numbers, the difference adjustment values being elements on a path formed by traversal search in the difference adjustment matrix, the difference adjustment numbers being the numbers of the difference adjustment values included in the path information;
for each piece of path information in the path information set, determining the sum of a plurality of difference adjustment values included in the path information as a target path distance corresponding to the path information;
for each path information in the path information set, root coding is carried out on a target path distance corresponding to the path information, and an obtained root value is determined as a target root value corresponding to the path information;
for each path information in the path information set, determining a ratio of a target root number value corresponding to the path information to a difference adjustment quantity included in the path information as a target ratio corresponding to the path information;
and screening out the path information corresponding to the minimum target ratio from the path information set as target path information.
3. The method for identifying the defects on the surface of the aluminum foil as claimed in claim 2, wherein the determining the gray scale difference degree according to the target path information and the difference coefficient comprises:
and determining the product of the target ratio corresponding to the target path information and the difference coefficient as the gray level difference.
4. The method for identifying the surface defects of the aluminum foil as claimed in claim 1, wherein the step of analyzing the surface appearances of the target aluminum foil image and the sample aluminum foil image to obtain the degree of difference in the surface appearances comprises the steps of:
for each target aluminum foil pixel point in the target aluminum foil image, determining the sum of gray values corresponding to pixel points in preset neighborhoods corresponding to the target aluminum foil pixel point as a target neighborhood gray value corresponding to the target aluminum foil pixel point;
determining a horizontal gray average value corresponding to each target aluminum foil pixel point according to a target neighborhood gray value, a gray value and an abscissa value corresponding to each target aluminum foil pixel point in the target aluminum foil image and a gray value and an abscissa value corresponding to each pixel point in a preset neighborhood corresponding to the target aluminum foil pixel point to obtain a horizontal gray average value sequence;
determining a vertical gray average value corresponding to each target aluminum foil pixel point according to a target neighborhood gray value, a gray value and a longitudinal coordinate value corresponding to each target aluminum foil pixel point in the target aluminum foil image and a gray value and a longitudinal coordinate value corresponding to each pixel point in a preset neighborhood corresponding to the target aluminum foil pixel point to obtain a vertical gray average value sequence;
determining a target covariance matrix corresponding to the target aluminum foil image according to the horizontal gray mean sequence and the vertical gray mean sequence;
determining a sample covariance matrix corresponding to the sample aluminum foil image;
respectively performing characteristic decomposition on the target covariance matrix and the sample covariance matrix to obtain two target characteristic values and two sample characteristic values;
and determining the degree of difference of the surface appearance according to the two target characteristic values and the two sample characteristic values.
5. The method for identifying the defects on the surface of the aluminum foil as claimed in claim 4, wherein the step of determining the sum of the gray values corresponding to the pixel points in the preset neighborhood corresponding to the pixel points of the target aluminum foil as the target neighborhood gray value corresponding to the pixel points of the target aluminum foil comprises the following steps:
determining an integral image corresponding to the target aluminum foil image;
according to the integral image corresponding to the target aluminum foil image, determining integral values corresponding to four corner points in a preset neighborhood corresponding to the target aluminum foil pixel point;
and determining a target neighborhood gray value corresponding to the target aluminum foil pixel point according to the integral values corresponding to the four corner points in the preset neighborhood corresponding to the target aluminum foil pixel point.
6. The method for identifying the surface defects of the aluminum foil as claimed in claim 4, wherein the determining the degree of surface appearance difference according to the two target characteristic values and the two sample characteristic values comprises:
determining a first target characteristic value of the two target characteristic values as an abscissa of a first coordinate;
determining the second target characteristic value of the two target characteristic values as the ordinate of the first coordinate;
determining a first sample characteristic value of the two sample characteristic values as an abscissa of a second coordinate;
determining a second sample characteristic value of the two sample characteristic values as a vertical coordinate of a second coordinate;
and determining one half of the Euclidean distance between the first coordinate and the second coordinate as the surface appearance difference degree.
7. The method for identifying the surface defects of the aluminum foil according to claim 1, wherein the determining the probability of the target defects corresponding to the aluminum foil to be detected according to the gray level difference and the surface appearance difference comprises:
determining the sum of the gray difference degree and the surface appearance difference degree as the integral difference degree corresponding to the aluminum foil to be detected;
determining the sum of the overall difference degree and 1 as a reference difference degree;
and determining the ratio of the overall difference degree to the reference difference degree as the target defect probability.
8. The method for identifying the surface defects of the aluminum foil as claimed in claim 1, wherein the generating of the target defect information corresponding to the aluminum foil to be detected according to the target defect probability and a preset defect probability threshold comprises:
when the target defect probability is larger than the defect probability threshold, generating target defect information representing that the aluminum foil to be detected has defects;
and when the target defect probability is smaller than or equal to the defect probability threshold, the generated target defect information represents that the aluminum foil to be detected is normal and has no defects.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211238356.XA CN115311272B (en) | 2022-10-11 | 2022-10-11 | Aluminum foil surface defect identification method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211238356.XA CN115311272B (en) | 2022-10-11 | 2022-10-11 | Aluminum foil surface defect identification method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115311272A CN115311272A (en) | 2022-11-08 |
CN115311272B true CN115311272B (en) | 2023-04-07 |
Family
ID=83868490
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211238356.XA Active CN115311272B (en) | 2022-10-11 | 2022-10-11 | Aluminum foil surface defect identification method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115311272B (en) |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105806849A (en) * | 2016-04-08 | 2016-07-27 | 广东工业大学 | Automobile seat surface defect detection system based on machine vision as well as detection method |
CN114862776A (en) * | 2022-04-22 | 2022-08-05 | 深圳职业技术学院 | Product surface defect detection method and device, computer equipment and medium |
CN115100191B (en) * | 2022-08-22 | 2023-08-01 | 佛山市南海祥汛金属制品有限公司 | Metal casting defect identification method based on industrial detection |
-
2022
- 2022-10-11 CN CN202211238356.XA patent/CN115311272B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN115311272A (en) | 2022-11-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114937055B (en) | Image self-adaptive segmentation method and system based on artificial intelligence | |
CN111179251B (en) | Defect detection system and method based on twin neural network and by utilizing template comparison | |
CN110349126B (en) | Convolutional neural network-based marked steel plate surface defect detection method | |
CN113570605B (en) | Defect detection method and system based on liquid crystal display panel | |
Pedreschi et al. | Computer vision classification of potato chips by color | |
CN116030060B (en) | Plastic particle quality detection method | |
CN113554631B (en) | Chip surface defect detection method based on improved network | |
CN112233067A (en) | Hot rolled steel coil end face quality detection method and system | |
CN113177924A (en) | Industrial production line product flaw detection method | |
CN110596117A (en) | Hyperspectral imaging-based rapid nondestructive detection method for apple surface damage | |
CN115526889B (en) | Nondestructive testing method of boiler pressure pipeline based on image processing | |
CN116152242B (en) | Visual detection system of natural leather defect for basketball | |
CN114092682A (en) | Small hardware fitting defect detection algorithm based on machine learning | |
CN118225803B (en) | Visual detection method for appearance of blade surface of bulldozer | |
CN112750113A (en) | Glass bottle defect detection method and device based on deep learning and linear detection | |
CN117934419B (en) | Visual detection method and system for defects of bolt assembly | |
CN114998333A (en) | Computer vision detection method and system for light source characteristics | |
CN116543247A (en) | Data set manufacturing method and verification system based on photometric stereo surface reconstruction | |
CN108109138B (en) | Method for self-adaptive light uniformization of high-light area of mirror-like object | |
CN117078608B (en) | Double-mask guide-based high-reflection leather surface defect detection method | |
CN115311272B (en) | Aluminum foil surface defect identification method | |
CN117392461A (en) | Silkworm cocoon picture classification method and system based on ResNet18 and attention mechanism | |
CN116363136A (en) | On-line screening method and system for automatic production of motor vehicle parts | |
Sun et al. | A novel method for multi-feature grading of mango using machine vision | |
CN112598632B (en) | Appearance detection method and device for contact piece of crimping connector |
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 |