Image processing method and device, battery detection method, equipment, system and medium
By extracting and compressing the gradient image of the detected image and performing image reconstruction, the problem of poor battery detection image quality is solved and the accuracy of the battery detection results is improved.
Patent Information
- Application Number
- CN202310971851.X
- 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 the prior art, the battery detection image quality is poor, resulting in the inability to accurately display the internal conditions of the battery, affecting the accuracy of the detection results.
By extracting the first gradient image and the second gradient image of the detection image and compressing it, the first compressed gradient image and the second compressed gradient image are obtained, and then image reconstruction is performed based on these compressed gradient images to obtain the object to be detected Reconstruct the image.
By reducing the gradient value, the clarity of the detail feature in the reconstructed image is improved, and the accuracy of image recognition results is improved, thereby improving the accuracy of battery detection results.
Smart Images

Figure CN119445048A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of battery technology, and in particular to an image processing method, device, battery detection method, equipment, system and 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] In order to understand the internal conditions of the battery, a detection device is used in the related art to detect the inside of the battery. The detection device scans the battery to obtain a detection image of the battery, and the internal conditions of the battery are understood through the detection image.
[0004] In the related art, if the quality of the acquired detection image is poor, it will lead to the inability to accurately display the internal conditions of the battery, affecting the battery detection results. Summary of the invention
[0005] The present application aims to solve at least one of the technical problems in the background technology. To this end, one object of the present application is to provide an image processing method, device, battery detection method, equipment, system and medium to improve the accuracy of the detection result.
[0006] An embodiment of the first aspect of the present application provides an image processing method, the method comprising: acquiring a detection image including an object to be detected; extracting the gradient of the detection image along a first direction and a second direction respectively to obtain a first gradient image and a second gradient image of the detection image, the first direction and the second direction being different; compressing the first gradient image and the second gradient image to obtain a first compressed gradient image and a second compressed gradient image; and reconstructing the image based on the first compressed gradient image and the second compressed gradient image to obtain a reconstructed image of the object to be detected.
[0007] In an embodiment of the present application, by extracting the first gradient image and the second gradient image, and compressing the first gradient image and the second gradient image, the gradient values in the obtained first compressed gradient image and the second compressed gradient image are reduced, and the change of the grayscale value in the reconstructed image obtained by reconstructing the first compressed gradient image and the second compressed gradient image is also reduced. For the reconstructed image, even if the grayscale values between adjacent pixels are not much different, they can be more easily identified from the reconstructed image, making the detailed features in the reconstructed image clearer and improving the accuracy of the image recognition results. This method is used in the processing of battery detection images to improve the accuracy of battery detection results.
[0008] In some embodiments, the first gradient image and the second gradient image are compressed to obtain the first compressed gradient image and the second compressed gradient image, including: determining the contour image of the object to be detected based on the first gradient image and the second gradient image, each pixel in the contour image includes a gradient amplitude; determining the compression value of each pixel based on the gradient amplitude of each pixel in the contour image; obtaining the first compressed gradient image based on the first gradient image and the compression value of each pixel, so that the gradient value of the pixel in the first gradient image is within a preset range; obtaining the second compressed gradient image based on the second gradient image and the compression value of each pixel, so that the gradient value of the pixel in the second gradient image is within a preset range. First, the contour image of the object to be detected is determined by the first gradient image and the second gradient image, each pixel in the contour image includes a gradient amplitude, and then the compression value of each pixel is determined according to the gradient amplitude of each pixel, so that when the compression process is performed later, each pixel can be compressed, and because the compression value of each pixel is not exactly the same, different compressions can be achieved for different pixels. Then, a larger compression is achieved for the pixels with larger gradient values, and a smaller compression is achieved for the pixels with smaller gradient values. Since the gradient values in the first compressed gradient image and the second compressed gradient image are reduced, the difference in grayscale values between the pixels in the subsequent reconstructed image can be reduced, and the detailed features in the reconstructed image can be more easily identified.
[0009] In some embodiments, obtaining a first compressed gradient image based on the first gradient image and the compression value of each pixel so that the gradient value of the pixel in the first gradient image is within a preset range includes: extracting the gradient value of each pixel in the first gradient image; obtaining the compressed gradient value of each pixel based on the gradient value of each pixel and the compression value of each pixel; and obtaining the first compressed gradient image based on the compressed gradient value of each pixel. The above method can be used to compress the gradient value of each pixel in the first gradient image, thereby reducing the gradient value, so that the gradient value of the first compressed gradient image is reduced compared to the gradient value of the first gradient image. At the same time, the compression amount of each gradient value is different, and the gradient value of each pixel is compressed differently, so that a larger compression is performed on a large gradient value and a smaller compression is performed on a small gradient value.
[0010] In some embodiments, the compression value of each pixel includes a first compression component along a first direction and a second compression component along a second direction, and the compressed gradient value of each pixel is obtained based on the gradient value of each pixel and the compression value of each pixel, including: obtaining the compressed gradient value of each pixel based on the gradient value of each pixel in the first gradient image and the first component of the compression value of each pixel. Since the first gradient image is extracted from the detection image along the first direction, when compressing the first gradient image, it is only necessary to compress the first gradient image through the first compression component.
[0011] In some embodiments, based on the first gradient image and the second gradient image, determining the contour image of the object to be detected includes: using a feature pyramid algorithm to process the first gradient image and the second gradient image to obtain the contour image. By processing the first gradient image and the second gradient image with the feature pyramid algorithm, the contour image can be easily obtained.
[0012] In some embodiments, the compression value of each pixel is determined based on the gradient amplitude of each pixel in the contour image, including: using a gradient domain dynamic range compression algorithm to process the gradient amplitude of each pixel in the contour image to obtain the compression value of each pixel. Using a gradient domain dynamic range compression algorithm to process the gradient amplitude of each pixel in the contour image to obtain the compression value of each pixel can achieve a greater degree of compression for larger gradient values than for smaller gradient values, so that when compressing, the detailed features in the image can be retained, which can not only achieve gradient value compression, but also better maintain the detailed features of the image.
[0013] In some embodiments, the first direction is the direction of pixel rows in the detection image, and the second direction is the direction of pixel columns in the detection image. The pixels in the detection image are arranged in an array, and the first direction is defined as the direction of pixel rows in the detection image, and the second direction is defined as the direction of pixel columns in the detection image. It is easier to distinguish two adjacent pixels in the detection image, and the first gradient image and the second gradient image can be better extracted. At the same time, the first direction and the second direction are perpendicular to each other, and the first gradient image and the second gradient image will not affect each other.
[0014] In some embodiments, the method further includes: performing image enhancement processing based on the reconstructed image to obtain a processed image of the object to be detected. Performing image enhancement processing on the reconstructed image can further enhance the contrast of the image, thereby making the detailed features in the image easier to identify.
[0015] In some embodiments, performing image enhancement processing based on the reconstructed image to obtain a processed image of the object to be detected includes: performing unidirectional contrast enhancement on the reconstructed image to obtain a processed image of the object to be detected. The unidirectional contrast enhancement can enhance the contrast in the image and avoid amplifying noise that may exist in the image, so that the object to be detected in the image is more obvious than other areas and is easier to identify.
[0016] In some embodiments, image enhancement processing is performed based on the reconstructed image to obtain a processed image of the object to be detected, including: performing local histogram processing on the reconstructed image to obtain a processed image of the object to be detected. The local histogram is also a contrast enhancement method, which can also enhance the contrast in the image and avoid amplifying noise that may exist in the image, so that the object to be detected in the image is more obvious than other areas and easier to identify.
[0017] In some embodiments, obtaining a detection image including an object to be detected includes: obtaining multiple initial images including the object to be detected acquired by a radiographic image acquisition device; and obtaining a detection image of the object to be detected based on the multiple initial images. The initial image is an unprocessed image, in which the object to be detected in the image is not clear enough. After processing the multiple initial images, the object to be detected in the image becomes clearer and is easier to identify.
[0018] In some embodiments, obtaining a detection image of the object to be detected based on multiple initial images includes: using at least one noise reduction algorithm to process the multiple initial images to obtain the detection image. By performing noise reduction processing on the multiple initial images, random noise such as quantum noise, aliasing noise, and electronic noise in the initial images can be removed, thereby greatly improving the signal-to-noise ratio of the initial images.
[0019] In some embodiments, multiple initial images are processed using at least one noise reduction algorithm to obtain a detection image, including: performing mean filtering noise reduction on multiple initial images to obtain a filtered image; performing Gaussian filtering noise reduction on the filtered image to obtain a Gaussian image; performing three-dimensional block matching noise reduction on the Gaussian image to obtain a noise-reduced image; extracting a reflected image from the noise-reduced image to obtain a detection image. By processing the initial image to obtain a detection image by combining at least one noise reduction method, the signal-to-noise ratio of the detection image can be improved. At the same time, the illumination image is the same. After removing the illumination image, a reflected image will be obtained, which can retain the original image data and enhance local features at the same time.
[0020] In some embodiments, extracting the reflection image from the denoised image to obtain the detection image includes: performing logarithmic processing on the denoised image to obtain an illumination image and a reflection image of the denoised image; removing the illumination image to obtain the reflection image; and obtaining the detection image based on the reflection image. The denoised image can be decomposed into the illumination image and the reflection image by the above logarithmic processing. Since the illumination images are the same, the reflection image can be obtained after removing the illumination image, thereby obtaining the detection image.
[0021] In some embodiments, performing 3D block matching denoising on the Gaussian image to obtain a denoised image includes: performing 3D block matching denoising on the filtered image to obtain a denoised image. Using only the 3D block matching denoising process can save time and improve processing efficiency.
[0022] In some embodiments, obtaining multiple initial images of the object to be detected collected by the radiographic image acquisition device includes: controlling the radiographic image acquisition device to take multiple shots of the object to be detected at the same position to obtain multiple initial images. Taking multiple shots of the object to be detected at the same position to obtain multiple initial images can reduce the impact of accidental errors on the detection results and make the obtained detection images more accurate.
[0023] In some embodiments, the gradient of the detection image is extracted along the first direction and the second direction respectively to obtain the first gradient image and the second gradient image of the detection image, including: extracting the difference in grayscale values between two adjacent pixels along the first direction in the detection image to obtain the first gradient; determining the first gradient image based on the first gradient; extracting the difference in grayscale values between two adjacent pixels along the second direction in the detection image to obtain the second gradient; determining the second gradient image based on the second gradient. The image formed by the difference in grayscale values between pixels is a gradient image, and the corresponding gradient can be directly obtained according to the difference in grayscale values between adjacent pixels, and then the corresponding gradient image is obtained according to the gradient.
[0024] In some embodiments, image reconstruction is performed based on the first compressed gradient image and the second compressed gradient image to obtain a reconstructed image of the object to be detected, including: determining a first coefficient corresponding to the first compressed gradient image and a second coefficient corresponding to the second compressed gradient image; and determining the reconstructed image of the object to be detected based on the first compressed gradient image and the first coefficient and the second compressed gradient image and the second coefficient. The coefficients corresponding to the first compressed gradient image and the second compressed gradient image are first determined respectively, and then the image is reconstructed according to the coefficients of the first compressed gradient image and the second compressed gradient image to obtain the reconstructed image of the object to be detected, which can enhance the image contrast while making the image smoother.
[0025] An embodiment of the second aspect of the present application provides an image processing device, comprising: an acquisition module, configured to acquire a detection image containing an object to be detected; an extraction module, configured to extract the gradient of the detection image along a first direction and a second direction, respectively, to obtain a first gradient image and a second gradient image of the detection image, wherein the first direction and the second direction are different; a processing module, configured to compress the first gradient image and the second gradient image to obtain a first compressed gradient image and a second compressed gradient image; and a reconstruction module, configured to perform image reconstruction based on the first compressed gradient image and the second compressed gradient image to obtain a reconstructed image of the object to be detected.
[0026] The third aspect of the present application provides a battery detection method, comprising: processing an image of a battery using any of the methods in the above embodiments to obtain a reconstructed image of the battery; and detecting the battery based on the reconstructed image. The above image processing method is used in processing the detection image of the battery to improve the accuracy of the battery detection result.
[0027] In some embodiments, the battery includes a wound battery, and the object to be detected includes at least one corner of the wound battery. The thickness of the corners of the wound battery varies greatly, and applying the above steps to the corner detection of the wound battery can improve the accuracy of the corner detection of the wound battery.
[0028] An embodiment of the fourth 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 method in the above embodiment.
[0029] An embodiment of the fifth aspect of the present application provides a battery detection system, including the electronic device in the above embodiment.
[0030] The embodiment of the sixth aspect of the present application provides a computer-readable storage medium storing a computer program, which implements the method in the above embodiment when the computer program is executed by a processor.
[0031] The embodiment of the seventh aspect of the present application provides a computer program product, including a computer program, which implements the method in the above embodiment when executed by a processor.
[0032] 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
[0033] 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.
[0034] Figure 1 A flowchart of an image processing method according to some embodiments of the present application;
[0035] Figure 2 A partial flow chart of an image processing method according to some embodiments of the present application;
[0036] Figure 3 A partial flow chart of an image processing method according to some embodiments of the present application;
[0037] Figure 4 A flowchart of an image processing method according to some embodiments of the present application;
[0038] Figure 5 A partial flow chart of an image processing method according to some embodiments of the present application;
[0039] Figure 6 A partial flow chart of an image processing method according to some embodiments of the present application;
[0040] Figure 7 A partial flow chart of an image processing method according to some embodiments of the present application;
[0041] Figure 8 This is a flowchart of a battery detection method according to some embodiments of the present application. DETAILED DESCRIPTION
[0042] The following embodiments of the technical solution of the present application are 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.
[0043] 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.
[0044] 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.
[0045] 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.
[0046] 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.
[0047] 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).
[0048] 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.
[0049] 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.
[0050] At present, from the perspective of market development, the application of power batteries is becoming more and more extensive. Power batteries are not only used in energy storage power systems such as hydropower, thermal power, wind power and solar power stations, but also widely used in electric vehicles such as electric bicycles, electric motorcycles, electric cars, as well as military equipment and aerospace and other fields. With the continuous expansion of the application field of power batteries, the market demand is also constantly expanding.
[0051] A battery generally includes an electrode assembly and a shell that wraps the electrode assembly. The electrode assembly is the component in the battery where the electrochemical reaction occurs, and the shell forms the internal environment of the battery. The inside of the battery is wrapped in the shell. If changes occur inside the battery, it cannot be known from the outside. The battery will be scanned and inspected through a radiographic image acquisition device to obtain a test image of the battery. By analyzing the test image, the internal situation of the battery can be known to achieve battery detection. If the grayscale values of the pixels in the test image differ greatly, then the changes between pixels with similar grayscale values are relatively small, and these pixels with similar grayscale values are difficult to distinguish. However, the information of the test image is generally reflected between pixels with similar grayscale values.
[0052] Taking lithium-ion batteries as an example, the gap between the cathode and cathode plates and the overhang (OH) between the cathode and cathode plates are important factors affecting the safety performance of wound batteries. For the gap between the cathode and cathode plates: During the charge and discharge process of the battery, when the gap between the cathode and cathode plates is large, the lithium ions cannot be fully embedded in the anode channel, resulting in the accumulation of some lithium ions and the problem of lithium precipitation, which poses a greater safety risk. Therefore, it is required that the gap between the cathode and cathode plates in the battery should not be too large. For the overhang of the cathode and cathode plates: During the charge and discharge process of the lithium battery, lithium ions will repeatedly deintercalate between the cathode and cathode plates, but when lithium ions are removed from the cathode but there is not enough anode channel to embed, it is easy to cause lithium ion accumulation and lithium precipitation, causing certain product safety risks. Therefore, it is necessary to ensure that the cathode plate is within the coating range of the anode as a whole. Therefore, it is necessary to detect the internal spacing of the battery and the overhang of the cathode and cathode plates to promptly detect internal defects of the battery and reduce the outflow of defective batteries. For wound batteries, the thickness of the inner circle is much greater than that of the outer circle. The thickness of the inner and outer circles of the wound battery passed through by the detection rays of the radiation image acquisition device is different, which makes the grayscale values of the parts corresponding to the inner and outer circles of the detection image differ greatly. However, the thickness difference between two adjacent circles of the wound battery is small, and the grayscale value change on the detection image is small. The grayscale difference between two adjacent circles is very small compared to the maximum grayscale difference. Therefore, it is difficult to distinguish the two adjacent circles of the wound battery on the detection image. This will cause the required features in the detection image to be unclear, affecting the results of battery detection.
[0053] An embodiment of the present application provides an image processing method, which first extracts the gradient of a detection image along a first direction and a second direction respectively to obtain a first gradient image and a second gradient image of the detection image, then compresses the first gradient image and the second gradient image to obtain a first compressed gradient image and a second compressed gradient image, and then reconstructs the image based on the first compressed gradient image and the second compressed gradient image to obtain a reconstructed image. The detection image is divided into a first gradient image along a first direction and a second gradient image along a second direction respectively extracting the detection image, and at the same time, the first gradient image and the second gradient image are compressed to obtain a first compressed gradient image and a second compressed gradient image, which can reduce the difference between grayscale values, so that the required features in the reconstructed image obtained by image reconstruction based on the first compressed gradient image and the second compressed gradient image are clearer, thereby improving the results of battery detection.
[0054] The image processing method disclosed in the embodiment of the present application can be used to process images during battery detection, so as to make the detection image clearer and improve the accuracy of battery detection.
[0055] The present application embodiment provides an image processing method, Figure 1 Flowchart of the image processing method of some embodiments of the present application. Figure 1 , the method comprising:
[0056] Step S10: Acquire a detection image containing the object to be detected;
[0057] Step S20: extracting the gradient of the detection image along a first direction and a second direction respectively to obtain a first gradient image and a second gradient image of the detection image, wherein the first direction and the second direction are different;
[0058] Step S30: compressing the first gradient image and the second gradient image to obtain a first compressed gradient image and a second compressed gradient image;
[0059] Step S40: performing image reconstruction based on the first compressed gradient image and the second compressed gradient image to obtain a reconstructed image of the object to be detected.
[0060] In the embodiments of the present application, the object to be detected may be a battery or a battery cell or any other object that can be detected by a radiographic image acquisition device.
[0061] In an embodiment of the present application, the detection image is an image acquired by an image acquisition device. Exemplarily, the detection image may be a processed image.
[0062] In some embodiments of the present application, the image acquisition device may be a X-ray image acquisition device, or a CT scanning device, or a PET scanning device.
[0063] Exemplarily, the radiation image acquisition device may include a radiation source and a flat panel detector, wherein the detection image may be acquired through the radiation source and the flat panel detector, the radiation emitted by the radiation source is projected to the flat panel detector through the battery to be tested, and the flat panel detector acquires the detection image based on the received radiation. The radiation emitted by the radiation source may be X-rays, gamma rays, beta rays, etc.
[0064] In an embodiment of the present application, the image formed by the difference in grayscale values between pixels is a gradient image, and the first direction and the second direction are different on the detection image, that is, the first gradient image and the second gradient image are different. For the first gradient image, the gradient value of a certain pixel point therein can be understood as the difference between the grayscale value of the corresponding pixel point on the detection image and the grayscale value of the previous pixel point on the detection image, the corresponding pixel point on the detection image and the previous pixel point on the detection image are arranged adjacently along the first direction, and the previous pixel point on the detection image is located in front of the corresponding pixel point on the detection image along the first direction. The size of the gradient value represents the size of the grayscale value change of the detection image between the pixel point and the adjacent pixel point. The larger the gradient value, the greater the change in the grayscale value between the grayscale value of the detection image at the pixel point and the adjacent pixel point.
[0065] The pixels in the detection image are arranged in an array. For a pixel point in the detection image, there are at least two adjacent pixels in two directions. Therefore, when extracting the gradient image, it is necessary to extract the first gradient image of the detection image along the first direction and the second gradient image of the detection image along the second direction.
[0066] In an embodiment of the present application, the compression process compresses the gradient value so that the gradient value in the first compressed gradient image is smaller than the gradient value in the first gradient image, and the gradient value in the second compressed gradient image is smaller than the gradient value in the second gradient image. Then, an image reconstruction is performed based on the first compressed gradient image and the second compressed gradient image to obtain a reconstructed image of the object to be detected, and the change of the grayscale value in the reconstructed image is reduced compared with the detection image.
[0067] In an embodiment of the present application, the detection image is a grayscale image, the first compressed gradient image and the second compressed gradient image are both gradient images and cannot be used for detection, and image reconstruction is performed on the first compressed gradient image and the second compressed gradient image, that is, the first compressed gradient image and the second compressed gradient image are restored to the original grayscale images to obtain a reconstructed image.
[0068] The image processing method provided by the embodiment of the present application extracts the first gradient image and the second gradient image, and compresses the first gradient image and the second gradient image so that the gradient value in the obtained first compressed gradient image and the second compressed gradient image is reduced, and the change of the gray value in the reconstructed image obtained by reconstructing the first compressed gradient image and the second compressed gradient image is also reduced. For the reconstructed image, even if the gray value between adjacent pixels is not much different, it can be more easily identified from the reconstructed image, so that the detailed features in the reconstructed image are clearer, and the accuracy of the image recognition results is improved. This method is used in the processing of battery detection images to improve the accuracy of battery detection results.
[0069] According to some embodiments of the present application, Figure 2 This is a partial flow chart of the image processing method of some embodiments of the present application.
[0070] See also Figure 2 , step S30, comprising:
[0071] Step S31: determining a contour image of the object to be detected based on the first gradient image and the second gradient image, wherein each pixel point in the contour image includes a gradient amplitude;
[0072] Step S32: determining a compression value of each pixel point based on the gradient amplitude of each pixel point in the contour image;
[0073] Step S33: obtaining a first compressed gradient image based on the first gradient image and the compression value of each pixel, so that the gradient value of the pixel in the first gradient image is within a preset range;
[0074] Step S34: obtaining a second compressed gradient image based on the second gradient image and the compression value of each pixel, so that the gradient value of the pixel in the second gradient image is within a preset range.
[0075] The first gradient image and the second gradient image include not only the object to be detected but also images of other regions. The contour of the object to be detected is extracted to obtain a contour image, which can reduce the amount of subsequent calculations.
[0076] Due to the difference in material or thickness between the object to be detected and the components in the surrounding area, the gradient value at the position corresponding to the contour of the object to be detected will be larger in the first gradient image and the second gradient image, so the contour image can be identified by the size of the gradient value in the first gradient image and the second gradient image.
[0077] The contour image of the object to be detected is determined based on the first gradient image and the second gradient image. The gradient amplitude of each pixel in the contour image includes both information in the first gradient image and information in the second gradient image. Therefore, the compression value of each pixel is determined based on the gradient amplitude of each pixel in the contour image, which can be used to compress the first gradient image or the second gradient image. The compression value is used to indicate the degree of compression of the gradient value.
[0078] The magnitude of the gradient amplitude indicates the direction and rate of change of the gradient value of the contour image at that pixel point. The larger the gradient amplitude, the more drastic the change of the contour at that pixel point, that is, the steeper the gradient of the contour image at that point, and the faster the change.
[0079] In an embodiment of the present application, the above-mentioned step S33 and step S34 can be performed simultaneously or in a distributed manner. Step S33 can be performed before step S34 or after step S34.
[0080] In an embodiment of the present application, the contour image of the object to be detected is first determined by the first gradient image and the second gradient image, and each pixel in the contour image includes a gradient amplitude. Then, the compression value of each pixel is determined according to the gradient amplitude of each pixel, so that when the compression processing is performed later, each pixel can be compressed, and because the compression value of each pixel is not exactly the same, different compressions can be achieved for different pixels. Then, a larger compression is achieved for the pixel with a larger gradient value, and a smaller compression is achieved for the pixel with a smaller gradient value. Since the gradient value in the first compressed gradient image and the second compressed gradient image is reduced, the difference in the grayscale value between the pixels in the subsequent reconstructed image can be reduced, and the detailed features in the reconstructed image can be more easily identified.
[0081] According to some embodiments of the present application, Figure 3 This is a partial flow chart of the image processing method of some embodiments of the present application.
[0082] See also Figure 3 , step S33 comprises:
[0083] Step S331: extracting the gradient value of each pixel in the first gradient image;
[0084] Step S332: obtaining a compressed gradient value of each pixel based on the gradient value of each pixel and the compression value of each pixel;
[0085] Step S333: Obtain a first compressed gradient image based on the compressed gradient value of each pixel.
[0086] The gradient value of each pixel is calculated with its corresponding compression value to obtain the compressed gradient value of each pixel.
[0087] In an embodiment of the present application, the above method can be used to compress the gradient value of each pixel in the first gradient image, thereby reducing the gradient value, so that the gradient value of the first compressed gradient image is reduced compared to the gradient value of the first gradient image. At the same time, the compression amount of each gradient value is different, and the gradient value of each pixel is compressed differently, so that a large gradient value is compressed more, and a small gradient value is compressed less.
[0088] In the embodiment of the present application, step S34 may also be processed in the same manner as step S33, that is, step S34 includes:
[0089] Step S341: extracting the gradient value of each pixel in the second gradient image;
[0090] Step S342: obtaining a compressed gradient value of each pixel based on the gradient value of each pixel and the compression value of each pixel;
[0091] Step S343: Obtain a second compressed gradient image based on the compressed gradient value of each pixel.
[0092] In an embodiment of the present application, the above method can be used to compress the gradient value of each pixel in the second gradient image, thereby reducing the gradient value, so that the gradient value of the second compressed gradient image is smaller than the gradient value of the second gradient image.
[0093] According to some embodiments of the present application, the compression value of each pixel includes a first compression component along a first direction and a second compression component along a second direction, and step S332 includes:
[0094] Step S3321: Obtain the compressed grayscale value of each pixel based on the grayscale value of each pixel and the first component of the compressed value of each pixel.
[0095] In an embodiment of the present application, since the compression value is obtained based on the gradient amplitude of each pixel in the contour image, and the contour image is obtained based on the first gradient image and the second gradient image, the compression value includes both information in the first gradient image and information in the second gradient image, that is, the compression value includes a first compression component along the first direction and a second compression component along the second direction.
[0096] In the embodiment of the present application, since the first gradient image is extracted from the detection image along the first direction, when compressing the first gradient image, it is only necessary to compress the first gradient image through the first compression component.
[0097] In the embodiment of the present application, step S342 may also be processed in the same manner as step S332, that is, step S342 includes:
[0098] Step S3421: Obtain the compressed grayscale value of each pixel based on the grayscale value of each pixel and the second component of the compressed value of each pixel.
[0099] According to some embodiments of the present application, step S31 includes:
[0100] Step S311: using a feature pyramid algorithm to process the first gradient image and the second gradient image to obtain a contour image.
[0101] The Feature Pyramid Networks (FPN) algorithm builds a feature pyramid structure and distributes objects of different sizes to different feature layers for detection. In the feature pyramid, the information of the high-level feature map is transferred to the low-level feature map to enhance the semantic information of the low-level feature map. In this way, high-resolution and strong semantic features can be obtained, which is conducive to the detection of small objects.
[0102] In some embodiments of the present application, there are at least two implementations of step S311. Exemplarily, one implementation of step S311 may include:
[0103] Step S3111: Processing the first gradient image into a plurality of first images of different scales;
[0104] Step S3112: Processing the second gradient image into a plurality of second images of different scales;
[0105] Step S3113: extracting contours of the object to be detected from the plurality of first images respectively to obtain a plurality of third images;
[0106] Step S3114: extracting contours of the object to be detected from the plurality of second images respectively to obtain a plurality of fourth images;
[0107] Step S3115: fuse the multiple third images and the multiple fourth images to obtain a contour image.
[0108] In step S3111, the first gradient image can be processed into multiple first images of different scales by downsampling and / or upsampling methods. Similarly, in step S3112, the second gradient image can be processed into multiple second images of different scales by downsampling and / or upsampling methods.
[0109] In the embodiment of the present application, the above-mentioned step S3111 and step S3112 can be performed simultaneously or in a distributed manner, and step S3111 can be performed before step S3112 or after step S3112. Similarly, the above-mentioned step S3113 and step S3114 can be performed simultaneously or in a distributed manner, and step S3113 can be performed before step S3114 or after step S3114.
[0110] In some embodiments of the present application, another implementation of step S311 may include:
[0111] Step S3116: Processing the first gradient image into a plurality of fifth images of different scales;
[0112] Step S3117: Processing the second gradient image into a plurality of sixth images of different scales;
[0113] Step S3118: fusing the plurality of fifth images and the plurality of sixth images to obtain a seventh image;
[0114] Step S3119: extracting the contour of the object to be detected in the seventh image to obtain a contour image.
[0115] In step S3116, the first gradient image can also be processed into multiple fifth images of different scales by downsampling and / or upsampling methods. Similarly, in step S3117, the second gradient image can be processed into multiple sixth images of different scales by downsampling and / or upsampling methods.
[0116] In an embodiment of the present application, the above-mentioned step S3116 and step S3117 can be performed simultaneously or in a distributed manner. Step S3116 can be performed before step S3117 or after step S3117.
[0117] Scale refers to the size and resolution of an image. When processing an image, the original image is often enlarged or reduced in size to convert it into a target image of a specified size. The process of enlarging or reducing an image is called scale adjustment. By rescaling the first gradient image, it can be processed into multiple first images of different scales.
[0118] For multiple images of different scales, significant changes in their grayscale values will produce larger gradient values at certain scales, while detail information usually corresponds to smaller gradient values. It can be understood that the location of the pole piece can be identified by identifying the location with a larger gradient value in the first gradient image, while the detail features in the first gradient image, such as the distance between the positive and negative pole pieces and the amount of misalignment between the positive and negative pole pieces, need to identify the location with a smaller gradient value.
[0119] By processing the first gradient image and the second gradient image through the feature pyramid algorithm, a contour image can be easily obtained.
[0120] According to some embodiments of the present application, step S32 includes:
[0121] Step S321: using a gradient domain dynamic range compression algorithm to process the gradient amplitude of each pixel in the contour image to obtain a compressed value of each pixel.
[0122] The gradient domain dynamic range compression algorithm is an algorithm for calculating the compression value. For example, the first gradient image extracted is G x , the extracted second gradient image is G y , the feature pyramid algorithm is used to calculate the first gradient image G x and the second gradient image is G y The contour map is obtained by processing. The gradient amplitude of any pixel point in the contour map is in k is the number of sampling times (including the total number of downsampling and upsampling). Calculate the compression value. The calculation formula for the compression value is: is the compression value, and the appropriate compression value can be determined by changing α and β.
[0123] In the embodiment of the present application, for the same contour image, its α and β are the same, and a suitable α and β can be determined by experiment, and then the compression value is determined according to α and β.
[0124] The gradient domain dynamic range compression algorithm is used to process the gradient amplitude of each pixel in the contour image to obtain the compressed value of each pixel. The compression degree of larger gradient values can be greater than that of smaller gradient values. In this way, the detailed features in the image can be retained during compression, which can not only achieve gradient value compression but also better maintain the detailed features of the image.
[0125] According to some embodiments of the present application, the first direction is a pixel row direction in the detection image, and the second direction is a pixel column direction in the detection image.
[0126] The pixels in the detection image are arranged in an array. For a pixel point in the detection image, there are at least two adjacent pixels in two directions. Therefore, when extracting the gradient image, it is necessary to extract the first gradient image of the detection image along the first direction and the second gradient image of the detection image along the second direction.
[0127] The pixels in the detection image are arranged in an array. The first direction is defined as the pixel row direction in the detection image, and the second direction is defined as the pixel column direction in the detection image. This makes it easier to distinguish two adjacent pixels in the detection image, and the first gradient image and the second gradient image can be better extracted. At the same time, the first direction and the second direction are perpendicular to each other, and the first gradient image and the second gradient image will not affect each other.
[0128] According to some embodiments of the present application, Figure 4 Flowchart of the image processing method of some embodiments of the present application. Figure 4 , the method further comprises:
[0129] Step S50: performing image enhancement processing based on the reconstructed image to obtain a processed image of the object to be detected.
[0130] Performing image enhancement processing on the reconstructed image can further enhance the contrast of the image, thereby making the detailed features in the image easier to identify.
[0131] According to some embodiments of the present application, step S50 includes:
[0132] Step S51: Perform unidirectional contrast enhancement on the reconstructed image to obtain a processed image of the object to be detected.
[0133] One-way contrast enhancement can enhance the contrast in an image while avoiding amplifying noise that may exist in the image, making the object to be detected in the image more obvious and easier to identify than other areas.
[0134] According to some embodiments of the present application, step S50 includes:
[0135] Step S52: Perform local histogram processing on the reconstructed image to obtain a processed image of the object to be detected.
[0136] The local histogram is also a contrast enhancement method, which can also enhance the contrast in the image while avoiding amplifying the noise that may exist in the image, making the object to be detected in the image more obvious and easier to identify than other areas.
[0137] In the related art, directly performing image enhancement processing on the detection image will simultaneously enhance the noise in the detection image. Experiments have found that by processing the detection image using the method provided in the present application to obtain a reconstructed image, and performing image enhancement processing on the reconstructed image, the noise can be reduced, thereby making the signal-to-noise ratio of the processed image higher.
[0138] According to some embodiments of the present application, Figure 5 This is a partial flow chart of the image processing method of some embodiments of the present application.
[0139] See also Figure 5 , step S10 comprises:
[0140] Step S11: acquiring a plurality of initial images including the object to be detected acquired by the radiographic image acquisition device;
[0141] Step S12: obtaining a detection image of the object to be detected based on the multiple initial images.
[0142] In an embodiment of the present application, the initial image is an unprocessed image, and the object to be detected in the image is not clear enough. After processing multiple initial images, the object to be detected in the image becomes clearer and easier to identify.
[0143] If only one initial image is collected, if this image has errors, the detection image processed later will also have errors, affecting the accuracy of the detection. In the embodiment of the present application, multiple initial images are collected and processed. If one of the initial images has errors, the other initial images are still correct, which can also reduce the impact of errors on the detection results.
[0144] According to some embodiments of the present application, step S12 includes:
[0145] Step S121: using at least one noise reduction algorithm to process the multiple initial images to obtain a detection image.
[0146] In the embodiment of the present application, by performing noise reduction processing on multiple initial images, random noises such as quantum noise, aliasing noise, electronic noise, etc. in the initial images can be removed, thereby greatly improving the signal-to-noise ratio of the initial images.
[0147] Exemplarily, the noise reduction algorithm includes at least one of mean filter noise reduction, Gaussian filter noise reduction, and three-dimensional block matching noise reduction.
[0148] According to some embodiments of the present application, Figure 6 This is a partial flow chart of the image processing method of some embodiments of the present application.
[0149] See also Figure 6 , step S121 includes:
[0150] Step S1211: performing mean filtering and noise reduction processing on multiple initial images to obtain filtered images;
[0151] Step S1212: performing Gaussian filtering and noise reduction processing on the filtered image to obtain a Gaussian image;
[0152] Step S1213: performing three-dimensional block matching noise reduction processing on the Gaussian image to obtain a noise-reduced image;
[0153] Step S1214: extracting the reflection image from the denoised image to obtain a detection image.
[0154] In the embodiment of the present application, mean filter denoising can improve the signal-to-noise ratio of the initial image from the time domain dimension, Gaussian filter denoising can improve the signal-to-noise ratio of the filtered image from the space domain dimension, and three-dimensional block matching denoising can improve the signal-to-noise ratio of the Gaussian image from the frequency domain dimension. By processing the initial image with a variety of denoising methods, a denoised image with a higher signal-to-noise ratio can be obtained.
[0155] The reflectivity mainly depends on the properties of the object itself. Different areas of the test object have different materials and reflect different amounts of rays, so the required features of the test image can be identified based on the reflected image.
[0156] In an embodiment of the present application, the initial image is processed by combining multiple noise reduction methods to obtain a detection image, which can improve the signal-to-noise ratio of the detection image. At the same time, the illumination image is the same. After removing the illumination image, a reflected image can be obtained, which can retain the original image data and enhance local features at the same time.
[0157] According to some embodiments of the present application, Figure 7 This is a partial flow chart of the image processing method of some embodiments of the present application.
[0158] See also Figure 7 , step S1214 includes:
[0159] Step S12141: performing logarithmic processing on the denoised image to obtain an illumination image and a reflection image of the denoised image;
[0160] Step S12142: remove the illumination image to obtain a reflection image;
[0161] Step S12143: Obtain a detection image based on the reflection image.
[0162] Logarithmic processing can enhance the darker parts of the image. According to the Retinex theoretical model, the denoised image I can be decomposed into the multiplication of the illumination component L and the reflection component R:
[0163] I(x,y)=L(x,y)×R(x,y)
[0164] The above formula is converted to addition by taking the logarithm:
[0165] log(I(x,y))=log(L(x,y))+log(R(x,y))
[0166] In the denoised image, the illumination is the same, that is, the illumination component L is the same. The illumination component L is regarded as a constant, and the reflection component R, that is, the reflection image, is obtained by giving the illumination component L in the denoised image. The reflection component R is then processed.
[0167] The denoised image can be decomposed into an illumination image and a reflection image through the above logarithmic processing. Since the illumination images are the same, the reflection image can be obtained after removing the illumination image, thereby obtaining the detection image.
[0168] According to some embodiments of the present application, step S1213 includes:
[0169] Step S12131: performing basic estimation denoising processing in three-dimensional block matching on the filtered image to obtain a denoised image.
[0170] The 3D Block Matching (BM3D) algorithm is a relatively effective image denoising algorithm. By matching with adjacent image blocks, several similar blocks are integrated into a 3D matrix, filtered in 3D space, and then the results are inversely transformed and fused into 2D space to form a denoised image. The BM3D algorithm has a good denoising effect and can obtain a higher Peak Signal to Noise Ratio (PSNR).
[0171] The BM3D algorithm is divided into two steps. The algorithms of the two steps are similar. The first step is basic estimation, which performs simple denoising through original image matching. The second step is final estimation, which performs more detailed denoising through the original image and basic estimation to further improve PSNR.
[0172] Since the second step is similar to the first step, and in the embodiment of the present application, a good denoising effect can be achieved by using only the first step, and the noise in the filtered image can be removed well.
[0173] In the embodiment of the present application, only the basic estimation in the three-dimensional block matching is used for noise reduction processing, which can save time and improve processing efficiency.
[0174] According to some embodiments of the present application, step S11 includes:
[0175] Step S111: controlling the radiographic image acquisition device to take multiple shots of the object to be detected at the same position to obtain multiple initial images.
[0176] Taking multiple shots of the object to be detected at the same position to obtain multiple initial images can reduce the impact of accidental errors on the detection results and make the obtained detection images more accurate.
[0177] According to some embodiments of the present application, step S20 includes:
[0178] Step S21: extracting the grayscale value difference between two adjacent pixel points along a first direction in the detection image to obtain a first gradient.
[0179] Exemplarily, the difference between the grayscale value of all pixels on the detection image and the grayscale value of the previous pixel is used together to form the first gradient. The corresponding pixel on the detection image is arranged and adjacent to the previous pixel along the first direction.
[0180] Step S22: determining a first gradient image based on the first gradient.
[0181] The difference of grayscale values is also a grayscale value. The first gradient image can be obtained by displaying the differences of all grayscale values in the form of an image.
[0182] Step S23: extracting the grayscale value difference between two adjacent pixel points along the second direction in the detection image to obtain a second gradient.
[0183] In the embodiment of the present application, the processing method of step S23 is similar to that of step S21, and the order between step S23 and step S21 is not limited.
[0184] Step S24: determining a second gradient image based on the second gradient.
[0185] In the embodiment of the present application, the processing methods of step S24 and step S22 are similar, and the order between step S24 and step S22 is not limited.
[0186] The image formed by the difference in grayscale values between pixels is a gradient image. The corresponding gradient can be directly obtained based on the difference in grayscale values between adjacent pixels, and then the corresponding gradient image can be obtained based on the gradient.
[0187] According to some embodiments of the present application, step S40 includes:
[0188] Step S41: Determine a first coefficient corresponding to the first compressed gradient image and a second coefficient corresponding to the second compressed gradient image.
[0189] Step S42: Determine a reconstructed image of the object to be detected based on the first compressed gradient image and the first coefficient and the second compressed gradient image and the second coefficient.
[0190] In an embodiment of the present application, the first coefficient and the second coefficient are used as weighted coefficients of the grayscale values of the corresponding pixels of the two images during image fusion, and the weighted grayscale values are used as the grayscale values of the pixels at the corresponding positions to obtain a reconstructed image. The first coefficient and the second coefficient can be set and adjusted according to the parameters of the first compressed gradient image and the second compressed gradient image. In some examples, the sum of the first coefficient and the second coefficient is equal to 1.
[0191] Exemplarily, the first coefficient and the second coefficient may both be 0.5.
[0192] In an embodiment of the present application, coefficients corresponding to the first compressed gradient image and the second compressed gradient image are first determined respectively, and then image reconstruction is performed according to the coefficients of the first compressed gradient image and the second compressed gradient image to obtain a reconstructed image of the object to be detected, which can enhance the image contrast while making the image smoother.
[0193] An embodiment of the present application provides an image processing device, which includes: an acquisition module, configured to acquire a detection image containing an object to be detected; an extraction module, configured to extract the gradient of the detection image along a first direction and a second direction, respectively, to obtain a first gradient image and a second gradient image of the detection image, wherein the first direction and the second direction are different; a processing module, configured to compress the first gradient image and the second gradient image to obtain a first compressed gradient image and a second compressed gradient image; and a reconstruction module, configured to perform image reconstruction based on the first compressed gradient image and the second compressed gradient image to obtain a reconstructed image of the object to be detected.
[0194] According to some embodiments of the present application, the processing module includes: a first determination submodule, configured to determine a contour image of an object to be detected based on a first gradient image and a second gradient image, each pixel in the contour image including a gradient amplitude; a second determination submodule, configured to determine a compression value of each pixel based on the gradient amplitude of each pixel in the contour image; a third determination submodule, configured to obtain a first compressed gradient image based on the first gradient image and the compression value of each pixel, so that the gradient value of the pixel in the first gradient image is within a preset range; a fourth determination submodule, configured to obtain a second compressed gradient image based on the second gradient image and the compression value of each pixel, so that the gradient value of the pixel in the second gradient image is within a preset range.
[0195] According to some embodiments of the present application, the third determination submodule includes: a first extraction unit, configured to extract the gradient value of each pixel in the first gradient image; a first determination unit, configured to obtain the compressed gradient value of each pixel based on the gradient value of each pixel and the compression value of each pixel; and a second determination unit, configured to obtain the first compressed gradient image based on the compressed gradient value of each pixel.
[0196] According to some embodiments of the present application, the compression value of each pixel includes a first compression component along a first direction and a second compression component along a second direction, and the first determination unit is further configured to obtain the compressed gradient value of each pixel based on the gradient value of each pixel in the first gradient image and the first component of the compression value of each pixel.
[0197] According to some embodiments of the present application, the first determining submodule is further configured to process the first gradient image and the second gradient image using a feature pyramid algorithm to obtain a contour image.
[0198] According to some embodiments of the present application, the second determining submodule is further configured to process the gradient amplitude of each pixel in the contour image using a gradient domain dynamic range compression algorithm to obtain a compressed value of each pixel.
[0199] According to some embodiments of the present application, the first direction is a pixel row direction in the detection image, and the second direction is a pixel column direction in the detection image.
[0200] According to some embodiments of the present application, the device further includes: an enhancement module configured to perform image enhancement processing based on the reconstructed image to obtain a processed image of the object to be detected.
[0201] According to some embodiments of the present application, the enhancement module is further configured to perform unidirectional contrast enhancement on the reconstructed image to obtain a processed image of the object to be detected.
[0202] According to some embodiments of the present application, the enhancement module is further configured to perform local histogram processing on the reconstructed image to obtain a processed image of the object to be detected.
[0203] According to some embodiments of the present application, the acquisition module includes: a first acquisition submodule, configured to acquire multiple initial images including the object to be detected acquired by the radiation image acquisition device; and a fifth determination submodule, configured to obtain a detection image of the object to be detected based on the multiple initial images.
[0204] According to some embodiments of the present application, the fifth determination submodule is further configured to process the multiple initial images using at least one noise reduction algorithm to obtain a detection image.
[0205] According to some embodiments of the present application, the fifth determination submodule includes: a mean filtering unit, configured to perform mean filtering denoising processing on multiple initial images to obtain a filtered image; a Gaussian filtering unit, configured to perform Gaussian filtering denoising processing on the filtered image to obtain a Gaussian image; a three-dimensional block matching unit, configured to perform three-dimensional block matching denoising processing on the Gaussian image to obtain a denoised image; and an extraction unit, configured to extract a reflected image from the denoised image to obtain a detection image.
[0206] According to some embodiments of the present application, the extraction unit includes: a processing subunit, configured to perform logarithmic processing on the denoised image to obtain an illumination image and a reflection image of the denoised image; a removal subunit, configured to remove the illumination image to obtain a reflection image; and a determination subunit, configured to obtain a detection image based on the reflection image.
[0207] According to some embodiments of the present application, the three-dimensional block matching unit is further configured to perform basic estimation denoising processing in three-dimensional block matching on the filtered image to obtain a denoised image.
[0208] According to some embodiments of the present application, the first acquisition submodule is further configured to control the radiographic image acquisition device to take multiple shots of the object to be detected at the same position to obtain multiple initial images.
[0209] For the specific definition of the image processing device, please refer to the definition of the image processing method above, which will not be repeated here. Each module in the above image processing device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the electronic device in the form of hardware, or can be stored in the memory of the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0210] The embodiment of the present application also provides a battery detection method. Figure 8 This is a flowchart of a battery detection method according to some embodiments of the present application. Figure 8 , methods include:
[0211] Step S100: Processing the image of the battery to obtain a reconstructed image of the battery;
[0212] Step S200: Detect the battery based on the reconstructed image.
[0213] In step S100 , the image of the battery may be processed using the image processing method described in the above embodiment.
[0214] The above image processing method is used in processing the detection image of the battery to improve the accuracy of the battery detection result.
[0215] Since OH detection and Gap detection focus on different detail features, the detection image obtained by the image processing method provided in the related art cannot simultaneously reflect the pole piece features required for OH detection and Gap detection. In the embodiment of the present application, since the reconstructed image processed by the above-mentioned image processing method has more obvious detail features, the pole piece features required for OH detection and Gap detection can be enhanced at the same time, so that the OH detection and Gap detection of the battery can be performed through one image, thereby improving the detection efficiency.
[0216] According to some embodiments of the present application, the battery includes a wound battery, and the object to be detected includes at least one corner of the wound battery.
[0217] The thickness at the corners of the wound battery varies greatly. Applying the above steps to the detection of the corners of the wound battery can improve the accuracy of the detection of the corners of the wound battery.
[0218] An embodiment 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 any one of the above embodiments.
[0219] An embodiment of the present application provides a battery detection system, including the electronic device of the above embodiment.
[0220] An embodiment of the present application provides a computer-readable storage medium storing a computer program, which implements any one of the methods in the above embodiments when the computer program is executed by a processor.
[0221] An embodiment of the present application provides a computer program product, including a computer program, which implements any method in the above embodiments when executed by a processor.
[0222] An embodiment of the present application provides an image processing method, the method comprising:
[0223] Step S901: Control the radiographic image acquisition device to take multiple shots of the object to be detected at the same position to obtain multiple initial images.
[0224] Exemplarily, the radiation image acquisition device may be an X-ray radiation image acquisition device, the object to be detected may be a wound battery, and the initial image includes corners of the wound battery cell.
[0225] Step 902: performing mean filtering and noise reduction processing on multiple initial images to obtain filtered images;
[0226] Step 903: Perform Gaussian filtering and noise reduction processing on the filtered image to obtain a Gaussian image;
[0227] Step 904: performing basic estimation denoising processing in three-dimensional block matching on the filtered image to obtain a denoised image;
[0228] Step 905: performing logarithmic processing on the denoised image to obtain an illumination image and a reflection image of the denoised image;
[0229] Step 906: remove the illumination image to obtain a reflection image;
[0230] Step 907: obtaining a detection image based on the reflection image;
[0231] Step 908: extracting a first gradient image and a second gradient image of the detection image along a first direction and a second direction respectively;
[0232] In an embodiment of the present application, the first direction may be a pixel row direction in the detection image, and the second direction may be a pixel column direction in the detection image.
[0233] Step 909: using a feature pyramid algorithm to process the first gradient image and the second gradient image to obtain a contour image, wherein each pixel point in the contour image includes a gradient amplitude;
[0234] Step S910: using a gradient domain dynamic range compression algorithm to process the gradient amplitude of each pixel in the contour image to obtain a compressed value of each pixel;
[0235] In an embodiment of the present application, the compression value of each pixel includes a first compression component along a first direction and a second compression component along a second direction.
[0236] Step S911: extracting the gradient value of each pixel in the first gradient image;
[0237] Step S912: obtaining a compressed gradient value of each pixel based on the gradient value of each pixel in the first gradient image and the first component of the compressed value of each pixel;
[0238] Step S913: obtaining a first compressed gradient image based on the compressed gradient value of each pixel;
[0239] Step S914: extracting the gradient value of each pixel in the second gradient image;
[0240] Step S915: obtaining a compressed gradient value of each pixel based on the gradient value of each pixel in the second gradient image and the second component of the compressed value of each pixel;
[0241] Step S916: obtaining a second compressed gradient image based on the compressed gradient value of each pixel;
[0242] Step S917: performing image reconstruction based on the first compressed gradient image and the second compressed gradient image to obtain a reconstructed image of the object to be detected;
[0243] Step S918: performing unidirectional contrast enhancement on the reconstructed image to obtain a processed image of the object to be detected;
[0244] Step S919: Perform local histogram processing on the reconstructed image to obtain a processed image of the object to be detected.
[0245] 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. An image processing method, characterized in that: The method comprises: Acquire a detection image containing an object to be detected; Extracting the gradient of the detection image along a first direction and a second direction respectively to obtain a first gradient image and a second gradient image of the detection image, wherein the first direction and the second direction are different; compressing the first gradient image and the second gradient image to obtain a first compressed gradient image and a second compressed gradient image; Image reconstruction is performed based on the first compressed gradient image and the second compressed gradient image to obtain a reconstructed image of the object to be detected.
2. The method according to claim 1, characterized in that The first gradient image and the second gradient image are compressed to obtain a first compressed gradient image and a second compressed gradient image, including: Determine a contour image of the object to be detected based on the first gradient image and the second gradient image, wherein each pixel point in the contour image includes a gradient amplitude; Determine a compression value of each pixel in the contour image based on the gradient amplitude of each pixel; Obtaining the first compressed gradient image based on the first gradient image and the compression value of each pixel, so that the gradient value of the pixel in the first gradient image is within a preset range; The second compressed gradient image is obtained based on the second gradient image and the compression value of each pixel, so that the gradient value of the pixel in the second gradient image is within a preset range.
3. The method according to claim 2, characterized in that Obtaining the first compressed gradient image based on the first gradient image and the compression value of each pixel so that the gradient value of the pixel in the first gradient image is within a preset range includes: Extracting the gradient value of each pixel in the first gradient image; Obtaining a compressed gradient value of each pixel based on the gradient value of each pixel and the compression value of each pixel; The first compressed gradient image is obtained based on the compressed gradient value of each pixel.
4. The method according to claim 3, characterized in that The compression value of each pixel includes a first compression component along the first direction and a second compression component along the second direction, and the compressed gradient value of each pixel is obtained based on the gradient value of each pixel and the compression value of each pixel, including: The compressed gradient value of each pixel is obtained based on the gradient value of each pixel in the first gradient image and the first component of the compressed value of each pixel.
5. The method according to any one of claims 2 to 4, characterized in that Determining a contour image of the object to be detected based on the first gradient image and the second gradient image includes: The first gradient image and the second gradient image are processed using a feature pyramid algorithm to obtain the contour image.
6. The method according to any one of claims 2 to 5, characterized in that Determining a compression value of each pixel point based on the gradient magnitude of each pixel point in the contour image includes: A gradient domain dynamic range compression algorithm is used to process the gradient amplitude of each pixel in the contour image to obtain a compressed value of each pixel.
7. The method according to any one of claims 1 to 6, characterized in that The first direction is a pixel row direction in the detection image, and the second direction is a pixel column direction in the detection image.
8. The method according to any one of claims 1 to 7, characterized in that The method further includes: performing image enhancement processing based on the reconstructed image to obtain a processed image of the object to be detected.
9. The method according to claim 8, characterized in that Performing image enhancement processing based on the reconstructed image to obtain a processed image of the object to be detected includes: The reconstructed image is subjected to unidirectional contrast enhancement to obtain a processed image of the object to be detected.
10. The method according to claim 8 or 9, characterized in that: Performing image enhancement processing based on the reconstructed image to obtain a processed image of the object to be detected includes: Performing local histogram processing on the reconstructed image to obtain a processed image of the object to be detected.
11. The method according to any one of claims 1 to 10, characterized in that Obtain a detection image containing the object to be detected, including: Acquire a plurality of initial images including the object to be detected acquired by a radiographic image acquisition device; A detection image of the object to be detected is obtained based on the multiple initial images.
12. The method according to claim 11, characterized in that Obtaining a detection image of the object to be detected based on the multiple initial images, comprising: The plurality of initial images are processed using at least one noise reduction algorithm to obtain the detection image.
13. The method according to claim 12, characterized in that Processing the multiple initial images using at least one noise reduction algorithm to obtain the detection image includes: Performing mean filtering and noise reduction processing on the multiple initial images to obtain filtered images; Performing Gaussian filtering and noise reduction processing on the filtered image to obtain a Gaussian image; Performing three-dimensional block matching noise reduction processing on the Gaussian image to obtain a noise-reduced image; A reflection image is extracted from the denoised image to obtain the detection image.
14. The method according to claim 13, characterized in that Extracting the reflected image from the denoised image to obtain the detection image includes: Performing logarithmic processing on the denoised image to obtain an illumination image and a reflection image of the denoised image; removing the illumination image to obtain the reflection image; Based on the reflection image, the detection image is obtained.
15. The method according to claim 13 or 14, characterized in that Performing three-dimensional block matching noise reduction processing on the Gaussian image to obtain a noise-reduced image includes: The filtered image is subjected to a basic estimation denoising process in three-dimensional block matching to obtain the denoised image.
16. The method according to any one of claims 11 to 15, characterized in that Acquiring a plurality of initial images including the object to be detected acquired by a radiographic image acquisition device, comprising: The radiographic image acquisition device is controlled to take multiple shots of the object to be detected at the same position to obtain the multiple initial images.
17. The method according to any one of claims 1 to 16, characterized in that Extracting the gradient of the detection image along a first direction and a second direction respectively to obtain a first gradient image and a second gradient image of the detection image, comprising: Extracting a difference in grayscale values between two adjacent pixels along the first direction in the detection image to obtain a first gradient; determining the first gradient image based on the first gradient; Extracting a difference in grayscale values between two adjacent pixels along the second direction in the detection image to obtain a second gradient; The second gradient image is determined based on the second gradient.
18. The method according to any one of claims 1 to 17, characterized in that Performing image reconstruction based on the first compressed gradient image and the second compressed gradient image to obtain a reconstructed image of the object to be detected includes: determining a first coefficient corresponding to the first compressed gradient image and a second coefficient corresponding to the second compressed gradient image; A reconstructed image of the object to be detected is determined based on the first compressed gradient image and the first coefficient and the second compressed gradient image and the second coefficient.
19. An image processing device, characterized in that: The device comprises: An acquisition module is configured to acquire a detection image containing an object to be detected; an extraction module, configured to extract the gradient of the detection image along a first direction and a second direction respectively, so as to obtain a first gradient image and a second gradient image of the detection image, wherein the first direction and the second direction are different; a processing module, configured to perform compression processing on the first gradient image and the second gradient image to obtain a first compressed gradient image and a second compressed gradient image; The reconstruction module is configured to perform image reconstruction based on the first compressed gradient image and the second compressed gradient image to obtain a reconstructed image of the object to be detected.
20. A battery detection method, characterized in that: The method comprises: Processing the image of the battery using the method according to any one of claims 1 to 18 to obtain a reconstructed image of the battery; and The battery is inspected based on the reconstructed image.
21. The method according to claim 20, characterized in that The battery comprises a wound battery, and the object to be detected comprises at least one corner of the wound battery.
22. 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 to enable the at least one processor to perform the method of any one of claims 1 to 18 or the method of claim 20 or 21.
23. A battery detection system, characterized in that: Comprising the electronic device as claimed in claim 22.
24. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method of any one of claims 1 to 18 or the method of claim 20 or 21 is implemented.