Thin-film capacitor electrode image segmentation method and electronic device
By compressing, opening, binarizing, and segmenting the image of the thin-film capacitor electrode, the coordinates of the electrode corner points are determined, solving the problem of balancing efficiency and accuracy in the segmentation of thin-film capacitor electrodes, and realizing fast and accurate electrode segmentation and defect detection.
Patent Information
- Application Number
- CN202311047166.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-18
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2043-08-18
AI Technical Summary
In the manufacturing process of thin-film capacitors, existing technologies struggle to simultaneously achieve both high efficiency and high accuracy in electrode sheet segmentation, especially in scenarios where flexible materials are easily deformed and the number of electrode sheets is large, making it difficult to balance segmentation efficiency and accuracy.
By acquiring the base film image, compression, opening, binarization, and double-threshold edge segmentation are performed to determine the corner coordinates of the electrode sheet. The electrode sheet image area is then segmented based on the compression ratio and corner coordinates, and continuous edge lines are generated using a preset edge tracking strategy.
It enables rapid and accurate segmentation of independent electrode sheet regions under the deformation of flexible thin film materials, improving segmentation efficiency and accuracy, and is suitable for defect detection of electrode sheets.
Smart Images

Figure CN117291940B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer image processing technology, and more specifically, to a method for image segmentation of thin-film capacitor electrodes and an electronic device. Background Technology
[0002] In the field of image segmentation, different scenarios have different requirements for segmentation algorithms, making it difficult to use a single segmentation algorithm to suit all scenarios, especially when high efficiency and high accuracy are required, which significantly increases the difficulty of balancing these factors. In the manufacturing process of thin-film capacitors, it is usually necessary to inspect the electrode sheets (or internal electrodes) to ensure their quality. These electrode sheets are typically printed on a flexible base film, meaning a large number of electrode sheets are printed on a single base film. The base film, formed from flexible thin-film materials, is prone to deformation, and the sheer number of electrode sheets—hundreds of thousands or even more—makes it difficult to simultaneously meet the dual requirements of high segmentation efficiency and high segmentation accuracy, regardless of whether template matching, projection, or other methods are used, due to the large and dense number of segments and the inherent deformation and skewing characteristics of flexible materials. Summary of the Invention
[0003] In view of this, the purpose of this application is to provide a method and electronic device for segmenting thin-film capacitor electrode images, which is beneficial to improving the efficiency and accuracy of segmenting independent electrode sheet image areas from images.
[0004] To achieve the above technical objectives, the technical solution adopted in this application is as follows:
[0005] In a first aspect, embodiments of this application provide a method for segmenting images of thin-film capacitor electrodes, the method comprising:
[0006] Acquire the original image obtained by photographing the base film, wherein the base film includes multiple electrode sheets arranged in an array for fabricating thin-film capacitors;
[0007] The original image is compressed according to a preset compression ratio to obtain a compressed first image.
[0008] The first image is subjected to an opening operation to obtain the second image;
[0009] The second image is binarized to obtain the third image;
[0010] By using a preset dual-threshold processing strategy, edge segmentation is performed on the third image to obtain the edge segmentation map of the electrode sheet in the third image;
[0011] The corner coordinates of each electrode sheet are determined from the third image having the edge segmentation map;
[0012] Based on the preset compression ratio and the corner coordinates of each electrode, determine the corresponding corner coordinates of each electrode in the original image;
[0013] Based on the corner coordinates corresponding to the original image and the preset size of the electrode sheet, the image area of each electrode sheet is segmented from the original image.
[0014] In conjunction with the first aspect, in some optional implementations, the third image is edge-segmented using a preset dual-threshold processing strategy to obtain an edge segmentation map of the electrode sheet in the third image, including:
[0015] Determine the gradient magnitude and gradient direction of each pixel in the third image;
[0016] Pixels with gradient magnitudes greater than a first preset threshold are marked as first-class pixels representing strong edges.
[0017] Pixels whose gradient magnitude is greater than the second preset threshold and less than or equal to the first preset threshold are marked as second type of pixels representing weak edges, where the second preset threshold is less than the first preset threshold.
[0018] Pixels with gradient magnitudes less than or equal to the second preset threshold are marked as third-class pixels representing non-edges;
[0019] Using a preset edge tracking strategy, the edge segmentation map of the electrode sheet in the third image is obtained based on the first type of pixel points, the second type of pixel points, and the third type of pixel points.
[0020] In conjunction with the first aspect, in some optional implementations, an edge segmentation map of the electrode patch in the third image is obtained based on the first type of pixels, the second type of pixels, and the third type of pixels using a preset edge tracking strategy, including:
[0021] Add the first type of pixels from the first image to the edge result;
[0022] The second type of pixels adjacent to the first type of pixels are updated to new first type of pixels, and the new first type of pixels are added to the edge result;
[0023] Repeat the steps to update the second type of pixels adjacent to the first type of pixels to new first type of pixels, and add the new first type of pixels to the edge result, until all the second type of pixels have been traversed, wherein the pixels in the edge result form the edge segmentation map.
[0024] In conjunction with the first aspect, in some optional implementations, the second image is binarized to obtain a third image, including:
[0025] The foreground area in the second image is set to white, and the background area in the second image is set to black to obtain the third image.
[0026] In conjunction with the first aspect, in some optional embodiments, the outline of the edge segmentation map is two pixels wide and white, and determining the corner coordinates of each electrode sheet from the third image having the edge segmentation map includes:
[0027] Traverse the pixels with a grayscale value of 255 in the first image having the edge segmentation map;
[0028] If the grayscale value of the edge of the current pixel layer is 255, the grayscale value of the inner layer is 255, and the grayscale value of the inner second layer is the grayscale value of the electrode sheet, then the position of the current pixel is taken as the corner coordinate of an electrode sheet.
[0029] In conjunction with the first aspect, in some alternative embodiments, the corner coordinates include the coordinates of the upper left corner of the electrode sheet.
[0030] In conjunction with the first aspect, in some optional embodiments, each of the electrode patches is associated with a corresponding coordinate, and each of the electrode patches serves as a region of interest for electrode patch defect detection.
[0031] Secondly, embodiments of this application also provide an electronic device, which includes a processor and a memory coupled to each other. The memory stores a computer program, and when the computer program is executed by the processor, the electronic device performs the above-described method.
[0032] The invention employing the above technical solution has the following advantages:
[0033] In the technical solution provided in this application, an original image of the base film is acquired; the original image is compressed according to a preset compression ratio to obtain a compressed first image. Performing computational processing based on the compressed first image helps reduce computational load and improves image segmentation efficiency. Next, an opening operation is performed on the first image to obtain a second image; the second image is binarized to obtain a third image; edge segmentation is performed on the third image using a preset dual-threshold processing strategy to obtain an edge segmentation map of the electrode pieces in the third image, wherein the width of the edge lines in the edge segmentation map is at least two pixels wide; the corner coordinates of each electrode piece are determined from the third image with the edge segmentation map; based on the preset compression ratio and the corner coordinates of each electrode piece, the corresponding corner coordinates of each electrode piece in the original image are determined; based on the corresponding corner coordinates in the original image and the preset size of the electrode piece, the image area of each electrode piece is segmented from the original image. Thus, even when the base film is deformed or skewed, accurate segmentation can still be performed, thereby improving the accuracy and efficiency of segmenting independent electrode piece image areas from the original image. Attached Figure Description
[0034] This application can be further illustrated by the non-limiting embodiments given in the accompanying drawings. It should be understood that the following drawings only illustrate some embodiments of this application and should not be considered as limiting the scope. For those skilled in the art, other related drawings can be obtained from these drawings without any inventive effort.
[0035] Figure 1 This is a schematic flowchart of the thin-film capacitor electrode image segmentation method provided in the embodiments of this application.
[0036] Figure 2 A schematic diagram of the original image provided for an embodiment of this application.
[0037] Figure 3 This is a schematic diagram of a single electrode sheet provided in an embodiment of this application.
[0038] Figure 4 This is a schematic diagram of a single, binarized electrode sheet provided in an embodiment of this application.
[0039] Figure 5 A schematic diagram showing the comparison before and after edge segmentation of the binarized image provided in the embodiments of this application.
[0040] Figure 6 This is a schematic diagram of the edge segmentation of a single electrode sheet provided in an embodiment of this application.
[0041] Figure 7 This is a partial schematic diagram of the edge line of the electrode sheet provided in an embodiment of this application.
[0042] Figure 8 This is a schematic diagram of the positioning point at the upper left corner of the electrode sheet provided in the embodiment of this application. Detailed Implementation
[0043] The present application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that similar or identical parts are referred to by the same reference numerals in the drawings or description. Implementations not shown or described in the drawings are forms known to those skilled in the art. In the description of this application, terms such as "first" and "second" are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0044] Please refer to Figure 1 This application provides a method for segmenting images of thin-film capacitor electrodes, which can be applied to electronic devices and executed or implemented by the electronic devices.
[0045] The electronic device may include a processing module and a storage module. The storage module stores a computer program, which, when executed by the processing module, enables the electronic device to perform the corresponding steps in the thin-film capacitor electrode image segmentation method described below.
[0046] Electronic devices can be, but are not limited to, personal computers, servers, etc. The thin-film capacitor electrode image segmentation method may include the following steps:
[0047] Step 110: Obtain the original image of the base film obtained by photographing it, wherein the base film includes multiple electrode sheets arranged in an array for fabricating thin-film capacitors;
[0048] Step 120: Compress the original image according to a preset compression ratio to obtain a compressed first image;
[0049] Step 130: Perform an opening operation on the first image to obtain the second image;
[0050] Step 140: Binarize the second image to obtain the third image;
[0051] Step 150: Using a preset dual-threshold processing strategy, edge segmentation is performed on the third image to obtain the edge segmentation map of the electrode sheet in the third image;
[0052] Step 160: Determine the corner coordinates of each electrode sheet from the third image having the edge segmentation map;
[0053] Step 170: Determine the corner coordinates of each electrode in the original image based on the preset compression ratio and the corner coordinates of each electrode.
[0054] Step 180: Based on the corner coordinates corresponding to the original image and the preset size of the electrode sheet, the image area of each electrode sheet is segmented from the original image.
[0055] The steps of the thin-film capacitor electrode image segmentation method will be described in detail below:
[0056] In step 110, the electronic device can acquire the original image obtained from the camera in real time, or it can acquire the original image pre-stored in the storage module locally. The method of acquiring the original image is not specifically limited here. The processing module can be a GPU (Graphics Processing Unit), which can be used to execute the various steps of the method to perform computational processing on the image.
[0057] In step 120, the preset compression ratio can be flexibly set according to actual conditions, for example, it can be 10 times, 20 times, 40 times, etc. The electronic device can perform resizing processing on the GPU to compress the original image size to a smaller size. The smaller the compression, the less processing time. The image after compression is the first image.
[0058] In step 130, the GPU performs erosion and dilation processes on the first image sequentially to achieve an opening operation. The purpose of the opening operation is to remove burrs on the first image, so that the final edge segmentation is closer to the outer edge of the image.
[0059] In step 140, the image binarization method can be flexibly determined according to the actual situation. For example, step 140 may include:
[0060] The foreground area in the second image is set to white, and the background area in the second image is set to black to obtain the third image.
[0061] Understandably, in the second image, the foreground area typically refers to the area in the second image that serves as the electrode sheet. The background area refers to the area between the electrode sheets, or the area excluding the electrode sheets.
[0062] Setting the foreground area to white can be understood as setting the grayscale value of all pixels in the foreground area to 255.
[0063] Setting the background image area to black can be understood as setting the grayscale value of all pixels in the background image area to 0.
[0064] Please refer to the reference. Figure 2 , Figure 3 and Figure 4 , Figure 2 This can be understood as a schematic diagram of the original image obtained by a camera capturing the base film. Figure 3It can be understood as Figure 2 A schematic diagram of a single electrode sheet on the base film. Figure 4 It can be understood as Figure 3 A schematic diagram of the electrode sheet after binarization.
[0065] In this embodiment, step 150 may include:
[0066] Step 151: Determine the gradient magnitude and gradient direction of each pixel in the third image;
[0067] Step 152: Mark the pixels with gradient magnitude greater than the first preset threshold (which can be denoted as nHighThreshold, referring to the high threshold) as the first type of pixels representing strong edges.
[0068] Step 153: Mark the pixels whose gradient magnitude is greater than the second preset threshold (which can be denoted as nlowThreshold, meaning low threshold) and less than or equal to the first preset threshold as second type of pixels representing weak edges, where the second preset threshold is less than the first preset threshold.
[0069] Step 154: Mark the pixels with gradient magnitude less than or equal to the second preset threshold as third-class pixels that represent non-edges;
[0070] Step 155: Using a preset edge tracking strategy, obtain the edge segmentation map of the electrode sheet in the third image based on the first type of pixel points, the second type of pixel points, and the third type of pixel points.
[0071] In this embodiment, various preset thresholds (such as the first preset threshold, the second preset threshold, etc.) can be flexibly determined according to the actual situation.
[0072] In this embodiment, gradient magnitude can be understood as the rate of change of grayscale value / pixel value in an image. Gradient magnitude represents the intensity of the change in grayscale value / pixel value, and can be understood as the edge intensity in the image. By performing a convolution operation on the image, the gradient magnitude of each pixel can be calculated.
[0073] The gradient direction can be understood as the direction in which the grayscale value / pixel value of a pixel changes in an image; that is, the edge direction in the image. The gradient direction is obtained by calculating the difference in pixel values around the pixel.
[0074] Please refer to the reference. Figure 4 , Figure 5 , Figure 6 and Figure 7 . Figure 5 (a) can be understood as Figure 4 In the simplified microscopic diagram, each cell represents a pixel. Figure 5 (b) can be understood as Figure 6 Simplified microscopic diagram, Figure 5 (b) The black pixel in the middle can be understood as Figure 6 The black area surrounded by a white border, specifically, Figure 5 (b) is Figure 5 (a) Schematic diagram after edge segmentation.
[0075] Please refer to this again. Figure 5 The implementation process of steps 151 to 154 can be as follows:
[0076] When calculating the gradient magnitude, the coordinates of any pixel in the image are denoted as (x, y). The gradient of that pixel in the x-direction is then recorded as:
[0077] float gx = pucSrcImg[(y-1)*nSrcWidth+x+1] (the position of the current pixel in the upper right) + 2*pucSrcImg[y*nSrcWidth+x+1] (the position of the current pixel in the right) + pucSrcImg[(y+1)*nSrcWidth+x+1] (the position of the current pixel in the lower right) - pucSrcImg[(y-1)*nSrcWidth+x-1] (the position of the current pixel in the upper left) - 2*pucSrcImg[y*nSrcWidth+x-1] (the position of the current pixel in the left) - pucSrcImg[(y+1)*nSrcWidth+x-1] (the position of the current pixel in the lower left).
[0078] The gradient of a pixel in the y-direction is denoted as:
[0079] float gy = pucSrcImg[(y+1)*nSrcWidth+x-1] (referring to the position of the current pixel in the lower left) + 2*pucSrcImg[(y+1)*nSrcWidth+x] (referring to the position below the current pixel) + pucSrcImg[(y+1)*nSrcWidth+x+1] (referring to the position of the current pixel in the lower right) - pucSrcImg[(y-1)*nSrcWidth+x-1] (referring to the position of the current pixel in the upper left) - 2*pucSrcImg[(y-1)*nSrcWidth+x] (referring to the position above the current pixel) - pucSrcImg[(y-1)*nSrcWidth+x+1] (referring to the position of the current pixel in the upper right).
[0080] The gradient magnitude of a pixel is denoted as:
[0081] fGradient = sqrtf(gx*gx+gy*gy), where the sqrtf() function is used to calculate the square root.
[0082] In electronic devices, GPUs use parallel kernel functions to determine the gradient magnitude fGradient of a pixel (x, y):
[0083] If fGradient>nHighThreshold (referring to the first preset threshold), set the pixel value of that point to white (255) and mark that pixel as a first-class pixel representing a strong edge;
[0084] If nlowThreshold<fGradient≤nHighThreshold, then the pixel is marked as a second type of pixel representing a weak edge. This means that such pixels may be edges, but further verification is needed.
[0085] If fGradient≤nlowThreshold, then the pixel is marked as a third-class pixel representing a non-edge, and its value is set to black (0). Figure 5 (b) The black cell in the center means that such pixels are not edge points, or are considered to be noisy or cluttered edges.
[0086] Step 155 uses a preset edge tracking strategy to obtain an edge segmentation map of the electrode patch in the third image based on the first type of pixels, the second type of pixels, and the third type of pixels, including:
[0087] Step 1551: Add the first type of pixels in the first image to the edge result;
[0088] Step 1552: Update the second type of pixels adjacent to the first type of pixels to new first type of pixels, and add the new first type of pixels to the edge result;
[0089] Repeat step 1552 to update the second type of pixels adjacent to the first type of pixels to new first type of pixels, and add the new first type of pixels to the edge result, until all the second type of pixels have been traversed, wherein the pixels in the edge result form the edge segmentation map.
[0090] Understandably, for pixels marked as weak edges (referring to second-type pixels), if there are pixels marked as strong edges (referring to first-type pixels) around them, then the weak-edge pixels are remarked as strong edges. This process is called edge tracking. Edge tracking can connect weak edges to strong edges, forming continuous edge lines. By repeating step 1552, all weak edge points can be processed.
[0091] In this embodiment, by using dual threshold processing, edge regions can be distinguished from noisy and cluttered edges, and by edge tracking, continuous edge lines can be generated, thereby obtaining more accurate and robust edge detection results.
[0092] Please refer to the reference. Figure 6 and Figure 7 , Figure 7 It can be understood as Figure 6 The upper part is a simplified microscopic diagram. Figure 7 Each cell represents a pixel. The outline of the edge segmentation map is two pixels wide and is white, as shown below. Figure 7 The two layers of white pixels shown represent the edge line, which can be equated with... Figure 6 The white border in the image. In step 160, determining the corner coordinates of each electrode piece from the third image having the edge segmentation map includes:
[0093] Traverse the pixels with a grayscale value of 255 in the first image having the edge segmentation map;
[0094] If the grayscale value of the edge of the current pixel layer is 255, the grayscale value of the inner layer is 255, and the grayscale value of the inner second layer is the grayscale value of the electrode sheet, then the position of the current pixel is taken as the corner coordinate of an electrode sheet.
[0095] Understandably, since the pixel value / grayscale value at the edge of each electrode sheet is set to 255, and it is wrapped in two layers, as... Figure 7 As shown, when the coordinates of the first top-left corner point are reached, two conditions are set based on those coordinates:
[0096] 1) The edge pixel value of the first layer is 255, and the edge pixel value of the inner layer is 255;
[0097] 2) The inner second layer edge pixels are 0.
[0098] Only pixels that simultaneously meet the above two conditions are designated as the top left corner of the electrode sheet; otherwise, the traversal continues in the first image.
[0099] Please refer to this again. Figure 7 If the corner point being searched is the top-left corner point, if the current pixel is... Figure 7In the white cell A, the edge pixels of the first layer can be pixel A, the five pixels to the left of pixel A in the same row, and the five pixels at the bottom of pixel A in the same column. The edge pixels of the inner layer are the bottom-right pixel B adjacent to the current pixel, the five pixels to the left of pixel B in the same row, and the five pixels at the bottom of pixel B in the same column. The edge pixels of the inner second layer are the bottom-right pixel C adjacent to pixel B, the five pixels to the left of pixel C in the same row, and the five pixels at the bottom of pixel C in the same column. This helps reduce the amount of computation when finding corner points.
[0100] exist Figure 7 In the image, the white cell A in the upper left corner is the pixel that satisfies both of the above conditions, and this pixel is the upper left corner of the electrode.
[0101] In step 170, after obtaining the corner coordinates of each electrode in the third image, an interpolation algorithm can be used to perform inverse coordinate calculations based on a preset compression ratio, thereby obtaining the corner coordinates of each electrode on the original image.
[0102] The corner coordinates on the original image can be directly used as positioning points for image segmentation, or the corner coordinates can be offset. For example, the corner coordinates can be slightly offset towards the upper left corner of the electrode (e.g., offset by 1-5 pixels) to obtain... Figure 8 The positioning points are shown. Among them, Figure 8 The white dot in the upper left corner of the middle electrode plate is the positioning point.
[0103] In step 180, the size of each electrode sheet on the same base film is usually fixed, and the operator can obtain the preset size of the electrode sheet through actual measurement. When performing image segmentation, the original image can be cropped based on the corresponding corner coordinates (or positioning points) and cropping boxes in the original image.
[0104] The size of the cutting frame can be the same as or slightly larger than the preset size of the electrode sheet. The size of the cutting frame can be flexibly designed according to the actual situation, as long as the cutting frame can only cut a complete electrode sheet image area and does not include the image areas of other electrode sheets. In this way, independent electrode sheet image areas can be obtained.
[0105] The image segmentation / cropping method can be understood as follows: Since the coordinates of the top-left corner of each electrode patch are already determined in the original image, each coordinate is then used to extract pixels within the cropping frame area (this can be understood as offsetting the corner coordinates to segment each electrode patch). This yields all pixels within the cropping frame area, thus forming the image region of a single electrode patch. Based on this method, the inventors performed image segmentation on an original image containing 100,000 electrode patches with a size of 12k×12k, with a segmentation time of approximately 150ms.
[0106] Based on the above design, this solution can quickly and accurately locate and separate each electrode sheet, and it can also achieve precise segmentation of individual electrode sheets even when the base film of the flexible thin film material is deformed or skewed. The segmented individual electrode sheets are associated with coordinate positions for defect detection, such as detecting appearance defects like enlargement or burrs. The detection method is conventional and will not be elaborated here. Associating the electrode sheets with coordinate positions facilitates the location of defective electrode sheets.
[0107] In this embodiment, the processing module can be an integrated circuit chip with signal processing capabilities. The processing module can be a general-purpose processor. For example, the processor can be a Central Processing Unit (CPU), GPU, Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application.
[0108] The storage module can be, but is not limited to, random access memory, read-only memory, programmable read-only memory, erasable programmable read-only memory, electrically erasable programmable read-only memory, etc. In this embodiment, the storage module can be used to store the original image, the image area of each electrode sheet, corner coordinates, and dual-threshold processing strategy, etc. Of course, the storage module can also be used to store programs, which the processing module executes after receiving an execution instruction.
[0109] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the electronic device described above can be referred to the corresponding steps in the aforementioned method, and will not be elaborated further here.
[0110] Based on the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by hardware or by using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application can be embodied in the form of a software product. This software product can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, mobile hard drive, etc.) and includes several instructions to cause a computer device (such as a personal computer, electronic device, or network device, etc.) to execute the methods described in the various implementation scenarios of this application.
[0111] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device and method embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which includes one or more executable instructions for implementing a specified logical function. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions. Furthermore, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0112] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method for segmenting images of thin-film capacitor electrodes, characterized in that, The method includes: Acquire the original image obtained by photographing the base film, wherein the base film includes multiple electrode sheets arranged in an array for fabricating thin-film capacitors; The original image is compressed according to a preset compression ratio to obtain a compressed first image. The first image is subjected to an opening operation to obtain the second image; The second image is binarized to obtain the third image; By using a preset dual-threshold processing strategy, edge segmentation is performed on the third image to obtain the edge segmentation map of the electrode sheet in the third image; The corner coordinates of each electrode sheet are determined from the third image having the edge segmentation map; Based on the preset compression ratio and the corner coordinates of each electrode, determine the corresponding corner coordinates of each electrode in the original image; Based on the corner coordinates corresponding to the original image and the preset size of the electrode sheet, the image area of each electrode sheet is segmented from the original image.
2. The method according to claim 1, characterized in that, Using a preset dual-threshold processing strategy, edge segmentation is performed on the third image to obtain an edge segmentation map of the electrode sheet in the third image, including: Determine the gradient magnitude and gradient direction of each pixel in the third image; Pixels with gradient magnitudes greater than a first preset threshold are marked as first-class pixels representing strong edges. Pixels whose gradient magnitude is greater than the second preset threshold and less than or equal to the first preset threshold are marked as second type of pixels representing weak edges, where the second preset threshold is less than the first preset threshold. Pixels with gradient magnitudes less than or equal to the second preset threshold are marked as third-class pixels representing non-edges; Using a preset edge tracking strategy, the edge segmentation map of the electrode sheet in the third image is obtained based on the first type of pixel points, the second type of pixel points, and the third type of pixel points.
3. The method according to claim 2, characterized in that, Using a preset edge tracking strategy, an edge segmentation map of the electrode patch in the third image is obtained based on the first type of pixels, the second type of pixels, and the third type of pixels, including: Add the first type of pixels from the first image to the edge result; The second type of pixels adjacent to the first type of pixels are updated to new first type of pixels, and the new first type of pixels are added to the edge result; Repeat the steps to update the second type of pixels adjacent to the first type of pixels to new first type of pixels, and add the new first type of pixels to the edge result, until all the second type of pixels have been traversed, wherein the pixels in the edge result form the edge segmentation map.
4. The method according to claim 1, characterized in that, The second image is binarized to obtain the third image, which includes: The foreground area in the second image is set to white, and the background area in the second image is set to black to obtain the third image.
5. The method according to claim 4, characterized in that, The outline of the edge segmentation map is two pixels wide and white. Determining the corner coordinates of each electrode piece from the third image having the edge segmentation map includes: Traverse the pixels with a grayscale value of 255 in the first image having the edge segmentation map; If the grayscale value of the edge of the current pixel layer is 255, the grayscale value of the inner layer is 255, and the grayscale value of the inner second layer is the grayscale value of the electrode sheet, then the position of the current pixel is taken as the corner coordinate of an electrode sheet.
6. The method according to any one of claims 1-5, characterized in that, The corner coordinates include the coordinates of the upper left corner of the electrode sheet.
7. The method according to any one of claims 1-5, characterized in that, Each of the electrode patches is associated with a corresponding coordinate region, and each of the electrode patch regions serves as a region of interest for electrode patch defect detection.
8. An electronic device, characterized in that, The electronic device includes a processor and a memory coupled together, the memory storing a computer program that, when executed by the processor, causes the electronic device to perform the method as described in any one of claims 1-7.
Citation Information
Patent Citations
Lithium battery pole piece defect detection method and system
CN114022418A
System and Method for Detecting Objects in an Image
US20170083762A1