Image processing method, defect detection method, and related device and storage medium
By enhancing the channel image and stitching multiple original images, multi-channel images are generated, and the problem of difficult to identify various types of defects under multiple light sources in the prior art is solved, and efficient defect detection effect is achieved.
Patent Information
- Application Number
- CN202411590410.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-08
AI Technical Summary
The prior art is difficult to identify various types of defects under single light source conditions, resulting in failure to cover all types of defect characteristics when directly processing the original image under multi-light source conditions.
By acquiring multiple original images of the target object, each of the channel images of different defect types is enhanced, and these channel images are stitched to generate multi-channel images for defect detection.
Feature enhancement of various types of defects is achieved, and it is able to identify all types of defects on one image, which improves the effect of defect detection, and reduces inference time and memory consumption.
Smart Images

Figure CN119131014B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image processing method, a defect detection method, and related devices and storage media. Background Art
[0002] At present, for the inspection of the surface of the target object (such as the coating surface of the battery cell, the shell surface of the battery cell, etc.), it is difficult to identify various types of defects under single light source conditions, so most of the time, multi-light source imaging solutions are used.
[0003] However, if the original images of multiple light sources are processed directly, whether the single-channel images of each light source are processed separately, or the multi-light source images are directly stitched to process the simply stitched images, the defect features of all types of defects cannot be covered; therefore, it is necessary to find a fast and effective image processing method that can enhance the features of various types of defects, so that all types of defects can be identified in one image. Summary of the invention
[0004] The present application at least provides an image processing method, a defect detection method, and related devices and storage media.
[0005] The first aspect of the present application provides an image processing method, which includes: acquiring multiple original images of a target object; wherein the multiple original images are obtained by an image acquisition device acquiring the surface of the target object under different light source conditions, and the different light source conditions include at least one of the light source type and the light source irradiation direction; using the multiple original images, obtaining at least two channel images corresponding to different defect types; wherein at least one channel image is obtained by performing enhancement processing on at least one original image corresponding to the defect type; splicing the at least two channel images to obtain a multi-channel image; wherein the multi-channel image is used to perform defect detection on the target object.
[0006] Therefore, since each channel image can magnify the defect features of the corresponding type of defect, the multi-channel image obtained by splicing at least two channel images can magnify the defect features of each type of defect. Since the multi-channel image can magnify the defect features of each type of defect, the multi-channel image provides a higher quality image for subsequent defect detection of the target object. Subsequent defect detection of the target object based on the multi-channel image can improve the defect detection effect of various types of defects.
[0007] In addition, since the subsequent defect detection of the target object is based on the multi-channel image, the reasoning time and video memory consumption of the defect detection are reduced compared to sequential defect detection of multiple single-channel images. Furthermore, the multi-channel image is obtained without using the neural network algorithm, that is, under the premise of not using the neural network algorithm, efficient image processing is achieved without the need for an additional graphics card.
[0008] The target object is a battery cell, the surface is a coating surface or a shell surface of the battery cell, and the defect type includes at least one of a surface deep defect, a surface non-deep defect, and an internal defect.
[0009] Therefore, when the target object is a battery cell and the surface is the coating surface of the battery cell, since the channel images corresponding to the surface depth defects, surface non-depth defects and internal defects of the battery cell coating surface can amplify the surface depth defect characteristics, surface non-depth defect characteristics and internal defect characteristics of the battery cell coating surface, the channel images corresponding to the surface depth defects, surface non-depth defects and internal defects of the battery cell coating surface provide better quality images for subsequent defect detection of the battery cell. Subsequent defect detection of the battery cell based on the channel images that can amplify the surface depth defect characteristics, surface non-depth defect characteristics and internal defect characteristics of the battery cell coating surface can improve the detection effect of the surface depth defects, surface non-depth defects and internal defects of the battery cell coating surface.
[0010] When the target object is a battery cell and the surface is the shell surface of the battery cell, since the channel images corresponding to the surface depth defects, surface non-depth defects and internal defects of the battery cell shell surface can amplify the surface depth defect features, surface non-depth defect features and internal defect features of the battery cell shell surface, the channel images corresponding to the surface depth defects, surface non-depth defects and internal defects of the battery cell shell surface provide better quality images for subsequent defect detection of the battery cell. Subsequently, defect detection of the battery cell is performed based on the channel images that can amplify the surface depth defect features, surface non-depth defect features and internal defect features of the battery cell shell surface, which can improve the detection effect of the surface depth defects, surface non-depth defects and internal defects of the battery cell shell surface.
[0011] Among them, the defect type includes surface depth defects, and the multiple original images include at least two first surface images, and the light source irradiation direction of each first surface image is different; using the multiple original images, at least two channel images corresponding to different defect types are obtained, including: enhancing the at least two first surface images corresponding to the surface depth defects to obtain the first channel images corresponding to the surface depth defects.
[0012] Therefore, for surface depth defects, the corresponding surface image cannot magnify the defect features of the surface depth defects, so at least two first surface images are used to perform enhancement processing on the corresponding surface depth defects to obtain the first channel image of the corresponding surface depth defects. The first channel image corresponding to the surface depth defect is obtained by performing enhancement processing on the corresponding surface depth defect, so the first channel image corresponding to the surface depth defect can magnify the defect features of the surface depth defect. Since the first channel image corresponding to the surface depth defect can magnify the defect features of the surface depth defect, the first channel image corresponding to the surface depth defect provides a higher quality image for the subsequent surface depth defect detection of the target object. The subsequent surface depth defect detection of the target object based on the first channel image corresponding to the surface depth defect can improve the detection effect of the surface depth defect.
[0013] Among them, performing enhancement processing on at least two first surface images corresponding to surface depth defects to obtain a first channel image corresponding to the surface depth defects includes: acquiring a difference image between at least two first surface images; using the difference image as the first channel image, or performing preset processing on the difference image to obtain the first channel image, and the preset processing includes at least one of difference amplification, brightness adjustment, channel truncation and normalization processing.
[0014] Therefore, the difference image corresponding to the surface depth defect can magnify the defect feature of the surface depth defect, so the difference image corresponding to the surface depth defect can be directly used as the channel image corresponding to the surface defect feature; the channel image corresponding to the surface depth defect feature provides a better quality image for the subsequent defect detection of the target object. The subsequent surface depth defect detection of the target object based on the channel image corresponding to the surface depth defect feature can improve the detection effect of the surface depth defect. In order to improve the detection effect of the subsequent surface depth defect detection based on the channel image corresponding to the surface depth defect, the difference image can also be pre-set for difference amplification, brightness adjustment, channel truncation or normalization, and the difference image after the preset processing is used as the channel image corresponding to the surface depth defect.
[0015] Among them, the preset processing includes the difference amplification, brightness adjustment, channel truncation and normalization processing; the preset processing is performed on the difference image to obtain the first channel image, including: multiplying each pixel value in the difference image by a preset multiple to obtain the difference image after difference amplification, and the preset multiple is greater than 1; adding a preset gain value to each pixel value in the difference image after difference amplification to obtain the difference image after brightness adjustment; setting the pixel values in the difference image after brightness adjustment that are less than the first value to the first pixel value, and setting the pixel values in the difference image after brightness adjustment that are greater than the second value to the second pixel value to obtain the difference image after channel truncation; normalizing the difference image after channel truncation to obtain the first channel image.
[0016] Therefore, the difference image corresponding to the surface depth defect can amplify the defect feature of the surface depth defect, and the first channel image corresponding to the surface depth defect is obtained by performing difference amplification on the basis of the difference image corresponding to the surface depth defect. Therefore, the first channel image corresponding to the surface depth defect can further amplify the defect feature of the surface depth defect, making the defect feature of the surface depth defect more prominent. The subsequent surface depth defect detection of the target object based on the channel image corresponding to the surface depth defect feature can further improve the detection effect of the surface depth defect. The preset gain value is added to each pixel value in the difference image, and each pixel value in the difference image is increased, so that the brightness of the difference image is increased, and the first channel image corresponding to the surface depth defect is avoided from being dark. The difference image is channel truncated to limit the pixel value of the difference image within a specified range, so that the pixel value of the difference image meets the requirements of the defect detection network for subsequent defect detection; and the first channel image corresponding to the surface depth defect is obtained by channel truncating the pixel value of the difference image, so the pixel value distribution of the first channel image corresponding to the surface depth defect meets the requirements of the defect detection network for subsequent defect detection, thereby improving the detection accuracy of the defect detection of the target object. Normalizing the difference image can scale the pixel values of the difference image to a specific range, so that the subsequent defect detection network can perform stable defect detection based on this, thereby improving the defect detection effect.
[0017] Among them, the defect type includes surface non-depth defects, and the multiple original images include a second surface image related to the surface non-depth defects; using the multiple original images, at least two channel images corresponding to different defect types are obtained, including: enhancing the second surface image corresponding to the surface non-depth defects to obtain the second channel image corresponding to the surface non-depth defects.
[0018] Therefore, for surface non-depth defects, the corresponding surface image cannot amplify the defect features of the surface non-depth defects, so the second surface image is used to perform enhancement processing on the corresponding surface non-depth defects to obtain the second channel image of the corresponding surface non-depth defects. The second channel image corresponding to the surface non-depth defect is obtained by performing enhancement processing on the corresponding surface non-depth defect, so the second channel image corresponding to the surface non-depth defect can amplify the defect features of the surface non-depth defect. Since the second channel image corresponding to the surface non-depth defect can amplify the defect features of the surface non-depth defect, the second channel image corresponding to the surface non-depth defect provides a better quality image for the subsequent surface non-depth defect detection of the target object. The subsequent surface non-depth defect detection of the target object based on the second channel image corresponding to the surface non-depth defect can improve the detection effect of the surface non-depth defect.
[0019] Among them, the number of second surface images is at least two, and the light source irradiation direction of each second surface image is different; the second surface image is enhanced for the surface non-depth defects to obtain the second channel image for the surface non-depth defects, including: weighted fusion of each second surface image to obtain the second channel image; or, the number of second surface images is one, and the light source light of the second surface image is coaxial with the lens axis of the image acquisition device; the second surface image is enhanced for the surface non-depth defects to obtain the second channel image for the surface non-depth defects, including: subtracting the second surface image from the third pixel value to obtain the second channel image.
[0020] Therefore, light sources from different irradiation directions will illuminate different parts of the surface of the target object. By fusing at least two second surface images from light sources from different irradiation directions, more comprehensive surface information of the target object can be obtained. In the weighted fusion process, the weight of the second surface image including more surface non-depth defect information can be increased to increase the contrast between the surface non-depth defect area and the background area (the surface non-defect area), so that the surface non-depth defect area is highlighted, and the defect characteristics of the surface non-depth defect are magnified. Alternatively, the second surface image has a very high grayscale value due to the mirror reflection of the flat surface (such as the flat surface of the battery shell); once there is a surface non-depth defect that destroys the flat surface, the reflection type of the surface non-depth defect area becomes diffuse reflection, and the grayscale value of the surface non-depth defect area will be much lower than other areas of the surface. Therefore, the area with a pixel value difference of 0 is the non-defect area of the surface when the second surface image is subtracted from the third pixel value, and the remaining area is the surface non-depth defect area; that is, the surface non-depth defect area is highlighted when the second surface image is subtracted from the third pixel value, and the defect characteristics of the surface non-depth defect are magnified.
[0021] The step of weighted fusion of the second surface images is performed when the surface is the coating surface of the battery cell; and the step of subtracting the second surface image using the third pixel value is performed when the surface is the shell surface of the battery cell.
[0022] Therefore, since the coating surface and the shell surface of the battery cell appear differently under the light source, the second channel images of the coating surface and the shell surface of the battery cell are acquired in different ways.
[0023] Among them, the defect type includes internal defects, and the multiple original images include internal images; using the multiple original images, at least two channel images corresponding to different defect types are obtained, including: using the internal image as a third channel image corresponding to the internal defect; or adjusting the pixel value distribution of the internal image to match other channel images to obtain a third channel image.
[0024] Therefore, for internal defects, the corresponding internal image itself can amplify the defect features of the internal defects, so the internal image can be directly used as the third channel image corresponding to the internal defect. Since the third channel image corresponding to the internal defect can amplify the defect features of the internal defect, the third channel image corresponding to the internal defect provides a better quality image for the subsequent internal defect detection of the target object. The subsequent internal defect detection of the target object based on the third channel image corresponding to the internal defect can improve the detection effect of the internal defect. Alternatively, due to the multi-channel image (such as including the first channel image and the third channel image, or including the first channel image, the second channel image and the third channel image) given to the defect detection network later, if the pixel value distribution of the third channel image does not match that of the other channel images or the gap is relatively large, it will affect the defect detection effect of the defect detection network. Therefore, the pixel value distribution of the internal image is adjusted to match the other channel images to obtain the third channel image.
[0025] Among them, the pixel value distribution of the internal image is adjusted to match the other channel images to obtain the third channel image, including: subtracting each pixel value in the internal image from the fourth pixel value to obtain the third channel image; or, obtaining the pixel value distribution of the internal image and the pixel value distribution of each other channel image; in response to the difference between the pixel value distribution of the internal image and the other channel images meeting the preset difference condition, subtracting each pixel value in the internal image from the fourth pixel value to obtain the third channel image.
[0026] Therefore, when the difference between the pixel distribution of the internal image and the other channel images is large, the pixel value distribution of the internal image is adjusted.
[0027] Among them, the step of using the internal image as the third channel image corresponding to the internal defect is performed when the surface is the coating surface of the battery cell, and the step of adjusting the pixel value distribution of the internal image to match other channel images is performed when the surface is the shell surface of the battery cell.
[0028] Therefore, since the coating surface and the shell surface of the battery cell appear differently under the light source, the third channel images of the coating surface and the shell surface of the battery cell are acquired in different ways.
[0029] A second aspect of the present application provides a defect detection method, which includes: acquiring a multi-channel image of a target object; wherein the multi-channel image is obtained by processing using the above-mentioned image processing method; and performing defect detection based on the multi-channel image to obtain the defect type existing in the target object.
[0030] According to a third aspect of the present application, there is provided an image processing device, which includes an acquisition module, a processing module and a stitching module; the acquisition module is used to acquire multiple original images of a target object; wherein the multiple original images are acquired by an image acquisition device from the surface of the target object under different light source conditions, and the different light source conditions include at least one of the light source type and the light source irradiation direction; the processing module is used to use the multiple original images to obtain at least two channel images corresponding to different defect types; wherein at least one channel image is obtained by performing enhancement processing on at least one original image corresponding to the defect type; the stitching module is used to stitch at least two channel images to obtain a multi-channel image; wherein the multi-channel image is used to perform defect detection on the target object.
[0031] The fourth aspect of the present application provides a defect detection device, which includes an acquisition module and a detection module; the acquisition module is used to acquire a multi-channel image of a target object; wherein the multi-channel image is obtained by processing using the above-mentioned image processing method; the detection module is used to perform defect detection based on the multi-channel image to obtain the defect type existing in the target object.
[0032] A fifth aspect of the present application provides an electronic device, which includes a memory and a processor, the memory stores program instructions, and the processor is used to execute the program instructions to implement the above method.
[0033] A sixth aspect of the present application provides a computer-readable storage medium, which is used to store program instructions, and the program instructions can be executed to implement the above method.
[0034] In the above technical solution, since each channel image can magnify the defect features of the corresponding type of defect, the multi-channel image obtained by splicing at least two channel images can magnify the defect features of each type of defect. Since the multi-channel image can magnify the defect features of each type of defect, the multi-channel image provides a higher quality image for subsequent defect detection of the target object. The subsequent defect detection of the target object based on the multi-channel image can improve the defect detection effect of each type of defect.
[0035] In addition, since the subsequent defect detection of the target object is performed based on the multi-channel image, compared with sequential defect detection of multiple single-channel images, the reasoning time and video memory consumption of defect detection are reduced.
[0036] Furthermore, the multi-channel image is obtained without using a neural network algorithm, that is, efficient image processing is achieved without using a neural network algorithm, and no additional graphics card is required. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is a flowchart of an embodiment of an image processing method provided by the present application;
[0038] Figure 2 is a schematic diagram of an embodiment of pixel value distribution of a surface image provided by the present application;
[0039] Figure 3 is a schematic diagram of another embodiment of the pixel value distribution of the surface image provided by the present application;
[0040] Figure 4 It is a flow chart of an embodiment of obtaining a channel image corresponding to a surface depth defect provided by the present application;
[0041] Figure 5 is a schematic diagram of an embodiment of the pixel value distribution of the first channel image provided by the present application;
[0042] Figure 6 is a schematic diagram of another embodiment of the pixel value distribution of the first channel image provided by the present application;
[0043] Figure 7 is a schematic diagram of an embodiment of pixel value distribution of a second channel image provided by the present application;
[0044] Figure 8 is a schematic diagram of another embodiment of the pixel value distribution of the second channel image provided by the present application;
[0045] Fig. 9 is a schematic diagram of an embodiment of pixel value distribution of a third channel image provided by the present application;
[0046] Fig.10 is a schematic diagram of an embodiment of pixel value distribution of a multi-channel image provided by the present application;
[0047] Fig.11 is a schematic diagram of another embodiment of the pixel value distribution of a multi-channel image provided by the present application;
[0048] Fig.12 It is a flow chart of an embodiment of a defect detection method provided by the present application;
[0049] Fig.13 is a structural schematic diagram of an embodiment of an image processing device provided by the present application;
[0050] Fig.14 It is a structural schematic diagram of an embodiment of a defect detection device provided by the present application;
[0051] Fig.15 It is a structural schematic diagram of an embodiment of an electronic device provided by the present application;
[0052] Fig.16 It is a structural schematic diagram of an embodiment of a computer-readable storage medium provided by the present application. DETAILED DESCRIPTION
[0053] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.
[0054] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0055] The term "and / or" in this article is only a description of the association relationship of 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 objects associated before and after are in an "or" relationship. In addition, "many" in this article means two or more than two. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C.
[0056] See also Figure 1 , Figure 1 is a flow chart of an embodiment of the image processing method provided by the present application. It should be noted that if there are substantially the same results, this embodiment does not necessarily use Figure 1 The process sequence shown is limited. Figure 1 As shown, this embodiment includes:
[0057] Step S11: Acquire multiple original images of the target object.
[0058] In this embodiment, multiple original images of the target object are obtained; wherein the multiple original images are obtained by the image acquisition device respectively acquiring the surface of the target object under different light source conditions, and the different light source conditions include at least one of the light source type and the light source irradiation direction. Specifically, under a light source type and a light source irradiation direction, the image acquisition device is used to acquire an image of the surface of the target object under this light source to obtain a light source image (original image) corresponding to this light source type and light source irradiation direction; original images corresponding to other light source types and other light source irradiation directions are also acquired according to the above-mentioned image acquisition method, which will not be described in detail here.
[0059] There is no limitation on the type of light source, which can be set according to actual use needs; for example, the light source can be a mixed light source, a red light source, a blue light source, an infrared light source, etc. In addition, there is no limitation on the position of the light source relative to the target object, which can be set according to actual use needs; for example, the light source is set on the left side, right side, upper side, lower side, etc. of the target object. Furthermore, there is no limitation on the position of the image acquisition device relative to the target object, which can be set according to actual use needs.
[0060] Step S12: using the multiple original images, obtaining at least two channel images corresponding to different defect types.
[0061] In this embodiment, multiple original images are used to obtain at least two channel images corresponding to different defect types; wherein at least one channel image is obtained by performing enhancement processing corresponding to the defect type on at least one original image.
[0062] The channel image corresponding to at least one defect type is obtained by performing enhancement processing on at least one original image for the corresponding defect type, that is, the channel images of these defect types are obtained by performing enhancement processing on the corresponding defect type, so the channel images corresponding to these defect types can amplify the defect features of the corresponding type of defects. Since the channel image obtained by performing enhancement processing on at least one original image for the corresponding defect type can amplify the defect features of the corresponding type of defects, the channel image obtained by performing enhancement processing on at least one original image for the corresponding defect type provides a higher quality image for subsequent defect detection of the target object. Subsequently, defect detection of the target object based on the channel image obtained by performing enhancement processing on at least one original image for the corresponding defect type can improve the defect detection effect.
[0063] It should be noted that the channel images of some defect types are not obtained by enhancing at least one original image for the corresponding defect type. This is because the original images of these defect types themselves can amplify the defect features of the corresponding types of defects. Therefore, for these defect types, the corresponding original images can be directly used as channel images, or the pixel value distribution of the corresponding original images can be adjusted to match other channel images and used as channel images.
[0064] There is no limit on the number of original images required for the enhancement processing of the corresponding defect type, and it can be specifically set according to actual use needs.
[0065] In addition, the defect type of the channel image obtained by performing enhancement processing of the corresponding defect type is not limited. For example, the channel images corresponding to all defect types are obtained by performing enhancement processing of the corresponding defect type on at least one original image, so the channel images corresponding to each defect type can amplify the defect features of the corresponding type of defect; that is, when the channel images corresponding to all defect types are obtained by performing enhancement processing of the corresponding defect type on at least one original image, the defect features of each type of defect will be amplified, and the defect detection of the target object based on the channel images corresponding to each defect type can improve the defect detection effect of each type of defect, that is, the overall defect detection effect will be improved.
[0066] In one embodiment, the target object is a battery cell, the surface is the coating surface or shell surface of the battery cell, and the defect type includes at least one of a surface depth defect, a surface non-depth defect, and an internal defect. For the shell surface of the battery cell, the surface depth defect of the battery cell shell surface may be a pit, a bulge, etc., the surface non-depth defect of the battery cell shell surface may be dirt, scratches, etc., and the internal defect of the battery cell shell surface may be foreign matter in the film, etc. It should be noted that the edge of the battery cell shell surface will be coated with a film; for the coating surface of the battery cell, the surface depth defect of the battery cell coating surface may be bubbles, pits, bulges, etc., the surface non-depth defect of the battery cell coating surface may be dirt, etc., and the internal defect of the battery cell coating surface may be foreign matter in the film, etc.
[0067] When the target object is a battery cell and the surface is a coating surface of the battery cell, multiple original images of the battery cell are used to obtain a channel image that can magnify the surface deep defect features, surface non-deep defect features and internal defect features of the coating surface of the battery cell (for example, at least one original image is enhanced for a corresponding defect type to obtain a channel image, and the channel image obtained by the defect type enhancement process can magnify the defect features of the corresponding type of defect; or, directly use the corresponding original image as a channel image, or adjust the pixel value distribution of the corresponding original image to match other channel images to use it as a channel image). Since the channel images corresponding to the surface depth defects, surface non-depth defects and internal defects on the cell coating surface can amplify the surface depth defect features, surface non-depth defect features and internal defect features on the cell coating surface, the channel images corresponding to the surface depth defects, surface non-depth defects and internal defects on the cell coating surface provide better quality images for subsequent defect detection of the cell. Subsequent defect detection of the cell based on the channel images that can amplify the surface depth defect features, surface non-depth defect features and internal defect features on the cell coating surface can improve the detection effect of the surface depth defects, surface non-depth defects and internal defects on the cell coating surface.
[0068] In the case where the target object is a battery cell and the surface is the shell surface of the battery cell, a channel image that can magnify the surface depth defect features, surface non-depth defect features and internal defect features of the battery cell shell surface is obtained by using multiple original images of the battery cell (for example, at least one original image is enhanced for the corresponding defect type to obtain a channel image, and the channel image obtained by the defect type enhancement process can magnify the defect features of the corresponding type of defect; or, the corresponding original image channel image is directly used, or the pixel value distribution of the corresponding original image is adjusted to match other channel images, and then used as the channel image). Since the channel images corresponding to the surface depth defects, surface non-depth defects and internal defects of the battery cell shell surface can magnify the surface depth defect features, surface non-depth defect features and internal defect features of the battery cell shell surface, the channel images corresponding to the surface depth defects, surface non-depth defects and internal defects of the battery cell shell surface provide better quality images for subsequent defect detection of the battery cell. Subsequent defect detection of the battery cell based on the channel images that can magnify the surface depth defect features, surface non-depth defect features and internal defect features of the battery cell shell surface can improve the detection effect of the surface depth defects, surface non-depth defects and internal defects of the battery cell shell surface.
[0069] There are various defect types, and each defect type has different characteristics. Therefore, in one embodiment, for defect type enhancement processing that is required to enable the channel image to amplify the defect features of the corresponding defect type, multiple original images are used to perform enhancement processing on the corresponding defect type to obtain the channel image of the corresponding defect type. For defect types whose original images themselves can amplify the defect features, the original image corresponding to the defect type can be directly used as the channel image of the defect type, or the pixel value distribution of the original image corresponding to the defect type can be adjusted to match other channel images and used as the channel image of the defect type.
[0070] Step S13: stitching at least two channel images to obtain a multi-channel image.
[0071] In this embodiment, at least two channel images are spliced to obtain a multi-channel image; wherein the multi-channel image is used to perform defect detection on the target object.
[0072] Since each channel image can magnify the defect features of the corresponding type of defect, the multi-channel image obtained by splicing at least two channel images can magnify the defect features of each type of defect. Since the multi-channel image can magnify the defect features of each type of defect, the multi-channel image provides a better quality image for subsequent defect detection of the target object. Subsequent defect detection of the target object based on the multi-channel image can improve the defect detection effect of various types of defects.
[0073] In addition, since the subsequent defect detection of the target object is performed based on the multi-channel image, compared with sequential defect detection of multiple single-channel images, the reasoning time and video memory consumption of defect detection are reduced.
[0074] Furthermore, the multi-channel image is obtained without using a neural network algorithm, that is, efficient image processing is achieved without using a neural network algorithm, and no additional graphics card is required.
[0075] In one embodiment, the defect type includes a surface depth defect, and the multiple original images include at least two first surface images, and the light source irradiation directions of the first surface images are different. At this time, using the multiple original images, at least two channel images corresponding to different defect types are obtained, specifically: at least two first surface images are enhanced corresponding to the surface depth defect to obtain the first channel image corresponding to the surface depth defect.
[0076] That is to say, for surface depth defects, the corresponding surface image cannot magnify the defect features of the surface depth defects, so at least two first surface images are used to perform enhancement processing on the corresponding surface depth defects to obtain the first channel image of the corresponding surface depth defects. The first channel image corresponding to the surface depth defect is obtained by performing enhancement processing on the corresponding surface depth defect, so the first channel image corresponding to the surface depth defect can magnify the defect features of the surface depth defect. Since the first channel image corresponding to the surface depth defect can magnify the defect features of the surface depth defect, the first channel image corresponding to the surface depth defect provides a higher quality image for the subsequent surface depth defect detection of the target object. The subsequent surface depth defect detection of the target object based on the first channel image corresponding to the surface depth defect can improve the detection effect of the surface depth defect.
[0077] In one embodiment, the light source corresponding to each first surface image is a first light source, and the first light source is a mixed light source. Of course, in other embodiments, the first light source may also be a single light source, such as a red light source, a blue light source, etc.
[0078] In one embodiment, the light source corresponding to each first surface image is a first light source, and there may be two first light sources, which are respectively located on different sides of the target object. Of course, in other embodiments, there may be one first light source, and the first light source is set on one side of the target object and image acquisition is performed, and then the first light source is moved to the other side of the target object and image acquisition is performed.
[0079] In one embodiment, the light sources corresponding to the first surface images are first light sources, and the irradiation directions of the first light sources on the surface are opposite.
[0080] In a specific implementation, the plurality of original images include two first surface images, the light sources corresponding to the two first surface images are both first light sources, and the irradiation directions of the first light sources on the surface are opposite.
[0081] For example, the surface of the target object is the coating surface of the battery cell, there are two first surface images, there are two first light sources and they are distributed on opposite sides of the coating surface of the battery cell (the two first light sources irradiate in opposite directions on the coating surface of the battery cell), and both first light sources are mixed light sources: Figure 2 As shown, Figure 2 1 is a schematic diagram of an embodiment of the pixel value distribution of the surface image provided by the present application. The image acquisition device is used to acquire an image of the coating surface of the battery cell under the first light source 1 to obtain a first surface image A. The pixel value distribution of the first surface image A is shown in FIG. Figure 2 As shown in the curve a in FIG; the image acquisition device is used to acquire an image of the coating surface of the battery cell under the first light source 2 to obtain a first surface image B. The pixel value distribution of the first surface image B is shown in FIG. Figure 2 As shown by curve b in . It can be seen from curve a and curve b that the pixel value distribution of the first surface image A and the first surface image B basically conforms to the normal distribution and the pixel value distribution center of the first surface image A is greater than the pixel value distribution center of the first surface image B, wherein the horizontal axis of the histogram is the pixel value size and the vertical axis is the number.
[0082] For example, the surface of the target object is the shell surface of the battery cell, there are two first surface images, there are two first light sources and they are distributed on opposite sides of the shell surface of the battery cell (the two first light sources have opposite irradiation directions on the shell surface of the battery cell), and both first light sources are mixed light sources: Figure 3 As shown, Figure 3 is a schematic diagram of another embodiment of the pixel value distribution of the surface image provided by the present application. The image acquisition device is used to acquire an image of the shell surface of the battery cell under the first light source 1 to obtain a first surface image C. The pixel value distribution of the first surface image C is shown in FIG. Figure 3 As shown in the curve c in FIG. 1 ; using the image acquisition device to acquire an image of the shell surface of the battery cell under the first light source 2, a first surface image D is obtained, and the pixel value distribution of the first surface image D is shown in FIG. Figure 3 As shown by curve d in . Since the edge of the shell surface of the battery cell is covered with a film, the shell surface of the battery cell includes the surrounding film surface and the central shell surface; and the reflection degree of the surrounding film surface and the central shell surface is different, so the first surface image C and the first surface image D have two pixel value distribution centers, the distribution center with a lower pixel value is the surrounding film area, and the distribution center with a higher pixel value is the central shell area. Among them, the horizontal axis of the histogram is the pixel value size, and the vertical axis is the number.
[0083] In one embodiment, if Figure 4 As shown, Figure 4 This is a flow chart of an embodiment of obtaining a channel image corresponding to a surface depth defect provided by the present application. The defect type includes a surface depth defect. At least two first surface images are enhanced corresponding to the surface depth defect to obtain a first channel image corresponding to the surface depth defect. Specifically, the following sub-steps are included:
[0084] Step S41: Acquire a difference image between at least two first surface images.
[0085] In this embodiment, a difference image between at least two first surface images is obtained. In the case of two first surface images, the pixel value in one first surface image is subtracted from the pixel value in another first surface image to obtain a difference image. In the case of three or more first surface images, the pixel value difference in each of the first surface images can be obtained, and the average of the pixel value difference can be calculated to obtain a difference image.
[0086] In one implementation, a difference image may be obtained by subtracting a first surface image with a large pixel value distribution center from a first surface image with a small pixel value distribution center.
[0087] For example, if Figure 2 As shown, the distribution center of the pixel value of the first surface image A corresponding to curve a is at (106, 130), and the distribution center of the pixel value of the first surface image B corresponding to curve b is at (94, 110); therefore, the pixel value of the first surface image A is subtracted from the pixel value of the first surface image B to obtain a difference image.
[0088] Step S42: using the difference image as the first channel image, or performing a preset process on the difference image to obtain the first channel image.
[0089] In this implementation, the difference image is used as the first channel image, or the difference image is subjected to preset processing to obtain the first channel image, wherein the preset processing includes at least one of difference amplification, brightness adjustment, channel truncation and normalization processing.
[0090] Take two first surface images and the first light sources corresponding to the two first surface images with opposite illumination directions as an example for explanation. Under the two first light sources with opposite illumination directions, the reflection or scattering characteristics of the non-surface depth defect area on the surface of the target object are similar, so when the two first surface images are subtracted, the intensity changes of the non-surface depth defect area will cancel each other out, thereby appearing as a lower brightness feature or a pixel value close to zero on the difference image; and the surface depth defect area on the surface of the target object, under the two first light sources with opposite illumination directions, has opposite performances and presents opposite characteristics (e.g., one surface depth defect area may appear as a dark area, and the other surface depth defect area may appear as a bright area), so when the two first surface images are subtracted, the surface depth defect area will appear as an obvious brightness change. Therefore, in the difference image, the non-surface depth defect area appears as a lower brightness feature or a pixel value close to zero, and the surface depth defect area appears as a higher brightness feature, thereby amplifying or highlighting the defect characteristics of the surface depth defect.
[0091] The difference image corresponding to the surface depth defect can amplify the defect features of the surface depth defect, so the difference image corresponding to the surface depth defect can be directly used as the channel image corresponding to the surface defect features; the channel image corresponding to the surface depth defect features provides a better image for subsequent defect detection of the target object. Subsequently, surface depth defect detection is performed on the target object based on the channel image corresponding to the surface depth defect features, which can improve the detection effect of surface depth defects.
[0092] In order to improve the detection effect of subsequent surface depth defect detection based on the channel image corresponding to the surface depth defect, the difference image can also be subjected to preset processing such as difference amplification, brightness adjustment, channel truncation or normalization, and the difference image after the preset processing can be used as the channel image corresponding to the surface depth defect.
[0093] In one embodiment, the difference image is differentially amplified, specifically: each pixel value in the difference image is multiplied by a preset multiple to obtain a first channel image corresponding to the surface depth defect, wherein the preset multiple is greater than 1. The difference image corresponding to the surface depth defect can amplify the defect feature of the surface depth defect, and the first channel image corresponding to the surface depth defect is obtained by differentially amplifying the difference image corresponding to the surface depth defect, so the first channel image corresponding to the surface depth defect can further amplify the defect feature of the surface depth defect, making the defect feature of the surface depth defect more prominent, and subsequently performing surface depth defect detection on the target object based on the channel image corresponding to the surface depth defect feature can further improve the detection effect of the surface depth defect.
[0094] The preset multiple is not limited and can be set according to actual use. For example, the preset multiple is 2, 3, 4 or 5.
[0095] In one embodiment, the brightness of the difference image is adjusted, specifically: each pixel value in the difference image is added with a preset gain value to obtain a first channel image corresponding to the surface depth defect. The preset gain value is added to each pixel value in the difference image, and each pixel value in the difference image is increased, so that the brightness of the difference image is increased, thereby avoiding the first channel image corresponding to the surface depth defect being dark.
[0096] The preset gain value is not limited and can be set according to actual use. For example, the preset gain value can be 32, 35, 40 or 50.
[0097] In one embodiment, the difference image is subjected to channel truncation, specifically: all pixel values in the difference image that are less than a first value are set to the first pixel value, and all pixel values in the difference image that are greater than a second value are set to the second pixel value, to obtain a first channel image corresponding to the surface depth defect. The difference image is subjected to channel truncation to limit the pixel values of the difference image within a specified range, so that the pixel values of the difference image meet the requirements of the defect detection network for subsequent defect detection; and the first channel image corresponding to the surface depth defect is obtained by performing channel truncation on the pixel values of the difference image, so the pixel value distribution of the first channel image corresponding to the surface depth defect meets the requirements of the defect detection network for subsequent defect detection, thereby improving the detection accuracy of defect detection on the target object.
[0098] The first value, the second value, the first pixel value, and the second pixel value are not limited and can be set according to actual use needs. For example, the first value can be 0, the second value can be 64, the first pixel value can be 0, and the second pixel value can be 64.
[0099] In one embodiment, the difference image is also normalized. Normalizing the difference image can scale the pixel values of the difference image to a specific range, so that the subsequent defect detection network can perform stable defect detection based on this, thereby improving the defect detection effect.
[0100] The normalized range is not limited and can be set according to actual use needs. For example, the normalized range is [0, 180].
[0101] In a specific embodiment, the preset processing includes difference amplification, brightness adjustment, channel truncation and normalization processing. At this time, the difference image is subjected to the preset processing to obtain the first channel image, specifically: each pixel value in the difference image is multiplied by a preset multiple to obtain a difference image after difference amplification, and the preset multiple is greater than 1; each pixel value in the difference image after difference amplification is added with a preset gain value to obtain a difference image after brightness adjustment; pixel values in the difference image after brightness adjustment that are less than the first value are all set to the first pixel value, and pixel values in the difference image after brightness adjustment that are greater than the second value are all set to the second pixel value to obtain a difference image after channel truncation; the difference image after channel truncation is subjected to normalization processing to obtain the first channel image. In other words, the difference image is subjected to difference amplification, brightness adjustment, channel truncation and normalization processing in sequence to obtain a channel image corresponding to the corresponding surface depth defect.
[0102] It should be noted that when the target object is a battery cell and the surface is the coating surface or shell surface of the battery cell, the channel image is obtained in the above manner for both the surface depth defects of the battery cell coating surface and the surface depth defects of the battery cell shell surface.
[0103] Take the case where the surface of the target object is the coating surface of the battery cell, there are two first surface images, there are two first light sources distributed on opposite sides of the coating surface of the battery cell (the two first light sources irradiate in opposite directions on the coating surface of the battery cell), and both first light sources are mixed light sources as an example: Figure 2 The first surface image A corresponding to the curve a shown, minus Figure 2The first surface image B corresponding to the curve b shown in the figure (actually, the pixel values of the first surface image A and the first surface image B are subtracted) is obtained to obtain a difference image; the difference image is sequentially subjected to difference amplification, brightness adjustment, channel truncation and normalization processing to obtain a first channel image of the surface depth defect corresponding to the cell coating surface. The pixel value distribution of the first channel image is shown in FIG. Figure 5 As shown by curve e in Figure 5 3 is a schematic diagram of an embodiment of the pixel value distribution of the first channel image provided by the present application, wherein the horizontal axis of the histogram is the pixel value size, and the vertical axis is the number.
[0104] Take the case where the surface of the target object is the shell surface of a battery cell, there are two first surface images, there are two first light sources distributed on opposite sides of the shell surface of the battery cell (the two first light sources irradiate in opposite directions on the shell surface of the battery cell), and both first light sources are mixed light sources as an example: Figure 3 The curve c shown corresponds to the first surface image C, minus Figure 3 The first surface image D corresponding to the curve d shown in FIG. 1 (actually, the pixel values of the first surface image C and the first surface image D are subtracted) is obtained to obtain a difference image; the difference image is sequentially subjected to difference amplification, brightness adjustment, channel truncation and normalization processing to obtain a first channel image of the surface depth defect corresponding to the battery cell shell surface. The pixel value distribution of the first channel image is shown in FIG. Figure 6 As shown by the curve f in Figure 6 It is a schematic diagram of another embodiment of the pixel value distribution of the first channel image provided by the present application, wherein the horizontal axis of the histogram is the pixel value size, and the vertical axis is the number.
[0105] In one embodiment, the defect type includes a surface non-depth defect, and the multiple original images include a second surface image related to the surface non-depth defect. At this time, the multiple original images are used to obtain at least two channel images corresponding to different defect types, specifically: the second surface image is enhanced corresponding to the surface non-depth defect to obtain a second channel image corresponding to the surface non-depth defect.
[0106] That is to say, for surface non-depth defects, the corresponding surface image cannot magnify the defect features of the surface non-depth defects, so the second surface image is used to perform enhancement processing on the corresponding surface non-depth defects to obtain the second channel image of the corresponding surface non-depth defects. The second channel image corresponding to the surface non-depth defect is obtained by performing enhancement processing on the corresponding surface non-depth defect, so the second channel image corresponding to the surface non-depth defect can magnify the defect features of the surface non-depth defect. Since the second channel image corresponding to the surface non-depth defect can magnify the defect features of the surface non-depth defect, the second channel image corresponding to the surface non-depth defect provides a better quality image for the subsequent surface non-depth defect detection of the target object. The subsequent surface non-depth defect detection of the target object based on the second channel image corresponding to the surface non-depth defect can improve the detection effect of the surface non-depth defect.
[0107] In one embodiment, the defect type includes a surface non-depth defect, the number of the second surface images is at least two, and the light source irradiation directions of the at least two second surface images are different. At this time, at least one second surface image is enhanced corresponding to the surface non-depth defect to obtain a second channel image corresponding to the surface non-depth defect, specifically: weighted fusion is performed on each second surface image to obtain the second channel image.
[0108] Light sources from different irradiation directions will illuminate different parts of the target object's surface. By fusing at least two second surface images from light sources from different irradiation directions, more comprehensive target object surface information can be obtained. In the weighted fusion process, the weight of the second surface image with more surface non-depth defect information can be increased to increase the contrast between the surface non-depth defect area and the background area (surface non-defect area), making the surface non-depth defect area stand out, and magnifying the defect characteristics of the surface non-depth defect.
[0109] It should be noted that weighted fusion of the second surface images is actually weighted summation of the pixel values of the second surface images.
[0110] In one embodiment, the weights corresponding to the second surface images may be the same. For example, there are two second surface images, and the weights corresponding to the second surface images are all 0.5.
[0111] Of course, in other embodiments, the weights corresponding to the second surface images may be different. For example, if there are two second surface images, the weight corresponding to one second surface image is 0.7, and the weight corresponding to the other second surface image is 0.3. For another example, if there are three second surface images, the weight corresponding to one second surface image is 0.5, the weight corresponding to the other second surface image is 0.2, and the weight corresponding to the other second surface image is 0.3.
[0112] In a specific implementation, the light source of each second surface image is a first light source, and the irradiation directions of the first light sources on the surface are opposite.
[0113] In a specific implementation, the plurality of original images include two second surface images, the light sources corresponding to the two second surface images are both first light sources, and the irradiation directions of the first light sources on the surface are opposite.
[0114] In a specific implementation, the light source of each second surface image is a first light source, and the first light source is a mixed light source. Of course, in other implementations, the first light source can also be a single light source, such as a red light source, a blue light source, etc.
[0115] In a specific embodiment, the light source of each second surface image is the first light source, and there may be two first light sources, which are respectively located on different sides of the target object. Of course, in other embodiments, there may be one first light source, and the first light source is set on one side of the target object and image acquisition is performed, and then the first light source is moved to the other side of the target object and image acquisition is performed.
[0116] It should be noted that the step of weighted fusion of each second surface image is performed when the surface is the coating surface of a battery cell. That is to say, by using at least two second surface images for weighted fusion, a second channel image of the surface non-depth defects of the corresponding battery cell coating surface is obtained, and this second channel image can amplify the defect features of the surface non-depth defects of the battery cell coating surface. Since the second channel image of the surface non-depth defects of the corresponding battery cell coating surface can amplify the defect features of the surface non-depth defects of the battery cell coating surface, the second channel image of the surface non-depth defects of the corresponding battery cell coating surface provides a higher quality image for the subsequent detection of the surface non-depth defects of the battery cell coating surface. The subsequent detection of the surface non-depth defects of the battery cell coating surface based on the second channel image of the surface non-depth defects of the corresponding battery cell coating surface can improve the detection effect of the surface non-depth defects of the battery cell coating surface.
[0117] For example, the surface of the target object is the coating surface of the battery cell, there are two second surface images, there are two first light sources and they are distributed on opposite sides of the coating surface of the battery cell (the two first light sources irradiate in opposite directions on the coating surface of the battery cell), and both first light sources are mixed light sources: Figure 2 As shown, the image acquisition device is used to acquire an image of the coating surface of the battery cell under the first light source 1 to obtain a second surface image A. The pixel value distribution of the second surface image A is shown in FIG. Figure 2 As shown in the curve a in the figure; the image acquisition device is used to acquire an image of the coating surface of the battery cell under the first light source 2 to obtain a second surface image B. The pixel value distribution of the second surface image B is shown in Figure 2As shown by curve b in . It can be seen from curve a and curve b that the pixel value distribution of the second surface image A and the second surface image B basically conforms to the normal distribution and the pixel value distribution center of the second surface image A is greater than the pixel value distribution center of the second surface image B, wherein the horizontal axis of the histogram is the pixel value size and the vertical axis is the number.
[0118] Further, using Figure 2 The second surface image A corresponding to the curve a shown in FIG. Figure 2 The second surface image B (actually the weighted sum of the pixel values of the second surface image A and the second surface image B) corresponding to the curve b shown in the figure obtains the second channel image of the surface non-depth defect of the battery cell film surface. The pixel value distribution of the second channel image is shown in FIG. Figure 7 As shown by the curve g in Figure 7 3 is a schematic diagram of an embodiment of the pixel value distribution of the second channel image provided by the present application, wherein the horizontal axis of the histogram is the pixel value size, and the vertical axis is the number.
[0119] In other embodiments, the defect type includes surface non-depth defects, the second surface image is one, and the light source light of the second surface image is coaxial with the lens axis of the image acquisition device; at this time, the second surface image is enhanced corresponding to the surface non-depth defects to obtain a second channel image corresponding to the surface non-depth defects, specifically: the second surface image is subtracted from the third pixel value to obtain the second channel image.
[0120] The second surface image of a flat surface (such as a flat surface of a battery cell shell) has a very high grayscale value due to mirror reflection; once there is a surface non-depth defect that destroys the flat surface, the reflection type of the surface non-depth defect area becomes diffuse reflection, and the grayscale value of the surface non-depth defect area will be much lower than other areas of the surface. Therefore, when the second surface image is subtracted from the third pixel value, the area with a pixel value difference of 0 is the non-defect area of the surface, and the remaining area is the surface non-depth defect area; that is, when the second surface image is subtracted from the third pixel value, the surface non-depth defect area is highlighted, thereby magnifying the defect characteristics of the surface non-depth defect.
[0121] The third pixel value is not limited and can be set according to actual use requirements. For example, the third pixel value is 255.
[0122] It should be noted that subtracting the second surface image from the third pixel value actually means subtracting each pixel value of the second surface image from the third pixel value.
[0123] In one specific implementation, the light source corresponding to the second surface image is the first light source, and the first light source is a mixed light source. Of course, in other specific implementations, the first light source may also be a single light source, such as a red light source, a blue light source, and the like.
[0124] For example, the surface of the target object is the shell surface of the battery cell, the second surface image is one image, the light of the first light source is coaxial with the lens axis of the image acquisition device, and the first light source is a mixed light source: Figure 3 As shown, the image acquisition device is used to acquire an image of the shell surface of the battery cell under the first light source to obtain a second surface image C. The pixel value distribution of the second surface image C is shown in FIG. Figure 3 As shown by the curve h in . Since the edge of the shell surface of the battery cell is covered with a film, the shell surface of the battery cell includes the surrounding film surface and the central shell surface; and the degree of reflection of the surrounding film surface and the central shell surface is different, so the second surface image C has two pixel value distribution centers, the distribution center with a lower pixel value is the surrounding film area, and the distribution center with a higher pixel value is the central shell area. Among them, in addition, under the coaxial light source (first light source), due to the strong specular reflection of the central shell surface, the pixel value of most areas of the second surface image C (coaxial image) is 255, and the reflection type of the surrounding film area or the non-deep defect area on the surface is diffuse reflection, so the gray value is less than 255. The horizontal axis of the histogram is the pixel value size, and the vertical axis is the number.
[0125] It should be noted that the step of subtracting the second surface image from the third pixel value is performed when the surface is the shell surface of the battery cell. That is to say, by subtracting the second surface image from the third pixel value, a second channel image of the surface non-depth defects corresponding to the shell surface of the battery cell is obtained, and this second channel image can magnify the defect features of the surface non-depth defects of the shell surface of the battery cell. Since the second channel image of the surface non-depth defects corresponding to the shell surface of the battery cell can magnify the defect features of the surface non-depth defects of the shell surface of the battery cell, the second channel image of the surface non-depth defects corresponding to the shell surface of the battery cell provides a higher quality image for the subsequent detection of the surface non-depth defects of the shell surface of the battery cell. The subsequent detection of the surface non-depth defects of the shell surface of the battery cell is performed based on the second channel image of the surface non-depth defects of the shell surface of the battery cell, which can improve the detection effect of the surface non-depth defects of the shell surface of the battery cell.
[0126] Take the case where the surface of the target object is the shell surface of the battery cell, the second surface image is one image, the light of the first light source is coaxial with the lens axis of the image acquisition device, and the first light source is a mixed light source as an example: use the third pixel value (255) to subtract Figure 3 The second surface image C corresponding to the curve h shown in FIG. 1 (actually, the third pixel value is subtracted from the pixel value of the second surface image C), and the second channel image corresponding to the surface non-depth defect of the battery shell surface is obtained. The pixel value distribution of the second channel image is shown in FIG. Figure 8 As shown by the curve i in Figure 8It is a schematic diagram of another embodiment of the pixel value distribution of the second channel image provided by the present application, wherein the abscissa of the histogram is the pixel value size, and the ordinate is the number.
[0127] In one embodiment, the defect type includes an internal defect, and the multiple original images include an internal image. At this time, the multiple original images are used to obtain at least two channel images corresponding to different defect types, specifically: the internal image is used as the third channel image corresponding to the internal defect.
[0128] For internal defects, the corresponding internal image itself can magnify the defect features of the internal defects, so the internal image can be directly used as the third channel image corresponding to the internal defects. Since the third channel image corresponding to the internal defects can magnify the defect features of the internal defects, the third channel image corresponding to the internal defects provides a better image for the subsequent internal defect detection of the target object. The subsequent internal defect detection of the target object based on the third channel image corresponding to the internal defects can improve the detection effect of the internal defects.
[0129] In a specific embodiment, the internal image is an image collected under an infrared light source. With the infrared light source, the imaging can penetrate the surface and clearly see the foreign matter under the surface. Therefore, the original image under the infrared light source can be directly used as the channel image corresponding to the internal defect. Of course, in other embodiments, the internal image can also be an image under other light sources that can penetrate the surface and clearly see the foreign matter under the surface, which is not limited here.
[0130] It should be noted that when the target object is a battery cell, the internal image is the image under the film of the battery cell. The infrared light source can penetrate the film covering the battery cell and clearly see the foreign matter under the film.
[0131] Take the target object as the coating surface of the battery cell, and the internal image as one image under infrared light source as an example: Figure 2 As shown, the image acquisition device is used to acquire an image of the coating surface of the battery cell under the third light source (infrared light source) to obtain an internal image A. The pixel value distribution of the internal image A is shown in Figure 2 As shown by curve j in . It can be seen from curve j that the pixel value distribution of internal image A basically conforms to the normal distribution and the pixel value distribution center of internal image A is larger than the pixel value distribution center of internal image A and the pixel value distribution center of internal image B, where the horizontal axis of the histogram is the pixel value size and the vertical axis is the number.
[0132] It should be noted that the step of using the internal image as the third channel image corresponding to the internal defects is performed when the surface is the coating surface of the battery cell. That is to say, by using the internal image as the third channel image corresponding to the internal defects, this third channel image can magnify the defect features of the internal defects of the coating surface of the battery cell. Since the third channel image corresponding to the surface internal defects of the coating surface of the battery cell can magnify the defect features of the internal defects of the coating surface of the battery cell, the third channel image corresponding to the internal defects of the coating surface of the battery cell provides a better quality image for the subsequent detection of the internal defects of the coating surface of the battery cell. The subsequent internal defect detection of the coating surface of the battery cell based on the third channel image of the internal defects of the coating surface of the battery cell can improve the detection effect of the internal defects of the coating surface of the battery cell.
[0133] In other embodiments, the defect type includes an internal defect, and the multiple original images include an internal image; in this case, the multiple original images are used to obtain at least two channel images corresponding to different defect types, specifically: the pixel value distribution of the internal image is adjusted to match the other channel images to obtain a third channel image.
[0134] For internal defects, the corresponding internal image itself can amplify the defect features of the internal defects, so the internal image can be used as the third channel image corresponding to the internal defect. Since the multi-channel image (e.g., including the first channel image and the third channel image, or including the first channel image, the second channel image and the third channel image) is subsequently given to the defect detection network, if the pixel value distribution of the third channel image does not match that of the other channel images or the gap is relatively large, it will affect the defect detection effect of the defect detection network. Therefore, the pixel value distribution of the third original image is adjusted to match the other channel images to obtain the third channel image.
[0135] On the one hand, since the third channel image corresponding to the internal defect can magnify the defect features of the internal defect, the third channel image corresponding to the internal defect provides a better quality image for the subsequent internal defect detection of the target object. The subsequent internal defect detection of the target object based on the third channel image corresponding to the internal defect can improve the detection effect of the internal defect. On the other hand, since the third channel image corresponding to the internal defect is obtained by adjusting the pixel value distribution based on the third original image corresponding to the internal defect, the third channel image corresponding to the internal defect matches the pixel value distribution of other channel images, further improving the defect detection effect of the subsequent defect detection network.
[0136] In a specific embodiment, the internal image is an image collected under an infrared light source. With the infrared light source, the imaging can penetrate the surface and clearly see the foreign matter under the surface. Therefore, the original image under the infrared light source can be directly used as the channel image corresponding to the internal defect. Of course, in other embodiments, the internal image can also be an image under other light sources that can penetrate the surface and clearly see the foreign matter under the surface, which is not limited here.
[0137] For example, the surface of the target object is the shell surface of the battery cell, and the internal image is one image under infrared light source: Figure 3 As shown, the image acquisition device is used to acquire an image of the shell surface of the battery cell under the third light source (infrared light source) to obtain an internal image B. The pixel value distribution of the internal image B is shown in FIG. Figure 3 As shown by the curve k in . Since the edge of the shell surface of the battery cell is covered with a film, the shell surface of the battery cell includes the surrounding film surface and the central shell surface; and the reflection degree of the surrounding film surface and the central shell surface is different, so the internal image B has two pixel value distribution centers, the distribution center with a lower pixel value is the surrounding film area, and the distribution center with a higher pixel value is the central shell area. Among them, the horizontal axis of the histogram is the pixel value size, and the vertical axis is the number.
[0138] It should be noted that the step of adjusting the pixel value distribution of the internal image to match the other channel images is performed when the surface is the shell surface of the battery cell. That is to say, the pixel value distribution of the internal image is adjusted to match the other channel images to obtain a third channel image, and this third channel image can not only enlarge the defect characteristics of the internal defects of the battery cell shell surface, but also match the pixel value distribution of other channel images. On the one hand, since the third channel image corresponding to the internal defects of the battery cell shell surface can enlarge the defect characteristics of the internal defects of the battery cell shell surface, the third channel image corresponding to the internal defects of the battery cell shell surface provides a higher quality image for the subsequent internal defect detection of the battery cell shell surface. The internal defect detection of the battery cell shell surface based on the third channel image of the internal defects of the battery cell shell surface can improve the detection effect of the internal defects of the battery cell shell surface. Since the third channel image corresponding to the internal defect is obtained by adjusting the pixel value distribution based on the third original image corresponding to the internal defect, the third channel image corresponding to the internal defect matches the pixel value distribution of other channel images, further improving the defect detection effect of the subsequent defect detection network.
[0139] In a specific implementation, the pixel value distribution of the internal image is adjusted to match other channel images to obtain a third channel image, specifically: each pixel value in the internal image is subtracted from the fourth pixel value to obtain the third channel image.
[0140] The size of the fourth pixel value is not limited and can be set according to actual use requirements. For example, the fourth pixel value is 255.
[0141] For example, the surface of the target object is the shell surface of the battery cell, the third original image is one, and the third light source is one and is an infrared light source: Fig. 9 As shown, Fig. 9 is a schematic diagram of an embodiment of the pixel value distribution of the third channel image provided by the present application. Figure 3 The internal image B corresponding to the curve k in FIG. 1 is used as the third channel image corresponding to the internal defects of the battery shell surface. The pixel value distribution of this third channel image is as follows: Fig. 9 As shown in the curve l in ; using the fourth pixel value (255) to subtract, Figure 3 The pixel values in the internal image B corresponding to the curve k in the figure are used to obtain the third channel image corresponding to the internal defects of the battery shell surface. The pixel value distribution of this third channel image is as follows: Fig. 9 As shown in the curve m in . Among them, the horizontal axis of the histogram is the pixel value size, and the vertical axis is the number.
[0142] In other specific embodiments, the pixel value distribution of the internal image is adjusted to match the other channel images to obtain a third channel image, specifically: obtaining the pixel value distribution of the internal image and the pixel value distribution of each other channel image; in response to the difference between the pixel value distributions of the internal image and the other channel images meeting a preset difference condition, subtracting each pixel value in the internal image from the fourth pixel value to obtain the third channel image.
[0143] That is to say, the pixel value distribution of the internal image will be compared with that of the other channel images. Only when the difference between the two meets the preset difference condition, the fourth pixel value will be subtracted from the pixel values in the internal image to make the pixel value distribution of the obtained third channel image match the pixel value distribution of the other channel images.
[0144] The surface of the target object is the coating surface of the battery cell, and at least two channel images include a first channel image corresponding to the surface depth defects of the battery cell coating surface, a second channel image corresponding to the surface non-depth defects of the battery cell coating surface, and a third channel image corresponding to the internal defects of the battery cell coating surface: the first channel image corresponding to the surface depth defects of the battery cell coating surface, the second channel image corresponding to the surface non-depth defects of the battery cell coating surface, and the third channel image corresponding to the internal defects of the battery cell coating surface are spliced to obtain a multi-channel image corresponding to the battery cell coating surface. The pixel value distribution of the multi-channel image is shown as follows: Fig.10 As shown, Fig.10 1 is a schematic diagram of an embodiment of the pixel value distribution of a multi-channel image provided by the present application, wherein the horizontal axis of the histogram is the pixel value size, and the vertical axis is the number.
[0145] The surface of the target object is the shell surface of the battery cell, and at least two channel images include a first channel image corresponding to the surface depth defects of the battery cell shell surface, a second channel image corresponding to the surface non-depth defects of the battery cell shell surface, and a third channel image corresponding to the internal defects of the battery cell shell surface: the first channel image corresponding to the surface depth defects of the battery cell shell surface, the second channel image corresponding to the surface non-depth defects of the battery cell shell surface, and the third channel image corresponding to the internal defects of the battery cell shell surface are spliced to obtain a multi-channel image corresponding to the battery cell shell surface, and the pixel value distribution of the multi-channel image is as shown in FIG. Fig.11 As shown, Fig.11 2 is a schematic diagram of another embodiment of the pixel value distribution of a multi-channel image provided by the present application, wherein the horizontal axis of the histogram is the pixel value size, and the vertical axis is the number.
[0146] See also Fig.12 , Fig.12 1 is a flow chart of an embodiment of a defect detection method provided by the present application. It should be noted that if there are substantially the same results, this embodiment does not necessarily Fig.12 The process sequence shown is limited. Fig.12 As shown, this embodiment includes:
[0147] Step S121: Acquire a multi-channel image of the target object.
[0148] In this embodiment, a multi-channel image of the target object is acquired; wherein the multi-channel image is obtained by using the above-mentioned image processing method.
[0149] Step S122: performing defect detection based on the multi-channel image to obtain the defect type existing in the target object.
[0150] In this embodiment, defect detection is performed based on multi-channel images to obtain the defect types existing in the target object. Since multi-channel images can amplify the defect features of various types of defects, defect detection on the target object based on multi-channel images can improve the defect detection effect of various types of defects.
[0151] See also Fig.13 , Fig.13It is a structural schematic diagram of an embodiment of an image processing device provided by the present application. The image processing device 130 includes an acquisition module 131, a processing module 132 and a stitching module 133. The acquisition module 131 is used to acquire multiple original images of the target object; wherein the multiple original images are acquired by the image acquisition device respectively acquiring the surface of the target object under different light source conditions, and the different light source conditions include at least one of the light source type and the light source irradiation direction; the processing module 132 is used to use the multiple original images to obtain at least two channel images corresponding to different defect types; wherein at least one channel image is obtained by performing enhancement processing on at least one original image corresponding to the defect type; the stitching module 133 is used to stitch at least two channel images to obtain a multi-channel image; wherein the multi-channel image is used to perform defect detection on the target object.
[0152] The target object is a battery cell, the surface is a coating surface or a shell surface of the battery cell, and the defect type includes at least one of a surface deep defect, a surface non-deep defect, and an internal defect.
[0153] Among them, the above-mentioned defect types include surface depth defects, and the multiple original images include at least two first surface images, and the light source irradiation directions of each first surface image are different; the processing module 132 is used to use the multiple original images to obtain at least two channel images corresponding to different defect types, including: performing enhancement processing corresponding to the surface depth defects on at least two first surface images to obtain the first channel images corresponding to the surface depth defects.
[0154] Among them, the processing module 132 is used to perform enhancement processing on the corresponding surface depth defects of at least two first surface images to obtain a first channel image corresponding to the surface depth defects, including: obtaining a difference image between at least two first surface images; using the difference image as the first channel image, or performing preset processing on the difference image to obtain the first channel image, and the preset processing includes at least one of difference amplification, brightness adjustment, channel truncation and normalization processing.
[0155] Among them, the above-mentioned preset processing includes the difference amplification, brightness adjustment, channel truncation and normalization processing; the processing module 132 is used to perform preset processing on the difference image to obtain a first channel image, including: multiplying each pixel value in the difference image by a preset multiple to obtain a difference image after difference amplification, and the preset multiple is greater than 1; adding a preset gain value to each pixel value in the difference image after difference amplification to obtain a difference image after brightness adjustment; setting the pixel values in the difference image after brightness adjustment that are less than the first value to the first pixel value, and setting the pixel values in the difference image after brightness adjustment that are greater than the second value to the second pixel value to obtain a difference image after channel truncation; normalizing the difference image after channel truncation to obtain the first channel image.
[0156] Among them, the above-mentioned defect types include surface non-depth defects, and the multiple original images include a second surface image related to the surface non-depth defects; the processing module 132 is used to use the multiple original images to obtain at least two channel images corresponding to different defect types, including: enhancing the second surface image corresponding to the surface non-depth defects to obtain a second channel image corresponding to the surface non-depth defects.
[0157] Among them, the number of the above-mentioned second surface images is at least two, and the light source irradiation direction of each second surface image is different; the processing module 132 is used to enhance the second surface image corresponding to the surface non-depth defects to obtain the second channel image corresponding to the surface non-depth defects, including: weighted fusion of each second surface image to obtain the second channel image; or, the number of the above-mentioned second surface images is one, and the light source light of the second surface image is coaxial with the lens axis of the image acquisition device; the processing module 132 is used to enhance the second surface image corresponding to the surface non-depth defects to obtain the second channel image corresponding to the surface non-depth defects, including: subtracting the second surface image from the third pixel value to obtain the second channel image.
[0158] The step of weighted fusion of the second surface images is performed when the surface is the coating surface of the battery cell; and the step of subtracting the second surface image using the third pixel value is performed when the surface is the shell surface of the battery cell.
[0159] Among them, the above-mentioned defect types include internal defects, and the multiple original images include internal images; the processing module 132 is used to use the multiple original images to obtain at least two channel images corresponding to different defect types, including: using the internal image as a third channel image corresponding to the internal defect; or adjusting the pixel value distribution of the internal image to match other channel images to obtain a third channel image.
[0160] Among them, the processing module 132 is used to adjust the pixel value distribution of the internal image to match the other channel images to obtain a third channel image, including: subtracting each pixel value in the internal image from the fourth pixel value to obtain the third channel image; or, obtaining the pixel value distribution of the internal image and the pixel value distribution of each other channel image; in response to the difference between the pixel value distribution of the internal image and the other channel images meeting a preset difference condition, subtracting each pixel value in the internal image from the fourth pixel value to obtain the third channel image.
[0161] Among them, the above-mentioned step of using the internal image as the third channel image corresponding to the internal defect is performed when the surface is the coating surface of the battery cell, and the step of adjusting the pixel value distribution of the internal image to match other channel images is performed when the surface is the shell surface of the battery cell.
[0162] See also Fig.14 , Fig.14 1 is a schematic diagram of the structure of an embodiment of a defect detection device provided by the present application. The defect detection device 140 includes an acquisition module 141 and a detection module 142. The acquisition module 141 is used to acquire a multi-channel image of a target object; wherein the multi-channel image is obtained by processing using the above-mentioned image processing method; the detection module 142 is used to perform defect detection based on the multi-channel image to obtain the defect type existing in the target object.
[0163] See also Fig.15 , Fig.15 1 is a schematic diagram of the structure of an embodiment of an electronic device provided by the present application. The electronic device 150 includes a memory 151 and a processor 152 coupled to each other, and the processor 152 is used to execute program instructions stored in the memory 151 to implement the steps of any of the above-mentioned image processing methods or defect detection method embodiments. In a specific implementation scenario, the electronic device 150 may include but is not limited to: a microcomputer, a server, and in addition, the electronic device 150 may also include a mobile device such as a laptop computer and a tablet computer, which is not limited here.
[0164] Specifically, the processor 152 is used to control itself and the memory 151 to implement the steps of any of the above-mentioned image processing methods or defect detection method embodiments. The processor 152 can also be called a CPU (Central Processing Unit). The processor 152 may be an integrated circuit chip with signal processing capabilities. The processor 152 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 152 can be implemented by an integrated circuit chip.
[0165] See also Fig.16 , Fig.16It is a structural diagram of an embodiment of a computer-readable storage medium provided by the present application. The computer-readable storage medium 160 of the embodiment of the present application stores a program instruction 161, and when the program instruction 161 is executed, it implements the method provided by any embodiment of the image processing method or defect detection method of the present application and any non-conflicting combination. Among them, the program instruction 161 can form a program file and be stored in the above-mentioned computer-readable storage medium 160 in the form of a software product, so that a computer device (which can be a personal computer, a server, or a network device, etc.) executes all or part of the steps of the methods of each implementation method of the present application. The aforementioned computer-readable storage medium 160 includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, or a terminal device such as a computer, a server, a mobile phone, and a tablet.
[0166] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for detecting defects in a battery cell, characterized in that: The method comprises: Acquire multiple original images of the target object; wherein the multiple original images are acquired by an image acquisition device respectively acquiring the surface of the target object under different light source conditions, the different light source conditions include at least one of the light source type and the light source irradiation direction, the target object is a battery cell, and the surface is a coating surface or a shell surface of the battery cell; Using the multiple original images, at least two channel images corresponding to different defect types are obtained; wherein the defect type includes at least one of a surface depth defect, a surface non-depth defect, and an internal defect; splicing the at least two channel images to obtain a multi-channel image; wherein the multi-channel image is used to perform defect detection on the target object; The method of using the multiple original images to obtain at least two channel images corresponding to different defect types includes at least one of the following steps: In the case where the defect type includes a surface depth defect, performing enhancement processing corresponding to the surface depth defect on at least two first surface images to obtain first channel images corresponding to the surface depth defect, wherein the light source irradiation directions of the first surface images are different; In the case where the defect type includes a surface non-depth defect, at least two second surface images are enhanced corresponding to the surface non-depth defect to obtain second channel images corresponding to the surface non-depth defect, and the light source irradiation directions of each second surface image are different.
2. The method according to claim 1, characterized in that The step of performing enhancement processing on at least two first surface images corresponding to the surface depth defect to obtain a first channel image corresponding to the surface depth defect includes: Acquire a difference image between the at least two first surface images; The first channel image is obtained by using the difference image as the first channel image, or performing preset processing on the difference image, wherein the preset processing includes at least one of difference amplification, brightness adjustment, channel truncation and normalization processing.
3. The method according to claim 2, characterized in that The preset processing includes the difference amplification, brightness adjustment, channel truncation and normalization processing; The performing a preset process on the difference image to obtain the first channel image includes: Multiplying each pixel value in the difference image by a preset multiple to obtain a difference image after difference amplification, wherein the preset multiple is greater than 1; Adding a preset gain value to each pixel value in the difference image after difference amplification to obtain a difference image after brightness adjustment; The pixel values in the brightness-adjusted difference image that are smaller than the first value are all set as the first pixel values, and the pixel values in the brightness-adjusted difference image that are larger than the second value are all set as the second pixel values, so as to obtain the difference image after channel truncation; The difference image after channel truncation is normalized to obtain the first channel image.
4. The method according to claim 1, characterized in that: The step of performing enhancement processing on at least two second surface images corresponding to the surface non-depth defects to obtain a second channel image corresponding to the surface non-depth defects includes: Performing weighted fusion on each of the second surface images to obtain the second channel image; Alternatively, the number of the second surface images is one, and the light source light of the second surface image is coaxial with the lens axis of the image acquisition device; performing enhancement processing on the second surface image corresponding to the surface non-depth defect to obtain a second channel image corresponding to the surface non-depth defect, including: The second surface image is subtracted from the third pixel value to obtain the second channel image.
5. The method according to claim 4, characterized in that The step of weighted fusion of each second surface image is performed when the surface is the coating surface of the battery cell; the step of subtracting the second surface image using the third pixel value is performed when the surface is the shell surface of the battery cell.
6. The method according to claim 1, characterized in that The defect type includes an internal defect, and the plurality of original images include an internal image; The method of using the plurality of original images to obtain at least two channel images corresponding to different defect types includes: Using the internal image as a third channel image corresponding to the internal defect; or, The pixel value distribution of the internal image is adjusted to match the other channel images to obtain the third channel image.
7. The method according to claim 6, characterized in that The step of adjusting the pixel value distribution of the internal image to match the other channel images to obtain the third channel image includes: Subtracting each pixel value in the internal image from the fourth pixel value to obtain the third channel image; or, Obtaining pixel value distribution of the internal image and pixel value distribution of each of the other channel images; In response to the difference between the pixel value distribution of the internal image and the other channel images meeting a preset difference condition, each pixel value in the internal image is subtracted from the fourth pixel value to obtain the third channel image.
8. The method according to claim 6, characterized in that The step of using the internal image as the third channel image corresponding to the internal defect is performed when the surface is the coating surface of the battery cell, and the step of adjusting the pixel value distribution of the internal image to match the other channel images is performed when the surface is the shell surface of the battery cell.
9. A defect detection method, characterized in that: The method comprises: Acquire a multi-channel image of the target object; wherein the multi-channel image is obtained by processing the battery cell defect detection method according to any one of claims 1 to 8; Defect detection is performed based on the multi-channel image to obtain the defect type existing in the target object.
10. A battery cell defect detection device, characterized in that: The device comprises: An acquisition module, used to acquire multiple original images of a target object; wherein the multiple original images are acquired by an image acquisition device respectively acquiring the surface of the target object under different light source conditions, wherein the different light source conditions include at least one of the light source type and the light source irradiation direction, wherein the target object is a battery cell, and the surface is a coating surface or a shell surface of the battery cell; A processing module, used to obtain at least two channel images corresponding to different defect types using the multiple original images; wherein the defect type includes at least one of a surface depth defect, a surface non-depth defect, and an internal defect; A stitching module, used for stitching the at least two channel images to obtain a multi-channel image; wherein the multi-channel image is used for defect detection of the target object; The method of using the multiple original images to obtain at least two channel images corresponding to different defect types includes at least one of the following steps: In the case where the defect type includes a surface depth defect, performing enhancement processing corresponding to the surface depth defect on at least two first surface images to obtain first channel images corresponding to the surface depth defect, wherein the light source irradiation directions of the first surface images are different; In the case where the defect type includes a surface non-depth defect, at least two second surface images are enhanced corresponding to the surface non-depth defect to obtain second channel images corresponding to the surface non-depth defect, and the light source irradiation directions of each second surface image are different.
11. A defect detection device, characterized in that: The device comprises: An acquisition module, used for acquiring a multi-channel image of a target object; wherein the multi-channel image is obtained by processing the battery cell defect detection method according to any one of claims 1 to 8; The detection module is used to perform defect detection based on the multi-channel image to obtain the defect type existing in the target object.
12. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores program instructions, and the processor is used to execute the program instructions to implement the method according to any one of claims 1-9.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program instructions, and the program instructions can be executed to implement the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Real-time steel pipe defect detection method based on improved YOLOv3 model
CN111062915A
Industrial product surface defect detection method
CN118411339A
Surface inspection method for metal material, surface inspection device for metal material, and metal material
CN118591726A