CN119295471B - Battery welding detection method and system based on machine vision - Google Patents

Battery welding detection method and system based on machine vision Download PDF

Info

Publication number
CN119295471B
CN119295471B CN202411834417.8A CN202411834417A CN119295471B CN 119295471 B CN119295471 B CN 119295471B CN 202411834417 A CN202411834417 A CN 202411834417A CN 119295471 B CN119295471 B CN 119295471B
Authority
CN
China
Prior art keywords
welding
boundary
sub
abnormal
cluster
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202411834417.8A
Other languages
Chinese (zh)
Other versions
CN119295471A (en
Inventor
朱少伟
田建红
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xi'an Jiegao Electronic Technology Co ltd
Original Assignee
Xi'an Jiegao Electronic Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xi'an Jiegao Electronic Technology Co ltd filed Critical Xi'an Jiegao Electronic Technology Co ltd
Priority to CN202411834417.8A priority Critical patent/CN119295471B/en
Publication of CN119295471A publication Critical patent/CN119295471A/en
Application granted granted Critical
Publication of CN119295471B publication Critical patent/CN119295471B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/50Extraction of image or video features by performing operations within image blocks; by using histograms, e.g. histogram of oriented gradients [HoG]; by summing image-intensity values; Projection analysis
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/54Extraction of image or video features relating to texture
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/762Arrangements for image or video recognition or understanding using pattern recognition or machine learning using clustering, e.g. of similar faces in social networks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E60/00Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation
    • Y02E60/10Energy storage using batteries

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Evolutionary Computation (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Quality & Reliability (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
  • Sealing Battery Cases Or Jackets (AREA)

Abstract

The invention relates to the technical field of image processing, in particular to a battery welding detection method and system based on machine vision. The method comprises the steps of collecting welding areas, obtaining inner and outer welding boundaries and abnormal edge sections on the inner and outer welding boundaries according to the welding areas, obtaining the abnormal degree of the outer welding boundaries and the abnormal degree of the inner welding boundaries according to the abnormal edge sections on the inner and outer welding boundaries, obtaining all subareas according to the welding areas, obtaining the abnormal degree of texture of each subarea according to LBP histograms of all subareas, obtaining the overall abnormal degree of the welding areas according to the abnormal degree of the inner welding boundaries and the abnormal degree of texture areas, and further evaluating welding quality.

Description

Battery welding detection method and system based on machine vision
Technical Field
The invention relates to the technical field of image processing, in particular to a battery welding detection method and system based on machine vision.
Background
Battery welding detection is a key step in ensuring battery assembly quality, and particularly in the new energy automobile industry, the safety and performance of a battery are directly related to the safety and cruising ability of a vehicle. Welding defects such as missing welding, broken welding, uneven welding, etc. may cause degradation of battery performance, leakage of electrolyte, and even safety accidents. Therefore, it is important to monitor the welding quality of the battery by using an efficient and accurate detection technology, and a machine vision technology detects and analyzes objects by simulating a human visual system. In battery weld inspection, a machine vision system may automatically capture a weld image and analyze weld quality via an image processing algorithm. The technology can greatly improve the detection speed and consistency, reduce human errors and treat complex welding patterns and tiny defects.
The patent application document with the current publication number of CN116109663A discloses a stomach CT image segmentation method based on multi-threshold segmentation, which is used for segmenting a gray image of a stomach CT image to obtain a stomach non-lymphoid tissue region, collecting characteristic pixel points around the region, constructing a window with a set size by taking the characteristic pixel points or the pixel points to be analyzed as the center, obtaining characteristic value parameters of the pixel points according to gray values of the pixel points in the window and the neighborhood pixel points, obtaining the characteristic pixel points or lymph characteristic values of the pixel points to be analyzed according to the characteristic value parameters and the gray values of the pixel points, obtaining the association degree between the characteristic pixel points and the pixel points to be analyzed according to the characteristic pixel points and the lymph characteristic values of the pixel points to be analyzed, determining the lymph confidence coefficient of the pixel points to be analyzed according to the association degree, and segmenting the lymph confidence coefficient to the pixel points to be analyzed to obtain the stomach region by taking the lymph confidence coefficient as a correction coefficient.
In battery welding detection, welding defects and anomalies cannot be accurately identified using conventional threshold segmentation algorithms, and in particular, the threshold segmentation algorithms are highly dependent on the choice of thresholds, since the gray values of background and defects may be similar, it becomes difficult to automatically select an appropriate threshold, and manual adjustment may be required, which increases the complexity and uncertainty of the algorithm. Eventually, the detection of the weld defect abnormality is inaccurate, and the determination of the weld quality is affected.
Disclosure of Invention
In order to solve the technical problem that the threshold segmentation algorithm is highly dependent on the selection of the threshold, and the gray values of the background and the defect are possibly similar, the automatic selection of the proper threshold becomes difficult, the invention provides a battery welding detection method and a battery welding detection system based on machine vision.
In a first aspect, the present invention provides a machine vision-based battery welding detection method, which adopts the following technical scheme:
The battery welding detection method based on machine vision comprises the following steps:
acquiring an inner welding boundary, an outer welding boundary, an abnormal edge section on the outer welding boundary and the degree of abnormality of the outer welding boundary according to the welding region ,Representing the degree of abnormality of the outer weld boundary; representing the length of the ith abnormal edge segment on the outer weld boundary; representing the number of abnormal edge segments on the outer weld boundary; Representing the number of pixel points on the outer welding boundary; representing the distance from the kth pixel point to the circle center on the outer welding boundary; Representing the distance from the (k+1) th pixel point to the circle center on the outer welding boundary;
the method comprises the steps of obtaining each subarea according to a welding area, obtaining the texture abnormality degree of each subarea, marking the subarea with the texture abnormality degree larger than or equal to a texture abnormality degree threshold value as an abnormal texture area, and obtaining the texture abnormality degree of each abnormal texture area;
Obtaining the overall degree of abnormality of a welded zone ;Representing the maximum value of the abnormality degree of the outer welding boundary and the abnormality degree of the inner welding boundary, wherein t represents the number of abnormal texture areas; And evaluating welding quality based on the overall degree of abnormality.
The method has the innovation that a Hough circle detection algorithm is used for obtaining a general welding area, a Canny edge detection algorithm is used for obtaining detailed and accurate inner and outer welding boundaries, an abnormal edge section is obtained according to comparison between the general welding area and the inner and outer welding boundaries, the abnormal degree of the inner and outer welding boundaries is obtained, further, a local binary pattern is used for obtaining texture characteristics of a welding part, the abnormal degree of texture of each sub-area is obtained, the influence of illumination conditions and the influence of the background in the welding environment are avoided, the texture characteristics are extracted more accurately, finally, the abnormal degree of the inner and outer welding boundaries and the abnormal degree of texture of each sub-area are combined, the overall abnormal degree of the welding part is obtained, the abnormal of the welding edge and the abnormal degree of the welding inside are considered, and the judgment of welding quality is more reliable.
Preferably, the acquiring the inner and outer welding boundaries includes:
And detecting the welding area by using a canny edge detection algorithm to obtain all edges in the welding area, marking the edge with the smallest distance from the farthest circumcircle in all edges as an outer welding boundary, and marking the edge with the smallest distance from the nearest circumcircle in all edges as an inner welding boundary.
And the inner and outer welding boundaries are acquired, so that the abnormal edge sections on the inner and outer welding boundaries can be acquired conveniently.
Preferably, the acquiring the abnormal edge section on the outer welding boundary includes:
acquiring a first cluster and a second cluster;
Taking a first cluster as an example, mapping pixel points in all the first clusters onto an external welding boundary to obtain a plurality of edge segments, counting the length of each edge segment, clustering the edge segments into two categories by using a k-means mean clustering algorithm according to the length of each edge segment, discarding edge segments in the category with the minimum average value in the category, marking edge segments in the category with the maximum average value in the category as abnormal edge segments, acquiring a plurality of abnormal edge segments according to a second cluster, and obtaining the abnormal edge segments on the external welding boundary.
Preferably, the acquiring the first cluster and the second cluster includes:
Counting the distance from each pixel point to the circle center on the outer welding boundary, clustering each pixel point on the outer welding boundary by using a mean shift clustering algorithm according to the distance from each pixel point to the circle center on the outer welding boundary to obtain a plurality of clusters, calculating the absolute value of the difference between the value of the center point of each cluster and the radius of the farthest circumcircle, marking the clusters with the difference smaller than a difference threshold as marked clusters, marking each cluster except the marked clusters as rest clusters, obtaining the difference between the value of the center point of each rest cluster and the value of the center point of the marked cluster as a first difference, marking a plurality of rest clusters corresponding to the first difference as a first cluster, and marking a plurality of rest clusters corresponding to the first difference as a negative number as second cluster.
Preferably, the acquiring each sub-region according to the welding region includes:
And emitting a ray at the center of the welding area every N degrees, intersecting the inner welding boundary and the outer welding boundary, and dividing the circular ring area between the inner welding boundary and the outer welding boundary into a plurality of subareas.
Preferably, the obtaining the texture abnormality degree of each sub-region includes:
;
in the formula, Representing the degree of texture abnormality of the h sub-region; And The abscissa corresponding to the a-th peak of the LBP histogram representing the h-th sub-regionA quartile number; And Mean value of abscissa corresponding to the a-th peak of LBP histogram representing all sub-regionsAverage of the quartiles; And Maximum and minimum values representing the abscissa corresponding to the a-th peak in the LBP histogram of all sub-regions; And The first in the LBP histogram representing all sub-regionsMaximum and minimum values of the quartiles; Standard deviation of all ordinate data values in the LBP histogram representing the h sub-region; representing the mean of the standard deviations of all ordinate data values in the LBP histogram of all sub-regions.
The degree of abnormality in the weld zone may be measured based on the degree of texture abnormality for each sub-zone.
Preferably, the obtaining of the a-th peak of the LBP histogram of the h-th sub-region includes:
The method comprises the steps of obtaining an LBP value of each pixel point in each sub-region, regarding the LBP value of each pixel point in any sub-region as an abscissa, regarding the number of the pixel points as an ordinate, constructing an LBP histogram of the sub-region, obtaining two peaks of a first large peak and a second large peak in the LBP histogram of the sub-region, and recording the two peaks as the two peaks of the LBP histogram of the sub-region.
The texture abnormality degree of each sub-region is convenient to acquire later.
Preferably, the evaluating the welding quality based on the overall degree of abnormality includes:
And presetting an ultra-parameter m, and if the overall abnormality degree of the welding area is greater than or equal to the ultra-parameter m, considering that the welding quality is qualified, otherwise, judging that the welding quality is unqualified.
The assessment of weld quality is more accurate.
In a second aspect, the invention provides a battery welding detection system based on machine vision, which adopts the following technical scheme:
The battery welding detection system based on machine vision comprises a processor and a memory, wherein the memory stores computer program instructions which when executed by the processor realize the battery welding detection method based on machine vision.
By adopting the technical scheme, the battery welding detection method based on machine vision generates a computer program, and the computer program is stored in the memory to be loaded and executed by the processor, so that the terminal equipment is manufactured according to the memory and the processor, and the use is convenient.
The method has the technical effects that the method aims at acquiring a general welding area by using a Hough circle detection algorithm, then acquiring an inner welding boundary and an outer welding boundary by using a Canny edge detection algorithm, acquiring an abnormal edge section according to comparison between the general welding area and the inner welding boundary and the outer welding boundary, and acquiring the abnormal degree of the inner welding boundary and the outer welding boundary, further acquiring the texture abnormal degree of each sub-area by using a local binary pattern, avoiding the influence of illumination conditions and the influence of the background in the welding environment, ensuring that the texture characteristic is extracted more accurately, finally acquiring the general abnormal degree of the welding part by combining the abnormal degree of the inner welding boundary and the abnormal degree of the welding part, and considering the abnormal of the welding edge and the abnormal degree of the welding inside, and judging the welding quality more reliably.
Drawings
The above, as well as additional purposes, features, and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description when read in conjunction with the accompanying drawings. In the drawings, several embodiments of the invention are illustrated by way of example and not by way of limitation, and like or corresponding reference numerals refer to like or corresponding parts.
Fig. 1 is a flowchart of a method in a battery welding detection method based on machine vision according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that when the terms "first," "second," and the like are used in the claims, the specification and the drawings of the present invention, they are used merely for distinguishing between different objects and not for describing a particular sequential order. The terms "comprises" and "comprising" when used in the specification and claims of the present invention are taken to specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
The embodiment of the invention discloses a battery welding detection method based on machine vision, which comprises the following steps of S1-S3 with reference to FIG. 1:
s1, collecting a welding area.
In the embodiment of the invention, a high-definition camera is used for shooting a welding area to obtain a welding RGB image, gray processing is carried out on the welding RGB image to obtain a welding gray image, a Hough circle detection algorithm is used for detecting circles in the welding gray image to obtain a plurality of concentric circles and circle centers, the concentric circle farthest from the circle center is marked as the farthest circumscribed circle, the area corresponding to the concentric circle farthest from the circle center is marked as the welding area, and the concentric circle closest to the circle center is marked as the nearest circumscribed circle.
S2, acquiring an inner welding boundary, an outer welding boundary and an abnormal edge section on the inner welding boundary according to the welding area, and acquiring the abnormality degree of the outer welding boundary and the abnormality degree of the inner welding boundary according to the abnormal edge section on the inner welding boundary and the outer welding boundary.
It should be noted that, in the battery welding detection, the welding defect and the abnormality cannot be accurately identified by using the conventional edge detection or threshold segmentation algorithm, specifically, the conventional edge detection may not accurately locate the welding edge and the abnormal texture, and the threshold segmentation algorithm is highly dependent on the selection of the threshold, since the gray values of the background and the defect may be similar, it becomes difficult to automatically select the appropriate threshold, and manual adjustment may be required, which increases the complexity and uncertainty of the algorithm. Eventually, the detection of the weld defect abnormality is inaccurate, and the determination of the weld quality is affected.
Step S2 includes step S20 to step S21, and is specifically as follows:
And S20, acquiring an inner welding boundary, an outer welding boundary and an abnormal edge section on the inner welding boundary and the outer welding boundary according to the welding area.
It should be noted that, in the welding process, the conditions of missing welding, false welding and offset often occur due to the conditions of misoperation and the like, so that the boundary of the welding part is not standard round like the ideal condition, and an edge abnormality, such as outward protrusion or inward recession of a certain block on the edge, may occur.
In the embodiment of the invention, a canny edge detection algorithm is used for detecting a welding area to obtain all edges in the welding area, the edge with the smallest distance from the farthest circumcircle in all the edges is marked as an outer welding boundary, and the edge with the smallest distance from the nearest circumcircle in all the edges is marked as an inner welding boundary;
Counting the distance from each pixel point to the circle center on the outer welding boundary, clustering each pixel point on the outer welding boundary by using a mean shift clustering algorithm according to the distance from each pixel point to the circle center on the outer welding boundary to obtain a plurality of clusters, calculating the absolute value of the difference between the value of the center point of each cluster and the radius of the farthest circumcircle, marking each cluster except the mark cluster as a mark cluster, marking the clusters with the difference smaller than the difference threshold as rest clusters, marking the difference between the value of the center point of each rest cluster and the value of the center point of the mark cluster as a first difference, marking the rest clusters corresponding to the first difference as a first cluster when the first difference is positive, and marking the rest clusters corresponding to the first difference as a second cluster when the first difference is negative;
taking a first cluster as an example, mapping pixel points in all the first clusters onto an outer welding boundary to obtain a plurality of edge segments, counting the length of each edge segment, clustering the edge segments into two categories by using a k-means mean value clustering algorithm according to the length of each edge segment, discarding edge segments in the category with the minimum average value in the category, and marking edge segments in the category with the maximum average value in the category as abnormal edge segments. And similarly, acquiring a plurality of abnormal edge segments according to the second cluster, and thus obtaining the abnormal edge segments on the outer welding boundary.
And acquiring the abnormal edge section on the inner welding boundary according to the method for acquiring the abnormal edge section on the outer welding boundary.
S21, acquiring the abnormality degree of the outer welding boundary and the abnormality degree of the inner welding boundary according to the abnormal edge sections on the inner welding boundary and the outer welding boundary.
It is noted that it is known that the abnormal edge segments on the outer weld boundary are obtained, and if the sum of the lengths of all the abnormal edge segments on the outer weld boundary is longer and the average value of the differences between the distances from all the adjacent pixel points to the center of the circle on the outer weld boundary is larger, the larger the defect that the outer edge of the welding area protrudes outward or is recessed inward is indicated, the greater the degree of abnormality of the outer weld boundary is indicated, and the following embodiments are given.
In the embodiment of the invention, the degree of abnormality of the outer welding boundary is obtained:
;
in the formula, Representing the degree of abnormality of the outer weld boundary; representing the length of the ith abnormal edge segment on the outer weld boundary; representing the number of abnormal edge segments on the outer weld boundary; Representing the number of pixel points on the outer welding boundary; Representing the proportion of all abnormal edge segments on the outer weld boundary to the outer weld boundary, when the number of abnormal edge segments on the outer weld boundary is larger, the length of each abnormal edge segment is longer, namely The greater the value of (2), the greater the degree of abnormality of the outer weld boundary, the poorer the weld quality; representing the distance from the kth pixel point to the circle center on the outer welding boundary; Representing the distance from the (k+1) th pixel point to the circle center on the outer welding boundary; the larger the value of (c) is, the larger the average value of the differences between the distances from the center of circles of all adjacent pixel points on the outer welding boundary is, the coarser and less smooth the boundary is, the higher the probability of various defects is, and thus the welding quality is improved The greater the degree of increase in the outer weld boundary, the greater the degree of abnormality in the outer weld boundaryThe larger the weld quality, the poorer.
And similarly, acquiring the abnormality degree of the inner welding boundary according to the abnormal edge section on the inner welding boundary.
S3, acquiring each subarea according to the welding area, acquiring the abnormal texture degree of each subarea according to the LBP histogram of each subarea, and acquiring the overall abnormal degree of the welding area according to the abnormal degree of the inner welding boundary and the abnormal texture degree of the abnormal texture area so as to evaluate the welding quality.
Step S3 includes step S30-step S31, specifically as follows:
S30, acquiring each subarea according to the welding area, and acquiring the abnormal texture degree of each subarea according to the LBP histogram of each subarea.
It should be noted that, the local binary pattern can capture texture information of a local area in an image, and has better robustness to illumination variation and noise, so that the local binary pattern can be used for extracting texture features of a welding line (an area between inner and outer welding boundaries), and the features can be used for identifying abnormal conditions of the welding line, therefore, the invention firstly divides the welding line area into various subareas, for any subarea, acquires an LBP value of each pixel point in the subarea, and constructing the LBP histogram of the subarea, wherein when the difference value of the horizontal coordinate corresponding to the peak value of the LBP histogram of the subarea and the average value of the horizontal coordinate corresponding to the peak value of the LBP histogram of all the subareas is larger, the difference value of the quartile of the LBP histogram of the subarea and the average value of the quartile of the LBP histogram of all the subareas is larger, and the standard deviation of all the ordinate data values in the LBP histogram of the subarea is larger than the average value of all the subareas, the abnormal texture degree of the subarea is larger.
In the embodiment of the invention, a ray is emitted at intervals of N degrees at the center of a welding area and is intersected with an inner welding boundary and an outer welding boundary, a circular area between the inner welding boundary and the outer welding boundary is divided into a plurality of subareas, the LBP value of each pixel point in each subarea is obtained, the LBP value of each pixel point in any subarea is taken as an abscissa, the number of the pixel points is taken as an ordinate, an LBP histogram of the subarea is constructed, and a first peak value and a second peak value in the LBP histogram of the subarea are obtained and recorded as two peak values of the LBP histogram of the subarea;
Obtaining the texture abnormality degree of each sub-region:
in the formula, Representing the degree of texture abnormality of the h sub-region; An abscissa corresponding to an a-th peak of the LBP histogram representing an h-th sub-region; representing the mean value of the abscissa corresponding to the a-th peak of the LBP histograms of all the subregions; representing the maximum value of the abscissa corresponding to the a-th peak in the LBP histogram of all sub-regions; representing the minimum value of the abscissa corresponding to the a-th peak in the LBP histograms of all the subregions; LBP histogram representing the h sub-region A quartile number; LBP histogram representing all sub-regions Average of the quartiles; the first in the LBP histogram representing all sub-regions Maximum of the quartiles; the first in the LBP histogram representing all sub-regions Minimum of the quartiles; Standard deviation of all ordinate data values in the LBP histogram representing the h sub-region; Representing the average value of the standard deviation of all the ordinate data values in the LBP histogram of all the subregions, and when the abscissa corresponding to the peak value of the LBP histogram of the h subregion, the quartile of the LBP histogram of the h subregion and the standard deviation of all the ordinate data values in the LBP histogram of the h subregion are larger than the average value of all the subregions, the greater the degree of texture abnormality of the h subregion.
A texture anomaly degree threshold T is preset, and if the texture anomaly degree of any sub-region is greater than or equal to the texture anomaly degree threshold T, the sub-region is an abnormal texture region, in the embodiment of the present invention, the texture anomaly threshold t=0.5 is preset, and in other embodiments, the value of T may be preset by an implementer according to a specific implementation manner.
S31, acquiring the overall abnormal degree of the welding area according to the abnormal degree of the inner welding boundary and the abnormal degree of the texture of the abnormal texture area, and further evaluating the welding quality.
If the maximum value of the degree of abnormality of the outer welding boundary and the degree of abnormality of the inner welding boundary is larger, and the degree of abnormality of the texture region is larger, the total degree of abnormality of the welding region is larger, and finally, the welding quality is evaluated according to the total degree of abnormality of the welding region.
In the embodiment of the invention, the total abnormal degree of the welding area is obtained:
;
in the formula, Representing the overall degree of abnormality of the weld zone; Representing the maximum value of the abnormality degree of the outer welding boundary and the abnormality degree of the inner welding boundary, wherein t represents the number of abnormal texture areas; Representing the degree of texture abnormality of the ith abnormal texture region when The greater the value of (2), the greater the overall degree of anomaly in the weld zone.
And presetting an ultra-parameter m, and if the overall abnormality degree of the welding area is greater than or equal to the ultra-parameter m, considering that the welding quality is qualified, otherwise, judging that the welding quality is unqualified.
The embodiment of the invention also discloses a battery welding detection system based on machine vision, which comprises a processor and a memory, wherein the memory stores computer program instructions, and the battery welding detection method based on machine vision is realized when the computer program instructions are executed by the processor.
The above system further comprises other components well known to those skilled in the art, such as a communication bus and a communication interface, the arrangement and function of which are known in the art and therefore are not described in detail herein.
In the context of this patent, the foregoing memory may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, the computer readable storage medium may be any suitable magnetic or magneto-optical storage medium, such as, for example, resistance change memory, dynamic random access memory, static random access memory, enhanced dynamic random access memory, high bandwidth memory, hybrid storage cube, etc., or any other medium that can be used to store the desired information and that can be accessed by an application, a module, or both. Any such computer storage media may be part of, or accessible by, or connectable to, the device.
While various embodiments of the present invention have been shown and described herein, it will be obvious to those skilled in the art that such embodiments are provided by way of example only. Many modifications, changes, and substitutions will now occur to those skilled in the art without departing from the spirit and scope of the invention. It should be understood that various alternatives to the embodiments of the invention described herein may be employed in practicing the invention.
The above embodiments are not intended to limit the scope of the invention, so that the equivalent changes of the structure, shape and principle of the invention are covered by the scope of the invention.

Claims (8)

1.基于机器视觉的电池焊接检测方法,其特征在于,包括步骤:1. A battery welding detection method based on machine vision, characterized in that it comprises the following steps: 采集焊接灰度图像,使用霍夫圆检测算法对焊接灰度图像进行检测,得到多个同心圆以及圆心,将距离圆心最远的同心圆记为最远外接圆,将其对应的区域记为焊接区域;将距离圆心最近的同心圆记为最近外接圆;对焊接区域进行边缘检测,得到若干个边缘,将与最远外接圆距离最小的边缘记为外焊接边界,将与最近外接圆距离最小的边缘记为内焊接边界;获取外焊接边界上的异常边缘段;获取外焊接边界的异常程度代表外焊接边界的异常程度;代表外焊接边界上第i个异常边缘段的长度;代表外焊接边界上异常边缘段的数量;代表外焊接边界上像素点的数量;代表外焊接边界上第k个像素点到圆心的距离;代表外焊接边界上第k+1个像素点到圆心的距离;获取内焊接边界上的异常边缘段,得到内焊接边界的异常程度;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; 获取焊接区域的总体异常程度代表外焊接边界的异常程度与内焊接边界的异常程度中的最大值;t代表异常纹理区域的数量;代表第u个异常纹理区域的纹理异常程度;基于所述总体异常程度对焊接质量进行评估。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. 2.根据权利要求1所述的基于机器视觉的电池焊接检测方法,其特征在于,所述获取外焊接边界上的异常边缘段,包括:2. The battery welding detection method based on machine vision according to claim 1, characterized in that the step of obtaining the abnormal edge segment on the outer welding boundary comprises: 获取第一聚类簇以及第二聚类簇;Obtain the first cluster and the second cluster; 以第一聚类簇为例,将所有第一聚类簇中的像素点映射到外焊接边界上,得到多个边缘段,统计每个边缘段的长度,根据每个边缘段的长度,使用k-means均值聚类算法将边缘段聚为两个类别,将类内平均值最小的类别中的边缘段舍弃,将类内平均值最大的类别中的边缘段记为异常边缘段;根据第二聚类簇,获取若干个异常边缘段;得到外焊接边界上的异常边缘段。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.根据权利要求2所述的基于机器视觉的电池焊接检测方法,其特征在于,所述获取第一聚类簇以及第二聚类簇,包括:3. The battery welding detection method based on machine vision according to claim 2, 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.根据权利要求1所述的基于机器视觉的电池焊接检测方法,其特征在于,所述根据焊接区域,获取各个子区域,包括:4. The battery welding detection method based on machine vision according to claim 1 is characterized in that the obtaining of each sub-area according to the welding area comprises: 在焊接区域的圆心处每隔N度发射一条射线,并与内焊接边界与外焊接边界相交,将内焊接边界与外焊接边界之间的圆环区域,划分为多个子区域。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.根据权利要求1所述的基于机器视觉的电池焊接检测方法,其特征在于,所述获取每个子区域的纹理异常程度,包括:5. The battery welding detection method based on machine vision according to claim 1, characterized in that the step of obtaining the texture abnormality degree of each sub-area comprises: 获取每个子区域的LBP直方图的两个峰值;Get the two peaks of the LBP histogram of each sub-region; ; 式中,代表第h个子区域的纹理异常程度;以及代表第h个子区域的LBP直方图的第a个峰值对应的横坐标以及第个四分位数;以及代表所有子区域的LBP直方图的第a个峰值对应的横坐标的均值以及第个四分位数的均值;以及代表所有子区域的LBP直方图中的第a个峰值对应的横坐标的最大值以及最小值;以及代表所有子区域的LBP直方图中的第个四分位数的最大值以及最小值;代表第h个子区域的LBP直方图中所有纵坐标数据值的标准差;代表所有子区域的LBP直方图中所有纵坐标数据值的标准差的均值。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.根据权利要求5所述的基于机器视觉的电池焊接检测方法,其特征在于,所述获取每个子区域的LBP直方图的两个峰值,包括:6. The battery welding detection method based on machine vision according to claim 5, characterized in that the step of obtaining two peaks of the LBP histogram of each sub-area comprises: 获取每个子区域中的每个像素点的LBP值,对于任意子区域中的每个像素点的LBP值,以LBP值为横坐标,像素点数量为纵坐标,构建该子区域的LBP直方图,获取该子区域的LBP直方图中第一大以及第二大的两个峰值,记为该子区域的LBP直方图的两个峰值。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.根据权利要求1所述的基于机器视觉的电池焊接检测方法,其特征在于,所述基于所述总体异常程度对焊接质量进行评估,包括:7. The battery welding detection method based on machine vision according to claim 1, characterized in that the welding quality is evaluated based on the overall abnormality degree, comprising: 预设超参数m,若焊接区域的总体异常程度大于或等于超参数m,认为焊接质量合格;反之,焊接质量不合格。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.基于机器视觉的电池焊接检测系统,其特征在于,包括:处理器和存储器,所述存储器存储有计算机程序指令,当所述计算机程序指令被所述处理器执行时实现根据权利要求1-7任一项所述的基于机器视觉的电池焊接检测方法。8. A battery welding detection system based on machine vision, characterized in that it comprises: 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.
CN202411834417.8A 2024-12-13 2024-12-13 Battery welding detection method and system based on machine vision Active CN119295471B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411834417.8A CN119295471B (en) 2024-12-13 2024-12-13 Battery welding detection method and system based on machine vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411834417.8A CN119295471B (en) 2024-12-13 2024-12-13 Battery welding detection method and system based on machine vision

Publications (2)

Publication Number Publication Date
CN119295471A CN119295471A (en) 2025-01-10
CN119295471B true CN119295471B (en) 2025-02-25

Family

ID=94160000

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411834417.8A Active CN119295471B (en) 2024-12-13 2024-12-13 Battery welding detection method and system based on machine vision

Country Status (1)

Country Link
CN (1) CN119295471B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114723758A (en) * 2022-06-10 2022-07-08 惠州威尔高电子有限公司 Production quality detection method for full-automatic connection of MiniLED thin plate
CN114820418A (en) * 2021-01-29 2022-07-29 深圳市万普拉斯科技有限公司 Image exception handling method and device, terminal equipment and readable storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3788279B2 (en) * 2001-07-09 2006-06-21 株式会社日立製作所 Pattern inspection method and apparatus
CN107833220B (en) * 2017-11-28 2021-06-11 河海大学常州校区 Fabric defect detection method based on deep convolutional neural network and visual saliency
CN117893553B (en) * 2024-03-15 2024-05-31 宝鸡鼎钛金属有限责任公司 Image processing titanium metal segmentation method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114820418A (en) * 2021-01-29 2022-07-29 深圳市万普拉斯科技有限公司 Image exception handling method and device, terminal equipment and readable storage medium
CN114723758A (en) * 2022-06-10 2022-07-08 惠州威尔高电子有限公司 Production quality detection method for full-automatic connection of MiniLED thin plate

Also Published As

Publication number Publication date
CN119295471A (en) 2025-01-10

Similar Documents

Publication Publication Date Title
CN115294140B (en) Method and system for detecting defects of hardware parts
CN113096130B (en) Method and device for detecting object defects
CN118037722B (en) Copper pipe production defect detection method and system
CN117705815B (en) Printing defect detection method based on machine vision
CN115984284A (en) X-ray hull weld image detection method for ship maintenance
CN110097542A (en) Detection method, device and the storage medium of chip bubble
CN118501177B (en) Appearance defect detection method and system for formed foil
CN115690108A (en) Aluminum alloy rod production quality evaluation method based on image processing
CN116721107B (en) Intelligent monitoring system for cable production quality
CN119741303B (en) Intelligent detection method and system for blade castings
CN118887217B (en) Test box surface weld quality detection method and system
CN119313697B (en) Laser welding quality assessment method
CN115345894A (en) Welding seam ray detection image segmentation method
CN118505689A (en) Method and system for rapidly detecting defects of textile products based on image features
CN117788470B (en) Tire defect detection method based on artificial intelligence
CN120235860B (en) Intelligent recognition method for surface cracks in radiator vibration test
CN119295471B (en) Battery welding detection method and system based on machine vision
CN120765664B (en) Industrial welding quality detection method based on machine vision
CN120318257A (en) Storage tank body defect detection method and system based on image processing
CN118644468B (en) A battery surface defect identification method, system, terminal and storage medium
CN119313676A (en) A fabric defect detection method for producing protective clothing
CN119600252A (en) Optical defect detection method, device, equipment and storage medium
CN118396999A (en) A method for oil seal quality detection based on image processing
CN116205923A (en) Nondestructive testing method for internal defects of automobile hub based on X-RAY
CN121459351B (en) A vision-assisted method and system for burr detection in precision electronic components

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Battery welding detection method and system based on machine vision

Granted publication date: 20250225

Pledgee: Weiyang sub branch of Shaanxi qinnong Rural Commercial Bank Co.,Ltd.

Pledgor: XI'AN JIEGAO ELECTRONIC TECHNOLOGY CO.,LTD.

Registration number: Y2025980025551

PE01 Entry into force of the registration of the contract for pledge of patent right