Battery image processing method and apparatus, battery detection method and apparatus, and device and medium
By performing noise reduction, filtering, histogram equalization and linear stretching on the battery X-ray image, the problem of low image contrast is solved and higher image recognition accuracy and reliability are achieved.
Patent Information
- Application Number
- PCT/CN2023/122907
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-03
- Filing Date
- 2023-09-28
- Publication Date
- 2025-02-06
AI Technical Summary
The low contrast of X-ray images and blurred edges lead to limited accuracy of battery defect detection.
By performing noise reduction, filtering, histogram equalization and linear stretching on the original image of the multi-frame sequence, the results of the processing are fused to improve image contrast.
The contrast and signal-to-noise ratio of the image are significantly enhanced, the accuracy and reliability of image recognition are improved, and the thickness changes and defects of the battery pole plate can be better identified.
Smart Images

Figure CN2023122907_06022025_PF_FP_ABST
Abstract
Description
Battery image processing method, battery detection method, device, equipment and medium
[0001] Cross-references
[0002] This application refers to Chinese patent application No. 202310973133.6 filed on August 3, 2023, entitled “Battery Image Processing Method, Battery Detection Method, Device, Equipment and Medium”, which is incorporated into this application in its entirety by reference. 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, a device, a device, and a medium. 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] X-ray imaging technology has been applied to nondestructive testing of batteries. This technology can image the battery's internal components based on the varying X-ray absorption capacities of the various materials and thicknesses within the battery. Using X-ray imaging, the shape and dimensions of each component can be determined without damaging the battery structure. This image can then be used to identify various defects within the battery. X-ray images are multi-bit grayscale images, which contain a large amount of information. However, they have low contrast and blurred edges, making them difficult to visually identify and thus limiting the accuracy of battery defect detection.
[0006] Summary of the Invention
[0007] The present application aims to solve at least one of the technical problems existing in the background technology. To this end, one purpose of the present application is to provide a battery image processing method, a battery detection method, an apparatus, a device and a medium to improve the problem of low contrast of battery detection images.
[0008] An embodiment of the first aspect of the present application provides a battery image processing method, which includes: 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; the multi-frame sequence original image is a multi-frame image continuously acquired within a preset time; filtering the single-frame original image to obtain a first processed image; performing histogram equalization on the grayscale values of the pixels in the first processed image to obtain a second processed image; performing linear stretching on the grayscale values of the pixels in the first processed image to obtain a third processed image; and fusing the second processed image and the third processed image to obtain a battery detection image.
[0009] In the technical solution of the embodiments of the present application, after noise reduction, filtering, histogram equalization, and linear stretching are performed on the original multi-frame sequence, the image contrast is greatly enhanced and the signal-to-noise ratio is improved, which is beneficial to the accuracy and reliability of subsequent image recognition. By performing histogram equalization and linear stretching on the first processed image to obtain the second and third processed images, and then fusing the second and third processed images to obtain the battery inspection image, the contrast of local areas in the image can be enhanced, thereby better highlighting the thickness information of the electrode at different locations in the image, which helps to identify various defects in the battery electrode.
[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 image; in response to the grayscale value of any pixel in the single-frame image exceeding the normal grayscale range, determining that the pixel is a noise location; and in response to the pixel being a noise location, adjusting the grayscale value of the pixel to a preset grayscale value. Determining the noise location based on the pixel's grayscale value and the normal grayscale range for the single-frame image allows for identifying pixels with abnormal grayscale values and uniformly adjusting their grayscale values to the preset grayscale value. This facilitates further noise reduction of the grayscale values at the noise locations during subsequent image processing, thereby improving the signal-to-noise ratio of the image.
[0011] In some embodiments, determining the normal grayscale range of a single-frame image includes: selecting a region of interest (ROI) in the single-frame image; the ROI comprising a plurality of pixels; calculating a histogram distribution of the grayscale values of the pixels in the ROI; and determining the normal grayscale range of the single-frame image based on the histogram distribution. By selecting an appropriate ROI to determine the normal grayscale range of the single-frame image, noise locations can be more accurately determined, thereby facilitating subsequent noise reduction processing.
[0012] 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 each 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. Median filtering can eliminate isolated noise locations and, while filtering out noise, protect signal edges from blurring, facilitating subsequent image processing.
[0013] In some embodiments, performing histogram equalization on the grayscale values of pixels in a 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 a plurality of pixels adjacent to the pixel and arranged in parallel along a first direction; performing a first one-way histogram equalization on the grayscale values of the pixels in the second local window to obtain a first intermediate processed image; traversing the pixels in the first intermediate processed image, establishing a third local window for any pixel, the third local window including a plurality of pixels adjacent to the pixel and arranged in parallel along a second direction, performing a second one-way histogram equalization on the grayscale values of the pixels in the third local window to obtain a second processed image; the second direction is different from the first direction. By performing one-way histogram equalization within the local windows along different directions, the range of grayscale values in the local area can be widened, thereby increasing contrast and making the image clearer, which is more conducive to identifying thickness changes of a single-layer electrode in the image based on grayscale changes, thereby improving the accuracy and reliability of image detection.
[0014] In some embodiments, linearly stretching the grayscale values of pixels in a first processed image to obtain a third processed image includes: traversing the pixels in the first processed image, establishing a fourth local window for any pixel, the fourth local window including a plurality of pixels adjacent to the pixel and arranged in parallel along a first direction; performing a first unidirectional linear stretching process on the grayscale values of the plurality of pixels arranged in parallel along the first direction within the fourth local window to obtain a second intermediate processed image; traversing the pixels in the second intermediate processed image, establishing a fifth local window for any pixel, the fifth local window including a plurality of pixels adjacent to the pixel and arranged in parallel along a second direction; performing a second unidirectional linear stretching process on the grayscale values of the plurality of pixels arranged in parallel along the second direction within the fifth local window to obtain a third processed image; the second direction being different from the first direction. By performing unidirectional linear stretching within the local windows in different directions, the grayscale values of the pixels in the image can be mapped to a larger grayscale range, thereby enhancing the contrast of the image, more clearly displaying various details in the image, improving the image quality, and facilitating subsequent image recognition.
[0015] In some embodiments, the first direction is perpendicular to the second direction. The first direction and the second direction are perpendicular, so that unidirectional histogram equalization and / or unidirectional linear stretching can be performed on two mutually perpendicular directions in the pixel array of the image, thereby improving the overall contrast of the image and improving the image quality.
[0016] In some embodiments, fusing the second processed image and the third processed image to obtain a battery inspection image includes: traversing the pixels of the second processed image and the pixels of the third processed image, and for any pixel in the second processed image, taking the sum of the product of the grayscale value of the pixel and the first distribution coefficient, and the product of the grayscale value of the pixel at the corresponding position in the third processed image and the second distribution coefficient as the processed grayscale value of the corresponding pixel in the battery inspection image; wherein the sum of the first distribution coefficient and the second distribution coefficient is 1. Because the second processed image and the third processed image are images obtained by performing histogram equalization and linear stretching on the first processed image, respectively, weighted fusion of the two can simultaneously improve the uniformity and distribution range of the pixel grayscale value distribution, thereby improving the overall image quality while better displaying the thickness changes of a single-layer electrode, which is beneficial for subsequent image recognition and defect detection.
[0017] 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 any pixel at the same position in the multi-frame sequence of original images based on multiple grayscale values corresponding to the pixel; and determining the grayscale value of the pixel at the corresponding position in the single-frame original image based on the determination result. By determining the presence of electronic noise and determining the corresponding grayscale value, the impact of electronic noise on the pixel grayscale value can be reduced, thereby improving image quality.
[0018] In some embodiments, determining whether electronic noise exists at a pixel based on multiple grayscale values corresponding to any pixel at the same location 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 location 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 pixel being greater than a preset threshold. Calculating the standard deviation of the multiple grayscale values of the pixel at the same location in the multi-frame sequence of original images facilitates the identification and determination of electronic noise, facilitating subsequent noise reduction processing and improving the signal-to-noise ratio and image quality of the single-frame original image.
[0019] In some embodiments, based on the judgment result, determining the grayscale value of the pixel point at the corresponding position of the single-frame original image includes: in response to the presence of electronic noise in the pixel point, performing a clustering operation on the multiple grayscale values of the pixel point corresponding to the multi-frame sequence original image, and marking the multiple grayscale values as normal or abnormal according to 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 pixel point at the corresponding position in the single-frame original image. By identifying abnormal grayscale values through clustering operations and eliminating the abnormal grayscale values when recalculating the grayscale values of the pixel point, and taking the average value of the remaining normal grayscale values as the grayscale value of the pixel point, the influence of electronic noise on the grayscale value of the pixel point can be reduced, thereby improving the quality of the image.
[0020] In some embodiments, determining the grayscale value of a pixel at a corresponding position in the single-frame original image based on the judgment result further 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 multi-frame sequence of original images and using the average as the grayscale value of the pixel at the corresponding position in the single-frame original image. By using the average of the multiple grayscale values in the multi-frame sequence of original images as the grayscale value of the pixel to obtain the single-frame original image, various image errors and noise in the single-frame original image can be eliminated, resulting in a more uniform single-frame original image and better facilitating subsequent processing and recognition.
[0021] The second aspect of the present application provides a battery inspection method, comprising: obtaining an original inspection image of a battery, the original inspection image comprising a multi-frame sequence of original images; processing the multi-frame sequence of original images using the aforementioned battery image processing method to obtain a battery inspection image; and determining a battery inspection result based on the battery inspection image. The inspection image obtained by the aforementioned image processing method can more accurately detect defects within the battery, thereby improving the accuracy and reliability of battery inspection.
[0022] In some embodiments, the battery testing method further includes: rejecting the unqualified battery in response to the battery test result indicating that the battery is unqualified. Rejecting the unqualified battery based on the test result prevents the unqualified battery from being discharged or entering the next process, thereby improving the reliability of the quality of the discharged battery.
[0023] An embodiment of the third aspect of the present application provides a battery image processing device, which includes: an acquisition module, configured to acquire a multi-frame sequence original image, where the multi-frame sequence original image is a multi-frame image continuously acquired within a preset time; a noise reduction module, configured to perform noise reduction processing on the multi-frame sequence original image to obtain a single-frame original image; a first processing module, configured to perform filtering processing on the single-frame original image to obtain a first processed image; a second processing module, configured to perform histogram equalization on the grayscale values of pixels in the first processed image to obtain a second processed image; a third processing module, configured to perform linear stretching on the grayscale values of pixels in the first processed image to obtain a third processed image; and a fusion module, configured to fuse the second processed image and the third processed image to obtain a battery detection image.
[0024] An embodiment of the fourth aspect of the present application provides a battery detection device, which includes: an image acquisition module, configured to obtain a battery detection original image, the detection original image including a multi-frame sequence original image; an image processing device, configured to use the above-mentioned battery image processing method to process the multi-frame sequence original image to obtain a battery detection image or the above-mentioned battery image processing device; a defect detection module, configured to determine the battery detection result based on the battery detection image.
[0025] 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 above-mentioned battery image processing method or the above-mentioned battery detection method.
[0026] An embodiment of the sixth aspect of the present application provides a battery production device, which includes the above-mentioned electronic device or the above-mentioned battery testing device.
[0027] An embodiment of the seventh aspect of the present application provides a computer-readable storage medium storing a computer program, which implements the above-mentioned battery image processing method or the above-mentioned battery detection method when executed by a processor.
[0028] An embodiment of the eighth aspect of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the battery image processing method in the above embodiment or the above battery detection method.
[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 components or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments disclosed in this application and should not be construed as limiting the scope of this application.
[0031] FIG1 is a schematic structural diagram of an X-ray detection system in some embodiments of the present application;
[0032] FIG2 is a grayscale value distribution diagram of an edge area of an original battery detection image in some embodiments of the present application;
[0033] FIG3 is a flowchart of a battery image processing method according to some embodiments of the present application;
[0034] FIG4 is a grayscale value distribution diagram of an edge area of a battery detection image according to some embodiments of the present application;
[0035] FIG5 is a flow chart of a battery detection method according to some embodiments of the present application;
[0036] FIG6 is a structural block diagram of a battery image processing device according to some embodiments of the present application;
[0037] FIG7 is a structural block diagram of a battery detection device according to some embodiments of the present application;
[0038] FIG8 is a flowchart of a battery image processing method according to some other embodiments of the present application;
[0039] FIG9 is a processed battery detection image according to some embodiments of the present application.
[0040] Description of reference numerals:
[0041] X-ray detection system 100; ray source 110, carrier assembly 120, detector 130, battery 140, industrial computer 150, display 160, housing 170; X-ray 111, edge region 131;
[0042] Battery image processing device 600, acquisition module 610, noise reduction module 620, first processing module 630, second processing module 640, third processing module 650, fusion module 660;
[0043] Battery testing device 700 , image acquisition module 710 , image processing module 720 , defect detection module 730 . DETAILED DESCRIPTION
[0044] 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.
[0045] 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.
[0046] 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.
[0047] 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.
[0048] 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.
[0049] 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).
[0050] 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.
[0051] In the description of the embodiments of the present application, unless otherwise expressly specified or limited, technical terms such as "installed," "connected," "connect," and "fixed" should be understood in a broad sense. For example, they can refer to fixed connections, detachable connections, or integration; mechanical connections or electrical connections; direct connections or indirect connections through an intermediate medium; internal connections between two components or interactions between two components. Those skilled in the art can understand the specific meanings of the above terms in the embodiments of the present application based on specific circumstances.
[0052] When using X-rays to inspect batteries, it is usually necessary to identify the grayscale image obtained by the inspection to determine whether the battery has corresponding defects. For example, when the electrode inside the battery has defects such as wrinkles, folds, breakage or fragments, the thickness difference between the defective part and the surrounding normal part is usually the thickness of a single-layer electrode (about 100 microns (um)). When the battery thickness is thicker (for example, greater than 32 (millimeter) mm), the ratio of the thickness change of the single-layer electrode to the battery thickness becomes smaller, which will result in a smaller amount of ray attenuation caused by the radiation penetrating the single-layer electrode, making the corresponding grayscale difference in the image smaller, thereby increasing the difficulty of image recognition and making it difficult to accurately judge the defects inside the battery. In particular, as the size of the battery becomes larger, this problem becomes more prominent.
[0053] In addition, the ray source is usually a point light source, and the emitted rays are naturally conical beams. Some rays directed to the edge of the battery will penetrate out from the side of the battery. Since the thickness of the ray penetration is variable, the imaging of the edge of the battery will have a strong distortion area, and the grayscale difference of the single-layer electrode is also difficult to display in the distorted area.
[0054] Based on the above considerations, the present application proposes a battery image processing method, which pre-processes the frame sequence original image of the battery collected by the detector, 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, filtering the single-frame original image to obtain a first processed image; performing histogram equalization on the grayscale values of the pixels in the first processed image to obtain a second processed image; performing linear stretching on the grayscale values of the pixels in the first processed image to obtain a third processed image; and then fusing the second processed image and the third processed image to obtain a battery detection image. After the multi-frame sequence original image is subjected to noise reduction, filtering, histogram equalization and linear stretching processing, the contrast of the image is greatly enhanced, and the signal-to-noise ratio is improved, which is beneficial to the accuracy and reliability of subsequent image recognition, thereby being able to well identify defects corresponding to changes in the thickness of a single-layer electrode, alleviating the difficulty in identifying the small grayscale difference in the image when the thickness change of the single-layer electrode is too small compared to the thickness of the entire battery cell, and also alleviating the difficulty in identifying the small grayscale difference in the thickness of the single-layer electrode caused by the optical path distortion of the rays in the edge area.
[0055] The battery image processing method disclosed in the embodiments of this application can be used to preprocess battery images based on X-ray imaging, and can also be used to process images obtained by other radiation or imaging methods, thereby better distinguishing the contrast in the image to facilitate image recognition and defect detection. The battery detection method, battery detection device, and battery production equipment disclosed in the embodiments of this application can be used in the battery production and manufacturing process. The batteries detected or produced can be used in, but are not limited to, electrical devices such as vehicles, ships, or aircraft.
[0056] The present invention provides an electric device that uses a battery as a power source. The electric device may be, but is not limited to, a mobile phone, a tablet, a laptop computer, an electric toy, an electric tool, a battery-powered vehicle, an electric car, a ship, a spacecraft, etc. The electric toy may include a fixed or mobile electric toy, such as a game console, an electric car toy, an electric ship toy, and an electric airplane toy, etc. The spacecraft may include an airplane, a rocket, a space shuttle, and a spacecraft, etc.
[0057] Please refer to Figures 1 and 2. Figure 1 shows a schematic diagram of the structure of an X-ray inspection system in some embodiments of the present application, and Figure 2 shows a grayscale value distribution diagram of the edge region of an original battery inspection image in some embodiments of the present application. As shown in Figure 1, X-ray inspection system 100 includes a radiation source 110, a carrier assembly 120, a detector 130, an industrial computer 150, and a display 160.
[0058] The radiation source 110 and the detector 130 are spaced apart from each other. The supporting assembly 120 is located between the radiation source 110 and the detector 130 and is used to support the battery 140 to be detected.
[0059] Radiation source 110 is a device for emitting detection radiation, primarily comprising a radiation tube and a corresponding power supply. Radiation source 110 emits radiation 111 that is X-ray. In some examples, radiation 111 may also be other radiation. Radiation source 110 may be open (open tube) or enclosed (closed tube).
[0060] Detector 130 may be a two-dimensional flat panel detector configured to receive attenuated X-rays 111 after passing through battery 140 and convert them into corresponding electrical signals for imaging. In some examples, flat panel detector 130 may be an indirect flat panel detector that absorbs attenuated X-rays and emits visible light of varying intensities, which then absorbs the visible light to generate corresponding electrical signals.
[0061] When the ray 111 emitted by the ray source 110 passes through the battery 140, due to the difference in the materials of the anode and cathode plates in the battery 140 (the anode surface is carbon powder, which has weak absorption of rays; the cathode surface is lithium ion material, which has strong absorption of rays), different materials have different absorption rates of X-rays. The detector 130 can convert the X-rays absorbed at different positions and with different attenuation degrees into corresponding electrical signals and use them to generate the original frame sequence image.
[0062] The industrial computer 150 may be pre-installed with a corresponding image processing algorithm to process the original frame sequence image and send it to the display 160 for display. By processing the original frame sequence image, it is more convenient to recognize the image and obtain the position information and defect information of each component within the battery 140, thereby realizing defect detection of the battery 140.
[0063] As shown in Figure 2, the distribution range of the grayscale values of the pixels in the edge area S1 of the original image is mainly concentrated between 16950 and 17050. For a 16-bit image, this grayscale value distribution range is relatively narrow, and much information in the image cannot be clearly presented, especially the defects corresponding to the thickness change of a single-layer electrode, such as electrode fragments, electrode wrinkles, electrode breakage, and electrode winding feed position defects, which are difficult to identify well.
[0064] Please refer to Figures 3 and 4. Figure 3 shows a flowchart of a battery image processing method according to some embodiments of the present application. Figure 4 shows a grayscale value distribution diagram of an edge region of a battery detection image according to some embodiments of the present application.
[0065] This embodiment of the present application provides a battery image processing method 200, which includes:
[0066] Step S210: 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; the multi-frame sequence original image is a multi-frame image continuously obtained within a preset time.
[0067] Step S220: performing filtering processing on the single frame original image to obtain a first processed image.
[0068] Step S230: performing histogram equalization on the grayscale values of the pixels in the first processed image to obtain a second processed image.
[0069] Step S240: linearly stretching the grayscale values of the pixels in the first processed image to obtain a third processed image.
[0070] Step S250: Fusing the second processed image and the third processed image to obtain a battery detection image.
[0071] The multi-frame sequence original image in step S210 is a multi-frame image acquired continuously within a preset time. For example, the detector 130 of the X-ray detection system 100 acquires an image of the battery 140. The detector 130 is triggered by a PLC or software to acquire all the frame sequence original images of the battery 140 output by the detector 130 and acquired within a short preset time. The multi-frame sequence original images are images of the same size. The preset time can be set according to actual needs, for example, 1 second (s). Denoising the multi-frame sequence original image means processing the grayscale value of the same pixel in different frame sequence original images, identifying and removing the electronic noise of the pixel, and reassigning the grayscale value after noise reduction to the pixel to obtain a single frame original image. In some examples, the multi-frame sequence original image that undergoes noise reduction removes several frame sequence original images initially obtained to avoid interference from image delay and afterimage. The multi-frame sequence original image can be copied from the central processing unit (CPU) to the graphic processing unit (GPU) through a signal connection, or can be called from other storage media. The battery 140 may be a wound battery, a cylindrical battery, or a laminated battery.
[0072] Filtering the single-frame original image in step S220 involves filtering the grayscale values of each pixel in the single-frame original image, reassigning the grayscale values of pixels identified as noise locations to produce a first processed image. The filtering method can be either linear or nonlinear. Filtering can suppress noise in the single-frame original image while preserving image detail as much as possible, thereby improving the effectiveness and reliability of subsequent image processing and recognition.
[0073] Histogram equalization in step S230 is a method for enhancing image contrast. It primarily uses the image's cumulative distribution function and the principle of histogram equalization to determine a mapping relationship between input and output. The cumulative distribution function can be used to transform the image's histogram distribution into a nearly uniform distribution, thereby enhancing the image's contrast. In this embodiment, the grayscale values of the pixels in the first processed image are histogram-equalized to produce the second processed image.
[0074] In step S240, linear stretching of the first processed image refers to transforming the grayscale values of the pixels of the image using a specified linear function to enhance or weaken the grayscale of the pixels. Through linear stretching, the grayscale value of each pixel is recalculated to obtain a third processed image with enhanced contrast.
[0075] In step S250, the grayscale values of the pixels at the same position in the second processed image that has undergone histogram equalization processing and the third processed image that has undergone linear stretching processing are fused. For example, the grayscale values of the pixels at the same position in the second processed image and the third processed image are weighted to obtain the grayscale value of the pixel at that position, thereby obtaining a battery detection image that has completed preprocessing.
[0076] As shown in Figures 2 and 4, the grayscale value of the edge area S1 of the battery detection image obtained after processing ranges from 0 to 40000, which is significantly improved compared to the grayscale value range of 16950-17050 of the edge area S1 before processing. It can be seen that the contrast of the battery detection image obtained after processing by the image processing method of this embodiment is significantly enhanced.
[0077] It is understood that the numbering of steps S210-S240 in this embodiment is merely for ease of description and does not limit the order of the steps. For example, there is no order restriction between step S230 and step S240; they can be performed separately or in any order, and this embodiment does not impose any restrictions on this.
[0078] After denoising, filtering, histogram equalization, and linear stretching the original multi-frame sequence, the image contrast is greatly enhanced and the signal-to-noise ratio is improved, which is beneficial to the accuracy and reliability of subsequent image recognition. By performing histogram equalization and linear stretching on the first processed image to obtain the second and third processed images, and then fusing the second and third processed images to obtain the battery inspection image, the contrast of local areas in the image can be enhanced, thereby better highlighting the thickness information of the electrode at different locations in the image, helping to identify various defects in the battery electrode.
[0079] According to some embodiments of the present application, step S220 includes:
[0080] Determine the normal grayscale range of a single frame image;
[0081] In response to a grayscale value of any pixel point in a single-frame image exceeding a normal grayscale range, the pixel point is determined to be a noise position;
[0082] In response to the pixel being a noise position, the grayscale value of the pixel is adjusted to a preset grayscale value.
[0083] The normal grayscale range of a single-frame image refers to the distribution range of the normal response of the overall grayscale value in a single frame. Because the grayscale values of noise points are usually extreme, these extreme values add or subtract from the true grayscale values of the image pixels, causing interference with bright and dark spots in the image, significantly reducing image quality and affecting subsequent tasks such as image restoration, segmentation, feature extraction, and image recognition.
[0084] By comparing the grayscale value of a pixel with the normal grayscale range, it can be determined whether the pixel is a noise location. The grayscale value of a pixel exceeds the normal grayscale range, which means that the grayscale value of the pixel is outside the normal grayscale range. For example, the grayscale value of the pixel is greater than the maximum value of the normal grayscale range or less than the minimum value of the normal grayscale range. If the pixel is determined to be a noise location, the grayscale value of the pixel is adjusted to a preset grayscale value, so that the grayscale values of the pixels at the noise location have the same extreme value. The preset grayscale value can be determined based on the bit depth of the image. In some examples, the single-frame image is a 16-bit image, and the preset grayscale value is 0 or 65535.
[0085] By determining the noise position based on the grayscale value of the pixel and the normal grayscale range of the single-frame image, the pixel points with abnormal grayscale values can be identified and the grayscale values can be uniformly adjusted to the preset grayscale values, which is conducive to further noise reduction of the grayscale values of the noise position in subsequent image processing, thereby improving the signal-to-noise ratio of the image.
[0086] According to some embodiments of the present application, determining a normal grayscale range of a single-frame image includes:
[0087] Selecting a region of interest from a single frame image; the region of interest includes multiple pixels;
[0088] Calculate the histogram distribution of the grayscale values of pixels in the region of interest;
[0089] Determine the normal grayscale range of a single-frame image based on the histogram distribution.
[0090] The region of interest can be any area in a single-frame image, and the size of the region of interest can be determined based on the size of the image and its location. In some examples, the region of interest can be a window of a certain size corresponding to the center area of the battery in a single-frame image. Since there is no grayscale distortion caused by optical path distortion at the position of the center area of the battery in the single-frame image, it can more truly reflect the grayscale range corresponding to the electrode state of the battery. The window contains multiple pixels, and the histogram distribution is the statistical distribution probability of different grayscale values. The horizontal axis of the histogram is the grayscale value, and the vertical axis is the number of pixels corresponding to each grayscale level in the image. The overall grayscale distribution of the region of interest can be displayed through the histogram distribution.
[0091] By calculating the histogram distribution of the grayscale values of multiple pixels in the window, according to the principle of X-ray imaging, the normal distribution range of the overall grayscale of the battery is obtained, and it is determined as the normal grayscale range of a single frame image.
[0092] By selecting a suitable region of interest to determine the normal grayscale range of a single-frame image, the noise position can be determined more accurately, which is beneficial to subsequent noise reduction processing.
[0093] According to some embodiments of the present application, step S220 further includes:
[0094] Traversing the pixels in the single-frame original image, establishing a first local window for any pixel, where the first local window includes a plurality of pixels adjacent to the pixel;
[0095] Perform median filtering on the grayscale values of the pixels in the first local window to obtain a first processed image.
[0096] The size of the first local window can be set according to the size of the single-frame original image. The median filtering method is a nonlinear smoothing technique that sets the grayscale value of each pixel to the median of the grayscale values of all pixels in a certain neighborhood window of the point, thereby obtaining a first processed image. In some examples, the first local window includes a plurality of pixels arranged along a first direction and a plurality of pixels arranged along a second direction. For example, the first local window can be a two-dimensional array window of N×N pixel points. For example, 8 pixel points adjacent to a certain pixel point, a total of 9 pixel points, are taken to form a 3×3 pixel matrix as the first local window, the grayscale values of the 9 pixel points in the first local window are sorted by size, and the median value is taken as the grayscale value of the pixel point.
[0097] Isolated noise locations can be eliminated by median filtering, and while filtering out noise, the edges of the signal can be protected so that they are not blurred, which is beneficial for subsequent image processing.
[0098] According to some embodiments of the present application, step S230 includes:
[0099] Traversing the pixels in the first processed image, establishing a second local window for any pixel, where the second local window includes a plurality of pixels adjacent to the pixel and arranged in parallel along the first direction;
[0100] Performing a first unidirectional histogram equalization process on the grayscale values of a plurality of pixel points arranged in parallel along the first direction in the second local window to obtain a first intermediate processed image;
[0101] Traverse the pixels in the intermediate processed image and establish a third local window for any pixel. The third local window includes multiple pixels adjacent to the pixel and arranged in parallel along the second direction.
[0102] Performing a second unidirectional histogram equalization process on the grayscale values of a plurality of pixels arranged in parallel along a second direction within the second local window to obtain a second processed image;
[0103] The second direction is different from the first direction.
[0104] The second local window and the third local window are one-dimensional windows along different directions. The number of pixels in the second local window and the third local window can be the same or different, and can be set according to the image size and needs. In one example, the second local window is centered on a certain pixel point and is composed of a number of pixels not exceeding a preset number along both ends parallel to the first direction. For example, the preset number is 50, and 50 pixels at both ends of a certain pixel point are taken along the first direction, totaling 101 pixels to form the second local window. It is understandable that when the number of pixels at one end of a certain pixel point is less than the preset number, all of the pixels can be included in the local window. For example, if a certain pixel point is the first pixel point along the first direction, the second local window of the pixel point only includes the 50 pixels at the other end and the pixel point itself, for a total of 51 pixels. The selection method of the third local window is similar to that of the second local window and will not be repeated in this embodiment.
[0105] Histogram equalization enhances contrast by adjusting grayscale values using a cumulative function. Unidirectional histogram equalization applies nonlinear stretching to multiple pixels within a local window in a single direction of the image, redistributing pixel values to maintain a roughly uniform number of pixels within a given grayscale range.
[0106] It should be noted that the first direction and the second direction are different directions, and this embodiment does not directly limit the specific directions. That is, the first unidirectional histogram equalization and the second histogram equalization are unidirectional histogram equalization performed along different directions, and this embodiment does not limit the order of the specific directions.
[0107] By performing unidirectional histogram equalization in a local window along different directions, the range of grayscale values in the local area can be widened, thereby increasing the contrast and making the image clearer. This is more conducive to identifying the thickness changes of single-layer electrodes in the image based on grayscale changes, thereby improving the accuracy and reliability of image detection.
[0108] According to some embodiments of the present application, step S240 includes:
[0109] Traversing the pixels in the first processed image, establishing a fourth local window for any pixel, where the fourth local window includes a plurality of pixels adjacent to the pixel and arranged in parallel along the first direction;
[0110] Performing a first unidirectional linear stretching process on the grayscale values of a plurality of pixel points arranged in parallel along the first direction within the fourth local window to obtain a second intermediate processed image;
[0111] Traversing the pixels in the second intermediate processed image, establishing a fifth local window for any pixel, where the fifth local window includes a plurality of pixels adjacent to the pixel and arranged in parallel along the second direction;
[0112] Performing a second unidirectional linear stretching process on the grayscale values of a plurality of inner pixels arranged in parallel along the second direction in the fifth local window to obtain a third processed image;
[0113] The second direction is different from the first direction.
[0114] The fourth and fifth local windows are established similarly to the second local window, along a specific direction, and will not be further described here. By performing a unidirectional linear stretch on the pixels within the local window, the grayscale values of the pixels can be mapped to a wider dynamic range. As shown in Figure 4, after processing, the grayscale difference in the rear edge region S1 reaches approximately 40,000, which meets the requirements of human visual recognition.
[0115] It should be understood that the first and second directions claimed in this embodiment are merely intended to indicate different directions and are not intended to limit specific directions. The first uniaxial stretching and the second uniaxial stretching also represent linear stretching in different directions, respectively, and the specific directions should not be construed as limiting the order of uniaxial stretching. It should be noted that the first and second directions in this embodiment may be the same as or different from the first and second directions described above.
[0116] By performing unidirectional linear stretching within a local window in different directions, the grayscale values of pixels in the image can be mapped to a larger grayscale range. This can enhance the contrast of the image, display various details in the image more clearly, improve the image quality, and facilitate subsequent image recognition.
[0117] According to some embodiments of the present application, the first direction is perpendicular to the second direction.
[0118] The first direction and the second direction may be, respectively, mutually perpendicular row and column directions in the image pixel array. In some examples, a first unidirectional histogram equalization may be performed along the row direction, followed by a second unidirectional histogram equalization along the column direction. In another example, a first unidirectional linear stretching may be performed along the row direction, followed by a second unidirectional linear stretching along the column direction. Alternatively, a first unidirectional linear stretching may be performed along the column direction, followed by a second unidirectional linear stretching along the row direction.
[0119] The first direction is perpendicular to the second direction, so that unidirectional histogram equalization and / or unidirectional linear stretching can be performed on the two mutually perpendicular directions in the pixel array of the image, thereby enhancing the overall contrast of the image and improving the image quality.
[0120] According to some embodiments of the present application, step S250 includes:
[0121] Traverse the pixels of the second processed image and the pixels of the third processed image,
[0122] For any pixel in the second processed image, the product of the grayscale value of the pixel and the first distribution coefficient and the sum of the grayscale value of the pixel at the corresponding position in the third processed image and the second distribution coefficient are taken as the grayscale value of the pixel after processing, to obtain a preprocessing result image;
[0123] The sum of the first distribution coefficient and the second distribution coefficient is 1.
[0124] The first and second distribution coefficients are both positive numbers less than 1, and the sum of the first and second distribution coefficients is 1. The fusion of the second processed image and the third processed image is to weight the grayscale values of the pixels at the same position. The grayscale values of the pixels in the second processed image are multiplied by the first distribution coefficient, and the grayscale values of the pixels in the third processed image are multiplied by the second distribution coefficient. The grayscale values obtained by adding them together are used as the grayscale values of the pixels at that position to obtain the preprocessing result image. The values of the first and second distribution coefficients can be determined based on the quality of the specific image. In one example, the first and second distribution coefficients can both be 0.5.
[0125] Since the second processed image and the third processed image are obtained by histogram equalization and linear stretching respectively on the basis of the first processed image, weighted fusion of the two can simultaneously improve the uniformity and distribution range of the grayscale value distribution of the pixel points, thereby improving the overall image quality and better showing the thickness changes of the single-layer electrode, which is beneficial to subsequent image recognition and defect detection.
[0126] According to some embodiments of the present application, step S210 includes:
[0127] According to the multiple grayscale values corresponding to any pixel at the same position in the multi-frame sequence original image, it is determined whether the pixel has electronic noise;
[0128] According to the judgment result, the grayscale value of the pixel point at the corresponding position of the single frame original image is determined.
[0129] Multi-frame sequence images are images acquired continuously over a short period of time. The target components in the images are located in almost the same position. However, due to differences in image acquisition conditions and environments, the grayscale values of pixels at the same position in the images may vary between different original images. This method extracts the grayscale values corresponding to a pixel at a certain position in the multi-frame sequence images and determines whether there is electronic noise in these grayscale values. Based on the determination results, the grayscale value of the pixel at the corresponding position is determined.
[0130] By determining whether electronic noise exists and determining the corresponding grayscale value, the impact of electronic noise on the grayscale value of the pixel can be reduced, thereby improving image quality.
[0131] According to some embodiments of the present application, determining 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 of original images includes:
[0132] Calculate the standard deviation of the grayscale value of the pixel point based on the multiple grayscale values corresponding to any pixel point at the same position in the multi-frame sequence original image;
[0133] In response to the standard deviation of the pixel being greater than a preset threshold, it is determined that electronic noise exists at the pixel.
[0134] Image noise refers to random, discrete, and isolated pixels that appear in an image due to factors such as imaging sensor noise, photo grain noise, and channel transmission errors during image transmission. This is called image noise. Image noise is often visually distinct from its neighboring pixels, such as white dots in a black area or black dots in a white area. The standard deviation of the grayscale values corresponding to the same pixel position in a multi-frame sequence is calculated and compared with a preset threshold to determine whether the grayscale value is significantly different from other grayscale values, thereby determining the presence of electronic noise. The preset threshold can be selected based on the grayscale value.
[0135] By calculating the standard deviation of multiple grayscale values of pixels at the same position in a multi-frame sequence original image, electronic noise can be more easily identified and determined, which is beneficial for subsequent noise reduction processing and improves the signal-to-noise ratio and image quality of a single-frame original image.
[0136] According to some embodiments of the present application, determining the grayscale value of a pixel at a corresponding position of a single-frame original image according to the judgment result includes:
[0137] In response to the presence of electronic noise in the pixel, clustering operations are performed on multiple grayscale values of the original multi-frame sequence of the pixel, and the multiple grayscale values are marked as normal or abnormal according to the results of the clustering operations;
[0138] Calculate the average value of the grayscale values marked as normal among multiple grayscale values and use it as the grayscale value of the pixel at the corresponding position in the single-frame original image.
[0139] Clustering is an unsupervised learning method that can segment a dataset into classes or clusters based on specific criteria and characteristics. The goal is to minimize the variance of data within the same class or cluster and maximize the variance of data between different classes or clusters. An example of this is the k-means algorithm. Through clustering, multiple grayscale values at the same location are classified as normal and abnormal, and labeled accordingly.
[0140] In response to the presence of electronic noise in a pixel, it means that there is an abnormal grayscale value, which can be identified through clustering operation and marked as abnormal. The grayscale values marked as abnormal are then removed, and the average of the remaining normal grayscale values is taken and assigned to the grayscale value of the pixel.
[0141] By identifying abnormal grayscale values through clustering operations and eliminating them when recalculating the grayscale values of pixels, the average of the remaining normal grayscale values is taken as the grayscale value of the pixel. This can reduce the impact of electronic noise on the grayscale value of the pixel and improve the quality of the image.
[0142] According to some embodiments of the present application, determining the grayscale value of a pixel at a corresponding position of the single-frame original image according to the judgment result further includes:
[0143] In response to the absence of electronic noise at the pixel point, an average value of multiple grayscale values corresponding to the pixel point in the multi-frame sequence original image is calculated and used as the grayscale value of the pixel point at the corresponding position in the single frame original image.
[0144] When the standard deviation of multiple grayscale values of a pixel point is less than or equal to a preset threshold, it is determined that there is no electronic noise at the pixel point. At this time, the average value of the multiple grayscale values is directly taken as the grayscale value of the pixel point, thereby obtaining a single-frame original image.
[0145] By taking the mean of multiple grayscale values in a multi-frame sequence of original images as the grayscale value of the pixel to obtain a single-frame original image, various image errors and noises in the single-frame original image can be eliminated. The resulting single-frame original image is more uniform and more conducive to subsequent processing and recognition.
[0146] Please refer to FIG5 , which shows a flow chart of a battery detection method according to some embodiments of the present application.
[0147] An embodiment of a second aspect of the present application provides a battery detection method, comprising:
[0148] Step S510: obtaining a detection original image of the battery, where the detection original image includes a plurality of frame sequence original images;
[0149] Step S520: using the above-mentioned battery image processing method to process the multi-frame sequence original image to obtain a battery detection image;
[0150] Step S530: determining a battery detection result based on the battery detection image.
[0151] The original inspection image can be acquired by an image acquisition device, such as an X-ray inspection device, or can be retrieved from a memory. The battery image processing method can be the image processing method in the above-mentioned embodiment. Determining the battery inspection result based on the battery inspection image means identifying the battery inspection image after image processing to determine whether there are corresponding defects inside the battery, and then outputting the corresponding inspection result.
[0152] The inspection image obtained by the above-mentioned image processing method can more accurately detect defects in the battery, thereby improving the accuracy and reliability of battery inspection.
[0153] According to some embodiments of the present application, the battery detection method further includes:
[0154] In response to the test result of the battery indicating that the battery is unqualified, the unqualified battery is rejected.
[0155] The test results include OK and NG. OK indicates that the battery is qualified, indicating that the battery has no corresponding defects and meets the corresponding quality requirements, and can be directly discharged or enter the next process. NG indicates that the battery is unqualified, indicating that the battery has defects and does not meet the corresponding quality requirements. The battery needs to be rejected or re-inspected.
[0156] Removing unqualified batteries based on the test results can prevent them from flowing out or entering the next process, which is beneficial to improving the reliability of the quality of the batteries flowing out.
[0157] Please refer to FIG. 6 , which shows a structural block diagram of a battery image processing device according to some embodiments of the present application.
[0158] An embodiment of the third aspect of the present application provides a battery image processing device 600 , which includes an acquisition module 610 , a noise reduction module 620 , a first processing module 630 , a second processing module 640 , a third processing module 650 and a fusion module 660 .
[0159] The acquisition module 610 is configured to acquire a multi-frame sequence original image, which is a multi-frame image continuously acquired within a preset time; the noise reduction module 620 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 630 is configured to filter the single-frame original image to obtain a first processed image; the second processing module 640 is configured to perform histogram equalization on the grayscale values of the pixels in the first processed image to obtain a second processed image; the third processing module 650 is configured to perform linear stretching on the grayscale values of the pixels in the first processed image to obtain a third processed image; the fusion module 660 is configured to fuse the second processed image and the third processed image to obtain a battery detection image.
[0160] The acquisition module 610 can directly receive the multi-frame sequence of original battery images collected by the detector, or it can obtain the multi-frame sequence of original images by retrieving image data stored in other memories. The battery image processing device 600 can process the multi-frame sequence of original images, eliminate image noise, and enhance image contrast, thereby facilitating the identification of defects such as thickness variations of single-layer electrode sheets in the image during subsequent image recognition.
[0161] Each module in the battery image processing device 600 can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in an electronic device in the form of hardware, or can be stored in a memory in the electronic device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0162] Please refer to FIG. 7 , which shows a structural block diagram of a battery detection device according to some embodiments of the present application.
[0163] The fourth aspect of the present application provides a battery inspection device 700, comprising an image acquisition module 710, an image processing device 720, and a defect detection module 730. The image acquisition module 710 is configured to acquire an original inspection image of the battery, wherein the original inspection image comprises a multi-frame sequence of original images; the image processing device 720 is configured to process the multi-frame sequence of original images using the battery image processing method described above to obtain a battery inspection image, or the battery image processing device 600 described above; and the defect detection module 730 is configured to determine a battery inspection result based on the battery inspection image.
[0164] Image acquisition module 710 can be a radiographic inspection device, such as the X-ray inspection system 100 described in the aforementioned embodiment. Image processing device 720 is signal-connected to image acquisition module 710 to receive the original inspection image captured by image acquisition module 710 and perform image processing. Defect detection module 730 can be pre-configured with an image recognition algorithm to identify and detect defects in the processed battery inspection image and output the corresponding inspection results.
[0165] The battery detection device 700 can realize image acquisition and defect detection of batteries, and by processing the acquired images, reduce image noise and improve image contrast, thereby improving the accuracy and reliability of battery detection.
[0166] 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 above-mentioned battery image processing method or the above-mentioned battery detection method.
[0167] An embodiment of the sixth aspect of the present application provides a battery production device, which includes the above-mentioned electronic device or the above-mentioned battery testing device.
[0168] An embodiment of the seventh aspect of the present application provides a computer-readable storage medium storing a computer program, which implements the above-mentioned battery image processing method or the above-mentioned battery detection method when executed by a processor.
[0169] An embodiment of the eighth aspect of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the battery image processing method in the above embodiment or the above battery detection method.
[0170] The battery image processing method of the present application is further described below with reference to a specific embodiment. Please refer to Figure 8, which shows a flowchart of the battery image processing method of another embodiment of the present application, and Figure 9 shows the processed battery detection image of the embodiment of the present application. Specifically, the following steps are included:
[0171] S801: Triggered by PLC or software, the data acquisition module obtains the battery detection original image output by the detector, and the detection original image includes all frame sequence original images.
[0172] S802: discard the first few frames of the sequence to avoid interference from image delay and afterimage.
[0173] S803: Copy the original multi-frame sequence from the CPU to the GPU.
[0174] S804: Calculate the average and standard deviation of the grayscale values of the pixel at the same position in the original image of the multi-frame sequence.
[0175] S805: Compare the calculated standard deviation with a preset threshold to determine whether electronic noise exists at a certain pixel point.
[0176] S806: When the standard deviation of a certain pixel position is less than a preset threshold, it is determined that there is no electronic noise, and the grayscale values of all frames at that position are directly averaged and assigned to the corresponding position of the single frame original image.
[0177] S807: When the standard deviation of a certain pixel position is greater than a preset threshold, a clustering operation is performed to mark all grayscale values as normal and abnormal, remove abnormal grayscale values, calculate the average value of the remaining normal grayscale values and assign them to a specified position in the single frame original image.
[0178] S808: According to the relative position relationship between the center of the battery and the captured image, a ROI (Region of Interest) of a certain size window in the center area of the battery in the image is obtained.
[0179] S809: Calculate the histogram distribution of the grayscale value in the ROI, and obtain the distribution range of the normal grayscale response in the battery area based on the principle of X-ray imaging.
[0180] S810: According to the normal grayscale value range obtained in S808, mark the noise position in the single frame image and adjust its grayscale value to 0 or 65535.
[0181] S811: Traverse all pixels and establish a local window for each pixel.
[0182] S812: Perform median filtering on the local window to obtain a first processed image.
[0183] S813: Traverse all pixel points and establish a local window for each pixel point.
[0184] S814: Perform one-way histogram equalization on the local window to obtain a second processed image.
[0185] The specific histogram equalization method is: assuming that the pixel density function of the histogram before equalization is p(x), and the statistical grayscale difference is dx, then the number of pixels in each grayscale difference is p(x)dx, and the pixel density after equalization is p(y), and p(y) is a constant, assuming it is 1. The number of pixels before and after equalization remains unchanged, then the following formula and changes are obtained:
[0186] Among them, S813 and S814 include establishing local windows in the row direction and the column direction respectively, and then performing unidirectional histogram equalization on the local windows in the row direction and the local windows in the column direction respectively.
[0187] S815: Traverse all pixels and establish a local window for each pixel.
[0188] S816: Perform unidirectional linear stretching on the local window, recalculate the grayscale value of each point, and obtain a third processed image.
[0189] Among them, S815 and S816 include establishing local windows along the row direction and the column direction respectively, and then performing unidirectional linear stretching on the local windows in the row direction and the local windows in the column direction respectively.
[0190] S817: Fusing the second processed image obtained in S013 and the third processed image obtained in S015.
[0191] S818: Copy from GPU to CPU.
[0192] S819: Output the pre-processed battery detection image.
[0193] As shown in Figure 9, the battery inspection image obtained after processing can well display the various defect states of the internal battery electrodes, such as electrode fragments S2 located at the edge position, electrode wrinkles S3, electrode winding and feeding position S4, and electrode fragments S5 overlapping with the winding and feeding position, thereby enabling accurate detection of various defects in the internal battery electrodes.
[0194] 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 original image, and perform noise reduction processing on the multi-frame sequence original image to obtain a single-frame original image; the multi-frame sequence original image is a multi-frame image acquired continuously within a preset time; Performing filtering processing on the single frame original image to obtain a first processed image; Performing histogram equalization on the grayscale values of the pixels in the first processed image to obtain a second processed image; Linearly stretching the grayscale values of the pixels in the first processed image to obtain a third processed image; The second processed image and the third processed image are fused 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 image; In response to a grayscale value of any pixel in the single-frame image exceeding the normal grayscale range, determining the pixel as a noise position; In response to the pixel being a noise position, the grayscale value of the pixel is adjusted 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 image includes: Selecting a region of interest of the single-frame image; 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 image is determined according to the histogram distribution.
4. The battery image processing method according to any one of claims 1 to 3, 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.
5. The battery image processing method according to any one of claims 1 to 4, wherein: The performing histogram equalization on 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 and arranged in parallel along a first direction; Performing a first unidirectional histogram equalization process on the grayscale values of the pixels in the second local window to obtain a first intermediate processed image; Traversing the pixel points in the first intermediate processed image, establishing a third local window for any pixel point, wherein the third local window is adjacent to the pixel point and includes a plurality of pixel points arranged in parallel along the second direction; Performing a second unidirectional histogram equalization process on the grayscale values of the pixels in the third local window to obtain a second processed image; The second direction is different from the first direction.
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 third processed image comprises: Traversing the pixel points in the first processed image, establishing a fourth local window for any pixel point, the fourth local window including a plurality of pixel points adjacent to the pixel point and arranged in parallel along a first direction; Performing a first unidirectional linear stretching process on the grayscale values of a plurality of pixel points arranged in parallel along the first direction in the fourth local window to obtain a second intermediate processed image; Traversing the pixel points in the second intermediate processed image, establishing a fifth local window for any pixel point, the fifth local window including a plurality of pixel points adjacent to the pixel point and arranged in parallel along the second direction, Performing a second unidirectional linear stretching process on the grayscale values of a plurality of pixel points arranged in parallel along the second direction in the fifth local window to obtain a third processed image; The second direction is different from the first direction.
7. The battery image processing method according to claim 5 or 6, wherein: The first direction is perpendicular to the second direction.
8. The battery image processing method according to any one of claims 1 to 7, wherein: The fusing the second processed image and the third processed image to obtain the battery detection image comprises: Traversing the pixels of the second processed image and the pixels of the third processed image, For any pixel in the second processed image, the product of the grayscale value of the pixel and the first allocation coefficient, and the sum of the product of the grayscale value of the pixel at the position corresponding to the pixel in the third processed image and the second allocation coefficient are used as the grayscale value of the corresponding pixel in the battery detection image; The sum of the first allocation coefficient and the second allocation coefficient is 1.
9. The battery image processing method according to any one of claims 1 to 8, 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 multi-frame sequence original image, determining whether the pixel has electronic noise; According to the judgment result, the gray value of the pixel point at the corresponding position of the single frame original image is determined.
10. The battery image processing method according to claim 9, wherein: The determining, based on a plurality of 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 pixel being greater than a preset threshold, it is determined that electronic noise exists at the pixel.
11. The battery image processing method according to claim 9 or 10, wherein: Determining the grayscale value of the pixel point at the corresponding position of the single frame original image according to the judgment result includes: In response to the presence 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 the plurality of grayscale values are marked as normal or abnormal according to the result of the clustering operation, The average value of the grayscale values marked as normal among the multiple grayscale values is calculated and used as the grayscale value of the pixel point at the corresponding position in the single-frame original image.
12. The battery image processing method according to any one of claims 9 to 11, wherein: Determining the grayscale value of the pixel point at the corresponding position of the single frame original image according to the judgment result also 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 pixel point at the corresponding position in the single frame original image.
13. A battery detection method, comprising: Acquire a detection original image of the battery, wherein the detection original image includes a plurality of frame sequence original images; Processing the multi-frame sequence original image using the battery image processing method described in any one of claims 1 to 12 to obtain a battery detection image; A detection result of the battery is determined based on the battery detection image.
14. The battery detection method according to claim 13, 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.
15. A battery image processing device, comprising An acquisition module is configured to acquire a multi-frame sequence original image, wherein the multi-frame sequence original image is a multi-frame image acquired 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 perform histogram equalization on the grayscale values of the pixels in the first processed image to obtain a second processed image; A third processing module is configured to linearly stretch the grayscale values of the pixels in the first processed image to obtain a third processed image; The fusion module is configured to fuse the second processed image and the third processed image to obtain a battery detection image.
16. A battery detection device, comprising An image acquisition module is configured to acquire an original detection image of the battery, wherein the original detection image includes a plurality of frame sequence original images; An image processing device, configured to process the multi-frame sequence original image using the battery image processing method according to any one of claims 1 to 12 to obtain a battery detection image or the battery image processing device according to claim 15; The defect detection module is configured to determine a detection result of the battery based on the battery detection image.
17. 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 12 or the battery detection method described in claim 13 or 14.
18. A battery production device, comprising the electronic device according to claim 17 or the battery testing device according to claim 16.
19. A computer-readable storage medium storing a computer program, wherein: When the computer program is executed by a processor, the battery image processing method described in any one of claims 1 to 12 or the battery detection method described in claim 13 or 14 is implemented.
20. A computer program product, comprising 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 12 or the battery detection method according to claim 13 or 14 is implemented.
Citation Information
Patent Citations
Image stitching method for focal plane terahertz imaging
CN108537735A
Underwater image enhancement method based on multi-interval sub-histogram equalization
CN114240793A
Lithium battery X-ray image enhancement method and device and storage medium
CN114494098A
Image enhancement method and device for defect detection, detection system and storage medium
CN115631117A
Cited By
Image enhancement method and device, electronic equipment and computer readable storage medium
CN120259091A