A method, apparatus, device, and readable storage medium for inspecting battery weld seams.
By performing region of interest extraction, roundness opening and closing operations, and feature filtering on weld seam images, the problem of over-detection caused by dirt and oxidation yellowing in weld seam image detection is solved, thus improving the accuracy and reliability of weld seam detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-23
- Publication Date
- 2026-03-13
AI Technical Summary
Existing technologies for weld image detection suffer from over-detection, especially when the weld is dirty or oxidized and yellowed, leading to decreased detection accuracy and an inability to effectively avoid interference from welding defects.
By extracting the region of interest from the image to be inspected, performing roundness opening and closing operations and feature filtering, the precise outer contour of the weld and the internal unwelded area are obtained. By using B-channel images, HSL images and gamma transformation processing, the interference of weld dirt and oxidation yellowing is eliminated, thereby improving the detection accuracy.
It effectively eliminates the interference of weld dirt and oxidation yellowing on the inspection, improves the accuracy of weld inspection, avoids missed detection and false detection, and ensures the reliability of welding quality.
Smart Images

Figure CN115829923B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image detection, and in particular to a method, apparatus, device, and readable storage medium for detecting battery weld seams. Background Technology
[0002] In battery welding, automated welding robots are gradually replacing manual welding, significantly improving production efficiency. However, due to the complexity and randomness of the welding process, automated welding lacks the human intelligence to control and stop welding defects. Incomplete welds and other defects are often unavoidable, affecting not only the battery's appearance and performance but, more importantly, posing risks of leakage and explosion. Therefore, real-time defect monitoring throughout the entire battery manufacturing chain is crucial for new energy applications. Currently, large-scale quality control still relies on repeated manual inspection of welding defects, which suffers from high subjectivity, limited accuracy, and low efficiency.
[0003] In existing technical solutions, when the image quality is poor due to weld contamination or oxidation, the weld quality itself is not affected, but the image quality still significantly interferes with image detection, often resulting in over-detection. Therefore, how to avoid the interference of these problems in weld defect detection is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a battery weld seam detection method, apparatus, equipment and readable storage medium, which solves the problem of overkill in weld seam image detection in the prior art.
[0005] To solve the above-mentioned technical problems, the present invention provides a method for inspecting battery welds, comprising:
[0006] Extract the region of interest from the acquired image to be detected, wherein the region of interest is the inscribed rectangle of the largest connected component obtained after binarizing the B channel image of the image to be detected;
[0007] Perform a roundness opening and closing operation on the region of interest, and filter the roundness features of the result of the opening and closing operation to obtain the rough outline region of the weld.
[0008] The precise outer contour region and the inner unwelded region of the weld are obtained based on the rough contour region of the weld.
[0009] The final weld area is obtained based on the precise outer contour area and the internal unwelded area;
[0010] Whether the weld is completely welded is determined based on the final weld area.
[0011] Optionally, performing a roundness opening / closing operation on the region of interest, and then filtering the roundness features of the result of the opening / closing operation to obtain the rough contour region of the weld, includes:
[0012] Perform the roundness opening and closing operation on the region of interest, and filter the roundness feature of the result of the opening and closing operation to obtain the first region;
[0013] Calculate the area of the first region and determine whether the area of the first region is less than the area threshold.
[0014] If so, then the first region shall be regarded as the rough outline region of the weld.
[0015] If not, tighten the parameters of the roundness opening / closing operation, perform the roundness opening / closing operation on the region of interest, and perform roundness feature filtering on the result of the opening / closing operation to obtain the first region.
[0016] Optionally, before obtaining the final weld area based on the precise outer contour area and the inner unwelded area, the method further includes:
[0017] The area where the dirt in the image intersects with the weld is selected as the second area;
[0018] Accordingly, obtaining the final weld area based on the precise outer contour area and the internal unwelded area, and calculating whether the weld is completely welded, includes:
[0019] The final weld area is obtained based on the precise outer contour area, the second area, and the internal unwelded area.
[0020] Optionally, the area where the dirt in the image intersects with the weld, as the second area, includes:
[0021] The image of the precise outer contour region is converted to obtain an HSL image;
[0022] Threshold segmentation is performed on the S-channel and H-channel images of the HSL image to obtain the first result region and the second result region, respectively.
[0023] The opening and closing operations are performed on the first and second result regions respectively to obtain the third and fourth regions;
[0024] The second region is obtained by performing a difference operation on the third region and the fourth region.
[0025] Optionally, obtaining the final weld area based on the precise outer contour area and the inner unwelded area includes:
[0026] Perform a difference operation on the precise outer contour region and the inner unwelded region to obtain the weld contour region;
[0027] The boundary is obtained from the B-channel image of the weld contour region image, and the opening and closing operation and filling operation are performed on the boundary to obtain the image of the first region to be detected.
[0028] The image of the first area to be detected is subjected to BLOB operation to obtain the final weld area.
[0029] Optionally, obtaining the precise outer contour region of the weld based on the rough contour region of the weld includes:
[0030] Gamma transformation processing is performed on the image of the coarse outline region of the weld to obtain the second weld region image;
[0031] The second weld area image is subjected to threshold segmentation to obtain the third result area;
[0032] The opening and closing operation is performed on the third result region to obtain the precise outer contour region.
[0033] Optionally, obtaining the internal unwelded area of the weld based on the rough contour area of the weld includes:
[0034] The image of the rough outline area of the weld is subjected to gamma transformation processing, and the first internal unwelded area is obtained by matching it with the inscribed circle area template.
[0035] The precise circular outline region of the internal unsoldered area is calculated using the first internal unsoldered area.
[0036] The precise circular contour region is subjected to expansion etching, and the result of the expansion etching is segmented by thresholding to obtain the internal unwelded area.
[0037] The present invention also provides a battery weld inspection device, comprising:
[0038] The first extraction module is used to extract the region of interest from the acquired image to be detected, wherein the region of interest is the inscribed rectangle of the largest connected component obtained after binarization of the B-channel image of the image to be detected;
[0039] The second extraction module is used to perform a roundness opening and closing operation on the region of interest, and to filter the roundness feature of the result of the opening and closing operation to obtain the rough outline region of the weld.
[0040] The first acquisition module is used to acquire the precise outer contour area and the internal unwelded area of the weld based on the rough contour area of the weld.
[0041] The second acquisition module is used to acquire the final weld area based on the precise outer contour area and the internal unwelded area;
[0042] The calculation module is used to calculate whether the weld is completely welded based on the final weld area.
[0043] The present invention also provides a battery weld inspection device, comprising:
[0044] Memory, used to store computer programs;
[0045] A processor is used to execute the computer program to implement the steps of the battery weld seam inspection method described above.
[0046] The present invention also provides a readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the above-described battery weld seam detection method.
[0047] As can be seen, this invention extracts the region of interest (ROI) from the acquired image to be detected. The ROI is the inscribed rectangle of the largest connected component obtained after binarizing the B-channel image of the image to be detected. A roundness opening / closing operation is performed on the ROI, and the result of the opening / closing operation is filtered for roundness features to obtain a coarse weld contour region. Based on the coarse weld contour region, a precise outer contour region and an unwelded inner region of the weld are obtained. Based on the precise outer contour region and the unwelded inner region, the final weld region is obtained, and the completeness of the weld is determined based on the final weld region. This invention, by extracting the ROI from the image to be detected, performing a roundness opening / closing operation on the ROI, and filtering the result of the opening / closing operation for roundness features, obtains a first weld region. Based on the first weld region, a precise outer contour region and an unwelded inner region are obtained, and then the final weld region is obtained based on the precise outer contour region and the unwelded inner region, thus determining whether the weld is completely welded. This avoids the problem of poor image quality caused by weld dirt and oxidation, which reduces the accuracy of weld detection, and improves the accuracy of weld detection in complex backgrounds.
[0048] In addition, the present invention also provides a battery weld inspection device, equipment and readable storage medium, which also have the above-mentioned beneficial effects. Attached Figure Description
[0049] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0050] Figure 1A flowchart of a battery weld inspection method provided in an embodiment of the present invention;
[0051] Figure 2 A flowchart of a method for detecting the rough contour region of a weld provided in an embodiment of the present invention;
[0052] Figure 3 A flowchart illustrating a battery weld inspection method provided in an embodiment of the present invention;
[0053] Figure 4 This is a schematic diagram of the structure of a battery weld inspection device provided in an embodiment of the present invention;
[0054] Figure 5 This is a schematic diagram of a battery weld inspection device provided in an embodiment of the present invention. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0056] Please refer to Figure 1 , Figure 1 A battery weld inspection method is provided as an embodiment of the present invention. The method may include:
[0057] S101: Extract the region of interest from the acquired image to be detected.
[0058] The execution subject in this embodiment is a terminal. This embodiment does not limit the type of terminal, as long as it can perform battery weld seam detection. For example, it can be a general-purpose terminal or a dedicated terminal. In this embodiment, the region of interest is the inscribed rectangle of the largest connected component obtained after binarizing the B-channel (B-channel is the blue channel in an RGB image, where RGB image is an image representation method) of the image to be detected. This embodiment does not limit the startup method of the program acquiring the image to be detected, as long as it can be acquired before battery weld seam detection. For example, it can start automatically after battery weld seam detection is started, or it can start after receiving an instruction to start the acquisition operation. This embodiment does not limit the frequency of acquiring the image to be detected, as long as the image to be detected is acquired in a timely manner. For example, it can be acquired in real-time, i.e., immediately executing the next acquisition operation after each acquisition operation is completed, or it can be acquired every preset acquisition time period. This embodiment does not limit the setting value of the preset acquisition time period; for example, it can be 1 second or 3 seconds. This embodiment does not limit the basis for setting the preset acquisition time period. For example, it can be set according to the number of battery weld seams inspected; the more battery weld seams inspected, the smaller the preset acquisition time period should be. Alternatively, it can be set according to the operator's custom settings. In order to acquire the image to be inspected in a timely manner, this embodiment can adopt a real-time acquisition method.
[0059] S102: Perform roundness opening and closing operations on the region of interest, and filter the roundness features of the results of the opening and closing operations to obtain the rough outline region of the weld.
[0060] This embodiment performs roundness opening and closing operations on the extracted region of interest (ROI), and then filters the results of the opening and closing operations using roundness features to obtain the coarse contour region of the weld. This embodiment is not limited to the method of obtaining the coarse contour region of the weld; for example, it can be extracted using BLOB operations (BLOB operations are performed on a binary image after separating the foreground and background, extracting and labeling connected components), or other methods capable of calculating the image contour region. It should be noted that the purpose of performing the opening operation on the extracted ROI is to eliminate interference from idiosyncratic features, and then the closing operation is to complete the image.
[0061] Furthermore, to more accurately eliminate interference areas such as weld contamination and yellowing due to oxidation, and to avoid missing interference areas, the above-mentioned roundness opening and closing operation is performed on the region of interest. The roundness feature is then filtered based on the results of the opening and closing operation to obtain the rough contour region of the weld. This may include the following steps, please refer to [reference needed]. Figure 2 , Figure 2 A flowchart of a method for detecting the rough contour region of a weld provided in an embodiment of the present invention may specifically include:
[0062] S201: Perform roundness opening and closing operations on the region of interest, and filter the roundness features of the results of the opening and closing operations to obtain the first region.
[0063] S202: Calculate the area of the first region and determine whether the area of the first region is less than the area threshold. If the area of the first region is less than the area threshold, proceed to step S203; if the area of the first region is greater than or equal to the area threshold, proceed to step S204.
[0064] In this embodiment, the basis for setting the area threshold is not limited, as long as the interference area can be identified. For example, it can be set according to the size of the weld area. It should be noted that the larger the weld area, the larger the area threshold setting value; it can also be set according to the operator's custom settings.
[0065] S203: If so, the first region is taken as the rough outline region of the weld.
[0066] In this embodiment, if the area of the first region is less than the area threshold, then the first region is regarded as the rough contour region of the weld.
[0067] S204: If not, tighten the parameters of the roundness opening and closing operation, perform the roundness opening and closing operation on the region of interest, and perform roundness feature filtering on the result of the opening and closing operation to obtain the first region.
[0068] In this embodiment, if the area of the first region is greater than or equal to the area threshold, the parameters of the roundness opening and closing operation are tightened, and the roundness opening and closing operation is performed on the region of interest. The result of the opening and closing operation is then filtered for roundness features to obtain the first region. It should be noted that by tightening the parameters of the roundness opening and closing operation, the interference of idiosyncratic features can be eliminated to a greater extent.
[0069] S103: Obtain the precise outer contour area and inner unwelded area of the weld based on the rough contour area of the weld.
[0070] Furthermore, in order to obtain the precise outer contour region of the weld more accurately, the above-mentioned method of obtaining the precise outer contour region of the weld based on the rough contour region of the weld may include the following steps:
[0071] Step 10: Perform gamma transformation on the image of the rough outline area of the weld to obtain the image of the second weld area.
[0072] In this embodiment, it should be noted that gamma transformation processing is used to improve the contrast between the foreground and background and tighten the parameters of image processing.
[0073] Step 11: Perform threshold segmentation on the second weld area image to obtain the third result area.
[0074] In this embodiment, it should be noted that threshold segmentation processing is performed on the second weld area image to obtain a more accurate weld contour area.
[0075] Step 12: Perform opening and closing operations on the third result area to obtain the precise outer contour area.
[0076] Furthermore, in order to obtain the internal unwelded area of the weld more accurately, the above-mentioned method of obtaining the internal unwelded area of the weld based on the rough contour area of the weld may include the following steps:
[0077] Step 20: Perform gamma transformation processing on the image of the rough outline area of the weld, and obtain the first internal unwelded area by matching it with the inscribed circle area template.
[0078] It should be noted in this embodiment that the template for the inner circular area is pre-set based on the unwelded area inside the weld.
[0079] Step 21: Calculate the precise circular outline region of the inner unsoldered area using the first inner unsoldered area.
[0080] This embodiment is not limited to calculating the precise circular outline region of the inner unsoldered area through the first inner unsoldered area. For example, it can be extracted using a circular measurement operator or other edge extraction algorithms. It should be noted that the circular measurement operator refers to the measurement operator in Halcon (a complete set of standard machine vision algorithms), which aims to find the edge features of a circle. Here, the measurement operator is used, but using other edge extraction algorithms to extract the boundary and then determine the circle will achieve the same result.
[0081] Step 22: Perform expansion etching on the precise circular contour area, and perform threshold segmentation on the result of the expansion etching to obtain the internal unwelded area.
[0082] In this embodiment, it should be noted that after the image of the precise circular contour region is re-dilated and eroded, since the two sides of the image are black and there are more blank areas at both ends, the new region after re-thresholding is basically an elliptical region.
[0083] S104: Obtain the final weld area based on the precise outer contour area and the internal unwelded area.
[0084] Furthermore, before obtaining the final weld area based on the precise outer contour area and the internal unwelded area, the following steps may also be included:
[0085] Step 30: Obtain the area where the dirt in the image intersects with the weld seam, as the second area.
[0086] It should be noted in this embodiment that the area where the contaminated area in the image intersects with the weld seam is obtained, thus avoiding the influence of contaminated areas outside the weld seam area and reducing the calculation area.
[0087] Accordingly, the process of obtaining the final weld area based on the precise outer contour area and the internal unwelded area, and calculating whether the weld is completely welded, can include:
[0088] Step 31: Obtain the final weld area based on the precise outer contour area, the second area, and the internal unwelded area.
[0089] It should be noted in this embodiment that the final weld area calculated according to the preset rules can be obtained by subtracting the inner unwelded area from the precise outer contour area and adding the second area to obtain the final weld area; or the precise outer contour area can be added to the second area and the inner unwelded area can be subtracted to obtain the final weld area.
[0090] Furthermore, in order to more accurately obtain the area where the contaminated area intersects with the weld in the image, the above-mentioned method of obtaining the area where the contaminated area intersects with the weld as a second area may include the following steps:
[0091] Step 40: Convert the image of the precise outer contour region to obtain the HSL image.
[0092] In this embodiment, the HSL image is an image representation method.
[0093] Step 41: Perform threshold segmentation on the S-channel and H-channel images of the HSL image to obtain the first result region and the second result region, respectively.
[0094] In this embodiment, the S channel is the hue channel and the H channel is the saturation channel.
[0095] Step 42: Perform opening and closing operations on the first and second result regions respectively to obtain the third and fourth regions.
[0096] Step 43: Perform a difference operation on the third and fourth regions to obtain the second region.
[0097] Furthermore, to obtain the final weld area more accurately, the above-mentioned method of obtaining the final weld area based on the precise outer contour area and the inner unwelded area may include the following steps:
[0098] Step 50: Perform a difference operation on the precise outer contour area and the inner unwelded area to obtain the weld contour area.
[0099] Step 51: Determine the boundary of the B channel image of the weld contour region, perform opening and closing operations and filling operations on the boundary to obtain the image of the first region to be detected.
[0100] It should be noted in this embodiment that the boundary filling operation fills the areas with small holes in the region, so that the overall image is not affected by the hole areas.
[0101] Step 52: Perform BLOB operation on the image of the first area to be detected to obtain the final weld area.
[0102] For a clearer understanding of this invention, please refer to the following details. Figure 3 , Figure 3 This is a flowchart illustrating a battery weld inspection method provided in an embodiment of the present invention, which may specifically include:
[0103] Step S1: Obtain the region of interest of the weld.
[0104] To obtain the region of interest (ROI) of the weld, the image is filtered by mean, then switched to the blue channel. After binarization, the largest connected component is obtained, and the inscribed rectangle of the connected component is then obtained, which is the ROI where the weld exists.
[0105] Step S2: Obtain the rough outline area of the weld.
[0106] The previously input region of interest undergoes roundness opening / closing operations, and relevant roundness features are used for filtering, calculating the area of the corresponding region. The area of the corresponding circle is then evaluated. If the area of the corresponding circle is greater than or equal to a set area threshold, surface oxidation may have caused the overall image to darken. In this case, the boundary needs to be extracted, and the kernel size parameters of the relevant opening / closing operations need to be tightened. When the area of the corresponding circle is less than the area threshold, a BLOB operation is performed on the image, and the circumcircle of this region is extracted, which is the rough outline region of the weld.
[0107] Step S3: Obtain the precise outer contour area of the weld.
[0108] After cropping the image of the rough contour area of the weld, gamma transformation is performed on the blue channel image. Threshold segmentation is then performed on the gamma-transformed image, and after performing the corresponding opening and closing operations, a more accurate minimum circumcircle image is generated again as the accurate outer contour area.
[0109] Step S4: Obtain the unwelded area inside the weld.
[0110] The image of the rough outline area of the weld is converted into a black and white channel image, and then gamma transformation is performed. The image after gamma transformation is used to obtain the approximate area of the inner circular unwelded area through template matching. Then the center of the area is obtained. The precise circular outline of the unwelded area is calculated by using a circular measurement operator. Then, the area is dilated and eroded, and then re-thresholded to obtain the elliptical area. This area is output as the inner unwelded area.
[0111] Step S5: Obtain the area where the contaminated area intersects with the weld in the image.
[0112] For the rough outline area of the weld, the image is cropped accordingly. Then, HSL image transformation is performed on the image. Thresholding and opening / closing operations are performed on the hue (S) and saturation (H) channels respectively. Finally, the difference operation is performed on the areas extracted from the S and H channels to obtain the area where the dirt in the image intersects with the weld.
[0113] Step S6: Calculate the final weld area to determine whether the weld is completely welded.
[0114] A new weld contour region is obtained by subtracting the unwelded area from the precise outer contour region. The Sobel operator (a commonly used template in edge detection) is used to find the boundary of the blue channel image of this contour region. Then, the boundary is subjected to the corresponding opening and closing operations and filling operations. The area where the blue marker and the weld intersect, obtained in step seven, is added to obtain a preliminary detection region. This region is divided into three parts: upper, middle, and lower. Different blob parameters are applied to these three parts to judge the density feature of the upper part and the overall grayscale histogram of the upper part of the image. If the region is brighter, the corresponding blob parameters are looser. Similarly, if the overall grayscale of the lower part of the image is darker, the corresponding blob parameters are tightened. Finally, the regions of the upper, middle, and lower parts are merged to obtain the final weld region.
[0115] Perform corresponding characteristic calculations such as width and length on the weld area to determine whether the weld is completely welded.
[0116] The battery weld detection method provided in this invention extracts a region of interest (ROI) from the acquired image to be detected. The ROI is the inscribed rectangle of the largest connected component obtained after binarizing the B-channel image of the image to be detected. A roundness opening / closing operation is performed on the ROI, and the result of the opening / closing operation is filtered for roundness features to obtain a coarse weld contour region. Based on the coarse weld contour region, a precise outer contour region and an unwelded inner region of the weld are obtained. Based on the precise outer contour region and the unwelded inner region, the final weld region is obtained, and the completeness of the weld is determined based on the final weld region. This invention, by extracting the ROI from the image to be detected, performing a roundness opening / closing operation on the ROI, and filtering the result of the opening / closing operation for roundness features, obtains a first weld region. Based on the first weld region, a precise outer contour region and an unwelded inner region are obtained, and then the final weld region is obtained based on the precise outer contour region and the unwelded inner region, thus determining whether the weld is completely welded. This avoids the problem of poor image quality caused by weld dirt and oxidation, which reduces the accuracy of weld detection, and improves the accuracy of weld detection in complex backgrounds. By performing opening and closing operations on the region of interest and using roundness feature filtering to calculate areas smaller than a certain area threshold, the coarse outline region of the weld can be effectively eliminated, preventing interference from weld contamination and oxidation. The intersection area between contaminants and the weld is calculated using the S and H channels of the HSL image, avoiding false positives. Gamma transformation processing of the image improves the contrast between the foreground and background, enhancing detection accuracy.
[0117] The battery weld inspection device provided in the embodiments of the present invention will be described below. The battery weld inspection device described below can be referred to in correspondence with the battery weld inspection method described above.
[0118] Please refer to the details. Figure 4 , Figure 4 A schematic diagram of the structure of the battery weld inspection device provided in the embodiments of the present invention may include:
[0119] The first extraction module 100 is used to extract the region of interest from the acquired image to be detected, wherein the region of interest is the inscribed rectangle of the largest connected component obtained after binarization of the B-channel image of the image to be detected.
[0120] The second extraction module 200 is used to perform a roundness opening and closing operation on the region of interest, and to filter the roundness feature of the result of the opening and closing operation to obtain the rough outline region of the weld.
[0121] The first acquisition module 300 is used to acquire the precise outer contour area and the inner unwelded area of the weld based on the rough contour area of the weld.
[0122] The second acquisition module 400 is used to acquire the final weld area based on the precise outer contour area and the internal unwelded area;
[0123] The calculation module 500 is used to calculate whether the weld is completely welded based on the final weld area.
[0124] Furthermore, based on the above embodiments, the second extraction module 200 may include:
[0125] A filtering unit is used to perform the roundness opening and closing operation on the region of interest, and to filter the result of the opening and closing operation using the roundness feature to obtain a first region;
[0126] The judgment unit is used to calculate the area of the first region and determine whether the area of the first region is less than the area threshold.
[0127] The first execution unit is configured to, if so, use the first region as the rough outline region of the weld.
[0128] The second execution unit is configured to, if not, tighten the parameters of the roundness opening / closing operation, perform the roundness opening / closing operation on the region of interest, and perform roundness feature filtering on the result of the opening / closing operation to obtain the first region.
[0129] Furthermore, based on any of the above embodiments, the battery weld inspection device may further include:
[0130] The third acquisition module is used to acquire the area where the dirt in the image intersects with the weld seam, as the second area;
[0131] Accordingly, the second acquisition module 400 may include:
[0132] The first acquisition unit is used to acquire the final weld area based on the precise outer contour area, the second area, and the internal unwelded area.
[0133] Furthermore, based on any of the above embodiments, the third acquisition module may include:
[0134] A conversion unit is used to convert the image of the precise outer contour region to obtain an HSL image;
[0135] The first threshold segmentation unit is used to perform threshold segmentation processing on the S-channel image and H-channel image of the HSL image to obtain the first result region and the second result region respectively.
[0136] The first calculation unit is used to perform the opening and closing operations on the first result region and the second result region respectively to obtain the third region and the fourth region.
[0137] The second calculation unit is used to perform a difference operation on the third region and the fourth region to obtain the second region.
[0138] Furthermore, based on any of the above embodiments, the second acquisition module 400 may include:
[0139] The third calculation unit is used to perform a difference operation on the precise outer contour region and the inner unwelded region to obtain the weld contour region.
[0140] The fourth calculation unit is used to obtain the boundary of the B-channel image of the weld contour region image, and to perform the opening and closing operation and filling operation on the boundary to obtain the image of the first detection region.
[0141] The fifth calculation unit is used to perform BLOB operation on the image of the first area to be detected to obtain the final weld area.
[0142] Furthermore, based on any of the above embodiments, the first acquisition module 300 may include:
[0143] The first gamma transformation unit is used to perform gamma transformation processing on the image of the coarse outline region of the weld to obtain the second weld region image.
[0144] The second threshold segmentation unit is used to perform threshold segmentation processing on the second weld area image to obtain a third result area.
[0145] The sixth calculation unit is used to perform the opening and closing operation on the third result area to obtain the precise outer contour area;
[0146] The second gamma transformation unit is used to perform gamma transformation processing on the image of the rough outline area of the weld, and obtain the first internal unwelded area by matching it with the inscribed circle area template.
[0147] The seventh calculation unit is used to calculate the precise circular outline region of the inner unsoldered area through the first inner unsoldered area;
[0148] The third threshold segmentation unit is used to perform expansion corrosion processing on the precise circular contour area, and to perform threshold segmentation on the result of the expansion corrosion processing to obtain the internal unwelded area.
[0149] It should be noted that the order of the modules and units in the aforementioned battery weld inspection device can be changed without affecting the logic.
[0150] Using the battery weld inspection device provided in this embodiment of the invention, the first extraction module 100 is used to extract the region of interest from the acquired image to be inspected, wherein the region of interest is the inscribed rectangle of the largest connected component obtained after binarization of the B-channel image of the image to be inspected. The second extraction module 200 is used to perform a roundness opening and closing operation on the region of interest, and to filter the roundness feature of the result of the opening and closing operation to obtain the rough contour region of the weld. The first acquisition module 300 is used to obtain the precise outer contour region and the internal unwelded region of the weld based on the rough contour region of the weld. The second acquisition module 400 is used to obtain the final weld region based on the precise outer contour region and the internal unwelded region. The calculation module 500 is used to calculate whether the weld is completely welded based on the final weld region. This invention extracts the region of interest (ROI) from the image to be detected, performs a roundness opening / closing operation on the ROI, and then filters the roundness features of the results of the opening / closing operation to obtain a first weld seam region. Based on this first weld seam region, a precise outer contour region and an internal unwelded region are obtained. Finally, based on the precise outer contour region and the internal unwelded region, the final weld seam region is obtained, determining whether the weld is completely welded. This avoids the problem of poor image quality caused by weld contamination and oxidation, which reduces the accuracy of weld seam detection and improves the accuracy of weld seam detection in complex backgrounds. By performing opening / closing operations and roundness feature filtering on the ROI to calculate the area smaller than a certain area threshold as the coarse contour region of the weld seam, interference from weld contamination and oxidation can be effectively eliminated, preventing missed detections. The intersection area between the contaminated area and the weld seam is calculated using the S and H channels of the HSL image, avoiding false positives. Gamma transformation processing of the image improves the contrast between the foreground and background, enhancing detection accuracy.
[0151] The battery weld inspection equipment provided in the embodiments of the present invention will be described below. The battery weld inspection equipment described below can be referred to in correspondence with the battery weld inspection method described above.
[0152] Please refer to Figure 5 , Figure 5 A schematic diagram of the structure of the battery weld inspection equipment provided in the embodiments of the present invention may include:
[0153] Memory 10 is used to store computer programs;
[0154] The processor 20 is used to execute computer programs to implement the battery weld inspection method described above.
[0155] The memory 10, processor 20, and communication interface 31 all communicate with each other through the communication bus 32.
[0156] In this embodiment of the invention, the memory 10 is used to store one or more programs. The programs may include program code, which includes computer operation instructions. In this embodiment, the memory 10 may store programs for implementing the following functions:
[0157] Extract the region of interest from the acquired image to be detected, wherein the region of interest is the inscribed rectangle of the largest connected component obtained after binarizing the B channel image of the image to be detected;
[0158] Perform a roundness opening and closing operation on the region of interest, and filter the roundness features of the result of the opening and closing operation to obtain the rough outline region of the weld.
[0159] The precise outer contour region and the inner unwelded region of the weld are obtained based on the rough contour region of the weld.
[0160] The final weld area is obtained based on the precise outer contour area and the internal unwelded area;
[0161] Whether the weld is completely welded is determined based on the final weld area.
[0162] In one possible implementation, the memory 10 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; and the data storage area may store data created during use.
[0163] Furthermore, memory 10 may include read-only memory and random access memory, providing instructions and data to the processor. A portion of the memory may also include NVRAM. The memory stores operating systems and operating instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the operating instructions may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic tasks and handling hardware-based tasks.
[0164] Processor 20 can be a central processing unit (CPU), an application-specific integrated circuit, a digital signal processor, a field-programmable gate array, or other programmable logic device. Processor 20 can be a microprocessor or any conventional processor. Processor 20 can call programs stored in memory 10.
[0165] Communication interface 31 can be an interface for the communication module, used to connect with other devices or systems.
[0166] Of course, it should be noted that, Figure 5The structure shown does not constitute a limitation on the battery weld inspection equipment in the embodiments of this application. In practical applications, the battery weld inspection equipment may include more than Figure 4 More or fewer components as shown, or combinations of certain components.
[0167] The readable storage medium provided in the embodiments of the present invention is described below. The readable storage medium described below can be referred to in correspondence with the battery weld detection method described above.
[0168] The present invention also provides a readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the battery weld detection method described above.
[0169] The readable storage medium may include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0170] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0171] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0172] Finally, it should be noted that in this document, relationships such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0173] The battery weld inspection method, apparatus, equipment, and readable storage medium provided by the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for inspecting battery weld seams, characterized in that, include: Extract the region of interest from the acquired image to be detected, wherein the region of interest is the inscribed rectangle of the largest connected component obtained after binarizing the B channel image of the image to be detected; Perform a roundness opening and closing operation on the region of interest, and filter the roundness features of the result of the opening and closing operation to obtain the rough outline region of the weld. Gamma transformation processing is performed on the image of the coarse outline region of the weld to obtain the second weld region image; The second weld area image is subjected to threshold segmentation to obtain the third result area; Perform the opening and closing operation on the third result region to obtain the precise outer contour region; The image of the rough outline area of the weld is subjected to gamma transformation processing, and the first internal unwelded area is obtained by matching it with the inscribed circle area template. The precise circular outline region of the internal unsoldered area is calculated using the first internal unsoldered area. The precise circular contour region is subjected to expansion etching, and the result of the expansion etching is segmented by thresholding to obtain the internal unwelded area. The final weld area is obtained based on the precise outer contour area and the internal unwelded area; Whether the weld is completely welded is determined based on the final weld area.
2. The battery weld inspection method according to claim 1, characterized in that, The step of performing a roundness opening / closing operation on the region of interest, and then filtering the roundness feature of the result of the opening / closing operation to obtain the rough contour region of the weld seam includes: Perform the roundness opening and closing operation on the region of interest, and filter the roundness feature of the result of the opening and closing operation to obtain the first region; Calculate the area of the first region and determine whether the area of the first region is less than the area threshold. If so, then the first region shall be regarded as the rough outline region of the weld. If not, tighten the parameters of the roundness opening / closing operation, perform the roundness opening / closing operation on the region of interest, and perform roundness feature filtering on the result of the opening / closing operation to obtain the first region.
3. The battery weld inspection method according to claim 1, characterized in that, Before obtaining the final weld area based on the precise outer contour area and the inner unwelded area, the method further includes: The area where the dirt in the image intersects with the weld is selected as the second area; Accordingly, obtaining the final weld area based on the precise outer contour area and the internal unwelded area, and calculating whether the weld is completely welded, includes: The final weld area is obtained based on the precise outer contour area, the second area, and the internal unwelded area.
4. The battery weld inspection method according to claim 3, characterized in that, The area where the dirt in the acquired image intersects with the weld seam, designated as the second area, includes: The image of the precise outer contour region is converted to obtain an HSL image; Threshold segmentation is performed on the S-channel and H-channel images of the HSL image to obtain the first result region and the second result region, respectively. The opening and closing operations are performed on the first and second result regions respectively to obtain the third and fourth regions; The second region is obtained by performing a difference operation on the third region and the fourth region.
5. The battery weld inspection method according to claim 1, characterized in that, The step of obtaining the final weld area based on the precise outer contour area and the internal unwelded area includes: Perform a difference operation on the precise outer contour region and the inner unwelded region to obtain the weld contour region; The boundary is obtained from the B-channel image of the weld contour region image, and the opening and closing operation and filling operation are performed on the boundary to obtain the image of the first region to be detected. The image of the first area to be detected is subjected to BLOB operation to obtain the final weld area.
6. A battery weld inspection device, characterized in that, include: The first extraction module is used to extract the region of interest from the acquired image to be detected, wherein the region of interest is the inscribed rectangle of the largest connected component obtained after binarization of the B-channel image of the image to be detected; The second extraction module is used to perform a roundness opening and closing operation on the region of interest, and to filter the roundness feature of the result of the opening and closing operation to obtain the rough outline region of the weld. The first acquisition module includes: The first gamma transformation unit is used to perform gamma transformation processing on the image of the coarse outline region of the weld to obtain the second weld region image. The second threshold segmentation unit is used to perform threshold segmentation processing on the second weld area image to obtain a third result area. The sixth calculation unit is used to perform the opening and closing operation on the third result area to obtain the precise outer contour area; The second gamma transformation unit is used to perform gamma transformation processing on the image of the rough outline area of the weld, and obtain the first internal unwelded area by matching it with the inscribed circle area template. The seventh calculation unit is used to calculate the precise circular outline region of the inner unsoldered area through the first inner unsoldered area; The third threshold segmentation unit is used to perform expansion corrosion processing on the precise circular contour area, and to perform threshold segmentation on the result of the expansion corrosion processing to obtain the internal unwelded area. The second acquisition module is used to acquire the final weld area based on the precise outer contour area and the internal unwelded area; The calculation module is used to calculate whether the weld is completely welded based on the final weld area.
7. A battery weld inspection device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the battery weld inspection method as described in any one of claims 1 to 5.
8. A readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed by a processor, implements the steps of the battery weld inspection method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Weld joint pseudo soldering detection method, device and equipment and readable storage medium
CN115456995A
Structured light and line laser fused welding seam thickness grading three-dimensional positioning method and system
CN120612367A