Battery image processing method, battery detection method, device, equipment and medium
By performing noise reduction, filtering, histogram equalization and linear stretching on the battery detection images, the problem of low image contrast in X-ray imaging technology is solved, and a higher signal-to-noise ratio and more accurate defect detection are achieved.
Patent Information
- Application Number
- CN202310973133.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-03
- Publication Date
- 2025-02-14
AI Technical Summary
In battery detection, X-ray imaging technology limits the accuracy of battery defect detection due to low image contrast and blurred edges.
By performing noise reduction, filtering, histogram equalization and linear stretching on the original image of the multi-frame sequence, the battery detection image is fused to improve the contrast and signal-to-noise ratio of the image.
It significantly enhances the contrast of the battery-detected images, improves the signal-to-noise ratio, enhances the accuracy and reliability of image recognition, and better recognizes various defects of the battery pole.
Smart Images

Figure CN119444646A_ABST
Abstract
Description
Technical Field
[0001] 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 equipment and a medium. Background Art
[0002] Energy conservation and emission reduction are the key to the sustainable development of the automobile industry. Electric vehicles have become an important part of the sustainable development of the automobile industry due to their advantages in energy conservation and environmental protection. For electric vehicles, battery technology is an important factor in their development.
[0003] X-ray imaging technology has been applied to non-destructive testing of batteries. It can obtain images of the internal components of the battery based on the different absorption capacities of the object structures of different materials and thicknesses inside the battery to X-rays. By using X-Ray to image the workpiece, the shape, size and other information of the internal components of the battery can be obtained without destroying the battery structure. The imaged image can then be identified to detect various defects inside the battery. X-Ray images are multi-bit grayscale images with a large amount of information, but low contrast and blurred edges, which are not conducive to visual recognition, thus restricting the accuracy of battery defect detection. Summary of the invention
[0004] 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, a device, a equipment and a medium to improve the problem of low contrast of battery detection images.
[0005] The embodiment of the first aspect of the present application provides a battery image processing method, which includes: acquiring 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.
[0006] In the technical solution of the embodiment of the present application, after the original multi-frame sequence image is subjected to noise reduction, filtering, histogram equalization and linear stretching, 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. By performing histogram equalization and linear stretching on the first processed image to obtain the second processed image and the third processed image, and then fusing the second processed image and the third processed image to obtain the battery detection image, the contrast of the local area in the image can be enhanced, thereby better highlighting the thickness information of the pole pieces at different positions in the image, which is helpful to identify various defects of the battery pole pieces.
[0007] In some embodiments, filtering a single-frame original image to obtain a first processed image includes: determining a normal grayscale range of 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 position; in response to the pixel being a noise position, adjusting the grayscale value of the pixel to a preset grayscale value. By determining the noise position based on the grayscale value of the pixel and the normal grayscale range of the single-frame image, pixels with abnormal grayscale values can be identified, and the grayscale values are uniformly adjusted to the preset grayscale values, which is beneficial for further noise reduction of the grayscale value of the noise position during subsequent image processing, thereby improving the signal-to-noise ratio of the image.
[0008] In some embodiments, determining the normal grayscale range of a single-frame image includes: selecting a region of interest of the single-frame image; the region of interest includes a plurality of pixels; calculating a histogram distribution of grayscale values of the pixels in the region of interest; and determining the normal grayscale range of the single-frame image according to the histogram distribution. 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, thereby facilitating subsequent noise reduction processing.
[0009] In some embodiments, filtering a single frame original image to obtain a first processed image further includes: traversing the pixels in the single frame original image, establishing a first local window for any pixel, the first local window including a plurality of pixels adjacent to the pixel; performing median filtering on the grayscale values of the pixels in the first local window to obtain the first processed image. Median filtering can eliminate isolated noise positions, and while filtering out noise, can protect the edge of the signal so that it is not blurred, which is beneficial to subsequent image processing.
[0010] In some embodiments, performing histogram equalization on 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, the second local window includes a plurality of pixels adjacent to the pixel and arranged in parallel along the first direction; performing a first unidirectional histogram equalization process on the grayscale values of the pixels in the second local window to obtain the 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 is adjacent to the pixel and 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 the second processed image; the second direction is different from the first direction. By performing unidirectional histogram equalization in the local windows along different directions, the range of grayscale values in the local area can be widened, thereby increasing the contrast and making the image clear, which is more conducive to identifying the thickness change of the single-layer pole piece in the image according to the grayscale change, thereby improving the accuracy and reliability of image detection.
[0011] In some embodiments, linearly stretching the grayscale values of pixels in the first processed image to obtain the third processed image includes: traversing the pixels in the first processed image, establishing a fourth local window for any pixel, the fourth local window includes a plurality of pixels adjacent to the pixel and arranged in parallel along the 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 in the fourth local window to obtain the 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 includes a plurality of pixels adjacent to the pixel and arranged in parallel along the 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 in the fifth local window to obtain the third processed image; the second direction is different from the first direction. By performing unidirectional linear stretching in the local windows in different directions respectively, the grayscale values of the pixels in the image can be mapped to a larger grayscale range, which can enhance the contrast of the image, more clearly display various details in the image, improve the quality of the image, and facilitate the recognition of subsequent images.
[0012] In some embodiments, the first direction is perpendicular to the second direction. The first direction is perpendicular to the second direction, 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.
[0013] In some embodiments, the second processed image and the third processed image are fused to obtain a battery detection image, including: 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 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 position corresponding to the pixel in the third processed image and the second distribution coefficient as the grayscale value of the processed pixel corresponding to the battery detection image; wherein the sum of the first distribution coefficient and the second distribution coefficient is 1. Since the second processed image and the third processed image are images obtained by performing histogram equalization and linear stretching 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, improve the overall image quality, and better display the thickness change of the single-layer electrode sheet, which is beneficial to subsequent image recognition and defect detection.
[0014] 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: judging whether there is electronic noise in the pixel according to multiple grayscale values corresponding to any pixel at the same position in the multi-frame sequence of original images; and determining the grayscale value of the pixel at the corresponding position of the single-frame original image according to the judgment result. By judging whether there is electronic noise and determining the size of the corresponding grayscale value, the influence of electronic noise on the grayscale value of the pixel can be reduced, thereby improving the image quality.
[0015] In some embodiments, judging whether electronic noise exists in a pixel point according to multiple grayscale values corresponding to any pixel point at the same position in the multi-frame sequence original image includes: calculating 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; and judging whether electronic noise exists in the pixel point in response to the standard deviation of the pixel point being greater than a preset threshold. By calculating the standard deviation of multiple grayscale values of the pixel point at the same position in the multi-frame sequence original image, electronic noise can be more easily identified and determined, which is beneficial to subsequent noise reduction processing and improves the signal-to-noise ratio and image quality of the single-frame original image.
[0016] 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, clustering the multiple grayscale values of the pixel point corresponding to the original image of the multi-frame sequence, and marking the multiple grayscale values as normal or abnormal according to the result of the clustering operation, and 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 abnormal grayscale values when recalculating the grayscale values of the pixel points, 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.
[0017] In some embodiments, according to the judgment result, determining the grayscale value of the pixel point at the corresponding position of the single-frame original image further includes: in response to the absence of electronic noise at the pixel point, calculating the average value of multiple grayscale values of the pixel point corresponding to the multi-frame sequence original image and using it as the grayscale value of the pixel point at the corresponding position in the single-frame original image. By using the average value of multiple grayscale values in the multi-frame sequence original image as the grayscale value of the pixel point to obtain the single-frame original image, various image errors and noises in the single-frame original image can be eliminated, and the obtained single-frame original image is more uniform, which is more conducive to subsequent processing and recognition.
[0018] The second aspect of the present application provides a battery detection method, which includes: obtaining a battery detection original image, the detection original image includes a multi-frame sequence original image; using the above-mentioned battery image processing method to process the multi-frame sequence original image to obtain a battery detection image; and determining the battery detection result based on the battery detection image. The detection 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 detection.
[0019] In some embodiments, the battery detection method further includes: in response to the battery detection result indicating that the battery is unqualified, rejecting the unqualified battery. Rejecting the unqualified battery according to the detection result prevents the unqualified battery from flowing out or entering the next process, which is conducive to improving the reliability of the quality of the outgoing battery.
[0020] 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 denoising module, configured to perform denoising 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.
[0021] 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 includes 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 is the above-mentioned battery image processing device; a defect detection module, configured to determine the battery detection result based on the battery detection image.
[0022] 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.
[0023] 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.
[0024] The 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.
[0025] 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.
[0026] 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
[0027] 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.
[0028] Figure 1 It is a schematic diagram of the structure of an X-ray detection system in some embodiments of the present application;
[0029] Figure 2 A grayscale value distribution diagram of an edge area of a battery detection original image in some embodiments of the present application;
[0030] Figure 3 A schematic diagram of a battery image processing method according to some embodiments of the present application;
[0031] Figure 4 A gray value distribution diagram of an edge area of a battery detection image in some embodiments of the present application;
[0032] Figure 5 A flowchart of a battery detection method according to some embodiments of the present application;
[0033] Figure 6 A structural block diagram of a battery image processing device according to some embodiments of the present application;
[0034] Figure 7 For the structural block diagram of the battery detection device of some embodiments of the present application;
[0035] Figure 8 A schematic flow chart of a battery image processing method according to some other embodiments of the present application;
[0036] Fig. 9 This is a processed battery inspection image according to some embodiments of the present application.
[0037] Description of reference numerals:
[0038] 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;
[0039] A battery image processing device 600, 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;
[0040] Battery testing device 700 , image acquisition module 710 , image processing module 720 , defect detection module 730 . DETAILED DESCRIPTION
[0041] The following embodiments of the technical solution of the present application will be described in detail in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.
[0042] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field 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" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.
[0043] In the description of the embodiments of the present application, the technical terms "first", "second", etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.
[0044] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0045] In the description of the embodiments of the present application, the term "and / or" is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0046] 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).
[0047] 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, which 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, and therefore should not be understood as a limitation on the embodiments of the present application.
[0048] In the description of the embodiments of the present application, unless otherwise clearly specified and limited, technical terms such as "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal connection of two elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to the specific circumstances.
[0049] 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 100um). When the battery thickness is thicker (for example, greater than 32mm), the ratio of the thickness change of the single-layer electrode to the battery thickness becomes smaller, which will cause the radiation attenuation caused by the radiation penetrating the single-layer electrode to be smaller, making the corresponding grayscale difference in the image smaller, which in turn increases the difficulty of image recognition and makes it difficult to accurately judge the defects inside the battery. In particular, as the size of the battery increases, this problem becomes more and more prominent.
[0050] 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. In this way, 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 a single-layer electrode is also difficult to display in the distorted area.
[0051] 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 merging 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, so that the defects corresponding to the change in the thickness of the single-layer pole piece can be well identified, and the grayscale difference in the image is small when the thickness change of the single-layer pole piece is too small compared to the thickness of the entire battery cell, which makes it difficult to identify. It can also alleviate the recognition difficulty caused by the small grayscale difference in the thickness of the single-layer pole piece due to the optical path distortion of the rays in the edge area.
[0052] The battery image processing method disclosed in the embodiment of the present application can be used to preprocess the image of the battery based on X-ray imaging, and can also process the image obtained by other rays or imaging methods, so as to better distinguish 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 embodiment of the present application can be used in the battery production and manufacturing process, and the detected or produced batteries can be used in but not limited to electrical devices such as vehicles, ships, or aircraft.
[0053] The embodiment of the present application provides an electric device using a battery as a power source, and the electric device may be, but is not limited to, a mobile phone, a tablet, a laptop, an electric toy, an electric tool, a battery car, an electric car, a ship, a spacecraft, etc. Among them, 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., and the spacecraft may include an airplane, a rocket, a space shuttle, and a spacecraft, etc.
[0054] For the convenience of description, the following embodiments are described by taking an X-ray detection system 100 according to an embodiment of the present application as an example.
[0055] See also Figure 1 and Figure 2 , Figure 1 shows a schematic structural diagram of an X-ray detection system in some embodiments of the present application, Figure 2 FIG. 4 shows a grayscale value distribution diagram of the edge area of the battery detection original image in some embodiments of the present application. Figure 1 As shown, the X-ray detection system 100 includes a ray source 110 , a carrier assembly 120 , a detector 130 , an industrial computer 150 and a display 160 .
[0056] The radiation source 110 and the detector 130 are disposed separately and spaced apart from each other. The carrying assembly 120 is located between the radiation source 110 and the detector 130 and is used to carry the battery 140 to be detected.
[0057] The radiation source 110 is a device for emitting detection radiation, mainly including a radiation tube and a corresponding power supply. The radiation source 110 emits radiation 111 which is an X-ray. In some examples, the radiation 111 may also be other radiation. The radiation source 110 may be open (open tube) or closed (closed tube).
[0058] The detector 130 may be a two-dimensional flat panel detector, which is used to receive the attenuated X-rays 111 after penetrating the battery 140 and convert them into corresponding electrical signals for imaging. In some examples, the flat panel detector 130 may be an indirect flat panel detector, which absorbs attenuated X-rays and emits visible light of different intensities, and then absorbs the visible light to generate corresponding electrical signals.
[0059] 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 for 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.
[0060] The industrial computer 150 may preset a corresponding image processing algorithm, and may 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 conducive to image recognition to obtain the position information and defect information of each component inside the battery 140, thereby realizing defect detection of the battery 140.
[0061] like Figure 2 As shown in the figure, 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 a lot of information in the image cannot be presented clearly, 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.
[0062] See also Figure 3 and Figure 4 , Figure 3 A schematic flow chart of a battery image processing method according to some embodiments of the present application is shown. Figure 4 A grayscale value distribution diagram of the edge area of a battery detection image according to some embodiments of the present application is shown.
[0063] The present application embodiment provides a battery image processing method 200, the method comprising:
[0064] Step S210: acquiring 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.
[0065] Step S220: filter the single frame original image to obtain a first processed image.
[0066] Step S230: performing histogram equalization on the grayscale values of the pixels in the first processed image to obtain a second processed image.
[0067] Step S240: linearly stretching the grayscale values of the pixels in the first processed image to obtain a third processed image.
[0068] Step S250: fusing the second processed image and the third processed image to obtain a battery detection image.
[0069] The multi-frame sequence original image in step S210 is a multi-frame image continuously acquired within a preset time. For example, the detector 130 of the X-ray detection system 100 acquires an image of the battery 140, and all the frame sequence original images of the battery 140 acquired within a relatively short preset time are acquired by the detector 130 through a PLC or software trigger. The multi-frame sequence original images are images of the same size, and the preset time can be set according to actual needs, such as 1 second. 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 the noise reduction process 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) by 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.
[0070] In step S220, filtering the single-frame original image refers to filtering the grayscale value of each pixel of the single-frame original image, reassigning the grayscale value of the pixel determined as the noise position to obtain the first processed image. The filtering method can be linear filtering or nonlinear filtering. The filtering process can suppress the noise of the single-frame original image while retaining the image detail features as much as possible, which is conducive to improving the effectiveness and reliability of subsequent image processing and recognition.
[0071] The histogram equalization in step S230 is a method for enhancing the contrast of an image. It mainly obtains the mapping relationship between input and output based on the cumulative distribution function of the image and the principle of histogram equalization. The histogram distribution of the image can be converted into an approximately uniform distribution through the cumulative distribution function, thereby enhancing the contrast of the image. In this embodiment, the grayscale values of the pixels in the first processed image are histogram-equalized to obtain the second processed image.
[0072] In step S240, linear stretching of the first processed image refers to transforming the grayscale value of the pixel points of the image through a specified linear function to enhance or weaken the grayscale of the pixel points. Through linear stretching, the grayscale value of each pixel point is recalculated to obtain a third processed image with enhanced contrast.
[0073] In step S250, the grayscale values of the pixels at the same position in the second processed image that has been subjected to histogram equalization processing and the third processed image that has been subjected to 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.
[0074] like Figure 2 and Figure 4 As shown, the grayscale value range of the edge area S1 of the battery detection image obtained after processing is between 0-40000, which is significantly improved compared with 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.
[0075] It is understandable that in this embodiment, S210-S240 are only numbered for ease of description and do not limit the order of the steps. For example, there is no order restriction between step S230 and step 240, and the two can be implemented separately or in any order, and this embodiment does not limit this.
[0076] After the original multi-frame sequence images are processed by noise reduction, filtering, histogram equalization and linear stretching, the contrast of the image is greatly enhanced and the signal-to-noise ratio is improved, which is conducive to the accuracy and reliability of subsequent image recognition. The second and third processed images are obtained by performing histogram equalization and linear stretching on the first processed image, and then the second and third processed images are fused to obtain the battery detection image, which can enhance the contrast of the local area in the image, thereby better highlighting the thickness information of the pole pieces at different positions in the image, which is helpful to identify various defects of the battery pole pieces.
[0077] According to some embodiments of the present application, step S220 includes:
[0078] Determine the normal grayscale range of a single frame image;
[0079] 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;
[0080] In response to the pixel being a noise position, the grayscale value of the pixel is adjusted to a preset grayscale value.
[0081] 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 image. Since the grayscale values of noise points are usually large or small extreme values, these extreme values act on the real grayscale values of image pixels through addition and subtraction, causing interference of bright and dark points in the image, greatly reducing the image quality and affecting subsequent work such as image restoration, segmentation, feature extraction, and image recognition.
[0082] By comparing the grayscale value of a pixel with the normal grayscale range, it can be determined whether the pixel is a noise position. 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 position, the grayscale value of the pixel is adjusted to a preset grayscale value, so that the grayscale values of the pixels at the noise position are the same extreme value. The preset grayscale value can be determined according to 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.
[0083] By determining the noise position based on the grayscale value of the pixel and the normal grayscale range of a single-frame image, the pixels 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 during subsequent image processing, thereby improving the signal-to-noise ratio of the image.
[0084] According to some embodiments of the present application, determining a normal grayscale range of a single frame image includes:
[0085] Selecting a region of interest of a single frame image; the region of interest includes multiple pixels;
[0086] Calculate the histogram distribution of the grayscale values of pixels in the region of interest;
[0087] Determine the normal grayscale range of a single frame image based on the histogram distribution.
[0088] The region of interest can be any area in a single-frame image, and the size of the region of interest can be determined according to the size and location of the image. In some examples, the region of interest can be a window of a certain size corresponding to the central 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 central area of the battery corresponding to 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 to statistically analyze the 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.
[0089] 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.
[0090] 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 the subsequent noise reduction process.
[0091] According to some embodiments of the present application, step S220 further includes:
[0092] Traversing the pixel points in the single-frame original image, establishing a first local window for any pixel point, the first local window including a plurality of pixel points adjacent to the pixel point;
[0093] Perform median filtering on the grayscale values of the pixels in the first local window to obtain a first processed image.
[0094] The size of the first local window can be set according to the size of the single-frame original image. The median filter 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 pixels. For example, 8 pixels adjacent to a certain pixel, a total of 9 pixels, are taken to form a 3×3 pixel matrix as the first local window, and the grayscale values of the 9 pixels in the first local window are sorted by size, and the median is taken as the grayscale value of the pixel.
[0095] Isolated noise locations can be eliminated by median filtering, and while filtering out noise, the edges of the signal can be protected from being blurred, which is beneficial for subsequent image processing.
[0096] According to some embodiments of the present application, step S230 includes:
[0097] Traversing the pixel points in the first processed image, establishing a second local window for any pixel point, the second local window including a plurality of pixel points adjacent to the pixel point and arranged in parallel along the first direction;
[0098] 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;
[0099] Traversing the pixel points in the intermediate processed image, establishing a third local window for any pixel point, the third local window is adjacent to the pixel point and multiple pixel points arranged in parallel along the second direction,
[0100] Performing a second unidirectional histogram equalization process on the grayscale values of a plurality of pixel points arranged in parallel along a second direction in the second local window to obtain a second processed image;
[0101] The second direction is different from the first direction.
[0102] The second local window and the third local window are one-dimensional windows along different directions, respectively. 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 a number of pixels not exceeding a preset number along both ends parallel to the first direction constitute a local window. For example, the preset number is 50, and 50 pixels at both ends of a certain pixel point are taken along the first direction, and a total of 101 pixels constitute the second local window. It can be understood 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 has 50 pixels at the other end and the pixel point itself, a total of 51 pixels. The selection method of the third local window is similar to that of the second local window, and this embodiment will not be repeated.
[0103] Histogram equalization is to "adjust" the grayscale value by using a cumulative function to achieve contrast enhancement. One-way histogram equalization is to perform nonlinear stretching on multiple pixels in a local window in a single direction of the image, redistribute the image pixel values, and make the number of pixels within a certain grayscale range roughly the same.
[0104] 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.
[0105] By performing unidirectional histogram equalization in the 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 change of a single-layer electrode in the image based on the grayscale change, thereby improving the accuracy and reliability of image detection.
[0106] According to some embodiments of the present application, step S240 includes:
[0107] 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 the first direction;
[0108] 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;
[0109] 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;
[0110] 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;
[0111] The second direction is different from the first direction.
[0112] The fourth and fifth local windows are established in a similar way to the second local window, which is a local window along a specific direction. The grayscale value of the pixel point can be mapped to a wider dynamic range by linearly stretching the pixel points in the local window in one direction, such as Figure 4 As shown, after the processing is completed, the grayscale difference of the rear edge area S1 reaches about 40,000, which can meet the recognition requirements of the human eye.
[0113] It is understood that the first direction and the second direction claimed in this embodiment are only to indicate different directions and are not intended to limit specific directions. The first uniaxial stretching and the second uniaxial stretching also indicate linear stretching in different directions, respectively, and the specific directions should not be regarded as limiting the uniaxial stretching sequence. It should be noted that the first direction and the second direction in this embodiment may be the same as the first direction and the second direction described above, or may be different.
[0114] By performing unidirectional linear stretching in the local window along different directions, the grayscale value of the pixel 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.
[0115] According to some embodiments of the present application, the first direction is perpendicular to the second direction.
[0116] The first direction and the second direction may be a row direction and a column direction perpendicular to each other in the image pixel array, respectively. In some examples, the first unidirectional histogram equalization may be performed along the row direction first, and then the second unidirectional histogram equalization may be performed along the column direction; in another example, the first unidirectional linear stretching may be performed along the row direction first, and then the second unidirectional linear stretching may be performed along the column direction. Alternatively, the first unidirectional linear stretching may be performed along the column direction first, and then the second unidirectional linear stretching may be performed along the row direction.
[0117] The first direction is perpendicular to the second direction, 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 enhancing the overall contrast of the image and improving the image quality.
[0118] According to some embodiments of the present application, step S250 includes:
[0119] Traverse the pixels of the second processed image and the pixels of the third processed image,
[0120] For any pixel point in the second processed image, the product of the gray value of the pixel point and the first allocation coefficient and the sum of the product of the gray value of the pixel point at a position corresponding to the pixel point in the third processed image and the second allocation coefficient are taken as the gray value of the pixel point after processing, to obtain a preprocessing result image;
[0121] The sum of the first distribution coefficient and the second distribution coefficient is 1.
[0122] The first distribution coefficient and the second distribution coefficient are both positive numbers less than 1, and the sum of the first distribution coefficient and the second distribution coefficient 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, multiply the grayscale values of the pixels in the second processed image by the first distribution coefficient, and multiply the grayscale values of the pixels in the third processed image by the second distribution coefficient, and then use the grayscale values obtained by adding them up as the grayscale values of the pixels at that position to obtain the preprocessing result image. The size of the first distribution coefficient and the second distribution coefficient can be determined according to the quality of the specific image. In an example, the first distribution coefficient and the second distribution coefficient can both be 0.5.
[0123] 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.
[0124] According to some embodiments of the present application, step S210 includes:
[0125] According to the multiple gray values corresponding to any pixel at the same position in the original image of the multi-frame sequence, it is determined whether there is electronic noise in the pixel;
[0126] According to the judgment result, the gray value of the pixel point at the corresponding position of the single frame original image is determined.
[0127] The multi-frame sequence original image is an image acquired continuously in a short period of time. The position of the target parts in the image is almost the same, but due to the differences in the conditions and environment of image acquisition, the grayscale value of the pixel at the same position in the image may be different in different original images. By extracting the multiple grayscale values corresponding to the pixel at a certain position in the multi-frame sequence original image, and judging whether there is electronic noise in these multiple grayscale values, and according to the judgment result, determining the size of the grayscale value of the pixel at the corresponding position.
[0128] By determining whether electronic noise exists and determining the corresponding grayscale value, the influence of electronic noise on the grayscale value of the pixel can be reduced, thereby improving the image quality.
[0129] According to some embodiments of the present application, judging whether there is electronic noise at a pixel point according to multiple grayscale values corresponding to any pixel point at the same position in a multi-frame sequence original image includes:
[0130] Calculate the standard deviation of the grayscale value of the pixel point according to the multiple grayscale values corresponding to any pixel point at the same position in the multi-frame sequence original image;
[0131] 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.
[0132] Noise in an image refers to random, discrete, and isolated pixels that appear on an image due to factors such as imaging sensor noise, photo grain noise, and channel transmission errors during image transmission. Image noise is usually visually distinct from its adjacent pixels, such as white dots in a black area, black dots in a white area, etc. The standard deviation is calculated based on the grayscale values of pixels at the same position in the original multi-frame sequence, and the standard deviation is compared with the preset threshold to determine whether the grayscale value is significantly abnormal from other grayscale values, and then determine whether there is electronic noise. The preset threshold can be selected according to the size of the grayscale value.
[0133] 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 to subsequent noise reduction processing and improves the signal-to-noise ratio and image quality of a single-frame original image.
[0134] 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:
[0135] In response to the existence of electronic noise in the pixel point, clustering operations are performed on multiple grayscale values of the original image of the multi-frame sequence corresponding to the pixel point, and the multiple grayscale values are marked as normal or abnormal according to the result of the clustering operation;
[0136] 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.
[0137] Clustering is an unsupervised learning method that can divide a data set into different classes or clusters according to certain specific standards and features. The data differences in the same class or cluster are as small as possible, and the data differences in different classes or clusters are as large as possible. For example, the k-means algorithm. Through clustering operations, multiple grayscale values at the same location are divided into normal and abnormal categories and marked separately.
[0138] In response to the presence of electronic noise in a pixel, it means that there is an abnormal grayscale value, which can be identified and marked as abnormal through clustering operation, and then the grayscale values marked as abnormal are eliminated, and the average of the remaining normal grayscale values is taken and assigned to the grayscale value of the pixel.
[0139] Abnormal grayscale values are identified through clustering operations, and are removed when recalculating the grayscale values of pixels. The mean 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.
[0140] 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 further includes:
[0141] In response to the absence of electronic noise at the pixel point, the average value of multiple grayscale values of the pixel points corresponding to the original images of the multiple frames of the sequence is calculated and used as the grayscale value of the pixel point at the corresponding position in the single frame of the original image.
[0142] When the standard deviation of multiple grayscale values of a pixel is less than or equal to a preset threshold, it is determined that there is no electronic noise at the pixel. At this time, the average value of the multiple grayscale values is directly taken as the grayscale value of the pixel, thereby obtaining a single-frame original image.
[0143] By taking the average 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 obtained single-frame original image is more uniform and more conducive to subsequent processing and recognition.
[0144] See also Figure 5 , Figure 5 A flowchart of a battery detection method according to some embodiments of the present application is shown.
[0145] The second aspect of the present application provides a battery detection method, which includes:
[0146] Step S510: obtaining a detection original image of the battery, the detection original image including a plurality of frame sequence original images;
[0147] Step S520: using the above-mentioned battery image processing method to process the multi-frame sequence original image to obtain a battery detection image;
[0148] Step S530: determining the battery detection result based on the battery detection image.
[0149] The original inspection image may be acquired by an image acquisition device, such as an X-ray inspection device, or may be acquired by calling from a memory. The battery image processing method may be the image processing method in the above-mentioned embodiment. Determining the inspection result of the battery based on the battery inspection image means identifying the battery inspection image after image processing, judging whether there are corresponding defects inside the battery, and then outputting the corresponding inspection result.
[0150] The detection 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 detection.
[0151] According to some embodiments of the present application, the battery detection method further includes:
[0152] In response to the test result of the battery indicating that the battery is unqualified, the unqualified battery is rejected.
[0153] The test results include OK and NG. OK indicates that the battery is qualified, indicating that the battery does not have the 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.
[0154] 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 outgoing batteries.
[0155] See also Figure 6 , Figure 6 A structural block diagram of a battery image processing device according to some embodiments of the present application is shown.
[0156] 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 .
[0157] 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 denoising module 620 is configured to perform denoising 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.
[0158] The acquisition module 610 can directly receive the multi-frame sequence original image of the battery collected by the detector, or can acquire the multi-frame sequence original image by retrieving the image data stored in other memories. The battery image processing device 600 can process the multi-frame sequence original image, eliminate image noise, and enhance the image contrast, so as to facilitate the subsequent image recognition to more easily identify the defects of the thickness change of the single-layer electrode in the image.
[0159] Each module in the battery image processing device 600 can be implemented in whole or in part by 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 an electronic device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0160] See also Figure 7 , Figure 7 A structural block diagram of a battery detection device according to some embodiments of the present application is shown.
[0161] The fourth aspect of the present application provides a battery detection device 700, which includes 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 a detection original image of the battery, and the detection original image includes a multi-frame sequence original image; the image processing device 720 is 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 600; the defect detection module 730 is configured to determine the battery detection result based on the battery detection image.
[0162] The image acquisition module 710 may be a ray detection device, such as the X-ray detection system 100 in the above embodiment, and the image processing device 720 is connected to the image acquisition module 710 by signal, so as to receive the detection original image acquired by the image acquisition module 710 and perform image processing. The defect detection module 730 may pre-set an image recognition algorithm to recognize and detect defects in the processed battery detection image and output the corresponding detection result.
[0163] The battery detection device 700 can realize image acquisition and defect detection of the battery, and by processing the acquired image, reduce image noise and improve image contrast, thereby improving the accuracy and reliability of battery detection.
[0164] 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.
[0165] 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.
[0166] The 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.
[0167] 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.
[0168] The battery image processing method of the present application is further described below in conjunction with a specific embodiment. Figure 8 , Figure 8 A schematic diagram showing a flow chart of a battery image processing method according to some other embodiments of the present application is shown. Fig. 9 The processed battery detection image of the embodiment of the present application is shown. Specifically, the following steps are included:
[0169] S801: Triggered by PLC or software, the data acquisition module obtains the detection original image of the battery output by the detector, and the detection original image includes all frame sequence original images.
[0170] S802: discard the original images of the first few frames of the sequence to avoid interference from image delay and residual images.
[0171] S803: Copy the original multi-frame sequence images from the CPU to the GPU.
[0172] S804: Calculate the average and standard deviation of the grayscale values of the pixel points at the same position in the original images of the multi-frame sequence.
[0173] S805: Compare the calculated standard deviation with a preset threshold to determine whether electronic noise exists at a certain pixel point.
[0174] 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 the position are directly averaged and assigned to the corresponding position of the single frame original image.
[0175] 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, the abnormal grayscale values are removed, the remaining normal grayscale values are averaged and assigned to a specified position of the single frame original image.
[0176] S808: According to the relative position relationship between the center of the photographed battery and the photographed image, a ROI (Region of Interest) of a certain size window in the center area of the battery in the image is obtained.
[0177] S809: Calculate the histogram distribution of the grayscale value in the ROI, and obtain the distribution range of the overall grayscale normal response in the battery area according to the X-ray imaging principle.
[0178] S810: According to the normal gray value range obtained in S808, mark the noise position in the single frame image and adjust its gray value to 0 or 65535.
[0179] S811: Traverse all pixel points and establish a local window for each pixel point.
[0180] S812: Perform median filtering on the local window to obtain a first processed image.
[0181] S813: Traverse all pixel points and establish a local window for each pixel point.
[0182] S814: Perform one-way histogram equalization on the local window to obtain a second processed image.
[0183] The specific histogram equalization method is: assuming that the pixel density function of the histogram before equalization is p(x), 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 there are the following formulas and changes:
[0184]
[0185] 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.
[0186] S815: Traverse all pixel points and establish a local window for each pixel point.
[0187] S816: Perform unidirectional linear stretching on the local window, recalculate the gray value of each point, and obtain a third processed image.
[0188] 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.
[0189] S817: Fusing the second processed image obtained in S013 and the third processed image obtained in S015.
[0190] S818: Copy from GPU to CPU.
[0191] S819: Output the pre-processed battery detection image.
[0192] like Fig. 9 As shown, the battery inspection image obtained after processing can well display the various defect states of the internal pole pieces of the battery, such as the pole piece fragments S2 located at the edge position, the pole piece wrinkles S3, the pole piece winding feeding position S4 and the pole piece fragments S5 overlapping with the winding feeding position, thereby being able to well realize the accurate detection of various defects of the internal pole pieces of the battery.
[0193] 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 replace some or all of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate 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, characterized in that: include: 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, characterized in that: 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, characterized in that: 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, characterized in that: 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, characterized in that: 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, characterized in that: 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, characterized in that: The first direction is perpendicular to the second direction.
8. The battery image processing method according to any one of claims 1 to 7, characterized in that: 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, characterized in that: 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, characterized in that: 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, characterized in that: 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, characterized in that: 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, characterized in that: include: 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, characterized in that: 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, characterized in that: include 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, characterized in that: include 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, characterized in that: include 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, characterized in that: The electronic device comprises the electronic device as claimed in claim 17 or the battery detection device as claimed in claim 16.
19. A computer-readable storage medium storing a computer program, characterized in that: 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.