Image processing method and apparatus, battery testing method, and device, system and medium
By extracting and compressing the gradient image of the detected image and performing image reconstruction, the problem of poor quality of the battery detection image is solved, and the accuracy and detail clarity of the detection results are improved.
Patent Information
- Application Number
- PCT/CN2023/124780
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-03
- Filing Date
- 2023-10-16
- Publication Date
- 2025-02-06
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 carried out based on these compressed gradient images to obtain a clearer reconstruction image.
The accuracy of battery detection results is improved, making the detailed features in the reconstructed image clearer and making it easier to identify the features inside the battery.
Smart Images

Figure CN2023124780_06022025_PF_FP_ABST
Abstract
Description
Image processing method, device, battery detection method, equipment, system and medium
[0001] Cross-references
[0002] This application refers to Chinese patent application No. 202310971851.X filed on August 3, 2023, entitled “Image processing method, device, battery detection method, equipment, system and medium”, which is incorporated into this application in its entirety by reference. Technical Field
[0003] The present application relates to the field of battery technology, and in particular to an image processing method, apparatus, battery detection method, equipment, system and medium. Background Art
[0004] Energy conservation and emission reduction are key to the sustainable development of the automotive industry. Electric vehicles, due to their energy-saving and environmentally friendly advantages, have become an important component of the sustainable development of the automotive industry. For electric vehicles, battery technology is a key factor in their development.
[0005] In order to understand the internal conditions of the battery, a detection device is used in related technologies to detect the interior 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.
[0006] 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.
[0007] Summary of the Invention
[0008] The present application aims to solve at least one of the technical problems in the background art. To this end, one object of the present application is to provide an image processing method, apparatus, battery detection method, device, system and medium to improve the accuracy of detection results.
[0009] An embodiment of the first aspect of the present application provides an image processing 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, 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; and reconstructing an 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.
[0010] In an embodiment of the present application, by extracting a first gradient image and a 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. Then, the change in 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. Using this method in the processing of battery detection images can improve the accuracy of battery detection results.
[0011] In some embodiments, a first gradient image and a second gradient image are compressed to obtain a first compressed gradient image and a second compressed gradient image, comprising: determining a contour image of an object to be detected based on the first gradient image and the second gradient image, wherein each pixel in the contour image includes a gradient magnitude; determining a compression value for each pixel based on the gradient magnitude of each pixel in the contour image; obtaining a first compressed gradient image based on the first gradient image and the compression value of each pixel, such that the gradient value of the pixel in the first gradient image is within a preset range; and obtaining a second compressed gradient image based on the second gradient image and the compression value of each pixel, such that the gradient value of the pixel in the second gradient image is within a preset range. The contour image of the object to be detected is first determined using the first gradient image and the second gradient image, wherein each pixel in the contour image includes a gradient magnitude; and then determining a compression value for each pixel based on the gradient magnitude of each pixel. Thus, in subsequent compression processing, each pixel can be compressed, and because the compression values of each pixel are not exactly the same, different compression values can be achieved for different pixels. Then, a larger compression is achieved for pixels with larger gradient values, and a smaller compression is achieved for 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 pixels in the subsequent reconstructed image can be reduced, making it easier to identify detailed features in the reconstructed image.
[0012] In some embodiments, obtaining a first compressed gradient image based on a first gradient image and a compression value of each pixel so that the gradient values of pixels in the first gradient image are within a preset range includes: extracting the gradient value of each pixel in the first gradient image; obtaining a compressed gradient value for 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 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 smaller than the gradient value of the first gradient image. Furthermore, the amount of compression for each gradient value is different, and the gradient value of each pixel is compressed differently, resulting in greater compression for large gradient values and less compression for small gradient values.
[0013] 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. Obtaining the compressed gradient value of each pixel based on the gradient value of each pixel and the compression value of each pixel includes: 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. Because the first gradient image is extracted from the detection image along the first direction, when compressing the first gradient image, only the first compression component needs to be used to compress the first gradient image.
[0014] In some embodiments, determining a contour image of the object to be detected based on the first gradient image and the second gradient image includes processing the first gradient image and the second gradient image using a feature pyramid algorithm to obtain the contour image. Processing the first gradient image and the second gradient image using the feature pyramid algorithm can easily obtain the contour image.
[0015] In some embodiments, determining a compression value for each pixel in the contour image based on the gradient magnitude of each pixel includes: processing the gradient magnitude of each pixel in the contour image using a gradient domain dynamic range compression algorithm to obtain the compression value for each pixel. Processing the gradient magnitude of each pixel in the contour image using a gradient domain dynamic range compression algorithm to obtain the compression value for each pixel can achieve a greater degree of compression for larger gradient values than for smaller gradient values. This allows detailed features in the image to be preserved during compression, thereby achieving both gradient value compression and better preservation of detailed features of the image.
[0016] 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. Defining the first direction as the direction of pixel rows and the second direction as the direction of pixel columns in the detection image makes it easier to distinguish two adjacent pixels in the detection image, thereby better extracting the first gradient image and the second gradient image. Furthermore, the first and second directions are perpendicular to each other, and the first and second gradient images do not affect each other.
[0017] 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 detailed features in the image easier to identify.
[0018] 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. Unidirectional contrast enhancement can enhance contrast in the image while avoiding amplification of noise that may be present in the image, thereby making the object to be detected more prominent than other areas in the image and easier to identify.
[0019] 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 local histogram processing on the reconstructed image to obtain a processed image of the object to be detected. Local histogram processing is also a contrast enhancement method that can also enhance image contrast while avoiding amplifying potential noise in the image, making the object to be detected more prominent and easier to identify than other areas of the image.
[0020] In some embodiments, acquiring a detection image including the object to be detected includes: acquiring multiple initial images including the object to be detected, captured 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 images are unprocessed images, and the object to be detected in the images is not clear. After processing the multiple initial images, the object to be detected in the images is made clearer, making it easier to identify the object to be detected.
[0021] In some embodiments, obtaining a detection image of the object to be detected based on multiple initial images includes processing the multiple initial images using at least one noise reduction algorithm to obtain the detection image. By performing noise reduction on the multiple initial images, random noise, such as quantum noise, aliasing noise, and electronic noise, can be removed from the initial images, significantly improving the signal-to-noise ratio of the initial images.
[0022] 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 the 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 reduced-noise image; and extracting a reflected image from the reduced-noise image to obtain a detection image. Processing the initial images using a combination of at least one noise reduction method to obtain a detection image can improve the signal-to-noise ratio of the detection image. While the illumination image remains the same, removing the illumination image yields a reflected image, preserving the original image data while enhancing local features.
[0023] In some embodiments, extracting a reflected image from a denoised image to obtain a detection image includes: performing logarithmic processing on the denoised image to obtain an illumination image and a reflected image of the denoised image; removing the illumination image to obtain a reflected image; and obtaining a detection image based on the reflected image. The logarithmic processing decomposes the denoised image into an illumination image and a reflected image. Since the illumination image is the same, removing the illumination image yields the reflected image, thereby obtaining the detection image.
[0024] In some embodiments, performing 3D block matching noise reduction on a Gaussian image to obtain a noise-reduced image includes performing 3D block matching noise reduction on a filtered image to obtain the noise-reduced image. Using only the 3D block matching noise reduction process can save time and improve processing efficiency.
[0025] In some embodiments, obtaining multiple initial images of the object to be inspected, captured by the radiographic image acquisition device, includes controlling the radiographic image acquisition device to capture multiple images of the object to be inspected at the same location to obtain the multiple initial images. Capturing the object to be inspected at the same location multiple times to obtain the multiple initial images can reduce the impact of accidental errors on inspection results, thereby making the obtained inspection images more accurate.
[0026] In some embodiments, extracting 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 includes: extracting the difference in grayscale values between two adjacent pixels along the first direction in the detection image to obtain a first gradient; determining a 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 a second gradient; and determining a second gradient image based on the second gradient. The image formed by the grayscale value difference between pixels is a gradient image, and the corresponding gradient can be directly obtained based on the grayscale value difference between adjacent pixels, and then the corresponding gradient image can be obtained based on the gradient.
[0027] In some embodiments, performing image reconstruction based on a first compressed gradient image and a 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; 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. Determining the coefficients corresponding to the first compressed gradient image and the second compressed gradient image, respectively, and then performing image reconstruction based on 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 can enhance image contrast while making the image smoother.
[0028] 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.
[0029] A third aspect of the present application provides a battery testing method, comprising: processing an image of a battery using any of the methods described in the aforementioned embodiments to obtain a reconstructed image of the battery; and testing the battery based on the reconstructed image. Applying the aforementioned image processing method to the battery test image can improve the accuracy of the battery test results.
[0030] In some embodiments, the battery comprises a wound battery, and the object to be inspected comprises at least one corner of the wound battery. The thickness of the corners of a wound battery can vary significantly. Applying the above steps to inspecting the corners of a wound battery can improve the accuracy of inspection.
[0031] 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.
[0032] An embodiment of the fifth aspect of the present application provides a battery detection system, including the electronic device in the above embodiment.
[0033] An 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 executed by a processor.
[0034] An 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.
[0035] 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
[0036] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments disclosed in the present application and should not be regarded as limiting the scope of the present application. In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on the drawings without paying creative work.
[0037] FIG1 is a flowchart of an image processing method according to some embodiments of the present application;
[0038] FIG2 is a partial flow chart of an image processing method according to some embodiments of the present application;
[0039] FIG3 is a partial flow chart of an image processing method according to some embodiments of the present application;
[0040] FIG4 is a flowchart of an image processing method according to some embodiments of the present application;
[0041] FIG5 is a partial flow chart of an image processing method according to some embodiments of the present application;
[0042] FIG6 is a partial flow chart of an image processing method according to some embodiments of the present application;
[0043] FIG7 is a partial flow chart of an image processing method according to some embodiments of the present application;
[0044] FIG8 is a flow chart of a battery detection method according to some embodiments of the present application. DETAILED DESCRIPTION
[0045] The following embodiments of the technical solution of the present application will be described in detail with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application and are therefore only examples and are not intended to limit the scope of protection of the present application.
[0046] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned figure descriptions are intended to cover non-exclusive inclusions.
[0047] In the description of the embodiments of this application, the technical terms "first" and "second" are used only to distinguish different objects and should not be understood to indicate or imply relative importance or implicitly specify the quantity, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, the meaning of "plurality" is more than two, unless otherwise clearly and specifically defined.
[0048] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0049] In the description of the embodiments of this application, the term "and / or" is simply a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent the following three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this document generally indicates that the associated objects are in an "or" relationship.
[0050] 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).
[0051] 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., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and 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 device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the embodiments of the present application.
[0052] In the description of the embodiments of the present application, unless otherwise expressly specified or limited, technical terms such as "installed," "connected," "connected," and "fixed" should be understood in a broad sense. For example, they can refer to fixed connections, detachable connections, or integration; mechanical connections or electrical connections; direct connections or indirect connections through an intermediate medium; internal connections between two components or interactions between two components. Those skilled in the art can understand the specific meanings of the above terms in the embodiments of the present application based on specific circumstances.
[0053] Currently, market developments indicate that power batteries are becoming increasingly widely used. They are not only used in energy storage systems such as hydropower, thermal, wind, and solar power plants, but are also widely used in electric vehicles like electric bicycles, electric motorcycles, and electric vehicles, as well as in military equipment and aerospace. As power battery applications continue to expand, market demand is also growing.
[0054] Batteries generally include an electrode assembly and a casing that wraps the electrode assembly. The electrode assembly is the component in the battery where electrochemical reactions occur, and the casing forms the internal environment of the battery. The interior of the battery is wrapped in the casing. If changes occur inside the battery, they cannot be detected from the outside. The battery is scanned and inspected using a radiographic image acquisition device to obtain a test image of the battery. By analyzing the test image, the internal conditions of the battery are determined, allowing battery testing to be completed. If the grayscale values of the pixels in the test image differ significantly, then the changes between pixels with similar grayscale values are relatively small, making it difficult to distinguish between these pixels with similar grayscale values. However, the information in the test image is generally reflected between pixels with similar grayscale values.
[0055] Taking lithium-ion batteries as an example, the gap between the cathode and anode sheets and the overhang (OH) between the cathode and anode sheets are important factors affecting the safety performance of wound batteries. Regarding the gap between the cathode and anode sheets: During the charge and discharge process of the battery, when the gap between the cathode and anode sheets is large, the lithium ions cannot be fully embedded in the anode channel, resulting in the accumulation of some lithium ions and the occurrence of lithium plating, which poses a greater safety risk. Therefore, it is required that the gap between the cathode and anode sheets in the battery should not be too large. Regarding the overhang: During the charge and discharge process of the lithium battery, lithium ions will repeatedly intercalate and deintercalate between the cathode and anode sheets. However, when lithium ions are released from the cathode but there are not enough anode channels to embed them, it is easy for lithium ions to accumulate and deposit lithium, causing certain product safety risks. Therefore, it is necessary to ensure that the cathode sheet is entirely within the coating range of the anode. Therefore, it is necessary to detect the internal spacing of the battery and the overhang of the cathode and anode sheets to promptly detect internal defects in the battery and reduce the outflow of defective batteries. For wound batteries, the inner ring is much thicker than the outer ring. The detection radiation from the radiographic image acquisition device penetrates the inner and outer rings at different thicknesses, resulting in significant differences in grayscale values between the inner and outer rings in the detection image. However, the thickness difference between adjacent rings is smaller, resulting in smaller grayscale variations in the detection image. The grayscale difference between adjacent rings is very small compared to the maximum grayscale difference, making it difficult to distinguish adjacent rings in the detection image. This results in unclear features in the detection image, affecting the battery detection results.
[0056] 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 extracted along a second direction, and the first gradient image and the second gradient image are compressed to obtain a first compressed gradient image and a second compressed gradient image. This can reduce the difference between grayscale values, making the required features in the reconstructed image obtained by image reconstruction based on the first compressed gradient image and the second compressed gradient image clearer, thereby improving the results of battery detection.
[0057] The image processing method disclosed in the embodiment of the present application can be used to process images during battery detection, making the detection images clearer and improving the accuracy of battery detection.
[0058] The present application provides an image processing method. FIG1 is a flowchart of the image processing method of some embodiments of the present application. Referring to FIG1 , the method includes:
[0059] Step S10: Acquire a detection image containing the object to be detected;
[0060] 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;
[0061] 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;
[0062] 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.
[0063] In an embodiment of the present application, the object to be inspected may be a battery, a battery cell, or any other object that can be inspected by a radiographic image acquisition device.
[0064] 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.
[0065] In some embodiments of the present application, the image acquisition device may be a radiographic image acquisition device, or a CT scanning device, or a PET scanning device.
[0066] Exemplarily, a radiographic image acquisition device may include a radiation source and a flat-panel detector. A detection image may be acquired by the radiation source and the flat-panel detector. Radiation emitted by the radiation source is projected onto the flat-panel detector through the battery under test, and the flat-panel detector acquires a detection image based on the received radiation. The radiation emitted by the radiation source may be X-rays, gamma rays, beta rays, or the like.
[0067] 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 adjacent to each other 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 change in the grayscale value 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.
[0068] 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.
[0069] In an embodiment of the present application, compression processing compresses the gradient values such that the gradient values in the first compressed gradient image are smaller than those in the first gradient image, and the gradient values in the second compressed gradient image are smaller than those in the second gradient image. Image reconstruction is then performed based on the first and second compressed gradient images to obtain a reconstructed image of the object to be detected. Compared to the detected image, the grayscale value variation in the reconstructed image is reduced.
[0070] In an embodiment of the present application, the detection image is a grayscale image, and the first compressed gradient image and the second compressed gradient image are both gradient images and cannot be used for detection. 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.
[0071] The image processing method provided in the embodiment of the present application extracts a first gradient image and a second gradient image, and compresses the first gradient image and the second gradient image to reduce the gradient values in the obtained first compressed gradient image and the second compressed gradient image. This reduces the variation in grayscale values in the reconstructed image obtained by reconstructing the first compressed gradient image and the second compressed gradient image. 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 can be used to process battery detection images to improve the accuracy of battery detection results.
[0072] According to some embodiments of the present application, FIG2 is a partial flow chart of an image processing method according to some embodiments of the present application. Referring to FIG2 , step S30 includes:
[0073] 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 in the contour image includes a gradient amplitude;
[0074] Step S32: determining a compression value of each pixel based on the gradient magnitude of each pixel in the contour image;
[0075] 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;
[0076] 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 values of the pixels in the second gradient image are within a preset range.
[0077] 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.
[0078] Since there is a 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. Therefore, the contour image can be identified by the size of the gradient values in the first gradient image and the second gradient image.
[0079] The contour image of the object to be detected, determined based on the first and second gradient images, has a gradient magnitude at each pixel in the contour image that includes information from both the first and second gradient images. Therefore, a compression value is determined based on the gradient magnitude of each pixel in the contour image, which can be used to compress both the first and second gradient images. The compression value indicates the degree of compression applied to the gradient value.
[0080] 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 dramatic 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.
[0081] 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.
[0082] In an embodiment of the present application, a contour image of the object to be detected is first determined using a first gradient image and a second gradient image. Each pixel in the contour image includes a gradient amplitude. Then, a compression value of each pixel is determined based on the gradient amplitude of each pixel. In this way, when compression processing is subsequently performed, each pixel can be compressed. Since the compression values of each pixel are not exactly the same, different compressions can be achieved for different pixels. Then, a greater compression is achieved for pixels with larger gradient values, and a smaller compression is achieved for 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 pixels in the subsequent reconstructed image can be reduced, making it easier to identify detailed features in the reconstructed image.
[0083] According to some embodiments of the present application, FIG3 is a partial flow chart of an image processing method according to some embodiments of the present application. Referring to FIG3 , step S33 includes:
[0084] Step S331: extracting the gradient value of each pixel in the first gradient image;
[0085] 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;
[0086] Step S333: Obtain a first compressed gradient image based on the compressed gradient value of each pixel.
[0087] The gradient value of each pixel is calculated with its corresponding compression value to obtain the compressed gradient value of each pixel.
[0088] 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 smaller than the gradient value of the first gradient image. Furthermore, the amount of compression for each gradient value is different, and the gradient value of each pixel is compressed differently, achieving greater compression for large gradient values and less compression for small gradient values.
[0089] 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:
[0090] Step S341: extracting the gradient value of each pixel in the second gradient image;
[0091] 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;
[0092] Step S343: Obtain a second compressed gradient image based on the compressed gradient value of each pixel.
[0093] 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.
[0094] 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. Step S332 includes:
[0095] 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.
[0096] 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.
[0097] 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 using the first compression component.
[0098] 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:
[0099] 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.
[0100] According to some embodiments of the present application, step S31 includes:
[0101] Step S311: Processing the first gradient image and the second gradient image using a feature pyramid algorithm to obtain a contour image.
[0102] The Feature Pyramid Network (FPN) algorithm builds a feature pyramid structure and distributes objects of different sizes across different feature layers for detection. Within the feature pyramid, information from higher-level feature maps is transferred to lower-level feature maps, enhancing their semantic information. This yields high-resolution, semantically robust features, facilitating the detection of small objects.
[0103] In some embodiments of the present application, there are at least two implementations of step S311. For example, one implementation of step S311 may include:
[0104] Step S3111: processing the first gradient image into a plurality of first images of different scales;
[0105] Step S3112: Processing the second gradient image into multiple second images of different scales;
[0106] Step S3113: extracting the contours of the object to be detected from the plurality of first images respectively to obtain a plurality of third images;
[0107] Step S3114: extracting the contours of the object to be detected from the plurality of second images respectively to obtain a plurality of fourth images;
[0108] Step S3115: Fusing the plurality of third images and the plurality of fourth images to obtain a contour image.
[0109] In step S3111, the first gradient image can be processed into multiple first images of different scales by using downsampling and / or down-sampling methods. Similarly, in step S3112, the second gradient image can be processed into multiple second images of different scales by using downsampling and / or down-sampling methods.
[0110] In the embodiment of the present application, the above-mentioned steps S3111 and 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 steps S3113 and S3114 can be performed simultaneously or in a distributed manner, and step S3113 can be performed before step S3114 or after step S3114.
[0111] In some embodiments of the present application, another implementation of step S311 may include:
[0112] Step S3116: Processing the first gradient image into a plurality of fifth images of different scales;
[0113] Step S3117: Processing the second gradient image into a plurality of sixth images of different scales;
[0114] Step S3118: fusing the plurality of fifth images and the plurality of sixth images to obtain a seventh image;
[0115] Step S3119: extracting the contour of the object to be detected in the seventh image to obtain a contour image.
[0116] In step S3116, the first gradient image can also be processed into multiple fifth images of different scales by using downsampling and / or down-sampling methods. Similarly, in step S3117, the second gradient image can be processed into multiple sixth images of different scales by using downsampling and / or down-sampling methods.
[0117] 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.
[0118] Scale refers to the size and resolution of an image. When processing images, the original image is often enlarged or reduced in size to convert it into a target image of a specified size. This process of enlarging or reducing an image is called rescaling. By rescaling the first gradient image, multiple first images of varying scales can be generated.
[0119] For multiple images of different scales, significant changes in grayscale values will produce larger gradient values at certain scales, while detailed information generally corresponds to smaller gradient values. This means that the location of the electrode can be identified by identifying locations with larger gradient values in the first gradient image, while detailed features in the first gradient image, such as the distance between the cathode and anode electrodes and the amount of misalignment, require identifying locations with smaller gradient values.
[0120] By processing the first gradient image and the second gradient image through the feature pyramid algorithm, a contour image can be easily obtained.
[0121] According to some embodiments of the present application, step S32 includes:
[0122] 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.
[0123] 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 (x, y), where k is the number of sampling times (including the total number of downsampling and upsampling). Calculate the compression value. The calculation formula of the compression value is: The compression value can be determined by changing α and β.
[0124] In the embodiment of the present application, for the same contour image, its α and β are the same, and a suitable α and β can be determined through experiments, and then the compression value is determined based on α and β.
[0125] 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.
[0126] 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.
[0127] 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.
[0128] 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.
[0129] According to some embodiments of the present application, FIG4 is a flowchart of an image processing method according to some embodiments of the present application. Referring to FIG4 , the method further includes:
[0130] Step S50: performing image enhancement processing based on the reconstructed image to obtain a processed image of the object to be detected.
[0131] 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.
[0132] According to some embodiments of the present application, step S50 includes:
[0133] Step S51: performing unidirectional contrast enhancement on the reconstructed image to obtain a processed image of the object to be detected.
[0134] One-way contrast enhancement can enhance the contrast in an image while avoiding amplifying possible noise in the image, making the object to be detected more obvious and easier to identify than other areas in the image.
[0135] According to some embodiments of the present application, step S50 includes:
[0136] Step S52: performing local histogram processing on the reconstructed image to obtain a processed image of the object to be detected.
[0137] Local histogram is also a contrast enhancement method that 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.
[0138] In the related art, directly performing image enhancement processing on the detection image will synchronously enhance the noise in the detection image. Experiments have found that by processing the detection image using the method provided in this application to obtain a reconstructed image, and performing image enhancement processing on the reconstructed image, the noise can be reduced, making the signal-to-noise ratio of the processed image higher.
[0139] According to some embodiments of the present application, FIG5 is a partial flow chart of an image processing method according to some embodiments of the present application. Referring to FIG5 , step S10 includes:
[0140] Step S11: acquiring a plurality of initial images including the object to be detected acquired by a 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 contains errors, the subsequently processed detection image will also contain 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 contains 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: Processing the multiple initial images using at least one noise reduction algorithm to obtain a detection image.
[0146] In the embodiment of the present application, by performing noise reduction processing on multiple initial images, random noise 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 filtering noise reduction, Gaussian filtering noise reduction, and three-dimensional block matching noise reduction.
[0148] According to some embodiments of the present application, FIG6 is a partial flow chart of an image processing method according to some embodiments of the present application. Referring to FIG6 , step S121 includes:
[0149] Step S1211: performing mean filtering and noise reduction processing on multiple initial images to obtain filtered images;
[0150] Step S1212: performing Gaussian filtering and noise reduction processing on the filtered image to obtain a Gaussian image;
[0151] Step S1213: performing 3D block matching noise reduction processing on the Gaussian image to obtain a noise-reduced image;
[0152] Step S1214: extracting the reflected image from the denoised image to obtain a detection image.
[0153] In the embodiments of the present application, mean filtering noise reduction processing can improve the signal-to-noise ratio of the initial image in the time domain, Gaussian filtering noise reduction processing can improve the signal-to-noise ratio of the filtered image in the spatial domain, and three-dimensional block matching noise reduction processing can improve the signal-to-noise ratio of the Gaussian image in the frequency domain. By processing the initial image with multiple noise reduction processing methods, a noise-reduced image with a higher signal-to-noise ratio can be obtained.
[0154] 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. Therefore, the required features of the test image can be identified based on the reflected image.
[0155] 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 will be obtained, which can retain the original image data and enhance local features at the same time.
[0156] According to some embodiments of the present application, FIG7 is a partial flow chart of an image processing method according to some embodiments of the present application. Referring to FIG7 , step S1214 includes:
[0157] Step S12141: performing logarithmic processing on the denoised image to obtain an illumination image and a reflection image of the denoised image;
[0158] Step S12142: removing the illumination image to obtain a reflected image;
[0159] Step S12143: Obtain a detection image based on the reflection image.
[0160] 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: I(x,y)=L(x,y)×R(x,y).
[0161] The above equation is converted to addition by taking the logarithm: log(I(x,y))=log(L(x,y))+log(R(x,y)).
[0162] 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.
[0163] 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.
[0164] According to some embodiments of the present application, step S1213 includes:
[0165] Step S12131: performing basic estimation denoising processing in three-dimensional block matching on the filtered image to obtain a denoised image.
[0166] The 3D Block Matching (BM3D) algorithm is a relatively effective image denoising algorithm. It matches adjacent image blocks, aggregates several similar blocks into a 3D matrix, performs filtering in 3D space, and then inversely transforms the result back into 2D space to create a denoised image. The BM3D algorithm offers excellent denoising performance, achieving a high Peak Signal to Noise Ratio (PSNR).
[0167] 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 by matching the original image. The second step is final estimation, which performs more detailed denoising by combining the original image and the basic estimation to further improve the PSNR.
[0168] Since the second step is similar to the first step, and in the embodiment of the present application, only the first step can achieve a good denoising effect, and the noise in the filtered image can be well removed.
[0169] 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.
[0170] According to some embodiments of the present application, step S11 includes:
[0171] Step S111: controlling the radiographic image acquisition device to take multiple shots of the object to be inspected at the same position to obtain multiple initial images.
[0172] 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.
[0173] According to some embodiments of the present application, step S20 includes:
[0174] 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.
[0175] For example, the difference between the grayscale value of all pixels on the detection image and the grayscale value of the previous pixel is used to form a first gradient. The corresponding pixels on the detection image and the previous pixel are arranged and adjacent to each other along a first direction.
[0176] Step S22: determining a first gradient image based on the first gradient.
[0177] The grayscale value difference is also a grayscale value. By displaying all grayscale value differences in the form of an image, a first gradient image can be obtained.
[0178] 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.
[0179] 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.
[0180] Step S24: determining a second gradient image based on the second gradient.
[0181] In the embodiment of the present application, the processing method of step S24 is similar to that of step S22, and the order between step S24 and step S22 is not limited.
[0182] 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.
[0183] According to some embodiments of the present application, step S40 includes:
[0184] Step S41: Determine a first coefficient corresponding to the first compressed gradient image and a second coefficient corresponding to the second compressed gradient image.
[0185] Step S42: determining 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.
[0186] In an embodiment of the present application, the first coefficient and the second coefficient serve as weighting coefficients for the grayscale values of corresponding pixels in 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 based on 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.
[0187] Exemplarily, the first coefficient and the second coefficient may both be 0.5.
[0188] 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 based on 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.
[0189] 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.
[0190] 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, wherein each pixel in the contour image includes 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; and 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.
[0191] 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 a 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 a first compressed gradient image based on the compressed gradient value of each pixel.
[0192] According to some embodiments of the present application, the compression value of each pixel point 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 point based on the gradient value of each pixel point in the first gradient image and the first component of the compression value of each pixel point.
[0193] 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.
[0194] 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.
[0195] 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.
[0196] According to some embodiments of the present application, the apparatus 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.
[0197] 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.
[0198] 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.
[0199] 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 radiographic 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.
[0200] According to some embodiments of the present application, the fifth determining submodule is further configured to process the multiple initial images using at least one noise reduction algorithm to obtain a detection image.
[0201] 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.
[0202] 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.
[0203] According to some embodiments of the present application, the 3D block matching unit is further configured to perform basic estimation denoising processing in 3D block matching on the filtered image to obtain a denoised image.
[0204] 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.
[0205] The definition of the image processing device can be found in the definition of the image processing method above and will not be repeated here. Each module in the above-mentioned image processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned 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 each of the above modules.
[0206] The embodiments of the present application also provide a battery detection method. FIG8 is a flow chart of the battery detection method of some embodiments of the present application. Referring to FIG8 , the method includes:
[0207] Step S100: processing the image of the battery to obtain a reconstructed image of the battery;
[0208] Step S200: inspecting the battery based on the reconstructed image.
[0209] In step S100 , the image of the battery may be processed using the image processing method described in the above embodiment.
[0210] Applying the above image processing method to processing battery detection images can improve the accuracy of battery detection results.
[0211] 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 electrode features required for OH detection and Gap detection. In the embodiment of the present application, since the reconstructed image after processing by the above-mentioned image processing method has more obvious detail features, the electrode 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.
[0212] According to some embodiments of the present application, the battery includes a wound battery, and the object to be inspected includes at least one corner of the wound battery.
[0213] 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.
[0214] 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.
[0215] An embodiment of the present application provides a battery detection system, including the electronic device of the above embodiment.
[0216] 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.
[0217] An embodiment of the present application provides a computer program product, including a computer program, which implements the method of any one of the above embodiments when executed by a processor.
[0218] An embodiment of the present application provides an image processing method, the method comprising:
[0219] Step S901: controlling the radiographic image acquisition device to take multiple shots of the object to be inspected at the same position to obtain multiple initial images.
[0220] Exemplarily, the radiation image acquisition device may be an X-ray radiation image acquisition device, the object to be inspected may be a wound battery, and the initial image includes corners of the wound battery cell.
[0221] Step 902: performing mean filtering and noise reduction processing on the multiple initial images to obtain filtered images;
[0222] Step 903: Perform Gaussian filtering and noise reduction on the filtered image to obtain a Gaussian image;
[0223] Step 904: performing basic estimation denoising processing in 3D block matching on the filtered image to obtain a denoised image;
[0224] Step 905: performing logarithmic processing on the denoised image to obtain an illumination image and a reflection image of the denoised image;
[0225] Step 906: remove the illumination image to obtain a reflected image;
[0226] Step 907: Obtain a detection image based on the reflection image;
[0227] Step 908: extracting a first gradient image and a second gradient image of the detection image along the first direction and the second direction respectively;
[0228] 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.
[0229] Step 909: Processing the first gradient image and the second gradient image using a feature pyramid algorithm to obtain a contour image, where each pixel in the contour image includes a gradient amplitude.
[0230] 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;
[0231] 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.
[0232] Step S911: extracting the gradient value of each pixel in the first gradient image;
[0233] 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;
[0234] Step S913: Obtain a first compressed gradient image based on the compressed gradient value of each pixel;
[0235] Step S914: extracting the gradient value of each pixel in the second gradient image;
[0236] 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;
[0237] Step S916: Obtain a second compressed gradient image based on the compressed gradient value of each pixel;
[0238] 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;
[0239] Step S918: performing unidirectional contrast enhancement on the reconstructed image to obtain a processed image of the object to be detected;
[0240] Step S919: performing local histogram processing on the reconstructed image to obtain a processed image of the object to be detected.
[0241] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application, and they should all be included in the scope of the claims and specification of the present application. In particular, as long as there is no structural conflict, the various technical features mentioned in the various embodiments can be combined in any way. The present application is not limited to the specific embodiments disclosed herein, but includes all technical solutions that fall within the scope of the claims.
Claims
1. An image processing method, the method comprising: 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, wherein: 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, wherein: 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, wherein: 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, wherein: 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, wherein: 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, wherein: 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, wherein: 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, wherein: 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, wherein: 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, wherein: 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, wherein: 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, wherein: 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, wherein: 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, wherein: 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, wherein: 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, wherein: 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, wherein: 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, the device comprising: 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, the method comprising: 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; as well as The battery is inspected based on the reconstructed image.
21. The method according to claim 20, wherein: 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 comprising at least one processor; as well as a memory communicatively coupled to the at least one processor; in The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor 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, comprising the electronic device according to claim 22.
24. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 18 or the method according to claim 20 or 21 is implemented.
Citation Information
Patent Citations
Multi-exposure welding area image fusion method based on Haar wavelet gradient reconstruction
CN110517210A
Battery pole piece surface defect detection method, device, equipment and product
CN115035050A
Battery hemming and sealing quality detection method
CN115294135A
Wafer defect detection method based on image enhancement
CN115311282A
Gradient-based noise reduction
US11593918B1