Aluminum foil surface defect detection method, device, equipment and computer storage medium

By using the target color space and high and low pass filtering technology in the detection of aluminum foil surface defects, the region of interest is determined and surface defects are classified, and the problem of poor anti-interference ability in the prior art is solved, and efficient and accurate defect detection and classification are achieved.

CN114119466BActive Publication Date: 2025-02-11WUHAN HEFUXIN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111177666.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-09
Publication Date
2025-02-11
Estimated Expiration
2041-10-09

AI Technical Summary

Technical Problem

The prior art has poor anti-interference ability in the detection of surface defects of aluminum foil, making it difficult to achieve accurate detection, mainly due to problems such as diverse defect types, large size changes, metal color reflection, and external light interference.

Method used

By acquiring the surface image of the aluminum foil to be detected based on the target color space, determining the region of interest, and using high and low pass filtering technology to determine the surface defect image and location. At the same time, the surface defects are classified by training the model to enhance the accuracy of detection.

Benefits of technology

The anti-interference ability and efficiency of aluminum foil surface defect detection is improved, the accuracy of detection is ensured, and the ability to identify and classify surface defects is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114119466B_ABST
    Figure CN114119466B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and computer storage medium for detecting aluminum foil surface defects. The method comprises: obtaining an aluminum foil surface image to be detected based on a target color space; the target color space comprises multiple components, the multiple components at least comprising brightness; determining an area of ​​interest in the aluminum foil surface image to be detected according to the multiple components; determining a surface defect image and the position of the surface defect according to the area of ​​interest; inputting the surface defect image into an aluminum foil surface defect classification model for classification to obtain a classification result of the surface defect, thereby enhancing the anti-interference ability of aluminum foil surface defect detection and ensuring the accuracy of aluminum foil surface defect detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of mechanical vision inspection, and in particular to a method, device and computer storage medium for detecting surface defects of aluminum foil. Background Art

[0002] To detect and identify aluminum foil surface defects, it is necessary to first collect the surface image of the aluminum foil in real time through the detection camera, and then analyze the image through the algorithm. The difficulty lies in the various types of aluminum foil defects, large size variations, metal color reflection, uneven distribution of defect samples, and interference from external lighting on site. Therefore, it is difficult to achieve accurate surface defect detection using traditional image processing and feature engineering methods, which have poor anti-interference capabilities. Summary of the invention

[0003] The embodiment of the present application provides a method, device, equipment and computer storage medium for detecting aluminum foil surface defects, which can enhance the anti-interference ability and efficiency of aluminum foil surface detection. The technical solution is as follows:

[0004] In a first aspect, an embodiment of the present application provides a method for detecting surface defects of an aluminum foil, the method comprising:

[0005] Acquire the surface image of the aluminum foil to be detected based on the target color space; the target color space includes multiple components, and the multiple components include at least brightness;

[0006] Determine a region of interest in the surface image of the aluminum foil to be detected according to the multiple components;

[0007] Determine a surface defect image and a location of the surface defect according to the region of interest;

[0008] The surface defect image is input into an aluminum foil surface defect classification model for classification to obtain a classification result of the surface defect.

[0009] In an embodiment of the present application, by acquiring an image of the surface of the aluminum foil to be detected based on a target color space including multiple components, and then determining a region of interest in the image of the surface of the aluminum foil to be detected according to the multiple components, thereby determining a surface defect image and the location of the surface defect, the anti-interference capability in the process of detecting surface defects of the aluminum foil can be enhanced, thereby ensuring the accuracy of detecting surface defects of the aluminum foil.

[0010] In a possible implementation, after acquiring the surface image of the aluminum foil to be inspected based on the target color space and before determining the surface defect image and the position of the surface defect according to the region of interest, the method further includes:

[0011] Extracting multiple components included in the target color space;

[0012] Determine the boundary between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to each component respectively;

[0013] Determine a target boundary line between the aluminum foil and the background in the aluminum foil surface image to be detected according to the boundary lines between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to each of the multiple components;

[0014] Determining the region of interest in the surface image of the aluminum foil to be detected according to the multiple components includes: determining the region of interest in the surface image of the aluminum foil to be detected according to the target boundary line.

[0015] In an embodiment of the present application, the target boundary line between the aluminum foil and the background in the aluminum foil surface image to be detected is determined according to the boundary lines between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to multiple components included in the target color space, thereby determining the area of ​​interest. This ensures that the boundary line between the aluminum foil and the background in the area of ​​interest in the aluminum foil surface image is definitely the target boundary line, i.e., the optimal boundary line, thereby improving the accuracy of aluminum foil surface defect detection.

[0016] In a possible implementation, the surface image of the aluminum foil to be detected includes M×N pixels, where M and N are both positive integers;

[0017] The step of respectively determining the boundary between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to each component includes:

[0018] Extracting any one component included in the target color space;

[0019] Calculate a horizontal projection curve of the component in the horizontal direction and a vertical projection curve in the vertical direction; the horizontal projection curve is used to represent the sum of all pixel points of the component of the aluminum foil surface image to be detected in the mth row, and the vertical projection curve is used to represent the sum of all pixel points of the component of the aluminum foil surface image to be detected in the nth column; wherein the value of m is all positive integers from 1 to M, and the value of n is all positive integers from 1 to N;

[0020] Determining a split point between the horizontal projection curve and the vertical projection curve;

[0021] The boundary between the aluminum foil and the background in the aluminum foil surface image to be detected is determined according to the segmentation point.

[0022] In an embodiment of the present application, by determining the segmentation point of the horizontal projection curve and the vertical projection curve of any component included in the target color space, and then determining the boundary line between the aluminum foil and the background in the aluminum foil surface image according to the segmentation point, the accuracy of aluminum foil surface defect detection can be improved.

[0023] In a possible implementation, determining a target boundary line between the aluminum foil and the background in the aluminum foil surface image to be detected according to the boundary lines between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to each of the multiple components includes:

[0024] Extracting the component value of the boundary line between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to each component;

[0025] The target dividing line is determined according to the component values ​​and at least one preset constraint condition.

[0026] In an embodiment of the present application, the target boundary line in the boundary line between the aluminum foil and the background in the aluminum foil surface image corresponding to each component is determined by using the component values ​​of the boundary line between the aluminum foil and the background in the aluminum foil surface image to be detected and at least one preset constraint condition, thereby further ensuring the accuracy of aluminum foil surface defect detection.

[0027] In a possible implementation, after determining the region of interest in the surface image of the aluminum foil to be inspected according to the multiple components and before determining the surface defect image and the position of the surface defect according to the region of interest, the method further includes:

[0028] Performing high-pass filtering on the region of interest to obtain a high-pass filtered image, and performing low-pass filtering on the region of interest to obtain a low-pass filtered image;

[0029] Determining a differential image according to the high-pass filtered image and the low-pass filtered image;

[0030] The determining the surface defect image and the position of the surface defect according to the region of interest includes: determining the surface defect image and the position of the surface defect according to the differential image.

[0031] In an embodiment of the present application, by performing high-pass and low-pass filtering on the region of interest, and then determining the surface defect image and the location of the surface defect based on the differential image of the high-pass and low-pass filtering, the influence of noise can be well reduced, and the details of the region of interest can be clearly highlighted, thereby improving the efficiency of aluminum foil surface defect detection.

[0032] In a possible implementation manner, a cutoff frequency of the high-pass filter is lower than a cutoff frequency of the low-pass filter.

[0033] In the embodiment of the present application, by making the cutoff frequency of the high-pass filter lower than the cutoff frequency of the low-pass filter, both high-frequency noise and low-frequency noise can be eliminated, thereby making the detail features of the area of ​​interest more obvious, thereby achieving the effect of improving the efficiency of aluminum foil surface defect detection.

[0034] In a possible implementation, the position of the surface defect includes a starting point, a length, and a width of a rectangle; and the rectangle includes all connected areas of the surface defect.

[0035] In an embodiment of the present application, the position of the surface defect is characterized by the starting point, length and width of a rectangle that includes all connected areas of the surface defect and is inscribed in the boundary of the surface defect. This allows the user to more intuitively and specifically understand the position, size, etc. of the aluminum foil surface defect in the aluminum foil surface image to be detected, thereby improving the user's efficiency in detecting aluminum foil surface defects.

[0036] In a possible implementation, the aluminum foil surface defect classification model is trained by X aluminum foil surface defect images of classification results of known surface defects; the X aluminum foil surface defect images are transformed by Y aluminum foil surface defect images, where X and Y are both positive integers, and X is greater than Y.

[0037] In an embodiment of the present application, an aluminum foil surface defect classification model is obtained by training aluminum foil surface defect images of X known surface defects obtained by transforming Y aluminum foil surface defect images, where X and Y are both positive integers, and X is greater than Y. The aluminum foil surface defects are classified by the aluminum foil surface defect classification model, which increases the training samples while ensuring the accuracy of the aluminum foil surface defect classification model, thereby ensuring the accuracy of the aluminum foil surface defect classification.

[0038] In a second aspect, an embodiment of the present application provides an aluminum foil surface defect detection device, comprising:

[0039] An acquisition module, used for acquiring the surface image of the aluminum foil to be detected based on a target color space; the target color space includes multiple components, and the multiple components include at least brightness;

[0040] A determination module, used for determining a region of interest in the surface image of the aluminum foil to be detected according to the multiple components;

[0041] The determination module is further used to: determine the surface defect image and the position of the surface defect according to the region of interest;

[0042] The classification module is used to input the surface defect image into the aluminum foil surface defect classification model for classification to obtain the classification result of the surface defect.

[0043] In a possible implementation, the aluminum foil surface defect detection device further includes:

[0044] An extraction module, used for extracting a plurality of components included in the target color space;

[0045] The determination module is also used to: respectively determine the boundary line between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to each component;

[0046] The determination module is further used to: determine the target boundary line between the aluminum foil and the background in the aluminum foil surface image to be detected according to the boundary lines between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to each of the multiple components;

[0047] The determination module is also specifically used to determine the region of interest in the surface image of the aluminum foil to be detected according to the target boundary line.

[0048] In a possible implementation, the surface image of the aluminum foil to be detected includes M×N pixels, where M and N are both positive integers;

[0049] The extraction module is further specifically used to: extract any one component included in the target color space;

[0050] The aluminum foil surface defect detection device also includes:

[0051] A calculation module, used for calculating a horizontal projection curve of the component in the horizontal direction and a vertical projection curve in the vertical direction; the horizontal projection curve is used for representing the sum of all pixel points of the component of the surface image of the aluminum foil to be detected in the mth row, and the vertical projection curve is used for representing the sum of all pixel points of the component of the surface image of the aluminum foil to be detected in the nth column; wherein the value of m is all positive integers from 1 to M, and the value of n is all positive integers from 1 to N;

[0052] The determination module is further used to: determine the segmentation point of the horizontal projection curve and the vertical projection curve;

[0053] The determination module is further used to determine a boundary line between the aluminum foil and the background in the aluminum foil surface image to be detected according to the segmentation point.

[0054] The boundary between the aluminum foil and the background in the aluminum foil surface image to be detected is determined according to the extreme value point.

[0055] In a possible implementation, the extraction module is further specifically used to: extract the component value of the boundary line between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to each component;

[0056] The determination module is further used to determine the target dividing line according to the component values ​​and at least one preset constraint condition.

[0057] In a possible implementation, the aluminum foil surface defect detection device further includes:

[0058] A filtering module, used for performing high-pass filtering on the region of interest to obtain a high-pass filtered image, and performing low-pass filtering on the region of interest to obtain a low-pass filtered image;

[0059] The determination module is further used to: determine a differential image according to the high-pass filtered image and the low-pass filtered image;

[0060] The determination module is further specifically used to determine the surface defect image and the position of the surface defect according to the differential image.

[0061] In a possible implementation manner, a cutoff frequency of the high-pass filter is lower than a cutoff frequency of the low-pass filter.

[0062] In a possible implementation, the position of the surface defect includes a starting point, a length, and a width of a rectangle; and the rectangle includes all connected areas of the surface defect.

[0063] In a possible implementation, the aluminum foil surface defect detection device further includes:

[0064] The training module is used to train the aluminum foil surface defect classification model by using X aluminum foil surface defect images of the classification results of known surface defects; the X aluminum foil surface defect images are obtained by transforming Y aluminum foil surface defect images, where X and Y are both positive integers, and X is greater than Y.

[0065] In a third aspect, an embodiment of the present application provides an aluminum foil surface defect detection device, characterized in that it includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the program, the steps of the method described in the above aspects are implemented.

[0066] In a fourth aspect, an embodiment of the present application provides a computer storage medium, which stores multiple instructions, and the instructions are suitable for being loaded by a processor and executing the method steps provided by the first aspect of the embodiment of the present application or any possible implementation of the first aspect.

[0067] It can be understood that the aluminum foil surface defect detection device provided by the second aspect, the aluminum foil surface defect detection equipment provided by the third aspect, and the computer storage medium provided by the fourth aspect are all used to execute the aluminum foil surface defect detection method provided by the first aspect or any one of the implementations of the first aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the aluminum foil surface defect detection method provided by the first aspect or any one of the implementations of the first aspect, and will not be repeated here.

[0068] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0070] Figure 1 A schematic diagram of the structure of a capacitor aluminum foil surface defect detection system provided in an embodiment of the present application;

[0071] Figure 2 A flow chart of a method for detecting surface defects of aluminum foil provided in an embodiment of the present application;

[0072] Figure 3 A schematic diagram of a pixel point structure of a target color space provided in an embodiment of the present application;

[0073] Figure 4 A schematic diagram of a projection curve provided in an embodiment of the present application;

[0074] Figure 5 A schematic diagram of an aluminum foil surface image to be detected provided in an embodiment of the present application;

[0075] Figure 6 A schematic diagram of a filtered projection curve provided in an embodiment of the present application;

[0076] Figure 7 A schematic diagram of a curve of a projected first-order derivative provided in an embodiment of the present application;

[0077] Figure 8 A schematic diagram of a region of interest provided in an embodiment of the present application;

[0078] Fig. 9 A flow chart of another aluminum foil surface defect detection method provided in an embodiment of the present application;

[0079] Fig.10 A schematic diagram of another aluminum foil surface image to be detected provided in an embodiment of the present application;

[0080] Fig.11 A flow chart of another aluminum foil surface defect detection method provided in an embodiment of the present application;

[0081] Fig.12 A flow chart of a training aluminum foil surface defect classification model provided in an embodiment of the present application;

[0082] Fig.13 A schematic diagram of the structure of an aluminum foil surface defect detection device provided in an embodiment of the present application;

[0083] Fig.14 A schematic diagram of the structure of an aluminum foil surface defect detection device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0084] In order to make the features and advantages of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0085] The terms "first", "second", "third", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0086] Aluminum foil can be used for packaging, electrolytic capacitors, insulation and other materials. Aluminum foil used for electrolytic capacitors is called capacitor aluminum foil. Capacitor aluminum foil includes chemical foil and etched foil. Chemical foil is made of special high-purity aluminum foil after electrochemical or chemical corrosion to expand the surface area, and then after electrochemical formation to form an oxide film (aluminum oxide) on the surface. Etched foil is made of electronic light foil as raw material, and holes are formed on the surface of the electronic light foil by electrochemical etching (Etching), thereby increasing the surface area of ​​the cathode and anode light foils to improve their specific capacitance. Capacitor aluminum foil plays an important role in daily life. With the intensification of market competition and the development of production technology, people have higher and higher requirements for the quality of capacitor aluminum foil. More and more manufacturers have begun to pay attention to different types of defects on the surface of the manufactured capacitor aluminum foil, such as holes, cracks, wrinkles, bulging, scratches, insect spots, yellow spots, black spots, horizontal stripes, etc. These defects on the surface of capacitor aluminum foil will not only affect the appearance of capacitor aluminum foil products, but also reduce the product's performance such as capacitance parameters, wear resistance and fatigue strength. By detecting defects on the surface of capacitor aluminum foil, the production quality of capacitor aluminum foil can be evaluated, and the quality of capacitor aluminum foil can be understood in advance, so as to classify the produced capacitor aluminum foil and improve production efficiency.

[0087] At present, to detect and identify aluminum foil surface defects, it is necessary to first collect the aluminum foil surface image in real time through the detection camera, and then analyze the image through the algorithm. The difficulty lies in the various types of aluminum foil surface defects, large size variations, metal color reflection, uneven distribution of defect samples, and interference from external lighting on site. Therefore, the traditional image processing and feature engineering methods have poor anti-interference ability, are time-consuming, and it is difficult to achieve accurate surface defect detection. The present application determines the region of interest of the aluminum foil surface image to be detected, namely the aluminum foil region, based on the target color space, thereby enhancing the anti-interference ability for complex boundary illumination and irregular boundaries; determines the surface defect image of the aluminum foil and the surface defect position of the aluminum foil by high-pass and low-pass filtering, and can also determine the size of the surface defect, which can well eliminate the influence of noise and highlight the detail features, thereby improving the efficiency and accuracy of aluminum foil surface defect detection; and classifies aluminum foil surface defects by training an aluminum foil surface defect image obtained by transforming Y aluminum foil surface defect images to obtain X known surface defect classification results, where X and Y are both positive integers, and X is greater than Y, thereby increasing the training samples while ensuring the accuracy of the aluminum foil surface defect classification model, thereby ensuring the accuracy of aluminum foil surface defect classification.

[0088] In the embodiment of the present application, the aluminum foil surface defect detection method can be applied to detect surface defects of the manufactured capacitor aluminum foil including the formed foil and the corroded foil. Figure 1 Schematic diagram of the structure of an aluminum foil surface defect detection system provided in an embodiment of the present application. Figure 1 It can be seen that the aluminum foil surface defect detection system 100 may at least include: at least one image acquisition device 110, a storage device 120, an aluminum foil surface defect detection device 130, and a display 140. The image acquisition device 110 includes at least two parts: a lens and an image sensor. The storage device 120 may be a memory for storing the image information acquired by the image acquisition device 110 and the result information of the aluminum foil surface defect detection obtained by the aluminum foil surface defect detection device 130. The aluminum foil surface defect detection device 130 may process the information of the capacitor aluminum foil surface image in the above storage device 110. The aluminum foil surface defect detection device 130 may be a tablet computer, a desktop, a laptop, a notebook computer, an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, a personal digital assistant (PDA), a server, etc.

[0089] Specifically, the backstage personnel can first collect the capacitor aluminum foil surface image through the image acquisition device 110 and store it in the storage device 120. The aluminum foil surface defect detection device 130 can detect the surface defects of the capacitor aluminum foil surface image stored in the storage device 120, and then display the result of the capacitor aluminum foil surface defect detection through the display 140. At the same time, the aluminum foil surface defect detection device 130 can also extract the aluminum foil surface defect image of the classification result of the known surface defects in the storage device 120, and then train the aluminum foil surface defect classification model based on the above image, so as to realize the classification of the aluminum foil surface defects.

[0090] Next, combine Figure 1 , introduces the aluminum foil surface defect detection method provided by the embodiment of the present application, which can obtain the capacitor aluminum foil surface image information collected by the camera stored in the memory through electronic devices such as mobile phones and computers, and detect surface defects on the capacitor aluminum foil surface image, which can enhance the anti-interference ability in the aluminum foil surface defect detection process and ensure the accuracy of aluminum foil surface defect detection. For details, please refer to Figure 2 , which is a flow chart of a method for detecting surface defects of aluminum foil provided in an embodiment of the present application. The method for detecting surface defects of aluminum foil comprises:

[0091] Step 201, acquiring an image of the surface of the aluminum foil to be detected based on a target color space; the target color space includes multiple components, and the multiple components include at least brightness.

[0092] Specifically, the surface image of the aluminum foil collected by an image acquisition device such as a camera includes a corrosion image and a non-corrosion image. The corrosion image is used to characterize the surface image of the aluminum foil that has been chemically corroded; the non-corrosion image is used to characterize the surface image of the aluminum foil that has not been corroded. The present application can detect surface defects on both the corrosion image and the non-corrosion image.

[0093] Specifically, the aluminum foil surface image is converted to a target color space to obtain the aluminum foil surface image to be detected. For example, the corrosion image captured by the camera can be converted from the RGB color space to a target color space such as the HSV color space and the YUV color space. Optionally, the aluminum foil surface image to be detected in the target color space such as the HSV color space and the YUV color space can also be directly obtained. The target color space includes multiple components, and the multiple components include at least brightness.

[0094] Step 202: determining a region of interest in the image of the aluminum foil surface to be detected according to the multiple components.

[0095] Specifically, Figure 3 As shown: the target color space includes M×N pixels, and each pixel (m, n) corresponds to a component value f of the above component. i, denoted as f i (m,n), M, N, m, n are all positive integers and m≤M, n≤N. First, extract any component included in the target color space, and then calculate the horizontal projection curve of the component in the horizontal direction and the vertical projection curve in the vertical direction. Among them, the horizontal projection f i m The calculation formula is: That is, the horizontal projection curve is used to represent the sum of all pixel points in the mth row of the component of the aluminum foil surface image to be detected, and the value of m is all positive integers from 1 to M; its abscissa is the position m of the row coordinate of the pixel point, and its ordinate is the sum of the pixel point component values ​​at the same row coordinate position. For example, when the abscissa of the horizontal projection curve is 2, its ordinate should be f i (2,1)+f i (2,2)+...+f i The value of (2,N); vertical projection f i n The calculation formula is: The vertical projection curve is used to represent the sum of all pixel points of the component of the aluminum foil surface image to be detected in the nth column, where n is a positive integer from 1 to N; its abscissa is the column coordinate position n of the pixel point, and its ordinate is the sum of the pixel component values ​​at the same column coordinate position. For example, when the abscissa of the vertical projection curve is 2, its ordinate should be f i (1,2)+f i (2,2)+...+f i The value of (M,2), the projection curve is as follows Figure 4As shown. Finally, the segmentation point of the horizontal projection curve and the vertical projection curve is determined; the segmentation point is the mean point or extreme point of the above-mentioned projection curve. If the segmentation point is the extreme point of the above-mentioned projection curve, the first-order derivative of the horizontal projection curve and the vertical projection curve is respectively performed to determine the extreme points of the horizontal projection curve and the vertical projection curve, and the boundary between the aluminum foil and the background in the aluminum foil surface image to be detected is determined according to the extreme points. If the segmentation point is the mean point of the above-mentioned projection curve, the coordinates of the mean point of the aluminum foil surface image to be detected can be directly determined according to the row coordinates and column coordinates of the mean point, and the boundary between the aluminum foil and the background in the aluminum foil surface image to be detected is directly determined by binarization according to the component values ​​corresponding to the coordinates of the mean point. The aluminum foil area within the boundary between the aluminum foil and the background in the aluminum foil surface image to be detected is determined as the area of ​​interest. The method of determining the boundary line between the aluminum foil and the background in the aluminum foil surface image to be detected based on the extreme points may specifically be to determine multiple extreme points based on the row coordinates of the extreme points of the horizontal projection curve and the column coordinates of the extreme points of the vertical projection curve, and to use binarization to determine the line connecting the pixel points having the same component value mean as the corresponding component value mean of the multiple extreme points as the boundary line between the aluminum foil and the background in the aluminum foil surface image to be detected. Figure 5 As shown: If the row coordinates of the extreme points of the horizontal projection curve are m1 and m2 and the column coordinates of the extreme points of the vertical projection curve are n1 and n2, a total of four extreme points (m1, n1), (m1, n2), (m2, n1), and (m2, n2) can be determined. Obtain the component values ​​f corresponding to the above four extreme points i (m1,n1),f i (m1,n2),f i (m2,n1),f i The average value of (m2,n2) Will The binarization threshold is set to binarize to obtain the boundary line 530 between the aluminum foil 510 and the background 520 in the aluminum foil surface image 500 to be detected. The above-mentioned region of interest can be determined as the aluminum foil 510 region within the boundary line 530.

[0096] Optionally, before calculating the sum of the horizontal projection curve of the component in the horizontal direction and the vertical projection curve in the vertical direction and performing first-order derivatives on the horizontal projection curve and the vertical projection curve, the projection curves may be subjected to median filtering. The median filtering window may include a linear window, such as 1×15, 1×7, etc. The size of the median window may be set according to the specific aluminum foil surface defect detection situation, and this application does not make specific restrictions on this. For example, for Figure 4 The projection filter curve obtained after median filtering is as follows: Figure 6 As shown. Figure 6It can be seen that the embodiment of the present application can filter out the oscillation on the projection curve through median filtering, so that the above projection curve becomes a smooth curve, which can more accurately reflect the changes of each pixel in the above image. When the window of the median filter is 1×7, it can be determined that the template for the first-order derivative is w=[-1,-1,-1,0,1,1,1], then Figure 6 The projection filtering curve in the above first-order derivative template can be used to obtain the curve of the projection first-order derivative as follows Figure 7 shown.

[0097] Step 203: determining a surface defect image and a position of the surface defect according to the region of interest.

[0098] Specifically, the region of interest is directly binarized to obtain the position of the surface defect and the surface defect image is cropped according to the position of the surface defect. The position of the surface defect includes the starting point, length and width of the rectangle; the rectangle includes all connected areas of the surface defect; the rectangle is the minimum circumscribed rectangle of the boundary of the surface defect. Figure 8 As shown: the region of interest 800 can be binarized to determine the starting point 810 , length L and width W of the surface defect image 820 and a rectangle 830 including all connected regions 820 of the surface defect, and the boundary of the surface defect 820 is inscribed in the rectangle 830 .

[0099] Step 204: input the surface defect image into an aluminum foil surface defect classification model for classification to obtain a classification result of the surface defect.

[0100] Specifically, the surface defect image is input into the aluminum foil surface defect classification model for classification, and the classification result of the surface defect can be obtained. The surface defect classification result includes the category of the surface defect and the confidence corresponding to each category. The categories of the surface defects include holes, cracks, wrinkles, bulging, scratches, worm spots, yellow spots, black spots, horizontal stripes, etc. The confidence is used to characterize the similarity between the surface defect and defects of each category, which can be 80%, 90%, etc. The aluminum foil surface defect classification model can automatically determine the defect category corresponding to the highest confidence as the category of the surface defect. The aluminum foil surface defect classification model is trained by X aluminum foil surface defect images of the classification results of known surface defects; the X aluminum foil surface defect images are transformed by Y aluminum foil surface defect images, and X and Y are both positive integers, and X is greater than Y. The transformation includes affine transformation, geometric transformation such as translation and scaling, noise addition, etc.

[0101] In this embodiment, by acquiring an image of the surface of the aluminum foil to be detected based on a target color space including multiple components, and then determining a region of interest in the image of the surface of the aluminum foil to be detected according to the multiple components, thereby determining a surface defect image and the location of the surface defect, the anti-interference capability in the process of detecting surface defects of the aluminum foil can be enhanced, thereby ensuring the accuracy of detecting surface defects of the aluminum foil.

[0102] Please refer to Fig. 9 , which is a flow chart of a method for detecting surface defects of aluminum foil provided in an embodiment of the present application. The method for detecting surface defects of aluminum foil comprises:

[0103] Step 901, acquiring an image of the surface of the aluminum foil to be detected based on a target color space; the target color space includes multiple components, and the multiple components include at least brightness.

[0104] Specifically, step 901 is consistent with step 201 and will not be repeated here.

[0105] Step 902: extract multiple components included in the target color space.

[0106] Specifically, multiple components of multiple pixel points included in the target color space are extracted.

[0107] Step 903 , respectively determining the boundary line between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to each component.

[0108] Specifically, the boundary line may include a regular boundary line and an irregular boundary line. The specific method for determining the boundary line between the aluminum foil and the background in the aluminum foil surface image to be detected is consistent with the method for determining the boundary line in step 202, and will not be repeated here.

[0109] Step 904 : determining a target boundary line between the aluminum foil and the background in the to-be-detected aluminum foil surface image according to the boundary lines between the aluminum foil and the background in the to-be-detected aluminum foil surface image corresponding to each of the multiple components.

[0110] Specifically, extract the component value of the boundary between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to each component; then determine the target boundary according to the component value and at least one preset constraint. The preset constraint may include H1: proportion. According to the sum or mean of the component values ​​of the boundary, the sum of the aluminum foil proportion and the background proportion corresponding to each component can be determined; the aluminum foil proportion is used to characterize the ratio of the number of pixel points within the boundary whose component value is greater than the sum or mean of the component value to the total number of all pixel points within the boundary; the background proportion is used to characterize the ratio of the number of pixel points outside the boundary whose component value is less than the sum or mean of the component value to the total number of all pixel points outside the boundary; the proportion H1=h1+h2; then, according to the sum H1 of the aluminum foil proportion and the background proportion corresponding to each component, determine the target boundary in the boundary between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to each component, that is, determine the boundary determined by the component corresponding to the largest sum H1 of the aluminum foil proportion and the background proportion as the optimal boundary, that is, the target boundary. For example, Fig.10 As shown: If the target color space shown includes three components, which are respectively recorded as A, B, and C, the three components can determine the corresponding three boundaries between the aluminum foil 1010 and the background 1020 in the aluminum foil surface image 1000 to be detected according to step 1003, which are respectively recorded as 103a, 103b, and 103c. According to the corresponding component value averages of the pixel points on the three boundary lines 103a, 103b, and 103c, the sums of the three corresponding aluminum foil proportions and the background proportions Sa, Sb, and Sc can be calculated. Since Sc>Sb>Sa, it can be determined that the boundary line 103c determined by the component C corresponding to Sc is the target boundary line.

[0111] Optionally, the preset constraint condition may also include H2: variance. After determining the boundary line between the aluminum foil and the background in the surface image of the aluminum foil to be detected corresponding to each component according to the segmentation point of the projection curve, select the projection and value of the preset interval around the segmentation point to calculate the variance H2. Then, the boundary line determined by the segmentation point corresponding to the largest variance H2 can be determined as the target boundary line. The preset interval can be a rectangular area with a preset length × preset width centered at the segmentation point and including both the aluminum foil and the background, for example, a 300×300 rectangular area centered at the segmentation point and including both the aluminum foil and the background. The preset length and preset width can be set according to actual conditions, and this application does not make specific restrictions on this.

[0112] Optionally, the preset constraint condition may also include N preset constraints at the same time, where N is a positive integer, denoted as H1, H2, ...HN. At this time, the constraint condition Φ=(W1*H1+W2*H2+...+WN*HN, where W1+W2+...+WN=1, where W1, W2, ...WN represent the weights of H1, H2, ...HN, for example, 50%, 60%, etc. The values ​​of W1, W2...WN can be set according to the actual aluminum foil surface defect detection situation, and this application does not make specific restrictions on this. H1 represents the proportion, and H2 represents the variance. At this time, determining the target dividing line according to the component value and at least one preset constraint condition is equivalent to selecting the dividing line corresponding to the largest constraint condition Φ as the target dividing line.

[0113] Step 905, determining the region of interest in the aluminum foil surface image to be detected according to the target boundary line.

[0114] Specifically, the aluminum foil area within the target boundary line is determined as the region of interest.

[0115] Step 906: determine the surface defect image and the location of the surface defect according to the region of interest.

[0116] Specifically, step 906 is consistent with step 203 and will not be described again here.

[0117] Step 907: input the surface defect image into an aluminum foil surface defect classification model for classification to obtain a classification result of the surface defect.

[0118] Specifically, step 907 is consistent with step 204 and will not be repeated here.

[0119] In this embodiment, the first-order derivative of the horizontal projection curve and the vertical projection curve corresponding to each component included in the target color space is taken to obtain the extreme points, and the boundary line between the aluminum foil and the background in the aluminum foil surface image is determined according to the extreme points. Then, the sum of the aluminum foil proportion corresponding to each component and the background proportion is compared to determine the optimal boundary line in the boundary line between the aluminum foil and the background in the aluminum foil surface image corresponding to each component, that is, the target boundary line. While enhancing the anti-interference ability in the process of aluminum foil surface defect detection, the accuracy of aluminum foil surface defect detection is further ensured.

[0120] Please refer to Fig.11 , which is a flow chart of a method for detecting surface defects of aluminum foil provided in an embodiment of the present application. The method for detecting surface defects of aluminum foil comprises:

[0121] Step 1101, obtaining an image of the surface of the aluminum foil to be detected based on a target color space; the target color space includes multiple components, and the multiple components include at least brightness.

[0122] Specifically, step 1101 is consistent with step 201 and will not be repeated here.

[0123] Step 1102: determining a region of interest in the image of the aluminum foil surface to be detected according to the multiple components.

[0124] Specifically, step 1102 is consistent with step 202 and will not be repeated here.

[0125] Step 1103: high-pass filter the region of interest to obtain a high-pass filtered image, and low-pass filter the region of interest to obtain a low-pass filtered image.

[0126] Specifically, a Gaussian filter of D1×D1 is used to perform high-pass filtering on the region of interest to obtain a high-pass filtered image, and a mean filter of D2×D2 is used to perform low-pass filtering on the region of interest to obtain a low-pass filtered image. The above D1 is smaller than D2. For example, if D1 can be 3, 5, 7, 9, etc., then D2 can be 41, 42, etc., which are larger than the filter radius of D1. For example, a Gaussian filter of size 3×3 can be used to perform high-pass filtering on the region of interest, retaining the details of the region of interest to obtain a high-pass filtered image, and a mean filter of size 31×31 can be used to perform low-pass filtering on the region of interest, retaining the aluminum foil background portion of the region of interest to obtain a high-pass filtered image. The sizes of the above filter radii D1 and D2 can be set according to the specific aluminum foil surface defect detection situation, and this application does not make specific limitations on this.

[0127] Step 1104: determine a differential image according to the high-pass filtered image and the low-pass filtered image.

[0128] Specifically, the pixel values ​​corresponding to the high-pass filtered image and the low-pass filtered image are subtracted to obtain a differential image.

[0129] Step 1105: determine the surface defect image and the position of the surface defect according to the differential image.

[0130] Specifically, the difference image is directly binarized to determine the position of the surface defect and the surface defect image is cropped according to the position of the surface defect. The position of the surface defect includes the starting point, length and width of a rectangle; the rectangle includes all connected areas of the surface defect; and the rectangle is the minimum circumscribed rectangle of the boundary of the surface defect.

[0131] Step 1106: input the surface defect image into an aluminum foil surface defect classification model for classification to obtain a classification result of the surface defect.

[0132] Specifically, step 1106 is consistent with step 204 and will not be repeated here.

[0133] In this embodiment, by performing high-pass and low-pass filtering on the region of interest, the cutoff frequency of the high-pass filter is made lower than the cutoff frequency of the low-pass filter, and then the surface defect image and the position of the surface defect are determined according to the differential image of the high-pass and low-pass filters, both high-frequency noise and low-frequency noise can be eliminated, thereby making the detail features of the region of interest more obvious, thereby improving the efficiency and accuracy of aluminum foil surface defect detection.

[0134] Please refer to Fig.12 , which provides a flow chart of training an aluminum foil surface defect classification model for an embodiment of the present application. The training process of the aluminum foil surface defect classification model in step 204 includes:

[0135] Step 1201, obtaining Y aluminum foil surface defect images with known surface defect classification results, where Y is a positive integer.

[0136] Specifically, Y aluminum foil surface defect images with known surface defect classification results stored in the storage device are obtained, where Y is a positive integer.

[0137] Step 1202: Perform at least one geometric transformation on the Y aluminum foil surface defect images to obtain X aluminum foil surface defect images, where X is a positive integer and X is greater than Y.

[0138] Specifically, the Y aluminum foil surface defect images obtained above are subjected to at least one geometric transformation such as rotation, translation, scaling, etc. to obtain X aluminum foil surface defect images, where X is a positive integer and X is greater than Y.

[0139] Step 1203: randomly divide the X aluminum foil surface defect images into training samples and test samples according to a preset ratio.

[0140] Specifically, the X aluminum foil surface defect images are first subjected to preprocessing operations such as filtering, and the noise of the aluminum foil surface defect images is suppressed while retaining the detailed features of the aluminum foil surface defect images as much as possible, so that the defect features of the aluminum foil surface defect images are more prominent, and more accurate defect features can be obtained more quickly, thereby making the training speed faster. The X aluminum foil surface defect images after the preprocessing operation are randomly divided into training samples and test samples according to a preset ratio. The preset ratio can be 4:1, that is, 80% of the training samples and 20% of the test samples, which can be set according to the specific aluminum foil surface defect detection situation and the actual situation, and this application does not make specific limitations on this.

[0141] Step 1204: input the training samples into the aluminum foil surface defect classification model.

[0142] Specifically, an aluminum foil surface defect classification model is first created and initialized, and then training samples are input into the aluminum foil surface defect classification model.

[0143] Step 1205, calculate the predicted value through forward propagation.

[0144] Specifically, after the training samples are input into the aluminum foil surface defect classification model, the predicted value is obtained through forward propagation calculation, and the mean square error between the predicted value and the actual value is calculated or the number of training times, the number of iterations, etc. are recorded.

[0145] Step 1206, judging whether the aluminum foil surface defect classification model has been trained according to the predicted value.

[0146] Specifically, it is determined whether the mean square error between the predicted value and the actual value is less than the preset error. If it is less than the preset error, it is determined whether the aluminum foil surface defect classification model has been trained, and then step 1207 is executed. If the mean square error between the predicted value and the actual value is greater than or equal to the preset error, it is determined that the aluminum foil surface defect classification model has not been trained, and then step 1208 is executed. The preset error may be 0.001, etc., and may be set according to the specific aluminum foil surface defect detection situation and the actual situation, and this application does not make specific limitations on this.

[0147] Optionally, it is also possible to determine whether the aluminum foil surface defect classification model has completed training by determining whether the training number or iteration number has reached a preset number. If the training number or iteration number has reached the preset number, it is determined that the aluminum foil surface defect classification model has completed training, and then step 1207 is performed. If the training number or iteration number has not reached the preset number, it is determined that the aluminum foil surface defect classification model has not completed training, and then step 1208 is performed.

[0148] Step 1207: If the aluminum foil surface defect classification model has been trained, the test sample is used to evaluate the prediction performance of the aluminum foil surface defect classification model.

[0149] Specifically, if the aluminum foil surface defect classification model has been trained, the above test sample is input into the above aluminum foil surface defect classification model, and the category of each aluminum foil surface defect in the corresponding test sample can be output. The categories of multiple aluminum foil surface defects are compared with the categories of multiple actual aluminum foil surface defects included in the test sample to obtain the accuracy of the prediction performance of the aluminum foil surface defect classification model, that is, the number of samples of surface defect categories whose categories of multiple aluminum foil surface defects are consistent with the categories of multiple actual aluminum foil surface defects in the test sample accounts for the percentage of the total number of test samples. For example, the test sample includes a total of 1,000 aluminum foil surface defect images. After the aluminum foil surface defect classification model is used, when the number of samples of surface defect categories that correspond to the actual defect categories of the 1,000 aluminum foil surface defect images is less than 800, it can be evaluated that the accuracy of the prediction performance of the aluminum foil surface defect classification model is 80%. If the accuracy of the prediction performance of the aluminum foil surface defect classification model is less than the preset accuracy, step 1208 is executed. If the accuracy of the prediction performance of the aluminum foil surface defect classification model is greater than or equal to the preset accuracy, it means that the aluminum foil surface defect classification model has been trained and can be formally used for the detection of aluminum foil surface defects. The preset accuracy can be 90%, etc., which can be set according to the specific aluminum foil surface defect classification situation and actual situation, and this application does not make specific limitations on this.

[0150] Step 1208: If the aluminum foil surface defect classification model has not been trained, the parameters of the aluminum foil surface defect classification model are updated through back propagation.

[0151] Specifically, if the aluminum foil surface defect classification model has not been trained, the parameters of the fully connected layer and the hidden layer are adjusted by using the stochastic gradient descent method according to the mean square error between the predicted value and the actual value, that is, the parameters of the aluminum foil surface defect classification model are updated by back propagation. Finally, the updated aluminum foil surface defect classification model is saved, and step 1205 is executed again.

[0152] In this embodiment, an aluminum foil surface defect classification model is obtained by training aluminum foil surface defect images of X known surface defects obtained by transforming Y aluminum foil surface defect images, where X and Y are both positive integers, and X is greater than Y. The aluminum foil surface defects are classified by the aluminum foil surface defect classification model, which increases the training samples while ensuring the accuracy of the aluminum foil surface defect classification model, thereby ensuring the accuracy of the aluminum foil surface defect classification.

[0153] Please refer to Fig.13 , which is a schematic diagram of the structure of an aluminum foil surface defect detection device provided in an embodiment of the present application. The aluminum foil surface defect detection device 1300 includes:

[0154] The acquisition module 1310 is used to acquire the surface image of the aluminum foil to be detected based on the target color space; the target color space includes multiple components, and the multiple components at least include brightness.

[0155] The determination module 1320 is used to determine the region of interest in the aluminum foil surface image to be detected according to the multiple components.

[0156] The determination module 1320 is further configured to determine a surface defect image and a location of the surface defect according to the region of interest.

[0157] The classification module 1330 is used to input the surface defect image into the aluminum foil surface defect classification model for classification to obtain the classification result of the surface defect.

[0158] In a possible implementation, the aluminum foil surface defect detection device further includes:

[0159] The extraction module is used to extract multiple components included in the target color space.

[0160] The determination module 1320 is further used to respectively determine the boundary line between the aluminum foil and the background in the to-be-detected aluminum foil surface image corresponding to each component.

[0161] The determination module 1320 is further configured to determine a target boundary line between the aluminum foil and the background in the aluminum foil surface image to be detected according to the boundary lines between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to each of the multiple components.

[0162] The determination module 1320 is further specifically configured to determine a region of interest in the surface image of the aluminum foil to be detected according to the target boundary line.

[0163] In a possible implementation, the aluminum foil surface image to be detected includes M×N pixels, where M and N are both positive integers.

[0164] The extraction module is also specifically used to extract any one component included in the target color space.

[0165] The aluminum foil surface defect detection device also includes:

[0166] A calculation module is used to calculate a horizontal projection curve of the component in the horizontal direction and a vertical projection curve in the vertical direction; the horizontal projection curve is used to represent the sum of all pixel points of the component of the aluminum foil surface image to be detected in the mth row, and the vertical projection curve is used to represent the sum of all pixel points of the component of the aluminum foil surface image to be detected in the nth column; wherein the value of m is all positive integers from 1 to M, and the value of n is all positive integers from 1 to N.

[0167] The determination module 1320 is further used to determine a segmentation point between the horizontal projection curve and the vertical projection curve.

[0168] The determination module 1320 is further used to determine a boundary line between the aluminum foil and the background in the aluminum foil surface image to be detected according to the segmentation point.

[0169] In a possible implementation manner, the extraction module is further specifically used to: extract the component value of the boundary line between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to each component.

[0170] The determination module 1320 is further configured to determine the target boundary line according to the component values ​​and at least one preset constraint condition.

[0171] In a possible implementation, the aluminum foil surface defect detection device further includes:

[0172] The filtering module is used to perform high-pass filtering on the region of interest to obtain a high-pass filtered image, and to perform low-pass filtering on the region of interest to obtain a low-pass filtered image.

[0173] The determination module 1320 is further configured to determine a differential image according to the high-pass filtered image and the low-pass filtered image.

[0174] The determination module 1320 is further specifically configured to determine a surface defect image and a position of a surface defect according to the differential image.

[0175] In a possible implementation manner, a cutoff frequency of the high-pass filter is lower than a cutoff frequency of the low-pass filter.

[0176] In a possible implementation, the position of the surface defect includes the starting point, length and width of a rectangle; the rectangle includes all connected areas of the surface defect; and the rectangle is the minimum circumscribed rectangle of the boundary of the surface defect.

[0177] In a possible implementation, the aluminum foil surface defect detection device further includes:

[0178] The training module is used to train the aluminum foil surface defect classification model by using X aluminum foil surface defect images of the classification results of known surface defects; the X aluminum foil surface defect images are obtained by transforming Y aluminum foil surface defect images, where X and Y are both positive integers, and X is greater than Y.

[0179] The division of each module in the above-mentioned aluminum foil surface defect detection device is only used for illustration. In other embodiments, the aluminum foil surface defect detection device can be divided into different modules as needed to complete all or part of the functions of the above-mentioned aluminum foil surface defect detection device. The implementation of each module in the aluminum foil surface defect detection device provided in the embodiment of the present application can be in the form of a computer program. The computer program can be run on a terminal or a server. The program modules constituted by the computer program can be stored in the memory of the terminal or the server. When the computer program is executed by the processor, all or part of the steps of the aluminum foil surface defect detection method described in the embodiment of the present application are implemented.

[0180] See also Fig.14 , is a schematic diagram of the structure of an aluminum foil surface defect detection device provided in the embodiment of the present application. Fig.14 As shown, the aluminum foil surface defect detection device 1400 may include: at least one processor 1410, at least one communication module 1420, a user interface 1430, a memory 1440, an image acquisition device 1450, a display 1460, an alarm 1470, a power supply 1480 and at least one communication bus 1490.

[0181] The communication bus 1490 is used to realize the connection and communication between these components.

[0182] The user interface 1430 may include buttons or a keyboard, and the optional user interface 730 may also include a standard wired interface or a wireless interface.

[0183] The communication module 1420 may optionally include a Bluetooth module, an NFC module, a Wi-Fi module, etc.

[0184] The image acquisition device 1450 includes at least two parts: a lens and an image sensor. The optical image generated by the lens (LENS) on the surface of the capacitor aluminum foil is projected onto the surface of the image sensor, and then converted into an electrical signal, which is converted into a digital image signal after A / D (analog-to-digital conversion), and then sent to the digital signal processing chip (DSP) for processing, and then transmitted to the processor 1410 for processing through the USB interface, and the image can be seen through the display 1460. The image acquisition device 1350 can be a camera, or other image acquisition devices including a camera;

[0185] The display 1460 is used to display information input by the user interface 1430 , information stored in the memory 1440 , information collected by the image acquisition device 1450 , and information such as the surface defect image and the location of the surface defect processed by the processor 1410 .

[0186] Among them, the alarm 1470 is used to send out a signal that a surface defect has occurred.

[0187] The power supply 1480 includes an input end and an output end. The input end of the power supply 1480 is connected to an external device, and receives the electric energy provided by the external device through the input end. The output end of the power supply 1480 is respectively connected to the processor 1410, the communication module 1420, the user interface 1430, the memory 1440, the image acquisition device 1450, the alarm 1470, and the display 1460, and transmits the electric energy to the processor 1410, the communication module 1420, the user interface 1430, the memory 1440, the image acquisition device 1450, the alarm 1470, and the display 1460.

[0188] The processor 1410 may include one or more processing cores. The processor 1410 uses various interfaces and lines to connect various parts of the entire aluminum foil surface defect detection device 1400, and executes various functions and processes data of the aluminum foil surface defect detection device 1400 by running or executing instructions, programs, code sets or instruction sets stored in the memory 1440, and calling data stored in the memory 1440. Optionally, the processor 1410 can be implemented in at least one hardware form of digital signal processing (DSP), field programmable gate array (FPGA), and programmable logic array (PLA). The processor 1410 can integrate one or more combinations of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; and the modem is used to process wireless communication. It is understandable that the above-mentioned modem may not be integrated into the processor 1410, but may be implemented by a separate chip.

[0189] Among them, the memory 1440 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 1440 includes a non-transitory computer-readable storage medium. The memory 1440 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 1440 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as an acquisition function, a classification function, a calculation function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 1440 may also be optionally at least one storage device located away from the aforementioned processor 1410. As Fig.14 As shown, the memory 1440 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an application program.

[0190] exist Fig.14 In the aluminum foil surface defect detection device 1400 shown, the user interface 1430 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 1410 can be used to call the application stored in the memory 1440 and specifically perform the following operations:

[0191] Acquire the surface image of the aluminum foil to be detected based on the target color space; the target color space includes multiple components, and the multiple components include at least brightness;

[0192] Determine a region of interest in the surface image of the aluminum foil to be detected according to the multiple components;

[0193] Determine a surface defect image and a location of the surface defect according to the region of interest;

[0194] The surface defect image is input into an aluminum foil surface defect classification model for classification to obtain a classification result of the surface defect.

[0195] In some possible embodiments, after acquiring the surface image of the aluminum foil to be detected based on the target color space and before determining the surface defect image and the position of the surface defect according to the region of interest, the processor 1410 further specifically performs:

[0196] Extracting multiple components included in the target color space;

[0197] Determine the boundary between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to each component respectively;

[0198] Determine a target boundary line between the aluminum foil and the background in the aluminum foil surface image to be detected according to the boundary lines between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to each of the multiple components;

[0199] Determining the region of interest in the surface image of the aluminum foil to be detected according to the multiple components includes: determining the region of interest in the surface image of the aluminum foil to be detected according to the target boundary line.

[0200] In some possible embodiments, the surface image of the aluminum foil to be detected includes M×N pixels, where M and N are both positive integers;

[0201] When determining the boundary between the aluminum foil and the background in the to-be-detected aluminum foil surface image corresponding to each component, the processor 1410 specifically performs:

[0202] Extracting any one component included in the target color space;

[0203] Calculate a horizontal projection curve of the component in the horizontal direction and a vertical projection curve in the vertical direction; the horizontal projection curve is used to represent the sum of all pixel points of the component of the aluminum foil surface image to be detected in the mth row, and the vertical projection curve is used to represent the sum of all pixel points of the component of the aluminum foil surface image to be detected in the nth column; wherein the value of m is all positive integers from 1 to M, and the value of n is all positive integers from 1 to N;

[0204] Determining a split point between the horizontal projection curve and the vertical projection curve;

[0205] The boundary between the aluminum foil and the background in the aluminum foil surface image to be detected is determined according to the segmentation point.

[0206] In some possible embodiments, when determining the target boundary line between the aluminum foil and the background in the aluminum foil surface image to be detected according to the boundary lines between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to each of the multiple components, the processor 1410 specifically performs:

[0207] Extracting the component value of the boundary line between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to each component;

[0208] The target dividing line is determined according to the component values ​​and at least one preset constraint condition.

[0209] In some possible embodiments, after determining the region of interest in the surface image of the aluminum foil to be detected according to the multiple components and before determining the surface defect image and the position of the surface defect according to the region of interest, the processor 1410 further specifically performs:

[0210] Performing high-pass filtering on the region of interest to obtain a high-pass filtered image, and performing low-pass filtering on the region of interest to obtain a low-pass filtered image;

[0211] Determining a differential image according to the high-pass filtered image and the low-pass filtered image;

[0212] The determining the surface defect image and the position of the surface defect according to the region of interest includes: determining the surface defect image and the position of the surface defect according to the differential image.

[0213] In some possible embodiments, a cutoff frequency of the high-pass filter is lower than a cutoff frequency of the low-pass filter.

[0214] In some possible embodiments, the position of the surface defect includes the starting point, length and width of a rectangle; the rectangle includes all connected areas of the surface defect; and the rectangle is the minimum circumscribed rectangle of the boundary of the surface defect.

[0215] In some possible embodiments, the processor 1410 is further used to execute: obtaining the aluminum foil surface defect classification model by training with X aluminum foil surface defect images of classification results of known surface defects; the X aluminum foil surface defect images are obtained by transforming Y aluminum foil surface defect images, where X and Y are both positive integers, and X is greater than Y.

[0216] The embodiment of the present application also provides a computer storage medium, which stores instructions, and when the instructions are executed on a computer or a processor, the computer or the processor executes one or more steps in any of the above methods. If the components of the above-mentioned aluminum foil surface defect detection device are implemented in the form of software functional units and sold or used as independent products, they can be stored in the storage medium.

[0217] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)), etc.

[0218] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes. In the absence of conflict, the technical features in this embodiment and the implementation scheme can be combined arbitrarily.

[0219] The embodiments described above are merely preferred embodiments of the present application and are not intended to limit the scope of the present application. Without departing from the design spirit of the present application, various modifications and improvements made to the technical solutions of the present application by ordinary technicians in this field should fall within the protection scope determined by the claims of the present application.

Claims

1. A method for detecting surface defects of aluminum foil, characterized in that: include: Acquire the surface image of the aluminum foil to be detected based on the target color space; The target color space includes a plurality of components, and the plurality of components includes at least brightness; Determine a region of interest in the surface image of the aluminum foil to be detected according to the multiple components; Determine a surface defect image and a location of the surface defect according to the region of interest; Inputting the surface defect image into an aluminum foil surface defect classification model for classification to obtain a classification result of the surface defect; The step of determining the region of interest in the surface image of the aluminum foil to be detected according to the multiple components comprises: Determine the region of interest in the surface image of the aluminum foil to be detected according to the target boundary line; The target dividing line is determined according to the dividing line between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to each of the multiple components; the dividing line corresponding to the component is determined according to the dividing point of the horizontal projection curve of the component in the horizontal direction and the vertical projection curve in the vertical direction.

2. The method according to claim 1, characterized in that After acquiring the surface image of the aluminum foil to be inspected based on the target color space and before determining the surface defect image and the position of the surface defect according to the region of interest, the method further includes: Extracting a plurality of components included in the target color space; Determine the boundary between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to each component respectively; Determine a target boundary line between the aluminum foil and the background in the aluminum foil surface image to be detected according to the boundary lines between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to each of the multiple components; The surface image of the aluminum foil to be detected includes M×N pixels, where M and N are both positive integers; The step of respectively determining the boundary between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to each component includes: Extracting any one component included in the target color space; Calculate a horizontal projection curve of the component in the horizontal direction and a vertical projection curve in the vertical direction; the horizontal projection curve is used to represent the sum of all pixel points of the component of the aluminum foil surface image to be detected in the mth row, and the vertical projection curve is used to represent the sum of all pixel points of the component of the aluminum foil surface image to be detected in the nth column; wherein the value of m is all positive integers from 1 to M, and the value of n is all positive integers from 1 to N; Determining a split point between the horizontal projection curve and the vertical projection curve; The boundary between the aluminum foil and the background in the aluminum foil surface image to be detected is determined according to the segmentation point.

3. The method according to claim 2, characterized in that The step of determining a target boundary line between the aluminum foil and the background in the aluminum foil surface image to be detected according to the boundary lines between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to each of the multiple components comprises: Extracting the component value of the boundary line between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to each component; The target dividing line is determined according to the component values ​​and at least one preset constraint condition.

4. The method according to claim 1, characterized in that After determining the region of interest in the surface image of the aluminum foil to be detected according to the multiple components, and before determining the surface defect image and the position of the surface defect according to the region of interest, the method further includes: Performing high-pass filtering on the region of interest to obtain a high-pass filtered image, and performing low-pass filtering on the region of interest to obtain a low-pass filtered image; Determining a differential image according to the high-pass filtered image and the low-pass filtered image; The determining the surface defect image and the position of the surface defect according to the region of interest includes: determining the surface defect image and the position of the surface defect according to the differential image.

5. The method according to claim 4, characterized in that The cut-off frequency of the high-pass filter is lower than the cut-off frequency of the low-pass filter.

6. The method according to claim 1, characterized in that The position of the surface defect includes the starting point, length and width of the rectangle; the rectangle includes all connected areas of the surface defect.

7. The method according to claim 1, characterized in that The aluminum foil surface defect classification model is trained by X aluminum foil surface defect images of classification results of known surface defects; the X aluminum foil surface defect images are transformed by Y aluminum foil surface defect images, where X and Y are both positive integers, and X is greater than Y.

8. An aluminum foil surface defect detection device, characterized in that: include: An acquisition module, used for acquiring the surface image of the aluminum foil to be detected based on the target color space; The target color space includes a plurality of components, and the plurality of components includes at least brightness; A determination module, used for determining a region of interest in the surface image of the aluminum foil to be detected according to the multiple components; The determination module is further used to: determine the surface defect image and the position of the surface defect according to the region of interest; A classification module, used for inputting the surface defect image into an aluminum foil surface defect classification model for classification to obtain a classification result of the surface defect; The determination module is specifically used for: The region of interest in the aluminum foil surface image to be detected is determined according to a target dividing line; the target dividing line is determined according to the dividing lines between the aluminum foil and the background in the aluminum foil surface image to be detected corresponding to each of the multiple components; the dividing line corresponding to the component is determined according to the dividing point of the horizontal projection curve of the component in the horizontal direction and the vertical projection curve in the vertical direction.

9. An aluminum foil surface defect detection device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 7 when executing the program.

10. A computer storage medium, characterized in that: The computer storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the method steps as claimed in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method for detecting and classifying defects of non-woven fabrics

    CN108765402A

  • Welding spot defect detection method, system and equipment

    CN110880175A