Image processing method and device, computer device and medium
By preprocessing the battery cell images, performing computer vision library detection, pixel enhancement, and median filtering, the problems of image blurring and background interference in X-ray inspection equipment were solved, thus improving the accuracy and quality of battery cell electrode inspection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG LYRIC ROBOT INTELLIGENT AUTOMATION CO LTD
- Filing Date
- 2023-06-28
- Publication Date
- 2026-07-24
AI Technical Summary
Existing X-ray inspection equipment suffers from problems such as blurred imaging, unclear electrodes, and background interference in the inspection of battery cell electrodes, making it difficult to predict the electrode endpoints and affecting the accuracy of battery cell testing.
By preprocessing the battery cell image, performing computer vision library detection, pixel enhancement operations, and median filtering, noise is removed and image clarity and edge information are enhanced.
This improves the accuracy of cell testing, ensures that the electrode endpoints are clearly visible, and enhances the accuracy of cell quality testing.
Smart Images

Figure CN116883336B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to an image processing method, apparatus, computer equipment, and medium. Background Technology
[0002] The manufacturing process of battery cells often involves multiple processing steps. Only after going through these layers of processes can a battery cell that meets quality requirements be obtained. Therefore, quality inspection of the battery cells during manufacturing becomes particularly important. On the battery cell production line, multiple inspections are typically performed on the cells, one of which is checking the alignment of the electrode plates. Currently, X-ray inspection equipment is generally used for non-destructive testing of the battery cells, thus avoiding damage and saving costs.
[0003] However, during the process of testing battery cells using X-ray testing equipment, there are problems such as blurred images of some battery cells, unclear electrode plates, and background interference between electrode plates. This affects the subsequent prediction of the electrode endpoints of the battery cells, making it difficult to predict the electrode endpoints, which in turn leads to a decrease in the accuracy of battery cell testing and affects the quality of the battery cells. Summary of the Invention
[0004] The main objective of this application is to provide an image processing method, apparatus, computer equipment, and medium that can avoid the impact of blurred battery cell images and improve the detection accuracy of battery cells.
[0005] To achieve the above objectives, a first aspect of this application provides an image processing method, the method comprising:
[0006] The acquired cell images are preprocessed to obtain the cell image to be tested, wherein the cell image is obtained by image acquisition of the cell to be tested;
[0007] The image of the battery cell to be tested is input into a preset computer vision library for image detection, and the first image is output.
[0008] Perform pixel enhancement operations on the pixels in the first image to obtain the second image;
[0009] The target image is obtained by performing median filtering on the second image based on the computer vision library.
[0010] In some embodiments, the preprocessing of the acquired cell image to obtain the cell image to be tested includes:
[0011] The average grayscale value of the battery cell image was tested.
[0012] The image of the battery cell that has passed the average grayscale test is rotated based on a preset rotation angle to obtain the image of the battery cell to be tested.
[0013] In some embodiments, the computer vision library includes a first convolution operator and a second convolution operator; the step of inputting the image of the battery cell to be tested into a preset computer vision library for image detection and outputting a first image includes:
[0014] The image of the battery cell to be tested is input into a preset computer vision library for grayscale conversion to obtain a grayscale image;
[0015] The grayscale image is subjected to mean filtering based on the first convolution operator;
[0016] Edge detection is performed on the grayscale image after mean filtering using the second convolution operator to obtain the first image.
[0017] In some embodiments, performing pixel enhancement operations on the pixels in the first image to obtain a second image includes:
[0018] The position of all pixels in the first image is calculated to obtain a set of pixel coordinates, wherein the set of pixel coordinates includes multiple pixel coordinates;
[0019] Calculate the grayscale value of all pixel coordinates in the pixel coordinate set to obtain a grayscale value set.
[0020] The gray value set is filtered based on a preset gray value threshold to obtain a first set and a second set, wherein all gray values in the first set are less than the gray value threshold, and all gray values in the second set are greater than the gray value threshold.
[0021] The brightness of the first image is adjusted based on the first set and the second set to obtain the second image.
[0022] In some embodiments, performing median filtering on the second image based on the computer vision library to obtain the target image includes:
[0023] The second image is input into the computer vision library, so that the computer vision library divides the pixels in the second image into multiple pixel partitions according to the pixel coordinates.
[0024] For each pixel partition, calculate the pixel value of all pixels in the pixel partition that correspond to the pixel coordinates;
[0025] Sort all the pixel values sequentially to obtain a sorted sequence;
[0026] The target median is determined according to the sorting sequence, and the pixel values of the pixel partitions are updated according to the target median until all pixel partitions are traversed.
[0027] Generate the target image based on all updated pixel partitions.
[0028] In some embodiments, adjusting the brightness of the first image according to the first set and the second set to obtain the second image includes:
[0029] For each gray value in the first set, calculate the first gray value difference between the gray value threshold and the gray value, and subtract the first gray value difference from the gray value threshold to obtain the first feature value;
[0030] Update the grayscale values in the first set based on the first feature value;
[0031] For each gray value in the second set, calculate the second gray value difference between the gray value and the gray value threshold, and add the gray value threshold and the second gray value difference to obtain the second feature value;
[0032] Update the grayscale values in the second set according to the second feature value;
[0033] The second image is generated based on the updated first set and the second set.
[0034] In some embodiments, the step of performing edge detection on the grayscale image after mean filtering based on the second convolution operator to obtain a first image includes:
[0035] The step of performing edge detection on the grayscale image after mean filtering based on the second convolution operator to obtain the first image includes:
[0036] Set the image depth parameters based on the grayscale image after mean filtering;
[0037] The image depth parameters, the grayscale image after mean filtering, and the preset convolution kernel are input into the second convolution operator for edge detection to obtain the first image.
[0038] A second aspect of this application provides an image processing apparatus, the apparatus comprising:
[0039] The image processing module is used to preprocess the acquired cell image to obtain the cell image to be tested, wherein the cell image is obtained by image acquisition of the cell to be tested;
[0040] The image detection module is used to input the image of the battery cell to be tested into a preset computer vision library for image detection and output a first image;
[0041] The pixel enhancement module is used to perform pixel enhancement operations on the pixels in the first image to obtain the second image;
[0042] The median filtering module is used to perform median filtering on the second image based on the computer vision library to obtain the target image.
[0043] A third aspect of this application provides a computer device including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor is used to perform an image processing method as described in any one of the embodiments of the first aspect of this application.
[0044] A fourth aspect of this application provides a storage medium, which is a computer-readable storage medium storing a computer program. When the computer program is executed by a computer, the computer is used to perform the image processing method as described in any one of the embodiments of the first aspect of this application.
[0045] The image processing method, apparatus, computer equipment, and medium proposed in this application first preprocess the acquired battery cell images to eliminate the influence of images with imaging errors and preprocess all battery cell images into a uniform specification to facilitate subsequent detection of battery cell images, thus obtaining the battery cell image to be tested. Then, the battery cell image to be tested is input into a preset computer vision library for image detection, and a first image is output, thereby improving computational efficiency, simplifying the image processing task, and removing the influence of noise in the battery cell image to be tested, making the image clearer. Afterwards, pixel enhancement operations are performed on the pixels in the first image to obtain a second image, thereby enhancing image details and making the edge contours in the image clearly visible, avoiding the influence of image blurring. Finally, median filtering is performed on the second image based on the computer vision library to obtain the target image, thereby removing isolated noise, preserving edge information, effectively removing isolated noise pixels, and improving the detection accuracy of the battery cell. Attached Figure Description
[0046] Figure 1 This is a flowchart of an image processing method provided in one embodiment of this application;
[0047] Figure 2 yes Figure 1 The detailed flowchart of step S101;
[0048] Figure 3 yes Figure 1 The detailed flowchart of step S102;
[0049] Figure 4 yes Figure 1The detailed flowchart of step S103;
[0050] Figure 5 yes Figure 1 The detailed flowchart of step S104;
[0051] Figure 6 yes Figure 4 The detailed flowchart of step S404;
[0052] Figure 7 yes Figure 3 The detailed flowchart of step S303;
[0053] Figure 8 This is a schematic diagram of the structure of the image processing apparatus provided in the embodiments of this application;
[0054] Figure 9 This is a schematic diagram of the hardware structure of the computer device provided in the embodiments of this application. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0056] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0058] The image processing method provided in this application can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, or smartwatch, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms; the software can be an application implementing the above method, but is not limited to the above forms.
[0059] The embodiments of this application can be used in numerous general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer computer devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0060] The manufacturing process of battery cells often involves multiple processing steps. Only after going through these layers of processes can a battery cell that meets quality requirements be obtained. Therefore, quality inspection of the battery cells during manufacturing becomes particularly important. On the battery cell production line, multiple inspections are typically performed on the cells, one of which is checking the alignment of the electrode plates. Currently, X-ray inspection equipment is generally used for non-destructive testing of the battery cells, thus avoiding damage and saving costs.
[0061] However, during the process of testing battery cells using X-ray testing equipment, there are problems such as blurred images of some battery cells, unclear electrode plates, and background interference between electrode plates. This affects the subsequent prediction of the electrode endpoints of the battery cells, making it difficult to predict the electrode endpoints, which in turn leads to a decrease in the accuracy of battery cell testing and affects the quality of the battery cells.
[0062] To address the aforementioned issues, this embodiment provides an image processing method, apparatus, computer device, and medium. First, the acquired battery cell images are preprocessed to eliminate the influence of images with imaging errors. All battery cell images are preprocessed to a uniform specification for subsequent detection, resulting in a battery cell image to be tested. This image is then input into a preset computer vision library for image detection, outputting a first image. This improves computational efficiency, simplifies the image processing task, and removes noise from the battery cell image, making the image clearer. Next, pixel enhancement is performed on the pixels in the first image to obtain a second image, enhancing image details and making edge contours clearly visible, avoiding the effects of image blurring. Finally, median filtering is applied to the second image based on the computer vision library to obtain the target image, thereby removing isolated noise, preserving edge information, effectively removing isolated noise pixels, and improving the detection accuracy of the battery cell.
[0063] The image processing method of this application embodiment will be further described below with reference to the accompanying drawings.
[0064] Please refer to Figure 1 , Figure 1 This is a flowchart of a specific method of the image processing method provided in the embodiments of this application. In some embodiments, the image processing method includes, but is not limited to, steps S101 to S104.
[0065] Step S101: Preprocess the acquired cell image to obtain the cell image to be tested;
[0066] It should be noted that the cell image is obtained by image acquisition of the cell under test.
[0067] In some embodiments, the acquired cell images are preprocessed to form images of uniform specifications to obtain the cell images to be tested, thereby facilitating subsequent identification of the cell images to be tested and improving computational efficiency.
[0068] Step S102: Input the image of the battery cell to be tested into a preset computer vision library for image detection and output the first image;
[0069] In some embodiments, the image of the battery cell to be tested is input into a preset computer vision library for image detection to remove noise from the image of the battery cell to be tested, making the image clearer and avoiding the influence of blurry images. The first image is then output to enhance specific feature information and achieve edge detection and edge sharpening of the feature information.
[0070] It should be noted that the computer vision library can be OpenCV (Open Source Computer Vision Library), PIL (Python Imaging Library), etc., and the computer vision library in this embodiment is OpenCV.
[0071] Step S103: Perform pixel enhancement operation on the pixels in the first image to obtain the second image;
[0072] In some embodiments, pixel enhancement operations are performed on all pixels in the first image, thereby making bright features brighter and dark features darker, thus distinguishing different features, improving the clarity of different features in the first image, enhancing image details, making the edge contours in the image clearly visible, and avoiding the effects of image blurring.
[0073] Step S104: Perform median filtering on the second image based on a computer vision library to obtain the target image.
[0074] In some embodiments, a median filtering operation is performed on the second image based on a computer vision library to obtain the target image, thereby removing isolated noise, preserving edge information, effectively removing isolated noise pixels, and preserving the edge information of the image while removing noise, thereby improving the accuracy of cell detection.
[0075] Please refer to Figure 2 , Figure 2 This is a flowchart illustrating step S101 provided in an embodiment of this application. In some embodiments, step S101 includes, but is not limited to, steps S201 and S202.
[0076] Step S201: Perform an average grayscale test on the cell image;
[0077] In some embodiments, the average grayscale is used to determine whether a battery cell image is a testable image. In the process of performing average grayscale testing on battery cell images, the average grayscale of the battery cell images is first calculated to obtain the average grayscale corresponding to each battery cell image. Then, the average grayscale of all battery cell images is compared with the preset average grayscale to determine whether the battery cell images meet the test conditions, thereby achieving preliminary screening of battery cell images and further improving the accuracy of battery cell image detection.
[0078] It should be noted that during the average grayscale test of the battery cell image, the sum of each pixel in the battery cell image needs to be calculated and then divided by the total number of pixels in the battery cell image to obtain the average grayscale value of the battery cell image. Finally, the average grayscale value is compared with the preset average grayscale value to evaluate the overall brightness and exposure of the image and detect whether the battery cell image has been affected by lighting or other factors. The preset average grayscale value can be calculated based on the image that has passed the average grayscale test before, and this embodiment does not impose specific limitations.
[0079] It is understandable that during the process of acquiring images of the battery cell under test, there may be cases where the acquired images are completely black or completely white. Therefore, it is necessary to perform an average grayscale test on the acquired battery cell images to avoid interference from completely black or completely white images.
[0080] Step S202: Rotate the image of the battery cell that has passed the average grayscale test based on a preset rotation angle to obtain the image of the battery cell to be tested.
[0081] In some embodiments, the cell image that has passed the average grayscale test is rotated according to a preset rotation angle, which facilitates subsequent image detection, avoids errors caused by the initial image placement angle, and obtains the cell image to be tested, thereby speeding up the subsequent process of cell image detection.
[0082] It should be noted that the rotation angle can be selected according to the tester's needs, such as 90 degrees, 45 degrees, 270 degrees, etc. This embodiment does not impose specific limitations.
[0083] It is worth noting that before rotating the cell image, multiple cell images can be resized to unify all cell images that have passed the average grayscale test to a specified image size, thereby improving the efficiency of subsequent image detection.
[0084] Please refer to Figure 3 , Figure 3 This is a flowchart illustrating step S102 as provided in an embodiment of this application. In some embodiments, step S102 may include, but is not limited to, steps S301 and S303.
[0085] It should be noted that the computer vision library includes a first convolution operator and a second convolution operator, wherein the first convolution operator can be the blur operator and the second convolution operator can be the filter2D operator.
[0086] Step S301: Input the image of the battery cell to be tested into a preset computer vision library for grayscale conversion to obtain a grayscale image;
[0087] In some embodiments, the image of the battery cell under test is input into a computer vision library for grayscale conversion, thereby reducing memory consumption and improving computational efficiency.
[0088] It should be noted that during the grayscale conversion of the image of the battery cell under test, the three channel values of each pixel are first obtained from the image of the battery cell under test, namely the blue value, green value and red value. Then, the three channel values of each pixel are weighted and averaged to obtain the corresponding grayscale value. Finally, the calculated grayscale value is assigned to the corresponding pixel position in the image of the battery cell under test, thereby completing the grayscale conversion process of each pixel value in the entire image of the battery cell under test, avoiding interference from color information and improving the image processing efficiency.
[0089] It is understood that in this embodiment, grayscale conversion can be performed using the cvtColor(src,dst,COLOR_BGR2GRAY) operator from the computer vision library.
[0090] Step S302: Perform mean filtering on the grayscale image based on the first convolution operator;
[0091] In some embodiments, after obtaining the grayscale image, the grayscale image is subjected to mean filtering by the first convolution operator to remove noise in the grayscale image, making the image clearer and avoiding the influence of a blurred image.
[0092] It should be noted that in the process of mean filtering the grayscale image, the first convolution operator performs a convolution operation on the grayscale image, multiplying the convolution kernel with each pixel and its neighborhood in the grayscale image element by element, summing all the products, and placing the final result in the corresponding position in the grayscale image, until all pixels in the grayscale image are traversed, thereby reducing the size of the grayscale image, reducing prominent details in the grayscale image, and achieving smoothing of the grayscale image.
[0093] Step S303: Perform edge detection on the grayscale image after mean filtering based on the second convolution operator to obtain the first image.
[0094] In some embodiments, edge detection is performed on the grayscale image after mean filtering according to the second convolution operator, thereby changing the features and specific information of the grayscale image, achieving the filtering effect of the grayscale image, obtaining a first image, enhancing specific feature information, and realizing edge detection and edge sharpening of feature information.
[0095] Please refer to Figure 4 , Figure 4 This is a flowchart illustrating step S103 as provided in an embodiment of this application. In some embodiments, step S103 includes, but is not limited to, steps S401 and S404.
[0096] Step S401: Calculate the position of all pixels in the first image to obtain a set of pixel coordinates;
[0097] It should be noted that the set of pixel coordinates includes the coordinates of multiple pixel points.
[0098] Step S402: Calculate the grayscale value of all pixel coordinates in the pixel coordinate set to obtain the grayscale value set;
[0099] Step S403: Filter the grayscale value set based on a preset grayscale value threshold to obtain a first set and a second set;
[0100] It should be noted that all gray values in the first set are less than the gray value threshold, while all gray values in the second set are greater than the gray value threshold.
[0101] Step S404: Adjust the brightness of the first image according to the first set and the second set to obtain the second image.
[0102] In steps S401 to S404 of some embodiments, the position of all pixels in the first image is calculated to obtain a set of pixel coordinates, wherein the set of pixel coordinates includes the pixel coordinates of all pixels in the first image. Then, grayscale values are calculated for all pixel coordinates in the set of pixel coordinates to obtain a set of grayscale values, which includes the grayscale values of all pixel coordinates. After that, the set of grayscale values is filtered according to a grayscale value threshold to obtain a first set and a second set. Grayscale values less than the grayscale value threshold are assigned to the first set, and grayscale values greater than the grayscale value threshold are assigned to the second set. That is, the brighter features and darker features in the first image are divided into two sets. Finally, the brightness of the first set and the second set is adjusted in the first image to obtain the second image, thereby making the bright and dark features in the first image clearer and avoiding the influence of image blurring.
[0103] It should be noted that the grayscale threshold is a range selected from 0 to 255, which can be set by the tester according to their needs. This embodiment does not impose any specific restrictions.
[0104] It is worth noting that this embodiment will delete pixels with gray values exceeding the range of 0-255.
[0105] Please refer to Figure 5 , Figure 5 This is a flowchart illustrating step S104 as provided in an embodiment of this application. In some embodiments, step S104 includes, but is not limited to, steps S501 and S505.
[0106] Step S501: Input the second image into the computer vision library so that the computer vision library can divide the pixels in the second image into multiple pixel partitions based on the pixel coordinates.
[0107] Step S502: For each pixel partition, calculate the pixel value of all pixels in the pixel partition that correspond to the pixel coordinates.
[0108] Step S503: Sort all pixel values sequentially to obtain a sorted sequence;
[0109] Step S504: Determine the target median based on the sorting sequence, and update the pixel values of the pixel partitions based on the target median until all pixel partitions have been traversed.
[0110] Step S505: Generate the target image based on all updated pixel partitions.
[0111] In some embodiments, steps S501 to S505 involve inputting the second image into a computer vision library for median filtering. This allows the computer vision library to divide the pixels in the second image into pixel partitions based on pixel coordinates. Each pixel and its surrounding pixels are divided into a pixel partition, where each pixel partition contains an odd number of pixels. For each pixel partition, the pixel values of all pixels corresponding to the pixel coordinates within that partition are calculated. Then, all pixel values are sorted sequentially to obtain a sorted sequence. Finally, the target median, i.e., the middle value in the sorted sequence, is determined based on the sorted sequence. The pixel values of the pixel partitions are updated based on the target median, and the target median is placed at the corresponding position in the second image. Steps S501 to S504 are repeated until all pixel partitions are traversed. A target image is generated based on all updated pixel partitions, thereby removing isolated noise from the second image while preserving the image's edge information, thus improving the accuracy of cell detection.
[0112] Please refer to Figure 6 , Figure 6 This is a flowchart illustrating step S404 as provided in an embodiment of this application. In some embodiments, step S404 includes, but is not limited to, steps S601 and S605.
[0113] Step S601: For each gray value in the first set, calculate the gray value threshold and the first gray value difference, and subtract the gray value threshold from the first gray value difference to obtain the first feature value;
[0114] Step S602: Update the grayscale values in the first set according to the first feature value;
[0115] Step S603: For each gray value in the second set, calculate the second gray value difference between the gray value and the gray value threshold, and add the gray value threshold and the second gray value difference to obtain the second feature value;
[0116] Step S604: Update the grayscale values in the second set according to the second feature value;
[0117] Step S605: Generate a second image based on the updated first set and the second set.
[0118] In steps S601 to S605 of some embodiments, for each gray value in the first set, a first gray value difference between the gray value threshold and the gray value is calculated, and the gray value threshold and the first gray value difference are subtracted to obtain a first feature value. Then, the gray values in the first set are updated according to the first feature value, thereby reducing the gray values of the pixels in the first set. For each gray value in the second set, a second gray value difference between the gray value and the gray value threshold is calculated, and the gray value threshold and the second gray value difference are added to obtain a second feature value. Then, the gray values in the second set are updated according to the second feature value, thereby increasing the gray values of the pixels in the second set. Finally, a second image is generated based on the updated first set and second set, thereby making the bright features in the image of the battery cell under test brighter and the dark features darker, making the contrast between the positive and negative electrodes of the battery cell under test clearer and improving the detection accuracy of the battery cell under test.
[0119] It should be noted that steps S601 and S603 can occur simultaneously or sequentially, and no specific restrictions are imposed in this embodiment.
[0120] Please refer to Figure 7 , Figure 7 This is a flowchart illustrating step S303 as provided in an embodiment of this application. In some embodiments, step S303 includes, but is not limited to, steps S701 and S702.
[0121] Step S701: Set the image depth parameters based on the grayscale image after mean filtering.
[0122] Step S702: Input the image depth parameters, the grayscale image after mean filtering, and the preset convolution kernel into the second convolution operator to perform edge detection and obtain the first image.
[0123] In some embodiments, image depth parameters are set according to the grayscale image after mean filtering, so that the depth of the input image is the same as the depth of the output image. Then, the image depth parameters, the grayscale image after mean filtering, and the preset convolution kernel are input into the second convolution operator for edge detection to obtain the first image. This realizes edge detection of the grayscale image on the X and Y axes, thereby changing the features and specific information of the grayscale image and achieving the filtering effect of the grayscale image.
[0124] It should be noted that the convolution kernel in step S702 is a 3x3 matrix kernel. This matrix is an improvement on Sobel edge detection in the y-direction, which can more accurately realize edge detection of grayscale images.
[0125] Please see Figure 8 This application also provides an image processing apparatus that can implement the above-described image processing method. The apparatus includes:
[0126] The image processing module 801 is used to preprocess the acquired cell image to obtain the cell image under test, wherein the cell image is obtained by image acquisition of the cell under test;
[0127] The image detection module 802 is used to input the image of the battery cell to be tested into a preset computer vision library for image detection and output the first image;
[0128] The pixel enhancement module 803 is used to perform pixel enhancement operations on the pixels in the first image to obtain the second image;
[0129] The median filtering module 804 is used to perform median filtering on the second image based on a computer vision library to obtain the target image.
[0130] The image processing apparatus of this application embodiment is used to execute the image processing method in the above embodiment. Its specific processing procedure is the same as the image processing method in the above embodiment, and will not be described in detail here.
[0131] This application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the image processing method described in the above embodiments of this application.
[0132] Reference Figure 9 , Figure 9 This is a schematic diagram of the hardware structure of the computer device provided in the embodiments of this application.
[0133] The following is combined Figure 9The hardware structure of the computer device is described in detail. The computer device includes: a processor 910, a memory 920, an input / output interface 930, a communication interface 940, and a bus 950.
[0134] The processor 910 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.
[0135] The memory 920 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 920 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 920 and called and executed by the processor 910 using the image processing method of the embodiments of this application.
[0136] The input / output interface 930 is used to implement information input and output;
[0137] The communication interface 940 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.); and the bus 950 is used to transmit information between the various components of the device (such as processor 910, memory 920, input / output interface 930 and communication interface 940).
[0138] The processor 910, memory 920, input / output interface 930 and communication interface 940 are connected to each other within the device via bus 950.
[0139] This application also provides a storage medium, which is a computer-readable storage medium storing a computer program. When the computer program is executed by a computer, the computer is used to perform the image processing method as described in the above embodiments of this application.
[0140] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0141] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0142] It will be understood by those skilled in the art that Figures 1 to 7 The technical solutions shown do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0143] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0144] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0145] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0146] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0147] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0148] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0149] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0150] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0151] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. An image processing method, characterized in that, The method includes: The acquired cell images are preprocessed to obtain the cell image to be tested, wherein the cell image is obtained by image acquisition of the cell to be tested; The image of the battery cell to be tested is input into a preset computer vision library for image detection, and the first image is output. Perform pixel enhancement operations on the pixels in the first image to obtain the second image; The target image is obtained by performing median filtering on the second image based on the computer vision library. The step of performing pixel enhancement operations on the pixels in the first image to obtain the second image includes: The position of all pixels in the first image is calculated to obtain a set of pixel coordinates, wherein the set of pixel coordinates includes multiple pixel coordinates; Calculate the grayscale value of all pixel coordinates in the pixel coordinate set to obtain a grayscale value set. The gray value set is filtered based on a preset gray value threshold to obtain a first set and a second set, wherein all gray values in the first set are less than the gray value threshold, and all gray values in the second set are greater than the gray value threshold. For each gray value in the first set, calculate the first gray value difference between the gray value threshold and the gray value, and subtract the first gray value difference from the gray value threshold to obtain the first feature value; Update the grayscale values in the first set based on the first feature value; For each gray value in the second set, calculate the second gray value difference between the gray value and the gray value threshold, and add the gray value threshold and the second gray value difference to obtain the second feature value; Update the grayscale values in the second set according to the second feature value; The second image is generated based on the updated first set and the second set.
2. The image processing method according to claim 1, characterized in that, The preprocessing of the acquired cell image to obtain the cell image to be tested includes: The average grayscale value of the battery cell image was tested. The image of the battery cell that has passed the average grayscale test is rotated based on a preset rotation angle to obtain the image of the battery cell to be tested.
3. The image processing method according to claim 1, characterized in that, The computer vision library includes a first convolution operator and a second convolution operator; the step of inputting the image of the battery cell to be tested into the preset computer vision library for image detection and outputting a first image includes: The image of the battery cell to be tested is input into a preset computer vision library for grayscale conversion to obtain a grayscale image; The grayscale image is subjected to mean filtering based on the first convolution operator; Edge detection is performed on the grayscale image after mean filtering using the second convolution operator to obtain the first image.
4. The image processing method according to claim 1, characterized in that, The step of performing median filtering on the second image based on the computer vision library to obtain the target image includes: The second image is input into the computer vision library, so that the computer vision library divides the pixels in the second image into multiple pixel partitions according to the pixel coordinates. For each pixel partition, calculate the pixel value of all pixels in the pixel partition that correspond to the pixel coordinates; Sort all the pixel values sequentially to obtain a sorted sequence; The target median is determined according to the sorting sequence, and the pixel values of the pixel partitions are updated according to the target median until all pixel partitions are traversed. Generate the target image based on all updated pixel partitions.
5. The image processing method according to claim 3, characterized in that, The step of performing edge detection on the grayscale image after mean filtering based on the second convolution operator to obtain the first image includes: Set the image depth parameters based on the grayscale image after mean filtering; The image depth parameters, the grayscale image after mean filtering, and the preset convolution kernel are input into the second convolution operator for edge detection to obtain the first image.
6. An image processing apparatus, characterized in that, The device includes: The image processing module is used to preprocess the acquired cell image to obtain the cell image to be tested, wherein the cell image is obtained by image acquisition of the cell to be tested; The image detection module is used to input the image of the battery cell to be tested into a preset computer vision library for image detection and output a first image; The pixel enhancement module is used to perform pixel enhancement operations on the pixels in the first image to obtain the second image; The median filtering module is used to perform median filtering on the second image based on the computer vision library to obtain the target image; The step of performing pixel enhancement operations on the pixels in the first image to obtain the second image includes: The position of all pixels in the first image is calculated to obtain a set of pixel coordinates, wherein the set of pixel coordinates includes multiple pixel coordinates; Calculate the grayscale value of all pixel coordinates in the pixel coordinate set to obtain a grayscale value set. The gray value set is filtered based on a preset gray value threshold to obtain a first set and a second set, wherein all gray values in the first set are less than the gray value threshold, and all gray values in the second set are greater than the gray value threshold. For each gray value in the first set, calculate the first gray value difference between the gray value threshold and the gray value, and subtract the first gray value difference from the gray value threshold to obtain the first feature value; Update the grayscale values in the first set based on the first feature value; For each gray value in the second set, calculate the second gray value difference between the gray value and the gray value threshold, and add the gray value threshold and the second gray value difference to obtain the second feature value; Update the grayscale values in the second set according to the second feature value; The second image is generated based on the updated first set and the second set.
7. A computer device, characterized in that, The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor is used to perform the image processing method as described in any one of claims 1 to 5.
8. A storage medium, characterized in that, The storage medium is a computer-readable storage medium that stores a computer program. When the computer program is executed by the computer, the computer is used to perform the image processing method as described in any one of claims 1 to 5.