Battery welding detection method and system based on machine vision
By using Hough circle detection and Canny edge detection algorithms in battery welding detection, combined with texture analysis, the shortcomings of traditional threshold segmentation algorithms in identifying welding defects and abnormalities are solved, and a more accurate welding quality evaluation is achieved.
Patent Information
- Application Number
- CN202411834417.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-12-13
AI Technical Summary
Traditional threshold segmentation algorithms cannot accurately identify welding defects and abnormalities in battery welding detection. This is mainly due to the similar grayscale values of the background and defects, which makes it difficult to automatically select the appropriate threshold, which increases the complexity and uncertainty of the algorithm.
The battery welding detection method based on machine vision is adopted, and the general welding area is obtained using the Hough circle detection algorithm, and the internal and external welding boundaries are obtained in combination with the Canny edge detection algorithm. The welding quality is evaluated through the analysis of abnormal edge segments and texture abnormality.
Through this method, welding defects and abnormalities can be more accurately identified, reducing the impact on light conditions and background, and improving the reliability of welding quality evaluation.
Smart Images

Figure CN119295471B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a battery welding detection method and system based on machine vision. Background Art
[0002] Battery welding inspection is a key step to ensure the quality of battery assembly, especially in the new energy vehicle industry, where the safety and performance of the battery are directly related to the safety and endurance of the vehicle. Welding defects, such as leaking welds, broken welds, and uneven welding, may lead to degradation of battery performance, leakage of electrolyte, and even safety accidents. Therefore, it is crucial to use efficient and accurate detection technology to monitor the quality of battery welding. Machine vision technology detects and analyzes objects by simulating the human visual system. In battery welding inspection, the machine vision system can automatically capture welding images and analyze welding quality through image processing algorithms. This technology can greatly improve the speed and consistency of inspection, reduce human errors, and can handle complex welding patterns and tiny defects.
[0003] The patent application document with the publication number CN116109663A currently discloses a gastric CT image segmentation method based on multi-threshold segmentation, which segments the grayscale image of the gastric CT image to obtain the gastric non-lymphatic tissue area, collects characteristic pixel points around the area, constructs a window of a set size with the characteristic pixel point or the pixel point to be analyzed as the center, and obtains the characteristic value parameters of the pixel point according to the grayscale value of the pixel point in the window and its neighboring pixel points; obtains the lymphatic characteristic value of the characteristic pixel point or the pixel point to be analyzed according to the characteristic value parameters and the grayscale value of the pixel point; obtains the degree of association between the characteristic pixel point and the pixel point to be analyzed according to the lymphatic characteristic value of the characteristic pixel point and the pixel point to be analyzed; determines the lymphatic confidence of the pixel point to be analyzed according to the degree of association; and uses the lymphatic confidence as a correction coefficient to segment the pixel point to be analyzed to obtain the gastric area.
[0004] In battery welding inspection, the traditional threshold segmentation algorithm cannot accurately identify welding defects and anomalies. Specifically, the threshold segmentation algorithm is highly dependent on the selection of thresholds. Since the grayscale values of the background and defects may be similar, it becomes difficult to automatically select a suitable threshold and may require manual adjustment, which increases the complexity and uncertainty of the algorithm. Ultimately, it leads to inaccurate detection of welding defects and anomalies, and affects the judgment of welding quality. Summary of the invention
[0005] In order to solve the technical problem that the threshold segmentation algorithm is highly dependent on the selection of the threshold, and it becomes difficult to automatically select a suitable threshold because the grayscale values of the background and the defects may be similar, the present invention provides a battery welding detection method and system based on machine vision.
[0006] In the first aspect, the present invention provides a battery welding detection method based on machine vision, which adopts the following technical solution:
[0007] The battery welding detection method based on machine vision includes the following steps:
[0008] According to the welding area, obtain the inner and outer welding boundaries, obtain the abnormal edge segment on the outer welding boundary; obtain the abnormal degree of the outer welding boundary , Represents the degree of abnormality of the outer weld boundary; represents the length of the i-th abnormal edge segment on the outer welding boundary; Represents the number of abnormal edge segments on the outer weld boundary; Represents the number of pixels on the outer welding boundary; Represents the distance from the kth pixel on the outer welding boundary to the center of the circle; Represents the distance from the k+1th pixel point on the outer welding boundary to the center of the circle; obtains the abnormality degree of the inner welding boundary;
[0009] According to the welding area, each sub-area is obtained; the texture abnormality degree of each sub-area is obtained; the sub-area whose texture abnormality degree is greater than or equal to the texture abnormality degree threshold is recorded as an abnormal texture area, and the texture abnormality degree of each abnormal texture area is obtained;
[0010] Get the overall degree of abnormality in the weld area ; represents the maximum value between the abnormal degree of the outer weld boundary and the abnormal degree of the inner weld boundary; t represents the number of abnormal texture areas; Represents the texture abnormality degree of the u-th abnormal texture area; and evaluates the welding quality based on the overall abnormality degree.
[0011] The innovation of the present invention lies in using the Hough circle detection algorithm to obtain the general welding area, and then using the Canny edge detection algorithm to obtain detailed and accurate internal and external welding boundaries, and obtaining abnormal edge segments based on the comparison between the general welding area and the internal and external welding boundaries, and obtaining the degree of abnormality of the internal and external welding boundaries; further, using the local binary pattern to obtain the texture features of the welding part, and obtaining the degree of texture abnormality of each sub-area, avoiding the influence of lighting conditions and background in the welding environment, making the texture feature extraction more accurate, and finally combining the degree of abnormality of the internal and external welding boundaries and the degree of texture abnormality of each sub-area, to obtain the overall degree of abnormality of the welding part, taking into account the abnormality of the welding edge and the abnormality inside the welding, which is more reliable for judging the welding quality.
[0012] Preferably, obtaining the inner and outer welding boundaries includes:
[0013] The welding area is detected using the Canny edge detection algorithm to obtain all the edges in the welding area. The edge with the smallest distance to the farthest circumscribed circle among all the edges is recorded as the outer welding boundary, and the edge with the smallest distance to the nearest circumscribed circle among all the edges is recorded as the inner welding boundary.
[0014] The inner and outer welding boundaries are obtained to facilitate the subsequent acquisition of abnormal edge segments on the inner and outer welding boundaries.
[0015] Preferably, obtaining the abnormal edge segment on the outer welding boundary includes:
[0016] Obtain the first cluster and the second cluster;
[0017] Taking the first cluster as an example, all pixel points in the first cluster are mapped to the outer welding boundary to obtain multiple edge segments, and the length of each edge segment is counted. According to the length of each edge segment, the k-means mean clustering algorithm is used to cluster the edge segments into two categories, and the edge segments in the category with the smallest average value within the class are discarded, and the edge segments in the category with the largest average value within the class are recorded as abnormal edge segments; according to the second cluster, several abnormal edge segments are obtained; and the abnormal edge segments on the outer welding boundary are obtained.
[0018] Preferably, the obtaining of the first cluster and the second cluster includes:
[0019] The distance from each pixel point on the outer welding boundary to the center of the circle is counted. According to the distance from each pixel point on the outer welding boundary to the center of the circle, the mean shift clustering algorithm is used to cluster each pixel point on the outer welding boundary to obtain several clusters. The absolute value of the difference between the value of the center point of each cluster and the radius of the farthest circumscribed circle is calculated. The clusters whose difference is less than the difference threshold are recorded as marked clusters, and each cluster except the marked cluster is recorded as the remaining clusters; the difference between the value of the center point of each remaining cluster and the value of the center point of the marked cluster is obtained, which is recorded as the first difference. When the first difference is a positive number, the corresponding number of clusters are recorded as the first cluster, and when the first difference is a negative number, the corresponding number of clusters are recorded as the second cluster.
[0020] Preferably, obtaining each sub-area according to the welding area includes:
[0021] A ray is emitted at the center of the welding area every N degrees and intersects with the inner welding boundary and the outer welding boundary, dividing the circular area between the inner welding boundary and the outer welding boundary into multiple sub-areas.
[0022] Preferably, obtaining the texture abnormality degree of each sub-region includes:
[0023] ;
[0024] In the formula, Represents the texture abnormality degree of the h-th sub-region; as well as The abscissa corresponding to the ath peak of the LBP histogram of the hth sub-region and the quartiles; as well as Represents the mean of the abscissa corresponding to the ath peak of the LBP histogram of all sub-regions and the The mean of the quartiles; as well as Represents the maximum and minimum values of the abscissa corresponding to the a-th peak in the LBP histogram of all sub-regions; as well as Represents the first LBP histogram of all sub-regions The maximum and minimum values of the quartiles; Represents the standard deviation of all ordinate data values in the LBP histogram of the hth sub-region; Represents the mean of the standard deviations of all ordinate data values in the LBP histogram of all sub-regions.
[0025] The degree of texture abnormality in each sub-region can be used to measure the degree of abnormality in the weld area.
[0026] Preferably, obtaining the ath peak value of the LBP histogram of the hth sub-region includes:
[0027] Get the LBP value of each pixel in each sub-region. For the LBP value of each pixel in any sub-region, construct the LBP histogram of the sub-region with the LBP value as the horizontal coordinate and the number of pixels as the vertical coordinate. Get the first and second largest peaks in the LBP histogram of the sub-region, and record them as the two peaks of the LBP histogram of the sub-region.
[0028] This facilitates the subsequent acquisition of the degree of texture abnormality in each sub-region.
[0029] Preferably, the evaluating the welding quality based on the overall abnormality degree comprises:
[0030] A hyperparameter m is preset. If the overall abnormality degree of the welding area is greater than or equal to the hyperparameter m, the welding quality is considered to be qualified; otherwise, the welding quality is unqualified.
[0031] The assessment of welding quality is more accurate.
[0032] In a second aspect, the present invention provides a battery welding detection system based on machine vision, which adopts the following technical solutions:
[0033] A battery welding detection system based on machine vision includes: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the battery welding detection method based on machine vision is implemented.
[0034] By adopting the above technical solution, the above-mentioned battery welding detection method based on machine vision is generated into a computer program and stored in a memory to be loaded and executed by a processor, so that a terminal device is manufactured according to the memory and the processor for easy use.
[0035] The present invention has the following technical effects: the purpose of the present invention is to use the Hough circle detection algorithm to obtain the general welding area, and then use the Canny edge detection algorithm to obtain the inner and outer welding boundaries, and obtain the abnormal edge segment according to the comparison between the general welding area and the inner and outer welding boundaries, and obtain the abnormality degree of the inner and outer welding boundaries; further, the texture features of the welding part are obtained by using the local binary pattern, and the texture abnormality degree of each sub-area is obtained, avoiding the influence of the lighting conditions and the background in the welding environment, so that the texture feature extraction is more accurate, and finally, the abnormality degree of the inner and outer welding boundaries and the texture abnormality degree of each sub-area are combined to obtain the overall abnormality degree of the welding part, taking into account the abnormality of the welding edge and the abnormality inside the welding, which is more reliable for the judgment of welding quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-restrictive manner, and the same or corresponding reference numerals represent the same or corresponding parts.
[0037] Figure 1 It is a flow chart of a method for detecting battery welding based on machine vision in an embodiment of the present invention. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0039] It should be understood that when the terms "first", "second", etc. are used in the claims, descriptions, and drawings of the present invention, they are only used to distinguish different objects, rather than to describe a specific order. The terms "include" and "comprise" used in the description and claims of the present invention indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their collections.
[0040] The present invention discloses a battery welding detection method based on machine vision, referring to Figure 1 , comprising steps S1 to S3:
[0041] S1: Collect welding area.
[0042] In an embodiment of the present invention, a high-definition camera is used to shoot the welding area to obtain a welding RGB image, which is then grayscaled to obtain a welding grayscale image; a Hough circle detection algorithm is used to detect circles in the welding grayscale image to obtain multiple concentric circles and the center of the circle, and the concentric circle farthest from the center of the circle is recorded as the farthest circumscribed circle, and the area corresponding to the concentric circle is recorded as the welding area; the concentric circle closest to the center of the circle is recorded as the closest circumscribed circle.
[0043] S2: According to the welding area, the inner and outer welding boundaries and the abnormal edge segments on the inner and outer welding boundaries are obtained; according to the abnormal edge segments on the inner and outer welding boundaries, the abnormality degree of the outer welding boundary and the abnormality degree of the inner welding boundary are obtained.
[0044] It should be noted that in battery welding detection, the use of traditional edge detection or threshold segmentation algorithms cannot accurately identify welding defects and anomalies. Specifically, traditional edge detection may not be able to accurately locate welding edges and abnormal textures, and the threshold segmentation algorithm is highly dependent on the selection of thresholds. Since the grayscale values of the background and defects may be similar, it becomes difficult to automatically select a suitable threshold, and manual adjustment may be required, which increases the complexity and uncertainty of the algorithm. Ultimately, it leads to inaccurate detection of welding defects and anomalies, and affects the judgment of welding quality.
[0045] Step S2 includes steps S20 and S21, which are specifically as follows:
[0046] S20: According to the welding area, the inner and outer welding boundaries and the abnormal edge segments on the inner and outer welding boundaries are obtained.
[0047] It should be noted that during the welding process, due to operational errors and the like, welding leaks, cold welds and offsets often occur, resulting in the boundary of the welding part not being a standard circle as in the ideal situation, and there may be edge abnormalities, such as a certain piece on the edge protruding outward or recessed inward. Therefore, the present invention detects the welding area according to the canny edge detection algorithm, obtains all edges in the welding area, and obtains the inner and outer welding boundaries and abnormal edge segments on the inner and outer welding boundaries, that is, abnormal edges caused by protruding outward or recessed inward on the inner and outer welding boundaries according to the distances between each edge and the nearest circumscribed circle and the farthest circumscribed circle.
[0048] In the embodiment of the present invention, the canny edge detection algorithm is used to detect the welding area to obtain all the edges in the welding area, and the edge with the smallest distance from the farthest circumscribed circle among all the edges is recorded as the outer welding boundary, and the edge with the smallest distance from the nearest circumscribed circle among all the edges is recorded as the inner welding boundary;
[0049] Obtain abnormal edge segments on the outer welding boundary: Count the distance from each pixel point on the outer welding boundary to the center of the circle, and use the mean shift clustering algorithm to cluster each pixel point on the outer welding boundary according to the distance from each pixel point on the outer welding boundary to the center of the circle to obtain several clusters, calculate the absolute value of the difference between the value of the center point of each cluster and the radius of the farthest circumscribed circle, record the clusters with a difference less than the difference threshold as marked clusters, and record each cluster except the marked cluster as the remaining clusters; obtain the difference between the value of the center point of each remaining cluster and the value of the center point of the marked cluster, record it as the first difference, record the several remaining clusters corresponding to the positive value of the first difference as the first cluster, and record the several remaining clusters corresponding to the negative value of the first difference as the second cluster;
[0050] Taking the first cluster as an example, all the pixels in the first cluster are mapped to the outer welding boundary to obtain multiple edge segments. The length of each edge segment is counted. According to the length of each edge segment, the edge segments are clustered into two categories using the k-means mean clustering algorithm. The edge segments in the category with the smallest average value within the class are discarded, and the edge segments in the category with the largest average value within the class are recorded as abnormal edge segments. Similarly, according to the second cluster, several abnormal edge segments are obtained; thus, the abnormal edge segments on the outer welding boundary are obtained.
[0051] According to the method for obtaining the abnormal edge segment on the outer welding boundary, the abnormal edge segment on the inner welding boundary is obtained.
[0052] S21: According to the abnormal edge segments on the inner and outer welding boundaries, the abnormality degree of the outer welding boundary and the abnormality degree of the inner welding boundary are obtained.
[0053] It should be noted that it is known that the abnormal edge segments on the outer welding boundary have been obtained. If the sum of the lengths of all the abnormal edge segments on the outer welding boundary is longer and the average of the differences in the distances from all adjacent pixel points on the outer welding boundary to the center of the circle is larger, it means that the defects protruding outward or recessed inward on the outer edge of the welding area are larger, indicating that the degree of abnormality of the outer welding boundary is greater. The specific implementation method is as follows.
[0054] In an embodiment of the present invention, the abnormality degree of the outer welding boundary is obtained:
[0055] ;
[0056] In the formula, Represents the degree of abnormality of the outer weld boundary; represents the length of the i-th abnormal edge segment on the outer welding boundary; Represents the number of abnormal edge segments on the outer weld boundary; Represents the number of pixels on the outer welding boundary; represents the proportion of all abnormal edge segments on the outer welding boundary to the outer welding boundary. When the number of abnormal edge segments on the outer welding boundary is larger and the length of each abnormal edge segment is longer, that is, The larger the value of , the greater the abnormality of the outer welding boundary and the worse the welding quality; Represents the distance from the kth pixel on the outer welding boundary to the center of the circle; Represents the distance from the k+1th pixel on the outer welding boundary to the center of the circle; The larger the value of , the larger the mean difference of the distances from all adjacent pixels on the outer welding boundary to the center of the circle, which means that the boundary is rougher and less smooth, and the greater the possibility of various defects. The greater the increase in the degree of the outer welding boundary, the greater the abnormality of the outer welding boundary. The larger it is, the worse the welding quality will be.
[0057] Similarly, the abnormal degree of the inner welding boundary is obtained according to the abnormal edge segment on the inner welding boundary.
[0058] S3: According to the welding area, each sub-area is obtained; according to the LBP histogram of each sub-area, the texture abnormality degree of each sub-area is obtained; according to the abnormality degree of the inner welding boundary and the texture abnormality degree of the abnormal texture area, the overall abnormality degree of the welding area is obtained, and then the welding quality is evaluated.
[0059] Step S3 includes steps S30 and S31, which are specifically as follows:
[0060] S30: acquiring each sub-region according to the welding region; acquiring the texture abnormality degree of each sub-region according to the LBP histogram of each sub-region.
[0061] It should be noted that the local binary pattern can capture the texture information of the local area in the image and has good robustness to illumination changes and noise. Therefore, the local binary pattern can be used to extract the texture features of the weld (the area between the inner and outer welding boundaries). These features can be used to identify abnormal conditions of the weld. Therefore, the present invention first divides the weld area into various sub-areas. For any sub-area, the LBP value of each pixel point in the sub-area is obtained, and the LBP histogram of the sub-area is constructed. When the difference between the horizontal coordinate corresponding to the peak value of the LBP histogram of the sub-area and the mean value of the horizontal coordinate corresponding to the peak value of the LBP histogram of all areas is larger, the difference between the quartile of the LBP histogram of the sub-area and the mean value of the quartile of the LBP histogram of all sub-areas is larger, and the standard deviation of all vertical coordinate data values in the LBP histogram of the sub-area is greatly different from the average value of all sub-areas, the texture abnormality of the sub-area is greater.
[0062] In the embodiment of the present invention, a ray is emitted at the center of the welding area every N degrees and intersects with the inner welding boundary and the outer welding boundary, and the annular area between the inner welding boundary and the outer welding boundary is divided into a plurality of sub-areas, and the LBP value of each pixel point in each sub-area is obtained. For the LBP value of each pixel point in any sub-area, the LBP value is used as the horizontal coordinate and the number of pixels is used as the vertical coordinate to construct the LBP histogram of the sub-area, and the first and second largest peaks in the LBP histogram of the sub-area are obtained, which are recorded as the two peaks of the LBP histogram of the sub-area;
[0063] Get the degree of texture anomaly for each sub-region:
[0064]
[0065] In the formula, Represents the texture abnormality degree of the h-th sub-region; The horizontal coordinate corresponding to the ath peak of the LBP histogram of the hth sub-region; Represents the mean of the abscissa corresponding to the a-th peak of the LBP histogram of all sub-regions; Represents the maximum value of the abscissa corresponding to the a-th peak in the LBP histogram of all sub-regions; Represents the minimum value of the abscissa corresponding to the a-th peak in the LBP histogram of all sub-regions; The hth LBP histogram represents the hth sub-region quartiles; The first LBP histogram representing all sub-regions The mean of the quartiles; Represents the first LBP histogram of all sub-regions The maximum value of the quartiles; Represents the first LBP histogram of all sub-regions The minimum of the quartiles; Represents the standard deviation of all ordinate data values in the LBP histogram of the hth sub-region; Represents the mean of the standard deviations of all ordinate data values in the LBP histogram of all sub-regions; when the abscissa corresponding to the peak of the LBP histogram of the h-th sub-region, the quartile of the LBP histogram of the h-th sub-region, and the standard deviation of all ordinate data values in the LBP histogram of the h-th sub-region are all significantly different from the average values of all sub-regions, the greater the degree of texture abnormality of the h-th sub-region.
[0066] A texture abnormality threshold T is preset. If the texture abnormality of any sub-region is greater than or equal to the texture abnormality threshold T, the sub-region is an abnormal texture region. In the embodiment of the present invention, the texture abnormality threshold T is preset to 0.5. In other embodiments, the implementer can preset the value of T according to the specific implementation method.
[0067] S31: According to the abnormality degree of the inner welding boundary and the texture abnormality degree of the abnormal texture area, the overall abnormality degree of the welding area is obtained, and then the welding quality is evaluated.
[0068] It should be noted that if the maximum value of the abnormality degree of the outer welding boundary and the abnormality degree of the inner welding boundary is greater, and the texture abnormality degree of the abnormal texture area is greater, the overall abnormality degree of the welding area is greater. Finally, the welding quality is evaluated based on the overall abnormality degree of the welding area.
[0069] In this embodiment of the present invention, the overall abnormality degree of the welding area is obtained:
[0070] ;
[0071] In the formula, Represents the overall degree of abnormality in the weld area; represents the maximum value between the abnormal degree of the outer weld boundary and the abnormal degree of the inner weld boundary; t represents the number of abnormal texture areas; represents the texture abnormality degree of the u-th abnormal texture area; when The larger the value of , the greater the overall abnormality of the welding area.
[0072] A hyperparameter m is preset. If the overall abnormality degree of the welding area is greater than or equal to the hyperparameter m, the welding quality is considered to be qualified; otherwise, the welding quality is unqualified.
[0073] The embodiment of the present invention also discloses a battery welding detection system based on machine vision, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a battery welding detection method based on machine vision according to the present invention is implemented.
[0074] The above system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface, and their configuration and functions are known in the art, so they will not be described in detail here.
[0075] In the present invention, the aforementioned memory may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium may be any suitable magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory, a dynamic random access memory, a static random access memory, an enhanced dynamic random access memory, a high bandwidth memory, a hybrid storage cube, etc., or any other medium that can be used to store the required information and can be accessed by an application, a module, or both. Any such computer storage medium may be part of the device or accessible or connectable to the device.
[0076] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
[0077] The above are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A battery welding detection method based on machine vision, characterized in that: Includes steps: Collect welding grayscale images, use Hough circle detection algorithm to detect welding grayscale images, obtain multiple concentric circles and circle centers, record the concentric circle farthest from the center as the farthest circumscribed circle, and record its corresponding area as the welding area; record the concentric circle closest to the center as the nearest circumscribed circle; perform edge detection on the welding area to obtain several edges, record the edge with the smallest distance from the farthest circumscribed circle as the outer welding boundary, and record the edge with the smallest distance from the nearest circumscribed circle as the inner welding boundary; obtain abnormal edge segments on the outer welding boundary; obtain the abnormal degree of the outer welding boundary , Represents the degree of abnormality of the outer weld boundary; represents the length of the i-th abnormal edge segment on the outer welding boundary; Represents the number of abnormal edge segments on the outer weld boundary; Represents the number of pixels on the outer welding boundary; Represents the distance from the kth pixel on the outer welding boundary to the center of the circle; represents the distance from the k+1th pixel point on the outer welding boundary to the center of the circle; obtains the abnormal edge segment on the inner welding boundary and obtains the abnormal degree of the inner welding boundary; According to the welding area, each sub-area is obtained; the texture abnormality degree of each sub-area is obtained; and the sub-area whose texture abnormality degree is greater than or equal to the texture abnormality degree threshold is recorded as an abnormal texture area; Get the overall degree of abnormality in the weld area ; represents the maximum value between the abnormal degree of the outer weld boundary and the abnormal degree of the inner weld boundary; t represents the number of abnormal texture areas; represents the texture abnormality degree of the u-th abnormal texture area; The weld quality is evaluated based on the overall abnormality level.
2. The battery welding detection method based on machine vision according to claim 1, characterized in that: The step of obtaining an abnormal edge segment on an outer welding boundary comprises: Obtain the first cluster and the second cluster; Taking the first cluster as an example, all pixel points in the first cluster are mapped to the outer welding boundary to obtain multiple edge segments, and the length of each edge segment is counted. According to the length of each edge segment, the k-means mean clustering algorithm is used to cluster the edge segments into two categories, and the edge segments in the category with the smallest average value within the class are discarded, and the edge segments in the category with the largest average value within the class are recorded as abnormal edge segments; according to the second cluster, several abnormal edge segments are obtained; and the abnormal edge segments on the outer welding boundary are obtained.
3. The battery welding detection method based on machine vision according to claim 2 is characterized in that: The obtaining of the first cluster and the second cluster comprises: The distance from each pixel point on the outer welding boundary to the center of the circle is counted. According to the distance from each pixel point on the outer welding boundary to the center of the circle, the mean shift clustering algorithm is used to cluster each pixel point on the outer welding boundary to obtain several clusters. The absolute value of the difference between the value of the center point of each cluster and the radius of the farthest circumscribed circle is calculated. The clusters whose difference is less than the difference threshold are recorded as marked clusters, and each cluster except the marked cluster is recorded as the remaining clusters; the difference between the value of the center point of each remaining cluster and the value of the center point of the marked cluster is obtained, which is recorded as the first difference. When the first difference is a positive number, the corresponding number of clusters are recorded as the first cluster, and when the first difference is a negative number, the corresponding number of clusters are recorded as the second cluster.
4. The battery welding detection method based on machine vision according to claim 1 is characterized in that: The step of obtaining each sub-area according to the welding area includes: A ray is emitted at the center of the welding area every N degrees and intersects with the inner welding boundary and the outer welding boundary, dividing the circular area between the inner welding boundary and the outer welding boundary into multiple sub-areas.
5. The battery welding detection method based on machine vision according to claim 1 is characterized in that: The obtaining of the texture abnormality degree of each sub-region includes: Get the two peaks of the LBP histogram of each sub-region; ; In the formula, Represents the texture abnormality degree of the h-th sub-region; as well as The abscissa corresponding to the ath peak of the LBP histogram of the hth sub-region and the quartiles; as well as Represents the mean of the abscissa corresponding to the ath peak of the LBP histogram of all sub-regions and the The mean of the quartiles; as well as Represents the maximum and minimum values of the abscissa corresponding to the a-th peak in the LBP histogram of all sub-regions; as well as Represents the first LBP histogram of all sub-regions The maximum and minimum values of the quartiles; Represents the standard deviation of all ordinate data values in the LBP histogram of the hth sub-region; Represents the mean of the standard deviations of all ordinate data values in the LBP histogram of all sub-regions.
6. The battery welding detection method based on machine vision according to claim 5 is characterized in that: The obtaining of two peaks of the LBP histogram of each sub-region includes: Get the LBP value of each pixel in each sub-region. For the LBP value of each pixel in any sub-region, construct the LBP histogram of the sub-region with the LBP value as the horizontal coordinate and the number of pixels as the vertical coordinate. Get the first and second largest peaks in the LBP histogram of the sub-region, and record them as the two peaks of the LBP histogram of the sub-region.
7. The battery welding detection method based on machine vision according to claim 1 is characterized in that: The evaluating of welding quality based on the overall abnormality degree comprises: A hyperparameter m is preset. If the overall abnormality degree of the welding area is greater than or equal to the hyperparameter m, the welding quality is considered to be qualified; otherwise, the welding quality is unqualified.
8. The battery welding detection system based on machine vision is characterized by: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the battery welding detection method based on machine vision according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Stomach CT image segmentation method based on multi-threshold segmentation
CN116109663A
Production quality detection method for full-automatic connection of MiniLED sheets
CN114723758A
Image exception processing method and device, terminal equipment and readable storage medium
CN114820418A