Battery image processing method, battery testing method, and apparatus
By performing noise reduction, filtering, linear stretching and histogram equalization on the battery image, the problem of low battery image quality in the prior art is solved, and higher detection accuracy and image visual quality are achieved.
Patent Information
- Application Number
- PCT/CN2023/124590
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-03
- Filing Date
- 2023-10-13
- Publication Date
- 2025-02-06
AI Technical Summary
In the prior art, the image quality of the battery image detection is not high, which makes it difficult for the accuracy of the detection results to meet the requirements.
By performing noise reduction, filtering, linear stretching and histogram equalization on the acquired multi-frame sequence original image, we enhance the contrast of the image, highlight local details, improve the visual quality of the image, and make the battery defect characteristics clearly visible.
The contrast and display quality of the battery image are improved, the defect characteristics of the battery are clearer, and the accuracy of the detection results are improved.
Smart Images

Figure CN2023124590_06022025_PF_FP_ABST
Abstract
Description
Battery image processing method, battery detection method and device
[0001] Cross-references
[0002] This application refers to Chinese patent application No. 202310972413.5, filed on August 3, 2023, entitled “Battery Image Processing Method, Battery Detection Method and Device,” which is incorporated herein by reference in its entirety. Technical Field
[0003] The present application relates to the field of battery technology, and in particular to a battery image processing method, a battery detection method and a battery detection device. Background Art
[0004] Energy conservation and emission reduction are key to the sustainable development of the automotive industry. Electric vehicles, due to their energy-saving and environmentally friendly advantages, have become an important component of the sustainable development of the automotive industry. For electric vehicles, battery technology is a key factor in their development.
[0005] During the battery production process, batteries need to be inspected for defects. In related technologies, non-destructive testing can be performed using battery images. Although this can achieve non-destructive testing, the quality of the inspection images is not high, making it difficult to meet the accuracy requirements of the inspection results.
[0006] Summary of the Invention
[0007] The present application aims to solve at least one of the technical problems in the background art. To this end, one object of the present application is to provide a battery image processing method, a battery detection method and a device to improve the quality of the image.
[0008] An embodiment of the first aspect of the present application provides a battery image processing method, including: obtaining a multi-frame sequence original image, performing noise reduction processing on the multi-frame sequence original image to obtain a single-frame original image; wherein the multi-frame sequence original image is a multi-frame image continuously shot within a preset time; filtering the single-frame original image to obtain a first processed image; linearly stretching the grayscale values of pixels in the first processed image to obtain a second processed image; and performing histogram equalization on the grayscale values of pixels in the second processed image to obtain a battery detection image.
[0009] In the technical solution of the embodiment of the present application, a single-frame original image is obtained by performing noise reduction processing on the acquired multi-frame sequence original image, and the single-frame original image is filtered to remove electronic noise and interference in the image. The grayscale values of the pixels in the image are then linearly stretched. Finally, the grayscale values of the pixels in the image are histogram-equalized to obtain a battery detection image, thereby enhancing the image contrast. This image processing algorithm improves the contrast of the battery image and simultaneously enhances the battery image, highlighting the local details in the battery image, thereby significantly improving the visual quality of the battery image and making the defect characteristics of the battery clearly visible.
[0010] In some embodiments, filtering a single-frame original image to obtain a first processed image includes: determining a normal grayscale range for the single-frame original image; determining a noise location in the single-frame original image based on the grayscale values of pixels in the single-frame original image and the normal grayscale range; and setting the grayscale value of the noise location to a preset grayscale value. Determining the noise location in the single-frame original image based on the grayscale values of pixels in the single-frame original image and the normal grayscale range, and setting the grayscale value of the noise location to the preset grayscale value, simplifies the process of determining the noise location and allows for faster identification of the noise location during subsequent battery image processing, thereby improving the efficiency of battery image processing.
[0011] In some embodiments, determining the normal grayscale range of a single-frame original image includes: selecting a region of interest from the single-frame original image; wherein the region of interest includes multiple pixels; calculating a histogram distribution of the grayscale values of the pixels in the region of interest; and determining the normal grayscale range of the single-frame original image based on the histogram distribution. By selecting a region of interest from the single-frame image and determining the normal grayscale range of the single-frame image based on the calculated histogram distribution of the grayscale values of the pixels in the region of interest, the determined normal grayscale range can be made more accurate.
[0012] In some embodiments, determining a noise location in a single-frame original image based on the grayscale value of a pixel in the single-frame original image and a normal grayscale range includes: determining the pixel as a noise location in response to the grayscale value of the pixel exceeding the normal grayscale range. When the grayscale value of a pixel exceeds the normal grayscale value range, the pixel can be determined as a noise location. That is, the noise location can be determined simply by comparing the grayscale values, further simplifying the process of determining the noise location.
[0013] In some embodiments, filtering a single-frame original image to obtain a first processed image further includes: traversing pixels in the single-frame original image, establishing a first local window for any pixel, the first local window including multiple pixels adjacent to the pixel; and performing median filtering on the grayscale values of the pixels within the first local window to obtain the first processed image. By establishing the first local window for any pixel and performing median filtering on the grayscale values of the pixels within the first local window, the local contrast of the battery image is enhanced. Furthermore, median filtering is simple and computationally inefficient, facilitating real-time application of the battery image processing method.
[0014] In some embodiments, linearly stretching the grayscale values of pixels in the first processed image to obtain the second processed image includes: traversing the pixels in the first processed image, establishing a second local window for any pixel, where the second local window includes multiple pixels adjacent to the pixel; and linearly stretching the grayscale values of the pixels within the second local window to obtain the second processed image. Processing the first processed image by establishing a second local window for any pixel and linearly stretching the grayscale values of the pixels within the second local window can further enhance image details, thereby further improving image display quality.
[0015] In some embodiments, linearly stretching the grayscale values of pixels within the second local window to obtain the second processed image includes: arranging a plurality of pixels within the second local window along rows and columns, and performing bidirectional linear stretching on the grayscale values of the pixels within the second local window to obtain the second processed image. Bidirectional linear stretching of the grayscale values of the pixels within the second local window can enhance image contrast while also improving battery image processing efficiency.
[0016] In some embodiments, performing histogram equalization on the grayscale values of pixels in the second processed image to obtain a battery detection image includes: dividing the second processed image into multiple sub-images, performing histogram equalization on each of the multiple sub-images to obtain a battery detection image. The second processed image is segmented to obtain multiple sub-images, and each sub-image is enhanced by histogram equalization, and then the sub-images after histogram equalization are spliced and fused into a final histogram-equalized battery detection image. In this way, when performing histogram equalization, multiple sub-images can be processed in parallel, and then the images are fused, which greatly speeds up the image processing speed. Moreover, for the enhancement of the second processed image of multiple targets, since the image is segmented, the targets in each image area are histogram-equalized over a larger range, which can better display the details of the image.
[0017] In some embodiments, performing histogram equalization on each of the multiple sub-images to obtain a battery detection image includes arranging pixels within the sub-images along rows and columns, and performing bidirectional histogram equalization on the grayscale values of the pixels within the sub-images to obtain the battery detection image. By performing bidirectional histogram equalization on the grayscale values of the pixels within the sub-images, the efficiency of battery image processing can be further improved while achieving image enhancement.
[0018] In some embodiments, obtaining a multi-frame sequence of original images and performing noise reduction processing on the multi-frame sequence of original images to obtain a single-frame original image includes: determining whether electronic noise exists at a pixel point based on multiple grayscale values corresponding to any pixel point at the same position in the multi-frame sequence of original images; and determining the grayscale value of the corresponding pixel point in the single-frame original image based on the determination result. Determining whether electronic noise exists at a pixel point based on multiple grayscale values corresponding to any pixel point at the same position in the multi-frame sequence of original images, and determining the grayscale value of the corresponding pixel point in the single-frame original image based on the determination result, can improve the accuracy of the grayscale values of each pixel point in the single-frame original image.
[0019] In some embodiments, determining whether electronic noise exists at a pixel based on multiple grayscale values corresponding to any pixel at the same position in a multi-frame sequence of original images includes: calculating a standard deviation of the grayscale values of the pixel based on the multiple grayscale values corresponding to any pixel at the same position in the multi-frame sequence of original images; and determining the presence of electronic noise at the pixel in response to the standard deviation of the grayscale values of the pixel being greater than a preset threshold. Determining the presence of electronic noise at a pixel by comparing the standard deviation of the grayscale values of the pixel calculated from the multiple grayscale values corresponding to any pixel at the same position in the multi-frame sequence of original images with a preset threshold can simplify the process of determining whether electronic noise exists at a pixel, thereby improving the efficiency of battery image processing.
[0020] In some embodiments, determining the grayscale value of a pixel corresponding to a single-frame original image based on the judgment result includes: in response to the presence of electronic noise in the pixel, performing a clustering operation on multiple grayscale values corresponding to the pixel in a multi-frame sequence of original images, marking the multiple grayscale values as normal or abnormal based on the result of the clustering operation, and calculating the average of the grayscale values marked as normal among the multiple grayscale values and using this average as the grayscale value of the corresponding pixel in the single-frame original image. The clustering operation can effectively separate normal grayscale values from abnormal grayscale values, and calculating the average of the normal grayscale values among the multiple grayscale values as the grayscale value of the corresponding pixel in the single-frame original image can make the grayscale value of the corresponding pixel in the single-frame original image more accurate, thereby improving the effect of battery image processing.
[0021] In some embodiments, determining the grayscale value of a pixel corresponding to the single-frame original image based on the determination result includes: in response to the absence of electronic noise at the pixel, calculating an average of multiple grayscale values corresponding to the pixel in the multiple-frame sequence of original images and using the average as the grayscale value of the corresponding pixel in the single-frame original image. By calculating the average of multiple grayscale values corresponding to the pixel in the multiple-frame sequence of original images and using the average as the grayscale value of the corresponding pixel in the single-frame original image, the grayscale value of the corresponding pixel in the single-frame original image can be made more accurate.
[0022] An embodiment of the second aspect of the present application provides a battery detection method, the method comprising: acquiring an image of a battery, the image comprising a multi-frame sequence of original images; processing the multi-frame sequence of original images using the battery image processing method of the aforementioned embodiment to obtain a battery detection image; and determining a battery detection result based on the battery detection image.
[0023] In some embodiments, the battery testing method further comprises: in response to the battery test result indicating that the battery is unqualified, rejecting the unqualified battery. This battery production method is suitable for large-scale batch production testing and can, to a certain extent, prevent defective batteries from entering the market.
[0024] The embodiment of the third aspect of the present application provides a battery image processing device, which includes: an acquisition module, a noise reduction module, a first processing module, a second processing module, and a third processing module. The acquisition module is configured to acquire a multi-frame sequence original image, wherein the multi-frame sequence original image is a multi-frame image continuously shot within a preset time; the noise reduction module is configured to perform noise reduction processing on the multi-frame sequence original image to obtain a single-frame original image; the first processing module is configured to perform filtering processing on the single-frame original image to obtain a first processed image; the second processing module is configured to perform linear stretching on the grayscale values of the pixels in the first processed image to obtain a second processed image; the third processing module performs histogram equalization on the grayscale values of the pixels in the second processed image to obtain a battery detection image.
[0025] In a fourth aspect, an embodiment of the present application provides a battery detection device, comprising: an image acquisition module, an image processing module, and a detection module. The image acquisition module is configured to acquire an image of the battery, the image comprising a multi-frame sequence of original images; the image processing module is configured to process the multi-frame sequence of original images using the battery image processing method of the aforementioned embodiment to obtain a battery detection image; and the detection module is configured to determine a battery detection result based on the battery detection image.
[0026] An embodiment of the fifth aspect of the present application provides an electronic device, comprising at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the battery image processing method in the above embodiment or the battery detection method in the above embodiment.
[0027] An embodiment of the sixth aspect of the present application provides a battery production device, including the electronic device in the above embodiment.
[0028] An embodiment of the seventh aspect of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the battery image processing method in the above embodiment or the battery detection method in the above embodiment.
[0029] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments disclosed in the present application and should not be regarded as limiting the scope of the present application. In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on the drawings without paying creative work.
[0031] FIG1 is a flowchart of a battery image processing method according to some embodiments of the present application;
[0032] FIG2 is a schematic diagram of a battery image according to some embodiments of the present application;
[0033] FIG3 is a grayscale diagram of a local area of a battery image according to some embodiments of the present application;
[0034] FIG4 is a schematic diagram of a battery detection image according to some embodiments of the present application;
[0035] FIG5 is a schematic diagram of grayscale of a local area of a battery detection image according to some embodiments of the present application;
[0036] FIG6 is a flow chart of a battery detection method according to some embodiments of the present application;
[0037] FIG7 is a block diagram of a battery image processing device according to some embodiments of the present application;
[0038] FIG8 is a block diagram of a battery detection device according to some embodiments of the present application;
[0039] FIG9 is a flowchart of a battery image detection method according to other embodiments of the present application. DETAILED DESCRIPTION
[0040] The following embodiments of the technical solution of the present application will be described in detail with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application and are therefore only examples and are not intended to limit the scope of protection of the present application.
[0041] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned figure descriptions are intended to cover non-exclusive inclusions.
[0042] In the description of the embodiments of this application, the technical terms "first" and "second" are used only to distinguish different objects and should not be understood to indicate or imply relative importance or implicitly specify the quantity, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, the meaning of "plurality" is more than two, unless otherwise clearly and specifically defined.
[0043] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0044] In the description of the embodiments of this application, the term "and / or" is simply a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent the following three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this document generally indicates that the associated objects are in an "or" relationship.
[0045] In the description of the embodiments of the present application, the term "multiple" refers to more than two (including two). Similarly, "multiple groups" refers to more than two groups (including two groups), and "multiple pieces" refers to more than two pieces (including two pieces).
[0046] In the description of the embodiments of the present application, the technical terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc. indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings. They are only for the convenience of describing the embodiments of the present application and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation. Therefore, they should not be understood as limiting the embodiments of the present application.
[0047] In the description of the embodiments of this application, unless otherwise expressly specified or limited, technical terms such as "installed," "connected," "connect," and "fixed" should be interpreted broadly. For example, they may refer to fixed connection, detachable connection, or integration; mechanical connection or electrical connection; direct connection or indirect connection through an intermediate medium; and internal communication between two components or interaction between two components. Those skilled in the art will understand the specific meanings of these terms in the embodiments of this application based on specific circumstances.
[0048] Currently, market developments indicate that power batteries are becoming increasingly widely used. They are not only used in energy storage systems such as hydropower, thermal, wind, and solar power plants, but are also widely used in electric vehicles like electric bicycles, electric motorcycles, and electric vehicles, as well as in military equipment and aerospace. As power battery applications continue to expand, market demand is also growing.
[0049] A battery consists of one or more cells. The battery production process includes electrode coating, cell winding, cell casing, and electrolyte injection. Various defects can occur during the battery production process, such as wrinkled electrodes, folded heads, cracked electrodes, and overlapping electrodes. These defects can affect battery quality and safety. Therefore, detecting battery defects is crucial.
[0050] In some inspection scenarios, a X-ray source and detector can be used to detect battery defects. The X-ray source emits radiation that passes through the battery, forming an image on the detector. Battery defects (such as wrinkled electrodes, folded electrodes, cracked electrodes, and overlapping electrodes) can cause the radiation to penetrate different thicknesses and attenuate the radiation. Consequently, battery defects are reflected in the inspection image as grayscale differences.
[0051] However, since the thickness change of a single-layer electrode (about 100um) is too small compared to the thickness of the entire battery cell (about 32mm), the radiation absorption is also very small, resulting in a very small imaging contrast of the edge of the defective area of the battery on the flat-panel detector. The battery defects may not be detected, which will affect the accuracy of the battery defect detection and lead to a low accuracy rate of the battery defect detection results.
[0052] In response to the above problems, the present application proposes a battery image processing method, a battery detection method and a device, which process the battery image into a recognizable state, and then detect the battery image to complete battery defect detection.
[0053] The battery image processing method disclosed in the embodiment of the present disclosure can be applied to, but is not limited to, battery defect detection, and can also be applied to the production process of batteries. The battery image processing method of the present application can improve the contrast of the battery image and highlight the local details in the battery image by performing noise reduction processing, filtering processing, linear stretching and histogram equalization on the acquired multi-frame sequence original image, thereby significantly improving the intuitive visual quality of the battery image and making the defect characteristics of the battery clearly visible.
[0054] FIG1 is a flow chart of a battery image processing method according to some embodiments of the present application. As shown in FIG1 , the battery image processing method 100 includes:
[0055] Step S110: obtaining a multi-frame sequence original image, and performing noise reduction processing on the multi-frame sequence original image to obtain a single-frame original image; wherein the multi-frame sequence original image is a multi-frame image continuously shot within a preset time.
[0056] Step S120: performing filtering processing on the single frame original image to obtain a first processed image.
[0057] Step S130: linearly stretching the grayscale values of the pixels in the first processed image to obtain a second processed image.
[0058] Step S140: performing histogram equalization on the grayscale values of the pixels in the second processed image to obtain a battery detection image.
[0059] In an embodiment of the present application, Figure 2 is a schematic diagram of a battery image of some embodiments of the present application, and Figure 3 is a grayscale schematic diagram of a local area of a battery image of some embodiments of the present application. As shown in Figure 2, the grayscale values of each area in the battery image are relatively close, and the location of the battery defect cannot be identified. As shown in Figure 3, the grayscale value of the defect position 301 on the battery electrode ranges from 32300 to 32500, and the maximum difference in grayscale value is only 200, so it is difficult to easily distinguish and identify in the image.
[0060] In an embodiment of the present application, a multi-frame sequence of original images can be acquired using a radiation source and a flat-panel detector. The radiation emitted by the radiation source passes through a detection object and is projected onto the flat-panel detector, which then acquires an image based on the received radiation. Images can be acquired continuously at a preset frequency, and multiple frames of images can be acquired continuously within a preset time. These continuously acquired multiple frames of images can serve as the multi-frame sequence original image. In an embodiment of the present application, the preset time can be determined based on the number of multi-frame sequence original images to be acquired and the frequency of image acquisition.
[0061] It is understandable that due to the possibility of image acquisition device jitter during the image acquisition process, the first few frames of images acquired continuously may not be completely aligned, and image offset or ghosting may occur. Therefore, the first few frames of images can be discarded.
[0062] In an embodiment of the present application, the shape, size, and number of pixels contained in each frame image in the multi-frame sequence original image are all the same. In the process of acquiring the multi-frame sequence original image, electronic noise may exist in the multi-frame sequence original image due to the influence of equipment or environmental factors. The grayscale values of the pixels in the multi-frame sequence original image where electronic noise exists will be abnormal, and the grayscale values of the pixels will be too large or too small. In order to achieve better image processing effects, the multi-frame sequence original image can be subjected to noise reduction processing. The method of performing noise reduction processing on the multi-frame sequence original image can be to filter each frame image in the multi-frame sequence original image, or to perform noise reduction processing on the multi-frame sequence original image at the same time based on the grayscale values of the pixels in each frame image in the multi-frame sequence original image.
[0063] In the embodiment of the present application, the shape, size, and number of pixels of the single-frame original image are identical to the shape, size, and number of pixels of each frame in the multi-frame sequence original image. The grayscale values of the corresponding pixels of the single-frame original image can be determined based on the multiple grayscale values of the multi-frame sequence original image after noise reduction processing, thereby reducing the impact of electronic noise.
[0064] In an embodiment of the present application, a single-frame original image may include battery defects. In addition, the single-frame original image also includes some random noise, which makes the defect characteristics of the battery less obvious. By filtering the single-frame original image, the defect characteristics of the battery pole piece can be enhanced, that is, the defect characteristics of the battery in the first processed image are more obvious than the single-frame original image.
[0065] In the embodiment of the present application, the grayscale values of the pixels in the first processed image are linearly stretched to map the grayscale value distribution of the pixels in the first processed image to the entire grayscale range, thereby enhancing the contrast of the first processed image and obtaining a second processed image.
[0066] In an embodiment of the present application, the grayscale value probability density distribution of the pixel points in the second processed image can be adjusted by histogram equalization, so that the grayscale value of the pixel points in the second processed image not only has a relatively balanced grayscale probability density distribution, but also adjusts the dynamic range of the grayscale value of the pixel points in the second processed image, expands the grayscale difference of the grayscale value of the pixel points in the second processed image, improves the grayscale value of the pixel points in the second processed image, and moves the grayscale value of the pixel points in the second processed image from a lower grayscale value to a higher distribution range. The grayscale value of the pixel points in the second processed image can be converted from a relatively concentrated grayscale interval to a uniform distribution within the entire grayscale range, thereby effectively enhancing the contrast of the second processed image and obtaining a battery detection image. Performing histogram equalization on the grayscale values of the pixel points in the second processed image can enhance the contrast of the image and obtain a battery detection image.
[0067] In an embodiment of the present application, Figure 4 is a schematic diagram of a battery detection image of some embodiments of the present application, and Figure 5 is a grayscale schematic diagram of a local area of a battery detection image of some embodiments of the present application. As shown in Figures 4 and 5, the defect position 501 in the battery detection image is the area where the pole piece fragments are located. The grayscale value of the defect position 501 ranges from 10,000 to 50,000, and the maximum difference in grayscale value is 40,000. Compared with the image before processing, the grayscale value range of the defect position is significantly increased, and the battery defect can be clearly identified in the battery detection image.
[0068] According to an embodiment of the present application, a single-frame original image is obtained by performing noise reduction processing on the acquired multi-frame sequence original image, and the single-frame original image is filtered to remove electronic noise and interference in the image. The grayscale values of the pixels in the image are then linearly stretched. Finally, the grayscale values of the pixels in the image are histogram-equalized to obtain a battery detection image, thereby enhancing the image contrast. This image processing algorithm improves the contrast of the battery image and simultaneously enhances the battery image, highlighting the local details in the battery image, thereby significantly improving the visual quality of the battery image and making the defect characteristics of the battery clearly visible.
[0069] According to some embodiments of the present application, filtering a single-frame original image to obtain a first processed image includes: determining a normal grayscale range of the single-frame original image; determining a noise position in the single-frame original image based on the grayscale value of the pixel points in the single-frame original image and the normal grayscale range; and setting the grayscale value of the noise position to a preset grayscale value.
[0070] In an embodiment of the present application, the normal grayscale value range of a single-frame image includes the maximum normal grayscale value of the single-frame image and the minimum normal grayscale value of the single-frame image. The grayscale value range of a single-frame image can be obtained by statistically analyzing the grayscale values of the single-frame image. However, in this case, the grayscale values of the single-frame image may include the grayscale values of bad pixels in the single-frame original image. The pixels with the largest grayscale value and the pixels with the smallest grayscale value are most likely to be bad pixels. Therefore, the grayscale value range of the single-frame image can be determined as the normal grayscale value range of the single-frame image by removing the maximum grayscale value and the minimum grayscale value. The normal grayscale value range of the single-frame image can also be determined by multiplying the grayscale value range of the single-frame image by a preset ratio.
[0071] In an embodiment of the present application, when the grayscale value of a pixel exceeds the normal grayscale value range of a single-frame image, the pixel can be determined to be a noise location in the single-frame original image. Furthermore, to better identify noise in subsequent steps of the battery image processing method, the grayscale value of the noise location can be set to a preset grayscale value. For example, when the battery image is a 16-bit image, the grayscale value of the noise location can be set to 0 or 65535.
[0072] In an embodiment of the present application, the noise position in the single-frame original image is determined based on the grayscale value of the pixel point in the single-frame image and the normal grayscale value range, and the grayscale value of the noise position is set to a preset grayscale value. This can make the process of determining the noise position simpler, and the noise position can be identified more quickly in the subsequent battery image processing process, thereby improving the efficiency of battery image processing.
[0073] According to some embodiments of the present application, determining the normal grayscale range of a single-frame original image includes: selecting a region of interest of the single-frame original image; wherein the region of interest includes multiple pixels; calculating the histogram distribution of the grayscale values of the pixels in the region of interest; and determining the normal grayscale range of the single-frame original image based on the histogram distribution.
[0074] In the embodiments of the present application, for example, the probability of bad pixels appearing in the center region of a single-frame image is generally low, and thus the center region of the single-frame image can be selected as the region of interest for the single-frame image. Since the region of interest for a single-frame image is selected to determine the normal grayscale range of the single-frame image, the region of interest needs to include multiple pixels, and the specific number of pixels is not specifically limited in the embodiments of the present application.
[0075] In the embodiments of the present application, the pixel grayscale value histogram calculates the probability of occurrence of the grayscale values of all pixels in the image, based on their grayscale values. A pixel grayscale value histogram is a function of grayscale level and can represent the number of pixels with a certain grayscale value in the image, reflecting the probability of a certain grayscale value occurring in the image. Based on the histogram distribution of the pixel grayscale values in the region of interest, the normal grayscale range of a single frame image can be determined.
[0076] In an embodiment of the present application, by selecting a region of interest of a single-frame image and determining the normal grayscale range of the single-frame image based on the calculated histogram distribution of the grayscale values of the pixels in the region of interest, the determined normal grayscale range can be made more accurate.
[0077] According to some embodiments of the present application, determining the noise position in a single-frame original image based on the grayscale value of the pixel point in the single-frame original image and the normal grayscale range includes: in response to the grayscale value of the pixel point exceeding the normal grayscale range, determining the pixel point as a noise position.
[0078] In an embodiment of the present application, the grayscale value of the pixel exceeds the normal grayscale range of a single-frame image, including the grayscale value of the pixel being greater than the maximum normal grayscale value of a single-frame image or less than the minimum normal grayscale value of a single-frame image.
[0079] In the embodiment of the present application, when the grayscale value of a pixel point exceeds the normal grayscale value range, the pixel point can be determined as a noise position, that is, the noise position can be determined by comparing the grayscale values, which further simplifies the process of determining the noise position.
[0080] According to some embodiments of the present application, filtering a single-frame original image to obtain a first processed image also includes: traversing the pixel points in the single-frame original image, establishing a first local window for any pixel point, the first local window including multiple pixel points adjacent to the pixel point; performing median filtering on the grayscale values of the pixel points in the first local window to obtain the first processed image.
[0081] In the embodiment of the present application, the median filter algorithm sorts the grayscale values of pixels in a neighborhood and then selects the median value of the group of data as the output pixel value. Due to its simplicity and practicality, and its ability to effectively eliminate noise, it has been widely used in many fields.
[0082] In the embodiment of the present application, the size of the first local window can be selected to be any size. A larger size will improve the denoising ability, but the blurring of the original image will be more severe. In other words, if the size of the first local window is too small, the denoising effect will not be good enough. If the size of the first local window is too large, more image details will be lost due to the large number of pixels involved in the calculation, resulting in image blurring. The size of the first local window can be selected based on the size of the defect in the image, and the embodiment of the present application does not impose any restrictions. For example, the size of the first local window can be 5×5.
[0083] In the embodiment of the present application, a first local window is established for any pixel point, and the grayscale value of the pixel point in the first local window is subjected to median filtering, thereby enhancing the local contrast of the battery image. At the same time, median filtering is simple and has a small amount of calculation, which is conducive to the real-time application of the battery image processing method.
[0084] According to some embodiments of the present application, linearly stretching the grayscale values of pixels in the first processed image to obtain a second processed image includes: traversing the pixels in the first processed image, establishing a second local window for any pixel, the second local window including multiple pixels adjacent to the pixel; linearly stretching the grayscale values of the pixels in the second local window to obtain the second processed image.
[0085] In an embodiment of the present application, for the linear stretching of the grayscale value of a pixel, a typical transformation formula for the grayscale value of each pixel is: grayscale value of the new pixel = maximum grayscale value × (grayscale value of the original pixel - grayscale value of the minimum pixel) / (grayscale value of the maximum pixel - grayscale value of the minimum pixel). Although the grayscale value distribution of the pixels of the original image may be biased towards a certain grayscale interval, through the transformation of the above formula, all grayscale values of an image will be distributed within the entire grayscale value range.
[0086] In the embodiment of the present application, by establishing a second local window for any pixel and linearly stretching the grayscale values of the pixels within the second local window, the local features of the image within the second local window can be enhanced, making the image details stand out. Based on the same processing method, the first processed image is traversed to complete the processing of the first processed image.
[0087] In an embodiment of the present application, by establishing a second local window for any pixel point and processing the first processed image by linearly stretching the grayscale value of the pixel point in the second local window, the image details can be further enhanced, thereby further improving the display quality of the image.
[0088] According to some embodiments of the present application, linearly stretching the grayscale values of pixels in the second local window to obtain a second processed image includes: arranging multiple pixels in the second local window along row and column directions, and performing bidirectional linear stretching on the grayscale values of pixels in the second local window to obtain the second processed image.
[0089] In an embodiment of the present application, the sub-image includes a plurality of pixels arranged along rows and a plurality of pixels arranged along columns. When linear stretching the sub-image, linear stretching is performed simultaneously based on the plurality of pixels arranged along rows and the plurality of pixels arranged along columns contained in the second local window. That is, bidirectional histogram equalization is performed on the grayscale values of the pixels in the second local window.
[0090] Exemplarily, when the size of the second local window is 2×2, linear stretching is performed simultaneously based on 4 pixels.
[0091] In the embodiment of the present application, by performing bidirectional linear stretching on the grayscale values of the pixels in the second local window, the image contrast can be enhanced while also improving the battery image processing efficiency.
[0092] According to some embodiments of the present application, performing histogram equalization on the grayscale values of pixels in the second processed image to obtain a battery detection image includes: dividing the second processed image into multiple sub-images, and performing histogram equalization on the multiple sub-images to obtain the battery detection image.
[0093] In an embodiment of the present application, the second processed image can be divided into multiple sub-images, and the number of sub-images can be determined according to the complexity of the second processed image. The second processed image can be divided evenly and regularly, that is, the size and / or shape of each sub-image can be the same or conform to a certain regularity. The second processed image can also be divided unevenly, that is, the size and / or shape of each sub-image can be different or irregular. For example, the second processed image can be divided into sub-images of different sizes and / or shapes according to the different levels of complexity of each part of the second processed image.
[0094] In an embodiment of the present application, histogram equalization can be performed on each sub-image. Histogram equalization stretches the grayscale of an image from a narrow grayscale range to a wider grayscale range. The histogram-equalized sub-images are then spliced together to re-merge them to obtain a battery detection image.
[0095] In an embodiment of the present application, the second processed image is segmented to obtain multiple sub-images, and each sub-image is enhanced by histogram equalization. The sub-images after histogram equalization are then spliced and fused to form a final histogram-equalized battery detection image. In this way, when performing histogram equalization, multiple sub-images can be processed in parallel and then the images are fused, which greatly speeds up the image processing speed. Moreover, for the enhancement of the second processed image of multiple targets, since the image is segmented and the targets in each image area are histogram-equalized over a larger range, the details of the image can be better displayed.
[0096] According to some embodiments of the present application, performing histogram equalization on multiple sub-images to obtain a battery detection image includes: arranging multiple pixels in the sub-image along row and column directions, and performing bidirectional histogram equalization on the grayscale values of the pixels in the sub-image to obtain the battery detection image.
[0097] In an embodiment of the present application, a sub-image includes a plurality of pixels arranged along rows and a plurality of pixels arranged along columns. When performing histogram equalization on the sub-image, histogram equalization is performed simultaneously on the plurality of pixels arranged along rows and the plurality of pixels arranged along columns contained in the histogram, that is, bidirectional histogram equalization is performed on the grayscale values of the pixels in the sub-image.
[0098] For example, when the size of the sub-image is 50×50, histogram equalization is performed simultaneously based on 2500 pixels.
[0099] In the embodiment of the present application, by performing bidirectional histogram equalization on the grayscale values of pixels in the sub-image, the efficiency of battery image processing can be further improved while meeting the image enhancement effect.
[0100] According to some embodiments of the present application, obtaining a multi-frame sequence original image and performing noise reduction processing on the multi-frame sequence original image to obtain a single-frame original image includes: judging whether there is electronic noise in the pixel point based on multiple grayscale values corresponding to any pixel point at the same position in the multi-frame sequence original image; and determining the grayscale value of the pixel point corresponding to the single-frame original image based on the judgment result.
[0101] In an embodiment of the present application, each frame in a multi-frame sequence image has the same shape, size, and number of pixels. Since a multi-frame sequence image is a collection of images acquired continuously within a preset timeframe, theoretically, the grayscale values corresponding to pixels at the same position in each frame should be the same or similar. This means that the multiple grayscale values corresponding to pixels at the same position in a multi-frame sequence image should be the same or similar. However, when interference such as electronic noise is present at a pixel, the grayscale value corresponding to that pixel may suddenly change. Therefore, the presence of electronic noise can be determined based on the multiple grayscale values corresponding to any pixel at the same position in the multi-frame sequence image. Specifically, the grayscale value corresponding to any pixel at any position in any image can be compared with the grayscale values at the same position in other images. If the grayscale value corresponding to any pixel at any position in an image differs from the grayscale values at the same position in other images, electronic noise may be present at that pixel in that image. The presence of electronic noise can also be determined by calculating the standard deviation of the pixel based on the multiple grayscale values corresponding to any pixel at the same position in the multi-frame sequence image.
[0102] In an embodiment of the present application, the judgment results include whether electronic noise exists in a pixel and whether electronic noise does not exist in the pixel. When electronic noise exists in a pixel, the grayscale value of the corresponding pixel in the single-frame original image can be determined based on the normal grayscale value among the multiple grayscale values corresponding to the pixel at the same position in the multi-frame sequence original image. When electronic noise does not exist in a pixel, the grayscale value of the corresponding pixel in the single-frame original image can be determined based on the multiple grayscale values corresponding to the pixel at the same position in the multi-frame sequence original image.
[0103] In an embodiment of the present application, the multiple grayscale values corresponding to any pixel at the same position in the multi-frame sequence original image are used to determine whether there is electronic noise in the pixel point, and the grayscale value of the pixel point corresponding to the single-frame original image is determined based on the judgment result, which can improve the accuracy of the grayscale value of each pixel point in the single-frame original image.
[0104] According to some embodiments of the present application, judging whether electronic noise exists at a pixel point based on multiple grayscale values corresponding to any pixel point at the same position in a multi-frame sequence original image includes: calculating the standard deviation of the grayscale values of the pixel point based on multiple grayscale values corresponding to any pixel point at the same position in the multi-frame sequence original image; and judging that electronic noise exists at the pixel point in response to the standard deviation of the grayscale values of the pixel point being greater than a preset threshold.
[0105] In an embodiment of the present application, the standard deviation of the grayscale values of a pixel can reflect the degree of discreteness of the multiple grayscale values corresponding to any pixel at the same position in the multi-frame sequence original image. The larger the standard deviation of the grayscale values of a pixel, the more discrete the multiple grayscale values corresponding to any pixel at the same position in the multi-frame sequence original image. The more discrete the multiple grayscale values corresponding to any pixel at the same position in the multi-frame sequence original image, the more interference such as electronic noise is present at the pixel. Therefore, the standard deviation of the grayscale values of a pixel can be calculated based on the multiple grayscale values corresponding to any pixel at the same position in the multi-frame sequence original image to determine whether electronic noise exists at the pixel. In response to the standard deviation of the pixel being greater than a preset threshold, it can be determined that electronic noise exists at the pixel.
[0106] In an embodiment of the present application, the preset threshold can be set according to the actual usage scenario of the image bad pixel correction method, and the embodiment of the present disclosure does not limit it. For example, when a 16-bit image is selected, the preset threshold can be 10.
[0107] In an embodiment of the present application, the standard deviation of the grayscale value of a pixel point calculated from multiple grayscale values corresponding to any pixel point at the same position in the multi-frame sequence original image is compared with a preset threshold to determine whether electronic noise exists in the pixel point. This can make the process of determining whether electronic noise exists in the pixel point simpler, thereby improving the efficiency of processing the battery image.
[0108] According to some embodiments of the present application, determining the grayscale value of a pixel point corresponding to a single-frame original image based on a judgment result includes: in response to the presence of electronic noise in the pixel point, performing a clustering operation on multiple grayscale values corresponding to the pixel point of a multi-frame sequence original image, and marking the multiple grayscale values as normal or abnormal based on the result of the clustering operation, calculating the average value of the grayscale values marked as normal among the multiple grayscale values and using it as the grayscale value of the corresponding pixel point in the single-frame original image.
[0109] In the embodiment of the present application, a clustering operation is performed on the pixels corresponding to the multiple grayscale values of the multi-frame sequence original image to obtain the clustering operation results. The clustering operation results are then separated, and the grayscale values of the multi-frame sequence original image that are less than or equal to the reference threshold are marked as normal, and the others are marked as abnormal. The abnormal grayscale values are electronic noise, and normal grayscale values are classified as electronic noise.
[0110] In an embodiment of the present application, due to the influence of environmental factors, etc., the grayscale values marked as normal are not necessarily completely equal. In order to make the grayscale values in a single-frame image more accurate, the average value of the grayscale values marked as normal among multiple grayscale values can be calculated and used as the grayscale value of the corresponding pixel point in the single-frame original image.
[0111] In the embodiment of the present application, normal grayscale values and abnormal grayscale values can be effectively separated through clustering operations, and the average value of the normal grayscale values among multiple grayscale values is calculated as the grayscale value of the corresponding pixel point in the single-frame original image. The grayscale value of the corresponding pixel point in the single-frame original image can make the grayscale value of the corresponding pixel point in the single-frame original image more accurate, thereby improving the effect of battery image processing.
[0112] According to some embodiments of the present application, determining the grayscale value of a pixel point corresponding to a single-frame original image based on a judgment result includes: in response to the absence of electronic noise at the pixel point, calculating the average value of multiple grayscale values corresponding to the pixel point in a multi-frame sequence of original images and using it as the grayscale value of the corresponding pixel point in the single-frame original image.
[0113] In the embodiment of the present application, when electronic noise is absent from the pixels, the multiple grayscale values of the multi-frame sequence original image are all normal values. However, due to environmental factors, the multiple grayscale values of the multi-frame sequence original image may not be completely equal. To make the grayscale value of the corresponding pixel in a single-frame original image more accurate, the average of the multiple grayscale values corresponding to the pixel in the multi-frame sequence original image can be calculated and used as the grayscale value of the corresponding pixel in the single-frame original image.
[0114] In an embodiment of the present application, by calculating the average of multiple grayscale values corresponding to the pixel points of the multi-frame sequence original images and using it as the grayscale value of the corresponding pixel points in the single-frame original image, the grayscale value of the corresponding pixel points in the single-frame original image can be made more accurate.
[0115] Embodiments of a second aspect of the present application provide a battery detection method. FIG6 is a flow chart of a battery detection method according to some embodiments of the present application. As shown in FIG6 , the battery detection method includes:
[0116] Step S610: Acquire an image of the battery, where the image includes multiple frames of a sequence of original images.
[0117] Step S620: Process the multi-frame sequence of original images using the battery image processing method of the above embodiment to obtain a battery detection image.
[0118] Step S630: Determine the battery detection result based on the battery detection image.
[0119] According to some embodiments of the present application, the operation of detecting the battery can be performed by means of a detection model or a recognition algorithm, and can be selected according to the actual application and needs. For example, in order to realize the detection of the battery, the detection model can be pre-trained to obtain a pre-trained detection model. After obtaining the battery image, the battery image is processed using the battery image processing method in the aforementioned embodiment to obtain a battery detection image, and the battery detection image is input into the pre-trained detection model. After being processed by the detection model, the battery detection result is obtained.
[0120] In an embodiment of the present application, by using the battery image processing method in the aforementioned embodiment to process the image of the battery to obtain a battery detection image, and detecting the battery based on the battery detection image, the problem of being unable to detect battery defects due to the battery image being unable to provide sufficiently clear and complete battery information can be solved, thereby improving the accuracy of the battery detection results.
[0121] According to some embodiments of the present application, the battery detection method further includes: in response to the battery detection result indicating that the battery is unqualified, rejecting the unqualified battery.
[0122] In the embodiment of the present application, in response to the battery test result indicating that the battery is defective, the defective battery can be transferred to a waste outlet. In response to the battery test result indicating that the battery is not defective, the non-defective battery can be subjected to further testing. This battery production method is suitable for large-scale batch production testing and can, to a certain extent, prevent defective batteries from entering the market.
[0123] Some embodiments of the fourth aspect of the present application provide a battery image processing device. FIG7 is a block diagram of a battery image processing device according to some embodiments of the present application. As shown in FIG7 , the battery image processing device 700 includes: an acquisition module 710, a noise reduction module 720, a first processing module 730, a second processing module 740, and a third processing module 750. The acquisition module 710 is configured to acquire a multi-frame sequence original image, wherein the multi-frame sequence original image is a plurality of frames of images continuously captured within a preset time; the noise reduction module 720 is configured to perform noise reduction processing on the multi-frame sequence original image to obtain a single-frame original image; the first processing module 730 is configured to perform filtering processing on the single-frame original image to obtain a first processed image; the second processing module 740 is configured to perform linear stretching on the grayscale values of pixels in the first processed image to obtain a second processed image; and the third processing module 750 performs histogram equalization on the grayscale values of pixels in the second processed image to obtain a battery detection image.
[0124] In some embodiments, the noise reduction module 720 includes: a grayscale range determination module, configured to determine the normal grayscale range of a single-frame original image; a noise position determination module, configured to determine the noise position in the single-frame original image based on the grayscale value of the pixel points in the single-frame original image and the normal grayscale range; and a grayscale value setting module, configured to set the grayscale value of the noise position to a preset grayscale value.
[0125] In some embodiments, the grayscale range determination module includes: an area of interest selection module, configured to select an area of interest of a single-frame original image; wherein the area of interest includes multiple pixels; a histogram distribution calculation module, configured to calculate the histogram distribution of the grayscale values of the pixels in the area of interest; and a normal grayscale range determination module, configured to determine the normal grayscale range of the single-frame original image based on the histogram distribution.
[0126] In some embodiments, the noise position determination module is configured to determine a pixel point as a noise position in response to a grayscale value of the pixel point exceeding a normal grayscale range.
[0127] In some embodiments, the first processing module 730 includes: a first local window establishment module, configured to traverse the pixel points in a single frame original image, establish a first local window for any pixel point, and the first local window includes multiple pixel points adjacent to the pixel point; a median filtering processing module, configured to perform median filtering on the grayscale values of the pixel points in the first local window to obtain a first processed image.
[0128] In some embodiments, the second processing module 740 includes: a second local window establishment module, configured to traverse the pixel points in the first processed image and establish a second local window for any pixel point, the second local window including multiple pixel points adjacent to the pixel point; a linear stretching module, configured to linearly stretch the grayscale values of the pixel points in the second local window to obtain a second processed image.
[0129] In some embodiments, the linear stretching module is configured to arrange multiple pixels in the second local window along the row direction and the column direction, and perform bidirectional linear stretching on the grayscale values of the pixels in the second local window to obtain the second processed image.
[0130] In some embodiments, the third processing module 750 includes: an image segmentation module configured to segment the second processed image into multiple sub-images; and a histogram equalization module configured to perform histogram equalization on the multiple sub-images to obtain a battery detection image.
[0131] In some embodiments, the histogram equalization module is configured to arrange the pixels in the sub-image along the row direction and the column direction, and perform bidirectional histogram equalization on the grayscale values of the pixels in the sub-image to obtain the battery detection image.
[0132] In some embodiments, the noise reduction module 720 includes: an electronic noise judgment module, which is configured to judge whether there is electronic noise at a pixel point based on multiple grayscale values corresponding to any pixel point at the same position in a multi-frame sequence original image; and a grayscale value determination module, which is configured to determine the grayscale value of the pixel point corresponding to the single-frame original image based on the judgment result.
[0133] In some embodiments, the electronic noise judgment module includes: a grayscale value standard deviation calculation module, configured to calculate the grayscale value standard deviation of a pixel point based on multiple grayscale values corresponding to any pixel point at the same position in the multi-frame sequence original image; an electronic noise judgment module, configured to determine that electronic noise exists at a pixel point in response to the standard deviation of the grayscale value of the pixel point being greater than a preset threshold.
[0134] In some embodiments, the electronic noise judgment module includes: a grayscale value marking module, configured to perform clustering operations on multiple grayscale values corresponding to the pixel points of a multi-frame sequence of original images in response to the presence of electronic noise in the pixel points, and mark the multiple grayscale values as normal or abnormal based on the results of the clustering operations; a first grayscale value calculation module, configured to calculate the average value of the grayscale values marked as normal among the multiple grayscale values and use it as the grayscale value of the corresponding pixel point in the single-frame original image.
[0135] In some embodiments, the electronic noise judgment module includes: a second grayscale value calculation module, which is configured to calculate the average value of multiple grayscale values corresponding to the pixel point in a multi-frame sequence of original images in response to the absence of electronic noise at the pixel point and use it as the grayscale value of the corresponding pixel point in the single-frame original image.
[0136] Some embodiments of the fourth aspect of the present application provide a battery detection device. FIG8 is a block diagram of the battery detection device of some embodiments of the present application. As shown in FIG8 , the battery detection device 800 includes: an image acquisition module 810, an image processing module 820, and a detection module 830. The image acquisition module 810 is configured to acquire an image of the battery, wherein the image includes a multi-frame sequence of original images; the image processing module 820 is configured to process the multi-frame sequence of original images using the battery image processing method of the above embodiment to obtain a battery detection image; and the detection module 830 is configured to determine the battery detection result based on the battery detection image.
[0137] Some embodiments of the present application also provide an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the battery image processing method or battery detection method in the above-mentioned embodiment.
[0138] Various embodiments of the systems and techniques described above in this application can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0139] An embodiment of the present application provides a battery production device, including the electronic device of the above embodiment.
[0140] Some embodiments of the present application further provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the battery image processing method or battery detection method in the above-mentioned embodiments.
[0141] Computer readable media can be tangible media that can contain or store programs for use with or in combination with an instruction execution system, device or equipment. Machine-readable media can be machine-readable signal media or machine-readable storage media. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0142] According to some embodiments of the present application, a computer program product is provided, including a computer program, which, when executed by a processor, implements the battery image processing method in the above embodiment or the battery detection method in the above embodiment.
[0143] The technical solution of the present application is further described below through a specific embodiment. FIG9 is a flow chart of a battery image detection method according to another embodiment of the present application. As shown in FIG9 , the method includes:
[0144] Step S901: Frame sequence original image: PLC or software triggers, and the data acquisition module obtains a multi-frame sequence original image, wherein the multi-frame sequence original image is a multi-frame image continuously shot within a preset time.
[0145] Step S902: discarding the first few frames of original images: discarding the first few frames of the sequence of original images to avoid interference from image delay and afterimage.
[0146] Step S903: CPU (Central Processing Unit) copies to GPU (Graphics Processing Unit): the multi-frame sequence original images with the first few frames discarded are copied from the CPU to the GPU.
[0147] Step S904: Calculate the standard deviation of the grayscale values of the same pixel position in the original images of different frame sequences: calculate the standard deviation of the grayscale values of the pixel point based on multiple grayscale values corresponding to any pixel point at the same position in the original images of multiple frame sequences.
[0148] Step S905: Whether the standard deviation is greater than a threshold: the standard deviation of the grayscale value of the pixel is compared with a preset threshold to determine whether electronic noise exists in the pixel.
[0149] Step S906: Clustering operation marks the noise points and calculates the average value to obtain a single-frame original image: In response to the presence of electronic noise in the pixel points, clustering operation is performed on the multiple grayscale values corresponding to the multi-frame sequence original images of the pixel points, and the multiple grayscale values are marked as normal or abnormal according to the results of the clustering operation. The average value of the grayscale values marked as normal in the multiple grayscale values is calculated and used as the grayscale value of the corresponding pixel point in the single-frame original image.
[0150] Step S907: directly calculating the mean to obtain a single-frame original image: in response to the absence of electronic noise at the pixel point, calculating the average value of multiple grayscale values corresponding to the pixel point in the multi-frame sequence original image and using it as the grayscale value of the corresponding pixel point in the single-frame original image.
[0151] Step S908: Obtaining the center area of the battery cell: selecting an area of interest of a single frame of the original image; wherein the area of interest includes a plurality of pixels.
[0152] Step S909: Calculate the normal grayscale range of the cell area based on the grayscale value histogram distribution of the cell center area: calculate the histogram distribution of the grayscale values of the pixels in the region of interest; and determine the normal grayscale range of the single frame original image based on the histogram distribution.
[0153] Step S910: Mark the position in the original image where the grayscale value exceeds the normal response grayscale range and mark it as 0 or 65535: In response to the grayscale value of the pixel point exceeding the normal grayscale range, determine the pixel point as a noise position.
[0154] Step S911: traverse all pixels and establish a local window for each pixel: traverse the pixels in the single-frame original image and establish a first local window for any pixel. The first local window includes multiple pixels adjacent to the pixel.
[0155] Step S912: Perform median filtering in the local window: perform median filtering on the grayscale values of the pixels in the first local window to obtain a first processed image.
[0156] Step S913: traverse all pixels and establish a local window for each pixel: traverse the pixels in the first processed image and establish a second local window for any pixel, where the second local window includes multiple pixels adjacent to the pixel.
[0157] Step S914: linear stretching within the local window: multiple pixel points within the second local window are arranged along the row direction and the column direction, and bidirectional linear stretching is performed on the grayscale values of the pixel points within the second local window to obtain a second processed image.
[0158] Step S915: Divide the image into multiple windows and perform local contrast histogram equalization on each window: Divide the second processed image into multiple sub-images, arrange the pixels in the sub-images along the row and column directions, and perform bidirectional histogram equalization on the grayscale values of the pixels in the sub-images to obtain a battery detection image.
[0159] Step S916: GPU to CPU copy: copy the battery detection image from the GPU to the CPU.
[0160] Step S917: Preprocessing result image: battery detection image.
[0161] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application, and they should all be included in the scope of the claims and specification of the present application. In particular, as long as there is no structural conflict, the various technical features mentioned in the various embodiments can be combined in any way. The present application is not limited to the specific embodiments disclosed herein, but includes all technical solutions that fall within the scope of the claims.
Claims
1. A battery image processing method, comprising: Acquire a multi-frame sequence of original images, and perform noise reduction processing on the multi-frame sequence of original images to obtain a single-frame original image; wherein the multi-frame sequence of original images is a multi-frame image taken continuously within a preset time; Performing filtering processing on the single frame original image to obtain a first processed image; Linearly stretching the grayscale values of the pixels in the first processed image to obtain a second processed image; Perform histogram equalization on the grayscale values of the pixels in the second processed image to obtain a battery detection image.
2. The battery image processing method according to claim 1, wherein: The filtering process of the single frame original image to obtain a first processed image comprises: Determining a normal grayscale range of the single-frame original image; Determining the noise position in the single frame original image according to the grayscale value of the pixel point in the single frame original image and the normal grayscale range; The grayscale value of the noise position is set to a preset grayscale value.
3. The battery image processing method according to claim 2, wherein: Determining the normal grayscale range of the single-frame original image includes: Selecting a region of interest of the single frame original image; wherein the region of interest includes a plurality of pixel points; Calculating the histogram distribution of the grayscale values of the pixels in the region of interest; A normal grayscale range of the single-frame original image is determined according to the histogram distribution.
4. The battery image processing method according to claim 2 or 3, wherein: The determining the noise position in the single frame original image according to the grayscale value of the pixel point in the single frame original image and the normal grayscale range comprises: In response to the grayscale value of the pixel point exceeding the normal grayscale range, the pixel point is determined as the noise position.
5. The battery image processing method according to any one of claims 1 to 4, wherein: The filtering process of the single frame original image to obtain a first processed image further comprises: Traversing the pixel points in the single-frame original image, establishing a first local window for any pixel point, wherein the first local window includes a plurality of pixel points adjacent to the pixel point; Perform median filtering on the grayscale values of the pixels in the first local window to obtain the first processed image.
6. The battery image processing method according to any one of claims 1 to 5, wherein: The linearly stretching the grayscale values of the pixels in the first processed image to obtain the second processed image comprises: Traversing the pixel points in the first processed image, establishing a second local window for any pixel point, wherein the second local window includes a plurality of pixel points adjacent to the pixel point; The grayscale values of the pixels in the second local window are linearly stretched to obtain the second processed image.
7. The battery image processing method according to claim 6, wherein: The step of linearly stretching the grayscale values of the pixels in the second local window to obtain the second processed image comprises: The plurality of pixels in the second local window are arranged along row and column directions, and the grayscale values of the pixels in the second local window are bidirectionally linearly stretched to obtain the second processed image.
8. The battery image processing method according to any one of claims 1 to 7, wherein: The performing histogram equalization on the grayscale values of the pixels in the second processed image to obtain the battery detection image comprises: dividing the second processed image into a plurality of sub-images; Histogram equalization is performed on the multiple sub-images to obtain the battery detection image.
9. The battery image processing method according to claim 8, wherein: The performing histogram equalization on the multiple sub-images to obtain the battery detection image comprises: The pixel points in the sub-image are arranged along the row direction and the column direction, and the grayscale values of the pixel points in the sub-image are subjected to bidirectional histogram equalization to obtain the battery detection image.
10. The battery image processing method according to any one of claims 1 to 9, wherein: The acquiring of a plurality of original frames of a sequence of images and performing noise reduction processing on the plurality of original frames of a sequence of images to obtain a single original frame of an image comprises: According to a plurality of grayscale values corresponding to any pixel at the same position in the original image of the multi-frame sequence, it is determined whether the pixel has electronic noise; According to the judgment result, the grayscale value of the pixel corresponding to the single frame original image is determined.
11. The battery image processing method according to claim 10, wherein: The determining, based on the multiple grayscale values corresponding to any pixel at the same position in the multi-frame sequence original image, whether the pixel has electronic noise comprises: Calculate the standard deviation of the grayscale value of the pixel point according to multiple grayscale values corresponding to any pixel point at the same position in the multi-frame sequence original image; In response to the standard deviation of the grayscale value of the pixel being greater than a preset threshold, it is determined that electronic noise exists at the pixel.
12. The battery image processing method according to claim 10 or 11, wherein: Determining the grayscale value of the pixel corresponding to the single frame original image according to the judgment result includes: In response to the existence of electronic noise at the pixel point, clustering operations are performed on the plurality of grayscale values of the pixel point corresponding to the plurality of frame sequence original images, and marking the plurality of grayscale values as normal or abnormal according to the result of the clustering operation; An average value of the grayscale values marked as normal among the multiple grayscale values is calculated and used as the grayscale value of the corresponding pixel point in the single frame original image.
13. The battery image processing method according to any one of claims 10 to 12, wherein: Determining the grayscale value of the pixel corresponding to the single frame original image according to the judgment result includes: In response to the absence of electronic noise at the pixel point, an average value of a plurality of grayscale values of the pixel point corresponding to the multi-frame sequence original images is calculated and used as the grayscale value of the corresponding pixel point in the single frame original image.
14. A battery detection method, comprising: Acquire an image of the battery, wherein the image includes a plurality of original frames of a sequence of images; Processing the multi-frame sequence original image using the battery image processing method according to any one of claims 1 to 13 to obtain a battery detection image; A detection result of the battery is determined based on the battery detection image.
15. The battery detection method according to claim 14, wherein: The method further comprises: In response to the test result of the battery indicating that the battery is unqualified, the unqualified battery is rejected.
16. A battery image processing device, comprising: An acquisition module is configured to acquire a multi-frame sequence of original images, wherein the multi-frame sequence of original images is a multi-frame image taken continuously within a preset time; A noise reduction module is configured to perform noise reduction processing on the multi-frame sequence original image to obtain a single-frame original image; A first processing module is configured to perform filtering processing on the single frame original image to obtain a first processed image; A second processing module is configured to linearly stretch the grayscale values of the pixels in the first processed image to obtain a second processed image; The third processing module performs histogram equalization on the grayscale values of the pixels in the second processed image to obtain a battery detection image.
17. A battery detection device, comprising: An image acquisition module is configured to acquire an image of the battery, wherein the image includes a plurality of original frames of a sequence of images; An image processing module, configured to process the multi-frame sequence original image using the battery image processing method according to any one of claims 1 to 13 to obtain a battery detection image; The detection module is configured to determine a detection result of the battery based on the battery detection image.
18. An electronic device comprising at least one processor; as well as a memory communicatively coupled to the at least one processor; in The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the battery image processing method described in any one of claims 1 to 13 or the battery detection method described in any one of claims 14 to 15.
19. A battery production device comprising the electronic device according to claim 18.
20. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the battery image processing method according to any one of claims 1 to 13 or the battery detection method according to any one of claims 14 to 15 is implemented.
Citation Information
Patent Citations
Enhancement processing method and apparatus for traffic video image
CN105046677A
Image processing method and mobile terminal
CN105827971A
Video image processing method, device, and video coding system
CN108062746A
Image enhancement method and device for defect detection, detection system and storage medium
CN115631117A
Gap detection device and gap detection method
CN115839684A
Cited By
Sole edge detection method based on image gray value analysis
CN120635084A