Disclosure of Invention
The invention provides a copper foil defect detection method and a medium for overcoming the defects in the prior art, which can extract a detection image of a copper foil to be detected, and compare the detection image with a standard copper foil image, wherein in the comparison process, a pixel unit of the detection image is taken as a minimum comparison unit, so that the comparison speed can be increased, and the detection of the copper foils on two sides can be completed in a short time.
According to one aspect of the invention, a method for detecting defects of a copper foil is provided, which comprises the following steps:
acquiring an initial image corresponding to the copper foil to be detected;
carrying out image preprocessing on the initial image to obtain a standard initial image;
performing contour matching on the standard initial image to obtain a detection image of the copper foil to be detected;
and generating a defect label associated with the copper foil to be detected based on the fact that the difference coefficient between the detection image and a standard copper foil image is larger than a threshold value.
Preferably, the image preprocessing the initial image to obtain a standard initial image includes:
scaling the initial image based on a fixed width and a fixed height;
and carrying out illumination compensation on the scaled initial image to obtain the standard initial image.
Preferably, the obtaining of the detection image of the copper foil to be detected by performing contour matching on the standard initial image includes:
acquiring a copper foil standard outline;
and matching the standard initial image based on the copper foil standard outline to obtain the detection image of the copper foil to be detected.
Preferably, the generating a defect label associated with the copper foil to be detected based on the difference coefficient between the detection image and a standard copper foil image being greater than a threshold value includes:
dividing a detection image into a plurality of pixel units, wherein each pixel unit comprises a plurality of pixels;
obtaining a unit gray value of each pixel unit according to the gray value of the pixel in the pixel unit;
obtaining the difference coefficient of the detection image based on the unit gray scale of each pixel unit and the corresponding gray scale range value recorded in the standard copper foil image;
and generating a defect label associated with the copper foil to be detected based on the difference coefficient being larger than the threshold value.
Preferably, the standard copper foil image comprises a plurality of pixel units, each pixel image has a gray scale value, and each pixel unit comprises a plurality of pixels.
Preferably, the number of pixels per pixel unit is 4 or 9.
Preferably, after the matching based on the copper foil standard profile on the standard initial image to obtain the detection image of the copper foil to be detected, the method further includes: affine transformation is performed on the detection image to translate and rotate the detection image to a reference position.
Preferably, the obtaining a copper foil standard profile includes:
obtaining a standard image of a standard copper foil;
and carrying out contour extraction on the standard image to obtain the standard contour of the copper foil.
Preferably, the standard outline of the copper foil is square.
According to an aspect of the present invention, there is provided a computer-readable storage medium storing a program which, when executed, implements the steps of the above-described copper foil defect detection method.
The beneficial effects of the above technical scheme are:
the method for detecting the defects of the copper foil can extract the detection image of the copper foil to be detected, and compares the detection image with the standard copper foil image, and in the comparison process, the pixel unit of the detection image is taken as the minimum comparison unit, so that the comparison speed can be improved, and the detection of the copper foils on the two sides can be completed in a short time.
Further features and advantages of the invention, as well as the structure and operation of various embodiments of the invention, are described in detail below with reference to the accompanying drawings. It should be noted that the present invention is not limited to the specific embodiments described herein. These examples are given herein for illustrative purposes only.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive effort based on the embodiments of the present invention, are within the scope of the present invention.
As used in this application, the terms "first," "second," and the like do not denote any order, quantity, or importance, but rather are used to distinguish one element from another. The word "comprising" or "comprises", and the like, means that the element or item listed before the word covers the element or item listed after the word and its equivalents, but does not exclude other elements or items. The terms "connected" or "coupled" and the like are not restricted to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "upper", "lower", "left", "right", and the like are used merely to indicate relative positional relationships, and when the absolute position of the object being described is changed, the relative positional relationships may also be changed accordingly.
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.
The invention is further described with reference to the following drawings and specific examples, which are not intended to be limiting.
According to one aspect of the invention, a method for detecting defects of a copper foil is provided.
Fig. 1 is a schematic view of an implementation scenario of the present invention. Fig. 1 shows animplementation scenario 100 of a copper foil defect detection method, acopper foil 103 to be detected is arranged on an inspection table 104 shown in fig. 1, the inspection table 104 can rotate, an illuminatinglamp 101 is used for providing a light source, animage extraction device 102 is used for collecting an image containing thecopper foil 103 to be detected on the inspection table 104, and the illuminatinglamp 101 and theimage extraction device 102 are both connected with anupper computer 105. Theupper computer 105 controls theillumination lamp 101, theimage pickup device 102, and theinspection stage 104, and receives an image captured by theimage pickup device 102.
FIG. 2 is a schematic flow chart of a copper foil defect detection method of the present invention. The copper foil defect detection method shown in FIG. 2 comprises: step S101, step S102, step S103, and step S104. Step S101, acquiring an initial image corresponding to the copper foil to be detected. Step S102, image preprocessing is carried out on the initial image to obtain a standard initial image. And step S103, performing contour matching on the standard initial image to obtain a detection image of the copper foil to be detected. And step S104, generating a defect label associated with the copper foil to be detected based on the fact that the difference coefficient between the detection image and a standard copper foil image is larger than a threshold value.
In step S101, the copper foil undertest 103 is photographed by theimage extraction device 102 to obtain an initial image of the copper foil undertest 103.
FIG. 3 is a flowchart illustrating a standard initial image acquisition method. FIG. 4 is a zoomed initial image of the present invention. Fig. 5 is a standard initial image. The standard initial image acquisition method shown in fig. 3 includes: step S201 and step S202. In step S201, the initial image is scaled based on a fixed width and a fixed height. Scaling the initial image width and height to a fixed width and fixed height results in an image as shown in fig. 4. In step S202, illumination compensation is performed on the scaled initial image to obtain a standard initial image. Since all copper foil detection needs to use the same detection method, in order to make the detection result more accurate, it is necessary to ensure that the difference of information expressed in other places except for the defect part of the image before detection is reduced as much as possible, and the initial image is subjected to illumination compensation processing to obtain the standard initial image shown in fig. 5.
Fig. 6 is a schematic view of a detection image acquisition process. Fig. 7 is a schematic diagram of a copper foil standard profile acquisition process. Step S103 further includes step S301, step S302, and step S303. In step 301, a copper foil standard profile is obtained. Step S301 further includes step S401 and step S402. In step S401, a standard image of a standard copper foil is obtained. And preprocessing the standard image to obtain a standard image with uniform illumination. In step S402, a standard profile of the copper foil is obtained by performing profile extraction on the standard image, wherein the standard profile of the copper foil is generally square.
Fig. 8 is a schematic diagram of a detection image. In step S302, a detection image of the copper foil to be detected is obtained by matching the standard initial image based on the standard profile of the copper foil. The detection image of thecopper foil 103 to be detected shown in fig. 5 can be obtained by matching the copper foil standard profile with the standard initial image. In step S303, affine transformation is performed on the detection image to translate and rotate the detection image to the reference position. The inspection image of the copper foil undertest 103 in fig. 5 needs to be translated and rotated, i.e., the inspection image shown in fig. 8 can be obtained after being converted to the reference position.
Fig. 9 is a schematic diagram of a defect label acquisition process. Fig. 10 is a schematic diagram of a pixel unit. Step S104 includes: step S501, step S502, step S503, and step S504. In step S501, the detection image is divided into a plurality of pixel units, each pixel unit including a plurality of pixels. Referring to fig. 10, the detection image shown in fig. 8 is divided into several pixel units, and eachpixel unit 201 includes 4pixels 202. In some instances, onepixel cell 201 may include 9 pixels. In step S502, a unit gray value of a pixel unit is obtained according to the gray value of the pixel in each pixel unit. Referring to fig. 10, the gray-scale values corresponding to the 4pixels 202 shown in fig. 10 may be 25, 205, 103, and 155, and then the unit gray-scale value of thepixel unit 201 is the mean value 122 of the gray-scale values of eachpixel 202. In step S503, a difference coefficient of the detection image is obtained based on the cell gradation of each pixel cell and the corresponding gradation range value described in the standard copper foil image. The standard copper foil image is likewise divided into pixel cells, and no pixel cell is assigned a gray scale value, e.g., 205-. The difference coefficient is the number of the pixel unit in the detected image whose unit gray-scale value is not in the corresponding gray-scale range, for example, the unit gray-scale value is 122, and the corresponding gray-scale range value is 133-135, then the difference coefficient of the detected image is increased by 1. In step S504, a defect label associated with the copper foil to be tested is generated based on the difference coefficient being greater than the threshold value. For example, if the difference coefficient is 1255 and the threshold value is 1200, the difference coefficient is greater than the threshold value, so that the copper foil to be tested can be determined as a defective product, and a defect label corresponding to the copper foil to be tested is generated.
According to an aspect of the present invention, there is provided a computer readable storage medium storing a program which, when executed, performs the steps of the above method.
Fig. 11 is a schematic structural diagram of a computer-readable storage medium of the present invention. Referring to fig. 11, aprogram product 800 for implementing the above method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable storage medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
In summary, the method and medium for detecting defects of copper foil in the present invention can extract the detection image of the copper foil to be detected, and compare the detection image with the standard copper foil image, and during the comparison process, the pixel unit of the detection image is used as the minimum comparison unit, so that the comparison speed can be increased, and the detection of the copper foils on the two sides can be completed in a short time
The foregoing is a more detailed description of the invention in connection with specific preferred embodiments and it is not intended that the invention be limited to these specific details. For those skilled in the art to which the invention pertains, several simple deductions or substitutions can be made without departing from the spirit of the invention, and all shall be considered as belonging to the protection scope of the invention.