A battery defect visual detection method and device based on combined lighting

Through a combined lighting method, multiple light sources are used to illuminate the battery from different angles to obtain images of the shadow area, which solves the problem of the existing technology that cannot simultaneously detect the height and area of ​​the solder joints, and realizes efficient battery solder joint detection.

CN118392867BActive Publication Date: 2025-09-09SHENZHEN GEYUAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410379067.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-29
Publication Date
2025-09-09
Estimated Expiration
2044-03-29

AI Technical Summary

Technical Problem

Existing technologies are unable to simultaneously and efficiently detect the height and area of ​​battery solder joints, resulting in low detection efficiency.

Method used

A combined lighting method is adopted to illuminate the battery from different angles using N light sources. The outline and height of the solder joint are determined by acquiring and combining shadow area images.

Benefits of technology

The efficiency of battery solder joint detection is improved, and the height and area of ​​the solder joints can be accurately determined at the same time, reducing misjudgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118392867B_ABST
    Figure CN118392867B_ABST
Patent Text Reader

Abstract

The present application provides a battery defect visual detection method based on combined lighting, which belongs to the field of image detection technology. The method includes: controlling N light sources to sequentially illuminate the battery to be inspected, where N is an integer greater than 3; obtaining N detection images arranged in the illumination order based on the timestamp of the illumination, namely the first detection image, the second detection image to the Nth detection image; obtaining the nth shadow area image based on the nth detection image, and obtaining the n+1th shadow area image based on the n+1th detection image, where n is an integer and 3≤n≤N‑1; obtaining N weld part contour images and an overlapping total image based on the nth shadow area image and the n+1th shadow area image; determining the weld contour based on the N weld contour images, and determining the weld height based on the overlapping total image; and judging whether the battery to be inspected is a defective battery based on the weld contour and the weld height. The present application provides a battery defect visual detection device based on combined lighting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image detection, and in particular to a method and device for visually detecting battery defects based on combined lighting. Background Art

[0002] During the battery production process, it is very important to detect the solder joints on the battery tabs or other places. Unqualified solder joints may lead to dangerous situations such as short circuits.

[0003] Solder joint inspection generally focuses on two important parameters: solder joint range and solder joint height. In related technologies, image inspection can only obtain plane data but not depth data. Therefore, it is impossible to simultaneously inspect both the height and area of ​​the solder joint, resulting in low inspection efficiency. Summary of the Invention

[0004] The embodiments of the present application provide a battery defect visual inspection method and device based on combined lighting to improve the above-mentioned problems.

[0005] To achieve the above objectives, this application adopts the following technical solutions:

[0006] In a first aspect, an embodiment of the present application provides a battery defect visual detection method based on combined lighting, the method comprising:

[0007] Controlling N light sources to sequentially illuminate a battery to be inspected, where N is an integer greater than 3, wherein the battery to be inspected has a weld plane, the N light sources are arranged around the battery to be inspected, and the light emission direction is not perpendicular to the weld plane, and obtaining N inspection images arranged in an illumination order based on the timestamps of the illumination, namely, a first inspection image, a second inspection image, to an Nth inspection image;

[0008] Acquire an nth shadow area image based on the nth detection image, and acquire an n+1th shadow area image based on the n+1th detection image, where n is an integer and 3≤n≤N-1;

[0009] Acquire N weld part contour images and an overlapping total image based on the nth shadow area image and the n+1th shadow area image;

[0010] Determine the weld contour based on the N weld contour images, and determine the weld height based on the overlapping total image;

[0011] Determine whether the battery to be inspected is a defective battery based on the solder joint profile and solder joint height.

[0012] Optionally, acquiring an nth shadow area image based on the nth detection image, and acquiring an n+1th shadow area image based on the n+1th detection image, where n is an integer and 1≤n≤N-1, includes:

[0013] Segmenting the nth detection image to form a plurality of nth sub-images;

[0014] Obtain the brightness parameter of each n-th sub-image and the average brightness parameter of the n-th detection image;

[0015] Compare the brightness parameter of each n-th sub-image with the average brightness parameter of the n-th detection image. If the brightness parameter of the n-th sub-image is less than the average brightness parameter of the n-th detection image, determine that the n-th sub-image is the n-th shadow sub-image.

[0016] An nth shadow area image is determined based on the plurality of nth shadow sub-images.

[0017] Optionally, determining the nth shadow area image based on the plurality of nth shadow sub-images includes:

[0018] Obtaining a brightness parameter of each n-th sub-image, and determining that all n-th sub-images with the same brightness parameter among all n-th sub-images are planar sub-images;

[0019] Obtaining the brightness parameter of each n-th shadow sub-image and the brightness parameter of the n-th sub-image adjacent to the n-th shadow sub-image;

[0020] If the brightness parameter of the nth sub-image adjacent to the nth shadow sub-image is the same as the brightness parameter of the plane sub-image, then the nth shadow sub-image is determined to be the nth edge sub-image;

[0021] An nth shadow area image is determined based on the nth edge sub-image.

[0022] Optionally, determining the nth shadow area image based on the edge sub-image includes:

[0023] Taking each n-th edge sub-image as a node, adjacent n-th edge sub-images form connection paths, which together constitute a connected graph;

[0024] If the number of connected graphs is one, then determine in the connected graph that the Euler circuit that takes any nth edge sub-image as a starting point and traverses all nth edge sub-images is the outline of the nth shadow area;

[0025] An nth shadow area image is determined based on the nth shadow area outline.

[0026] Optionally, determining the nth shadow area image based on the edge sub-image further includes:

[0027] If the number of connected graphs is greater than one, determine in each connected graph an Euler circuit that takes any n-th edge sub-image as a starting point and traverses all n-th edge sub-images;

[0028] Determine the nesting of multiple Euler loops, and determine the outermost Euler loop of the multi-layer nesting as the outline of the nth shadow area.

[0029] Optionally, acquiring N weld portion contour images and an overlapping total image based on the nth shadow area image and the (n+1)th shadow area image includes:

[0030] Acquire an overlapping shadow image based on the nth shadow area image and the (n+1)th shadow area image, wherein each overlapping shadow image is composed of a plurality of overlapping sub-images;

[0031] The overlapping sub-images belonging to the edge of the weld portion contour among the multiple overlapping sub-images are determined, and the multiple overlapping sub-images constitute a weld portion contour image.

[0032] Optionally, determining a weld contour based on the N weld contour images and determining a weld height based on the overlapping total image includes:

[0033] N weld part contour images are stitched together to form the weld point contour.

[0034] Optionally, acquiring N weld portion contour images and an overlapping total image based on the nth shadow area image and the (n+1)th shadow area image includes:

[0035] Based on the first detection image and the second to Nth detection images, obtaining a first shadow area image and a second to Nth shadow area image;

[0036] A total overlapping image is acquired based on the first shadow area image and the second to Nth shadow area image images.

[0037] Optionally, determining a weld contour based on the N weld contour images and determining a weld height based on the overlapping total image includes:

[0038] Obtain the angle θ between the light emission directions of N light sources and the welding plane;

[0039] Get the longest straight line segment l0 in the overlapping total image;

[0040] The height of the solder joint is determined based on the angle θ between the longest straight line segment l0 and the light emission directions of N light sources and the soldering plane, satisfying:

[0041]

[0042] Where h is the height of the solder joint.

[0043] In a second aspect, an embodiment of the present application provides a battery defect visual inspection device based on combined lighting, the device being configured as follows:

[0044] Controlling N light sources to sequentially illuminate a battery to be inspected, where N is an integer greater than 3, wherein the battery to be inspected has a weld plane, the N light sources are arranged around the battery to be inspected, and the light emission direction is not perpendicular to the weld plane, and obtaining N inspection images arranged in an illumination order based on the timestamps of the illumination, namely, a first inspection image, a second inspection image, to an Nth inspection image;

[0045] Acquire an nth shadow area image based on the nth detection image, and acquire an n+1th shadow area image based on the n+1th detection image, where n is an integer and 3≤n≤N-1;

[0046] Acquire N weld part contour images and an overlapping total image based on the nth shadow area image and the n+1th shadow area image;

[0047] Determine the weld contour based on the N weld contour images, and determine the weld height based on the overlapping total image;

[0048] Determine whether the battery to be inspected is a defective battery based on the solder joint profile and solder joint height.

[0049] Optionally, the device is configured to:

[0050] Segmenting the nth detection image to form a plurality of nth sub-images;

[0051] Obtain the brightness parameter of each n-th sub-image and the average brightness parameter of the n-th detection image;

[0052] Compare the brightness parameter of each n-th sub-image with the average brightness parameter of the n-th detection image. If the brightness parameter of the n-th sub-image is less than the average brightness parameter of the n-th detection image, determine that the n-th sub-image is the n-th shadow sub-image.

[0053] An nth shadow area image is determined based on the plurality of nth shadow sub-images.

[0054] Optionally, the device is configured to:

[0055] Obtaining a brightness parameter of each n-th sub-image, and determining that all n-th sub-images with the same brightness parameter among all n-th sub-images are planar sub-images;

[0056] Obtaining the brightness parameter of each n-th shadow sub-image and the brightness parameter of the n-th sub-image adjacent to the n-th shadow sub-image;

[0057] If the brightness parameter of the nth sub-image adjacent to the nth shadow sub-image is the same as the brightness parameter of the plane sub-image, then the nth shadow sub-image is determined to be the nth edge sub-image;

[0058] An nth shadow area image is determined based on the nth edge sub-image.

[0059] Optionally, the device is configured to:

[0060] Taking each n-th edge sub-image as a node, adjacent n-th edge sub-images form connection paths, which together constitute a connected graph;

[0061] If the number of connected graphs is one, then determine in the connected graph that the Euler circuit that takes any nth edge sub-image as a starting point and traverses all nth edge sub-images is the outline of the nth shadow area;

[0062] An nth shadow area image is determined based on the nth shadow area outline.

[0063] Optionally, the device is configured to:

[0064] If the number of connected graphs is greater than one, determine in each connected graph an Euler circuit that takes any n-th edge sub-image as a starting point and traverses all n-th edge sub-images;

[0065] Determine the nesting of multiple Euler loops, and determine the outermost Euler loop of the multi-layer nesting as the outline of the nth shadow area.

[0066] Optionally, the device is configured to:

[0067] Acquire an overlapping shadow image based on the nth shadow area image and the (n+1)th shadow area image, wherein each overlapping shadow image is composed of a plurality of overlapping sub-images;

[0068] The overlapping sub-images belonging to the edge of the weld portion contour among the multiple overlapping sub-images are determined, and the multiple overlapping sub-images constitute a weld portion contour image.

[0069] Optionally, the device is configured to:

[0070] N weld part contour images are stitched together to form the weld point contour.

[0071] Optionally, the device is configured to:

[0072] Based on the first detection image and the second to Nth detection images, obtaining a first shadow area image and a second to Nth shadow area image;

[0073] A total overlapping image is acquired based on the first shadow area image and the second to Nth shadow area image images.

[0074] Optionally, the device is configured to:

[0075] Obtain the angle θ between the light emission directions of N light sources and the welding plane;

[0076] Get the longest straight line segment l0 in the overlapping total image;

[0077] The height of the solder joint is determined based on the angle θ between the longest straight line segment l0 and the light emission directions of N light sources and the soldering plane, satisfying:

[0078]

[0079] Where h is the height of the solder joint.

[0080] In summary, the above method and device have the following technical effects:

[0081] The present application proposes a battery defect visual detection method based on combined lighting. First, N light sources are controlled to sequentially illuminate the battery to be inspected. N detection images arranged in the illumination order are obtained based on the illumination timestamp. Then, the nth shadow area image is obtained based on the nth detection image, and the n+1th shadow area image is obtained based on the n+1th detection image. Then, N welding part contour images and an overlapping total image are obtained based on the nth shadow area image and the n+1th shadow area image. Then, the weld contour is determined based on the N welding contour images, and the weld height is determined based on the overlapping total image. Finally, whether the battery to be inspected is a defective battery is determined based on the weld contour and the weld height. The present application proposes a battery defect visual detection method based on combined lighting. The shadows formed when N light sources illuminate the battery to be inspected can be used to obtain the weld contour by combining the shadows, and the weld height can be determined by the overlapping total image of all shadows. The detection method is highly efficient. BRIEF DESCRIPTION OF THE DRAWINGS

[0082] Figure 1 This is a flow chart of a battery defect visual inspection method based on combined lighting proposed in this application. DETAILED DESCRIPTION

[0083] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0084] This application proposes a battery defect visual detection method based on combined lighting, please refer to Figure 1 , the method comprises the following steps:

[0085] S101: Control N light sources to sequentially illuminate the battery to be inspected, where N is an integer greater than 3, wherein the battery to be inspected has a welding plane, the N light sources are arranged around the battery to be inspected, and the light emission direction is not perpendicular to the welding plane, and N detection images arranged in the illumination order are obtained based on the illumination timestamp, namely the first detection image, the second detection image to the Nth detection image.

[0086] In this application, the location of the protruding solder joints on the battery is inspected using an image inspection method. Solder joint inspection generally focuses on two key parameters: the solder joint range and the solder joint height. During the welding process, the amount of solder added for each weld varies. If the solder joint height is too high, the weld area will be too small, resulting in poor structural strength. Conversely, if the solder joint area is too large, the solder joint height will be insufficient. Therefore, in this embodiment, a visual inspection method is used to simultaneously inspect the solder joint height and area.

[0087] Specifically, in this embodiment, N light sources are used to sequentially illuminate the battery to be inspected, where N is an integer greater than 3. The battery to be inspected has a welding plane, that is, the plane where the welding point is located. The N light sources are arranged around the battery to be inspected, and the light emission direction is not perpendicular to the welding plane. It can be understood that the provision of at least three light sources can ensure that all angles around the welding point can be illuminated, and a shadow is formed at the edge of the welding point opposite to the light source. By sequentially illuminating the battery to be inspected with multiple light sources, an image of the battery can be obtained from a fixed angle, for example, an image of the battery can be obtained from an angle perpendicular to the welding plane. Of course, in other embodiments, a single light source can also be used. In this case, the battery to be inspected can be rotated to obtain images at different time points during the rotation process. In this embodiment, the battery to be inspected is sequentially illuminated from the 1st to Nth light sources, so that the first detection image, the second detection image to the Nth detection image are obtained in sequence.

[0088] S102: Acquire an nth shadow area image based on the nth detection image, and acquire an n+1th shadow area image based on the n+1th detection image, where n is an integer and 3≤n≤N-1.

[0089] It is understandable that in this embodiment, due to the different angles of illumination of the light source, the shadows in the detection image are necessarily different. It is understandable that since the weld must protrude from the welding plane, when a light beam that is not perpendicular to the welding surface illuminates the weld, the light reflected from the area with the weld on the welding plane is necessarily changed. Therefore, a shadow area is necessarily present on the image of the entire welding surface. The shadow area at this time includes the area that is not reflected from the area without the weld on the welding plane, that is, the area of ​​the weld itself, and the shadow area formed on the welding plane due to the height difference between the weld and the welding plane blocking the light. Based on this, it is understandable that the nth detection image and the n+1th detection image are two adjacent images, that is, the two detection images with the smallest amount of shadow change as different light sources illuminate in sequence. n can be any integer in 3≤n≤N-1. Different values ​​of n will result in different nth detection images.

[0090] Regarding how to determine the shadow area, as an implementation, step S102 may include the following steps:

[0091] S1021: Divide the nth detection image to form multiple nth sub-images.

[0092] It can be understood that for the nth detection image, segmenting it is a basic step in image processing. Specifically, based on the performance of different processing equipment, the nth sub-image should be at least a unit pixel in a single nth detection image. Of course, it can also be 4, 9, 16, or 25 pixels, which is not limited here.

[0093] S1022: Obtain the brightness parameter of each n-th sub-image and the average brightness parameter of the n-th detection image.

[0094] Regarding how to determine the shadow area, in this embodiment, when the light beam is irradiated at locations other than the weld point, the light reflected from the weld plane should be uniform, meaning that the brightness of the sub-images comprising the reflected image should also be uniform. Generally speaking, when the light beam is irradiated at locations other than the weld point, its reflection efficiency is higher, resulting in higher brightness in these areas. Of course, in other embodiments, the reflection can be reduced by changing the irradiation angle.

[0095] S1023: Compare the brightness parameter of each nth sub-image with the average brightness parameter of the nth detection image. If the brightness parameter of the nth sub-image is less than the average brightness parameter of the nth detection image, determine that the nth sub-image is the nth shadow sub-image.

[0096] It can be understood that since the reflection efficiency of the light beam is higher when it is irradiated on positions other than welding points, the brightness of these places is also higher. Therefore, the nth sub-image whose brightness parameter is less than the average brightness parameter of the nth detection image can be determined as the nth shadow sub-image.

[0097] S1024: Determine an nth shadow area image based on multiple nth shadow sub-images.

[0098] It can be understood that when the nth shadow sub-image is determined, the nth shadow area image, that is, the shadow image in the nth detection image, can be obtained by combining multiple nth shadow sub-images.

[0099] In order to determine a clear boundary between the shadow portion and the non-shadow portion, in some embodiments, the following method may be used:

[0100] First, the brightness parameters of each nth sub-image are obtained, and all nth sub-images with the same brightness parameters are determined to be plane sub-images. It is understood that all nth sub-images with the same brightness parameters necessarily include sub-images formed at all non-weld locations. Then, the brightness parameters of each nth shadow sub-image and the brightness parameters of the nth sub-images adjacent to the nth shadow sub-image are obtained. It is understood that if the brightness parameters of the nth sub-image adjacent to the nth shadow sub-image are the same as the brightness parameters of the plane sub-image, the nth shadow sub-image is determined to be the nth edge sub-image, that is, the image at the boundary between the shadow area and the non-shadow area. Finally, the nth shadow area image is determined based on the nth edge sub-image.

[0101] In some other embodiments, some areas of the solder joint may also reflect higher brightness, causing misjudgment. Therefore, in the process of determining the nth shadow area image based on multiple nth shadow sub-images, each nth edge sub-image can be used as a node, and adjacent nth edge sub-images can be connected by paths, forming a connected graph. It is understood that if the number of connected graphs is one, it proves that there is only one edge region, that is, there are no overly bright sub-images or abnormally reflected light in the solder joint area. In this way, the Euler circuit in the connected graph, starting from any nth edge sub-image and traversing all nth edge sub-images, can be determined to be the nth shadow area outline.

[0102] Of course, if there are more than one connected graph, then in each connected graph, an Euler circuit is determined, starting from any n-th edge sub-image and traversing all n-th edge sub-images. In this way, multiple Euler circuits must be nested together. Therefore, the outermost nested Euler circuit can be selected as the n-th shadow area outline. Finally, the n-th shadow area image is determined based on the n-th shadow area outline.

[0103] S103: Acquire N welding part contour images and an overlapping total image based on the nth shadow area image and the (n+1)th shadow area image.

[0104] It can be understood that after determining the nth shadow area image and the n+1th shadow area image, among all the shadow area images, each pair of the nth shadow area image and the n+1th shadow area image can determine an image of the outline of a portion of the welding part.

[0105] Specifically, step S103 may include the following steps:

[0106] S1031: Acquire an overlapping shadow image based on the nth shadow area image and the (n+1)th shadow area image, wherein each overlapping shadow image is composed of a plurality of overlapping sub-images.

[0107] As can be understood, an overlapping shadow image is an image formed by the overlap of two shadow area images. The steps for obtaining shadow images have been explained in the above steps and will not be repeated here. In this embodiment, since the variable when forming two shadows is the angle at which the light illuminates the weld, the edge of a shadow image near the light source will inevitably overlap with the edge of the weld area. Therefore, multiple pairs of the nth shadow area image and the (n+1)th shadow area image are generated to extract these edges, thus forming the weld contour image.

[0108] S1032: Determine overlapping sub-images belonging to the edge of the weld portion contour among the multiple overlapping sub-images, where the multiple overlapping sub-images constitute a weld portion contour image.

[0109] It can be understood that by determining the overlapping sub-images belonging to the contour edge of the welding part among the multiple overlapping sub-images, the contour image of the welding part can be obtained for the final combination.

[0110] For the overlapping total image, that is, the overlap of all shadow images, the overlapping total image must include the shadow formed by the entire solder joint on the soldering plane. The shadow is directly related to the height of the solder joint.

[0111] Specifically, based on the first detection image and the second detection image to the Nth detection image, the first shadow area image and the second shadow area map to the Nth shadow area map image can be obtained, and then based on the first shadow area image and the second shadow area map to the Nth shadow area map image, all images are overlapped to obtain a total overlapping image.

[0112] S104: Determine a weld contour based on the N weld contour images, and determine a weld height based on the overlapping total image.

[0113] As can be understood, in the above steps, N weld contour images are spliced ​​together to form the weld contour. To determine the weld height, since the shadow is affected by the weld height, geometric relationships are used to directly obtain the angle θ between the light emission directions of the N light sources and the weld plane. The longest straight line segment l0 in the overlapping total image is then obtained. As can be understood, the longest straight line segment l0 necessarily corresponds to the highest weld height. Finally, the weld height is determined based on the longest straight line segment l0 and the angle θ between the light emission directions of the N light sources and the weld plane, satisfying:

[0114]

[0115] Where h is the height of the solder joint.

[0116] S105: Determine whether the battery to be inspected is a defective battery based on the solder joint profile and solder joint height.

[0117] It is understandable that after obtaining the outline of the solder joint area and the solder joint height, whether the solder joint is qualified can be determined based on relevant technical indicators, which are not limited here.

[0118] The present application proposes a battery defect visual detection method based on combined lighting. First, N light sources are controlled to sequentially illuminate the battery to be inspected. N detection images arranged in the illumination order are obtained based on the illumination timestamp. Then, the nth shadow area image is obtained based on the nth detection image, and the n+1th shadow area image is obtained based on the n+1th detection image. Then, N welding part contour images and an overlapping total image are obtained based on the nth shadow area image and the n+1th shadow area image. Then, the weld contour is determined based on the N welding contour images, and the weld height is determined based on the overlapping total image. Finally, whether the battery to be inspected is a defective battery is determined based on the weld contour and the weld height. The present application proposes a battery defect visual detection method based on combined lighting. The shadows formed when N light sources illuminate the battery to be inspected can be used to obtain the weld contour by combining the shadows, and the weld height can be determined by the overlapping total image of all shadows. The detection method is highly efficient.

[0119] Based on the same inventive concept, an embodiment of the present application further proposes a battery defect visual inspection device based on combined lighting, the device being configured as follows:

[0120] Controlling N light sources to sequentially illuminate a battery to be inspected, where N is an integer greater than 3, wherein the battery to be inspected has a weld plane, the N light sources are arranged around the battery to be inspected, and the light emission direction is not perpendicular to the weld plane, and obtaining N inspection images arranged in an illumination order based on the timestamps of the illumination, namely, a first inspection image, a second inspection image, to an Nth inspection image;

[0121] Acquire an nth shadow area image based on the nth detection image, and acquire an n+1th shadow area image based on the n+1th detection image, where n is an integer and 3≤n≤N-1;

[0122] Acquire N weld part contour images and an overlapping total image based on the nth shadow area image and the n+1th shadow area image;

[0123] Determine the weld contour based on the N weld contour images, and determine the weld height based on the overlapping total image;

[0124] Determine whether the battery to be inspected is a defective battery based on the solder joint profile and solder joint height.

[0125] Optionally, the device is configured to:

[0126] Segmenting the nth detection image to form a plurality of nth sub-images;

[0127] Obtain the brightness parameter of each n-th sub-image and the average brightness parameter of the n-th detection image;

[0128] Compare the brightness parameter of each n-th sub-image with the average brightness parameter of the n-th detection image. If the brightness parameter of the n-th sub-image is less than the average brightness parameter of the n-th detection image, determine that the n-th sub-image is the n-th shadow sub-image.

[0129] An nth shadow area image is determined based on the plurality of nth shadow sub-images.

[0130] Optionally, the device is configured to:

[0131] Obtaining a brightness parameter of each n-th sub-image, and determining that all n-th sub-images with the same brightness parameter among all n-th sub-images are planar sub-images;

[0132] Obtaining the brightness parameter of each n-th shadow sub-image and the brightness parameter of the n-th sub-image adjacent to the n-th shadow sub-image;

[0133] If the brightness parameter of the nth sub-image adjacent to the nth shadow sub-image is the same as the brightness parameter of the plane sub-image, then the nth shadow sub-image is determined to be the nth edge sub-image;

[0134] An nth shadow area image is determined based on the nth edge sub-image.

[0135] Optionally, the device is configured to:

[0136] Taking each n-th edge sub-image as a node, adjacent n-th edge sub-images form connection paths, which together constitute a connected graph;

[0137] If the number of connected graphs is one, then determine in the connected graph that the Euler circuit that takes any nth edge sub-image as a starting point and traverses all nth edge sub-images is the outline of the nth shadow area;

[0138] An nth shadow area image is determined based on the nth shadow area outline.

[0139] Optionally, the device is configured to:

[0140] If the number of connected graphs is greater than one, determine in each connected graph an Euler circuit that takes any n-th edge sub-image as a starting point and traverses all n-th edge sub-images;

[0141] Determine the nesting of multiple Euler loops, and determine the outermost Euler loop of the multi-layer nesting as the outline of the nth shadow area.

[0142] Optionally, the device is configured to:

[0143] Acquire an overlapping shadow image based on the nth shadow area image and the (n+1)th shadow area image, wherein each overlapping shadow image is composed of a plurality of overlapping sub-images;

[0144] The overlapping sub-images belonging to the edge of the weld portion contour among the multiple overlapping sub-images are determined, and the multiple overlapping sub-images constitute a weld portion contour image.

[0145] Optionally, the device is configured to:

[0146] N weld part contour images are stitched together to form the weld point contour.

[0147] Optionally, the device is configured to:

[0148] Based on the first detection image and the second to Nth detection images, obtaining a first shadow area image and a second to Nth shadow area image;

[0149] A total overlapping image is acquired based on the first shadow area image and the second to Nth shadow area image images.

[0150] Optionally, the device is configured to:

[0151] Obtain the angle θ between the light emission directions of N light sources and the welding plane;

[0152] Get the longest straight line segment l0 in the overlapping total image;

[0153] The height of the solder joint is determined based on the angle θ between the longest straight line segment l0 and the light emission directions of N light sources and the soldering plane, satisfying:

[0154]

[0155] Where h is the height of the solder joint.

[0156] The present application proposes a battery defect visual inspection device based on combined lighting. First, N light sources are controlled to sequentially illuminate the battery to be inspected. N inspection images arranged in the order of illumination are obtained based on the timestamp of illumination. Then, the nth shadow area image is obtained based on the nth inspection image, and the n+1th shadow area image is obtained based on the n+1th inspection image. Then, N welding part contour images and an overlapping total image are obtained based on the nth shadow area image and the n+1th shadow area image. Then, the weld contour is determined based on the N welding contour images, and the weld height is determined based on the overlapping total image. Finally, whether the battery to be inspected is a defective battery is determined based on the weld contour and the weld height. The present application proposes a battery defect visual inspection device based on combined lighting. The shadows formed when N light sources illuminate the battery to be inspected can be used to obtain the weld contour by combining the shadows, and the weld height can be determined by the overlapping total image of all shadows. The inspection method is highly efficient.

[0157] Based on the same inventive concept, an embodiment of the present application further provides an electronic device, the electronic device comprising:

[0158] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the battery defect visual detection method based on combined lighting according to an embodiment of the present application.

[0159] In addition, to achieve the above-mentioned purpose, an embodiment of the present application further proposes a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the battery defect visual detection method based on combined lighting of an embodiment of the present application.

[0160] The following is a detailed introduction to the various components of electronic equipment:

[0161] The term "processor" is the control center of an electronic device and may be a single processor or a collective term for multiple processing elements. For example, the processor may be one or more central processing units (CPUs), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention, such as one or more digital signal processors (DSPs) or one or more field programmable gate arrays (FPGAs).

[0162] Optionally, the processor can perform various functions of the electronic device by running or executing a software program stored in the memory, and calling data stored in the memory.

[0163] The memory is used to store the software program for executing the solution of the present invention, and the execution is controlled by the processor. The specific implementation method can refer to the above method embodiment and will not be repeated here.

[0164] Alternatively, the memory may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, an optical disc storage (including a compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may be integrated with the processor or exist independently and be coupled to the processor through an interface circuit of the electronic device, and this is not specifically limited in the embodiments of the present invention.

[0165] A transceiver is used to communicate with network devices or terminal devices.

[0166] Optionally, the transceiver may include a receiver and a transmitter, wherein the receiver is used to implement a receiving function, and the transmitter is used to implement a sending function.

[0167] Optionally, the transceiver may be integrated with the processor, or may exist independently and be coupled to the processor via an interface circuit of the router, which is not specifically limited in the embodiment of the present invention.

[0168] In addition, the technical effects of the electronic device can refer to the technical effects of the data transmission method in the above method embodiment, and will not be repeated here.

[0169] It should be understood that the processor in the embodiments of the present invention may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0170] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0171] The above embodiments can be implemented in whole or in part through software, hardware (such as circuits), firmware, or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. A computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer program are loaded or executed on a computer, the process or function according to the embodiments of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired method (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains a collection of one or more available media. The available media can be magnetic media (such as floppy disks, hard disks, tapes), optical media (such as DVDs), or semiconductor media. The semiconductor media can be a solid-state drive.

[0172] It should be understood that the term "and / or" as used herein simply describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A alone, A and B together, or B alone. A and B can be singular or plural. Furthermore, the character " / " as used herein generally indicates an "or" relationship between the associated objects, but it may also indicate an "and / or" relationship. For specific understanding, please refer to the context.

[0173] In this disclosure, "at least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, "at least one of a, b, or c" can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or plural.

[0174] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0175] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.

Claims

1. A battery defect visual inspection method based on combined lighting, characterized in that: The method comprises: Controlling N light sources to sequentially illuminate a battery to be inspected, where N is an integer greater than 3, wherein the battery to be inspected has a weld plane, the N light sources are arranged around the battery to be inspected, and the light emission directions are not perpendicular to the weld plane, and obtaining N inspection images arranged in an illumination order based on the timestamps of the illuminations, namely, a first inspection image, a second inspection image, to an Nth inspection image; Acquire an nth shadow area image based on the nth detection image, and acquire an n+1th shadow area image based on the n+1th detection image, where n is an integer and 3≤n≤N-1; dividing the nth detection image to form a plurality of nth sub-images; Obtaining a brightness parameter of each of the n-th sub-images and an average brightness parameter of the n-th detection image; comparing the brightness parameter of each of the nth sub-images with the average brightness parameter of the nth detection image, and determining that the nth sub-image is an nth shadow sub-image if the brightness parameter of the nth sub-image is less than the average brightness parameter of the nth detection image; determining the nth shadow area image based on a plurality of the nth shadow sub-images; Obtaining a brightness parameter of each of the n-th sub-images, and determining that all the n-th sub-images having the same brightness parameter among all the n-th sub-images are planar sub-images; Acquire a brightness parameter of each of the n-th shadow sub-images and a brightness parameter of the n-th sub-images adjacent to the n-th shadow sub-image; If the brightness parameter of the nth sub-image adjacent to the nth shadow sub-image is the same as the brightness parameter of the plane sub-image, determining that the nth shadow sub-image is the nth edge sub-image; determining the nth shadow area image based on the nth edge sub-image; Taking each of the n-th edge sub-images as a node, connecting paths are formed between adjacent n-th edge sub-images to form a connected graph; If the number of the connected graph is one, determining in the connected graph that an Euler circuit starting from any one of the nth edge sub-images and traversing all the nth edge sub-images is the nth shadow area contour; determining the nth shadow area image based on the nth shadow area outline; Acquire N weld portion contour images and an overlapping total image based on the nth shadow area image and the (n+1)th shadow area image; Determine a weld contour based on the N weld portion contour images, and determine a weld height based on the overlapping total image; It is determined whether the battery to be inspected is a defective battery based on the solder joint profile and the solder joint height.

2. The battery defect visual inspection method based on combined lighting according to claim 1, characterized in that: Determining the nth shadow area image based on the nth edge sub-image further includes: If the number of the connected graphs is greater than one, determining in each of the connected graphs the Euler circuit that takes any one of the n-th edge sub-images as a starting point and traverses all the n-th edge sub-images; The nesting conditions of the multiple Euler loops are determined, and the outermost Euler loop of the multi-layer nesting is determined to be the outline of the n-th shadow area.

3. The battery defect visual inspection method based on combined lighting according to claim 1, characterized in that: Acquiring N weld portion contour images and an overlapping total image based on the nth shadow area image and the (n+1)th shadow area image, including: Acquire an overlapping shadow image based on the nth shadow area image and the (n+1)th shadow area image, wherein each of the overlapping shadow images is composed of a plurality of overlapping sub-images; The overlapping sub-images belonging to the edge of the weld portion contour among the plurality of overlapping sub-images are determined, and the plurality of overlapping sub-images constitute a weld portion contour image.

4. The battery defect visual inspection method based on combined lighting according to claim 3, characterized in that: Determining a weld contour based on the N weld portion contour images, and determining a weld height based on the overlapping total image, comprising: The N welding part contour images are spliced ​​together to form the welding point contour.

5. The battery defect visual inspection method based on combined lighting according to claim 1, characterized in that: Acquiring N weld portion contour images and an overlapping total image based on the nth shadow area image and the (n+1)th shadow area image, including: Acquire a first shadow area image and a second shadow area image to an Nth shadow area image based on the first detection image and the second detection image to the Nth detection image; A total overlapping image is acquired based on the first shadow area image, the second shadow area image to the Nth shadow area image.

6. A battery defect visual inspection device based on combined lighting, characterized in that: The device is configured to: Controlling N light sources to sequentially illuminate a battery to be inspected, where N is an integer greater than 3, wherein the battery to be inspected has a weld plane, the N light sources are arranged around the battery to be inspected, and the light emission directions are not perpendicular to the weld plane, and obtaining N inspection images arranged in an illumination order based on the timestamps of the illuminations, namely, a first inspection image, a second inspection image, to an Nth inspection image; Acquire an nth shadow area image based on the nth detection image, and acquire an n+1th shadow area image based on the n+1th detection image, where n is an integer and 3≤n≤N-1; dividing the nth detection image to form a plurality of nth sub-images; Obtaining a brightness parameter of each of the n-th sub-images and an average brightness parameter of the n-th detection image; comparing the brightness parameter of each of the nth sub-images with the average brightness parameter of the nth detection image, and determining that the nth sub-image is an nth shadow sub-image if the brightness parameter of the nth sub-image is less than the average brightness parameter of the nth detection image; determining the nth shadow area image based on a plurality of the nth shadow sub-images; Obtaining a brightness parameter of each of the n-th sub-images, and determining that all the n-th sub-images having the same brightness parameter among all the n-th sub-images are planar sub-images; Acquire a brightness parameter of each of the n-th shadow sub-images and a brightness parameter of the n-th sub-images adjacent to the n-th shadow sub-image; If the brightness parameter of the nth sub-image adjacent to the nth shadow sub-image is the same as the brightness parameter of the plane sub-image, determining that the nth shadow sub-image is the nth edge sub-image; determining the nth shadow area image based on the nth edge sub-image; Taking each of the n-th edge sub-images as a node, connecting paths are formed between adjacent n-th edge sub-images to form a connected graph; If the number of the connected graph is one, determining in the connected graph that an Euler circuit starting from any one of the nth edge sub-images and traversing all the nth edge sub-images is the nth shadow area contour; determining the nth shadow area image based on the nth shadow area outline; Acquire N weld portion contour images and an overlapping total image based on the nth shadow area image and the (n+1)th shadow area image; Determine a weld contour based on the N weld portion contour images, and determine a weld height based on the overlapping total image; It is determined whether the battery to be inspected is a defective battery based on the solder joint profile and the solder joint height.

Citation Information

Patent Citations

  • Method and system for determining rock height through shadow at different angles

    CN116379930A

  • Paste-inspecting apparatus and method

    JP2000275186A