A capacitor welding quality on-line detection system based on machine vision
By using multi-view image processing and dynamic threshold judgment, a solder joint anomaly scoring system was constructed, which solved the stability and accuracy problems of existing capacitor solder joint detection systems and realized efficient online detection of capacitor solder joint quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HENAN ZHILIE ELECTRONIC TECH CO LTD
- Filing Date
- 2026-01-23
- Publication Date
- 2026-05-29
AI Technical Summary
Existing capacitor solder joint quality inspection systems rely on manual judgment, which is susceptible to subjective differences and environmental influences. They are difficult to achieve stable and accurate identification of minor defects such as cold solder joints, and lack multi-view image processing and dynamic threshold adjustment, resulting in unstable inspection results and a high misjudgment rate.
A multi-view image filtering module is used to extract the mean grayscale distribution and the mean frequency domain energy. A fuzziness factor value is constructed to filter target view images. Combined with the solder joint structure enhancement model and the feature vector of the training template, an abnormal score value of the solder joint is generated. The cold solder joint defect is judged by the dynamic defect judgment threshold.
It enables stable online detection of weld joint quality, improves the detection rate and accuracy of cold weld defects, reduces the false judgment rate, and adapts to the quality distribution changes of different production batches.
Smart Images

Figure CN122115903A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine vision inspection technology, and more specifically to an online inspection system for capacitor welding quality based on machine vision. Background Technology
[0002] In the capacitor manufacturing process, the quality of the solder joints is directly related to the conductivity and long-term reliability of the device. Even minor defects such as poor soldering, missing soldering, or false soldering can cause the entire batch of products to fail.
[0003] Traditional solder joint quality inspection mainly relies on manual sampling or offline inspection equipment. The inspection process usually involves manually judging the clarity of the solder joint image and then combining it with human experience to assess the integrity and morphological consistency of the solder joint edge. The advantage of this method is that the equipment investment is low, the operation method is relatively flexible, and it has a high ability to identify obvious defects, which can assist in quality control to a certain extent.
[0004] However, existing systems struggle to meet the challenges of continuous batch production, specifically including: (1) Visual judgment relies on the operator's experience, which not only has subjective differences, but is also easily affected by factors such as fluctuations in image clarity and light interference, resulting in unstable detection results; (2) Existing systems often only perform static judgment on single-frame images and lack a screening mechanism for sharpness differences in multi-view images, which can easily lead to the incomplete capture of edge change areas and reduce the accuracy of abnormal feature extraction. (3) Existing systems generally rely on fixed thresholds for defect judgment, making it difficult to dynamically adjust the judgment criteria according to the differences in quality distribution between production batches. This results in a high misjudgment rate and a high missed detection rate, making it impossible to reliably identify minor defects such as cold solder joints. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention provides an online inspection system for capacitor welding quality based on machine vision, the system comprising: The viewpoint filtering module S11 is used to acquire multi-view images at the capacitor welding station, and extract the mean gray level distribution and the mean frequency domain energy of each image; calculate the ambiguity factor value based on the mean gray level distribution and the mean frequency domain energy, and filter images with ambiguity factor values lower than the preset ambiguity threshold as target viewpoint images; The feature extraction module S12 is used to perform region boundary reconstruction and brightness suppression processing based on the high-reflection region in the target view image to generate a reflection compensation image; the reflection compensation image is input into the preset solder joint structure enhancement model to extract the gradient change region at the edge of the solder joint and generate a solder joint morphology change response map. The anomaly scoring module S13 is used to construct a solder joint feature vector based on the gradient mutation width and edge closure degree extracted from the solder joint morphology mutation response map; and to perform multi-dimensional similarity matching between the solder joint feature vector and the training template feature vector to generate a solder joint anomaly score value. The defect judgment module S14 is used to construct a solder joint time sequence quality record based on the solder joint abnormality score value and the image acquisition timestamp; it determines whether the current solder joint abnormality score value exceeds the dynamic defect judgment threshold, and if so, marks the current capacitor solder joint as a cold solder defect.
[0006] Furthermore, the steps for extracting the mean of the grayscale distribution and the mean of the frequency domain energy are as follows: S111, by performing grayscale preprocessing on multi-view images at the capacitor welding station, the pixel grayscale matrix of each image is obtained; S112, calculate the average gray level of all pixels in the image according to the row and column directions based on the pixel gray level matrix to obtain the mean gray level distribution; S113: By performing a fast Fourier transform on the pixel grayscale matrix, the sum of squared amplitudes of each frequency component is extracted to obtain the mean energy value in the frequency domain.
[0007] Furthermore, the steps for calculating the ambiguity factor value are as follows: S114, normalization is performed on the mean of grayscale distribution and the mean of frequency domain energy respectively to obtain the normalized grayscale value and the normalized energy value; S115, perform a weighted calculation based on the grayscale normalized value and the energy normalized value to obtain the fusion sharpness score; S116, convert the fusion sharpness score into a fuzziness factor value based on a preset fuzziness conversion function.
[0008] Furthermore, the steps for filtering images from the target viewpoint are as follows: S117, By comparing the blur factor value of each image with the preset blur threshold, images with blur factor values higher than the blur threshold are filtered out; S118, sort the remaining images after filtering in ascending order of acquisition timestamp to generate a clear image candidate set; S119, based on the spatial viewpoint difference in the clear image candidate set, extract a subset of images covering the entire viewpoint range, and use the subset of images as the target viewpoint image.
[0009] Furthermore, the steps for performing region boundary reconstruction and brightness suppression are as follows: S121, extract the boundary pixels of the highlight reflection region based on the brightness value distribution in the target view image; S122, Reconstruct the region boundary contour using spline interpolation based on the boundary pixels to generate boundary contour data; S123 suppresses overexposure in highlight areas by performing local brightness normalization and histogram cropping within the boundary contour, and outputs the processed target view image as a reflection compensation image.
[0010] Furthermore, the steps for extracting the gradient abrupt change region at the solder joint edge are as follows: S124, Input the reflection compensation image into the preset solder joint structure enhancement model to obtain the feature map of the enhanced solder joint area; S125, Calculate the image gradient distribution and extract the gradient magnitude matrix based on the feature map of the solder joint area; S126. By locating abrupt change points exceeding the local threshold in the gradient magnitude matrix and performing edge connectivity analysis, the gradient abrupt change region at the solder joint edge is obtained, and the gradient abrupt change region at the solder joint edge is converted into a solder joint morphology abrupt change response map.
[0011] Furthermore, the steps for constructing the solder joint feature vector are as follows: S131, Extract the contour length data of the edge closed region based on the solder joint morphology abrupt change response map; S132, Calculate the gradient mutation width distribution data within the mutation region based on the solder joint morphology mutation response diagram; S133 combines the contour length data and gradient mutation width distribution data into a multidimensional feature matrix, and outputs the multidimensional feature matrix as a weld point feature vector.
[0012] Furthermore, the steps for generating solder joint anomaly scores through multidimensional similarity matching are as follows: S134, the feature matching similarity is obtained by performing cosine distance calculation on the feature vector of the solder joint and the feature vector of the training template; S135, perform a weighted summation based on the feature matching similarity and the label weights of the training template to obtain the abnormal matching score; S136, perform normalization processing based on the anomaly matching score and the score normalization coefficient of the training template to generate solder joint anomaly score values, and output the solder joint anomaly score values as quality judgment score data.
[0013] Furthermore, the steps for constructing solder joint timing quality records are as follows: S141, by combining the image acquisition timestamp and the solder joint anomaly score value to construct a time score pair, and combine all time score pairs in the order of timestamps to form a solder joint quality score sequence; S142, extract continuous abnormal scoring segments based on the solder joint quality scoring sequence and mark the segment range, and combine the solder joint quality scoring sequence and abnormal scoring segments into a solder joint time series quality record.
[0014] Furthermore, the steps for identifying cold solder joint defects are as follows: S143, obtain the score ratio by comparing the current weld point abnormality score value with the dynamic defect judgment threshold; S144. Determine whether the dynamic defect judgment threshold is exceeded based on the score ratio. If the dynamic defect judgment threshold is exceeded, mark the current capacitor solder joint as a cold solder joint defect and write the cold solder joint defect marking result into the solder joint timing quality record.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention constructs an image clarity screening mechanism based on the mean grayscale distribution and mean frequency domain energy extracted from multi-view images at the capacitor welding station, thereby achieving automatic optimization of target view images and improving the overall clarity of the input image. Furthermore, by constructing a solder joint feature vector based on the contour length data and gradient mutation width distribution data extracted from the solder joint morphology mutation response map, and combining it with the training template feature vector to perform multi-dimensional similarity matching, the automatic generation of solder joint anomaly score values is achieved, thereby improving the sensitivity of identifying solder joint quality differences. Furthermore, this invention constructs a time-series quality record of weld joints based on the weld joint anomaly score value and the image acquisition timestamp, and performs a score ratio determination in conjunction with a dynamic defect judgment threshold to achieve adaptive discrimination of cold weld defects, thereby improving the stability of the cold weld defect detection rate and thus improving the overall accuracy of online welding quality detection. In summary, this invention constructs a solder joint feature vector based on multi-view images and performs quality judgment by combining a dynamic defect judgment threshold, thereby achieving stable online detection of cold solder joint defects in capacitors. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0017] Figure 1 This is a block diagram of an online capacitor welding quality inspection system based on machine vision, provided in Embodiment 1 of the present invention. Detailed Implementation
[0018] 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, 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.
[0019] Please see Figure 1 As shown in the figure, this embodiment discloses an online inspection system for capacitor welding quality based on machine vision. The system includes: The viewpoint filtering module S11 is used to acquire multi-view images at the capacitor welding station, and extract the mean gray level distribution and the mean frequency domain energy of each image; calculate the ambiguity factor value based on the mean gray level distribution and the mean frequency domain energy, and filter images with ambiguity factor values lower than the preset ambiguity threshold as target viewpoint images; Specifically, the steps for extracting the mean of grayscale distribution and the mean of frequency domain energy are as follows: S111, by performing grayscale preprocessing on multi-view images at the capacitor welding station, the pixel grayscale matrix of each image is obtained; Multi-view images are acquired by fixed-view industrial cameras deployed around the capacitor welding station. The industrial cameras synchronously acquire images from different angles at the same welding moment according to a preset sampling trigger signal. Grayscale preprocessing follows existing image processing logic, using a standard RGB to grayscale formula. The RGB components of each pixel are weighted and summed using fixed coefficients to obtain the grayscale value, forming a two-dimensional grayscale matrix with the same size as the image. S112, calculate the average gray level of all pixels in the image according to the row and column directions based on the pixel gray level matrix to obtain the mean gray level distribution; The mean gray level distribution is obtained by summing the gray levels of all pixels in the pixel gray level matrix and then dividing by the total number of pixels in the image. It is used to characterize the overall brightness level of the image. Represented as: In the formula, The mean of the grayscale distribution. For the image located at the Line number The grayscale value of the column pixels, and These represent the number of rows and columns of the image, respectively. It should be noted that all pixels in the pixel grayscale matrix participate in the calculation, and no region cropping is performed.
[0020] S113, by performing a fast Fourier transform on the pixel grayscale matrix, the sum of squared amplitudes of each frequency component is extracted to obtain the mean energy value in the frequency domain; The average energy in the frequency domain is obtained by expanding the pixel gray-level matrix into a one-dimensional gray-level signal by rows and performing a fast Fourier transform to obtain the complex coefficients of each frequency component. The squares of the modulus of the complex coefficients are then summed and divided by the total number of frequency components. It should be noted that the Fast Fourier Transform is performed based on the system's built-in image frequency domain analysis program, and the total number of frequency components is equal to the total number of image pixels.
[0021] Specifically, the steps for calculating the ambiguity factor value are as follows: S114, normalization is performed on the mean of grayscale distribution and the mean of frequency domain energy respectively to obtain the normalized grayscale value and the normalized energy value; The grayscale normalized value is obtained by dividing the mean of the grayscale distribution by the set maximum grayscale reference value, and the energy normalized value is obtained by dividing the mean of the frequency domain energy by the set maximum energy reference value. It should be noted that the maximum reference value for grayscale and the maximum reference value for energy are obtained based on the statistics of historical image samples and are stored in the image sharpness parameter table. S115, perform a weighted calculation based on the grayscale normalized value and the energy normalized value to obtain the fusion sharpness score; Among them, the fusion sharpness score is obtained by multiplying the gray-level normalized value and the energy normalized value by the corresponding weight coefficients and then adding them together, which is used to comprehensively characterize the overall sharpness of the image. It should be noted that the grayscale weighting coefficient and energy weighting coefficient are obtained by performing fitting calculations on sample images with artificially labeled sharpness levels. S116, convert the fusion sharpness score into a fuzziness factor value based on a preset fuzziness conversion function; In one specific embodiment, the ambiguity conversion function adopts inverse mapping logic, which converts the fused sharpness score into a ambiguity factor value in an inverse proportional relationship, so that the clearer the image, the smaller the ambiguity factor value, and the more blurred the image, the larger the ambiguity factor value. Represented as: In the formula, To incorporate the sharpness score, To integrate the sharpness rating criteria values, This is the ambiguity factor value; It should be noted that: The average of the fused sharpness scores obtained from multiple sets of images with the same resolution in historical data when they are displayed most clearly is calculated.
[0022] Specifically, the steps for filtering images from the target viewpoint are as follows: S117, By comparing the blur factor value of each image with the preset blur threshold, images with blur factor values higher than the blur threshold are filtered out; In one specific embodiment, the fuzziness threshold is determined by statistical analysis of the fuzziness factor values of historical image samples that are manually calibrated as clear, and is used to exclude image samples with insufficient clarity. It should be noted that the value of the fuzziness threshold is stored in the image quality judgment parameter table and is called by the processing program during image sharpness filtering.
[0023] S118, sort the remaining images after filtering in ascending order of acquisition timestamp to generate a clear image candidate set; The acquisition timestamp is automatically written into the image metadata by the industrial camera when the image is captured. The images that pass the sharpness screening are combined into a sharp image candidate set by sorting them in ascending order by timestamp. It should be noted that the clock source for collecting timestamps is uniformly synchronized and calibrated during the system deployment phase.
[0024] S119, Based on the spatial viewpoint difference in the clear image candidate set, extract a subset of images covering the entire viewpoint range, and use the subset of images as the target viewpoint image; Spatial viewpoint difference is calculated based on the difference in installation angles of each industrial camera around the workstation, and is used to select the smallest image covering the full angular range from the set of clear image candidates; It should be noted that the installation angles of each industrial camera are measured and calibrated during the deployment phase and stored in the image acquisition parameter table for use in calculating spatial perspective differences.
[0025] The feature extraction module S12 is used to perform region boundary reconstruction and brightness suppression processing based on the high-reflection region in the target view image to generate a reflection compensation image; the reflection compensation image is input into the preset solder joint structure enhancement model to extract the gradient change region at the edge of the solder joint and generate a solder joint morphology change response map. Specifically, the steps for performing region boundary reconstruction and brightness suppression are as follows: S121, extract the boundary pixels of the highlight reflection region based on the brightness value distribution in the target view image; In one specific embodiment, the brightness value of each pixel is calculated in the brightness matrix of the target view image and compared with a preset brightness threshold. All pixels with brightness values greater than the threshold are marked as candidate pixels for highlights. Then, the pixels with the most drastic changes in brightness gradient are extracted from these candidate pixels as the boundary pixels of the highlight reflection area. It should be noted that the brightness matrix is obtained by mapping the grayscale matrix of the target view image to the brightness channels, and the brightness threshold is set based on the statistical highlight distribution of the calibration sample image. S122, Reconstruct the region boundary contour using spline interpolation based on the boundary pixels to generate boundary contour data; In one specific embodiment, the extracted boundary pixels are connected into a discrete point column according to their arrangement order in the image coordinate system, a continuous and smooth closed boundary curve is generated based on the cubic spline interpolation algorithm, and the coordinate sequence of the boundary curve in the image coordinate space is recorded as boundary contour data. It should be noted that the node order used in the interpolation process is determined by sorting the polar angles of the boundary pixels to avoid intersections or breaks in the boundary contours. S123, by implementing local brightness normalization and histogram cropping within the boundary contour, suppresses the overexposure of the highlight area and outputs the processed target view image as a reflection compensation image. In one specific embodiment, the brightness values of all pixels within the boundary contour are scaled to a preset local brightness reference range, and the high-frequency small intervals in the brightness histogram of the region are cropped. The brightness of pixels exceeding the set upper limit is forcibly truncated to the upper limit value, and the brightness-suppressed image is output as a reflection compensation image. It should be noted that the local brightness reference range and histogram cropping upper limit are obtained by statistically analyzing the brightness distribution of highlight areas in historical images.
[0026] Specifically, the steps for extracting gradient abrupt change regions at the solder joint edges are as follows: S124, Input the reflection compensation image into the preset solder joint structure enhancement model to obtain the feature map of the enhanced solder joint area; In one specific embodiment, the reflection compensation image is input into the trained convolutional neural network model in the form of a pixel matrix to obtain a feature map with significantly enhanced response at the edge position of the solder joint area. It should be noted that the solder joint structure enhancement model was trained using image samples with manually annotated solder joint edges before system deployment, and the model parameters remained fixed after deployment.
[0027] S125, Calculate the image gradient distribution and extract the gradient magnitude matrix based on the feature map of the solder joint area; In a specific embodiment, the gray-level difference of each pixel neighborhood is calculated in the horizontal and vertical directions of the feature map of the solder joint area and synthesized into a gradient vector. Then, the magnitude of the gradient vector is taken as the gradient magnitude, and the gradient magnitudes of all pixels are combined into a gradient magnitude matrix. It should be noted that the size of the gradient magnitude matrix is the same as that of the solder joint region feature map, and each matrix element corresponds one-to-one with a pixel in the feature map.
[0028] S126, by locating abrupt change points exceeding local thresholds in the gradient magnitude matrix and performing edge connectivity analysis, the gradient abrupt change region of the solder joint edge is obtained, and the gradient abrupt change region of the solder joint edge is converted into a solder joint morphology abrupt change response map; In a specific embodiment, pixels in the gradient magnitude matrix that are greater than a set local threshold are marked as candidate mutation points. Based on the four-neighbor connectivity, adjacent candidate mutation points are aggregated into edge connected regions, and the connected regions are mapped onto a binary mask image with the same size as the original image as the gradient mutation region of the solder joint edge. It should be noted that the local threshold is set statistically based on the gradient distribution of the solder joint edge region in the sample image, and the solder joint morphology change response map is generated by superimposing the mask image with the original image.
[0029] The anomaly scoring module S13 is used to construct a solder joint feature vector based on the gradient mutation width and edge closure degree extracted from the solder joint morphology mutation response map; and to perform multi-dimensional similarity matching between the solder joint feature vector and the training template feature vector to generate a solder joint anomaly score value. Specifically, the steps for constructing the solder joint feature vector are as follows: S131, Extract the contour length data of the edge closed region based on the solder joint morphology abrupt change response map; Specifically, in the response map of abrupt changes in solder joint morphology, the set of connected boundary pixels of closed edge regions is identified, and the sum of the Euclidean distances of the boundary pixels in each closed region in the image coordinate space is calculated. The result is used as the contour length data of the region. It should be noted that the identification of closed edge regions is achieved through eight-neighbor connectivity analysis, and the coordinates of the boundary pixel set are directly read from the pixel positions in the solder joint morphology change response map. S132, Calculate the gradient mutation width distribution data within the mutation region based on the solder joint morphology mutation response diagram; In a specific embodiment, the centerline pixel of the mutation region is first located in the solder joint morphology mutation response map. Then, the positions where the edge intensity decays to a set threshold are searched on both sides of the centerline in the vertical direction. The pixel spacing between the left and right edge positions is taken as the gradient mutation width at that position. The complete gradient mutation width distribution data is calculated for all centerline positions. It should be noted that the threshold is set based on the statistical setting of gradient intensity in abrupt change regions of the sample image; S133 combines the contour length data and gradient mutation width distribution data into a multidimensional feature matrix, and outputs the multidimensional feature matrix as a weld point feature vector. In a specific embodiment, the contour length data corresponding to each solder joint and the width values of all gradient abrupt changes in the corresponding region are arranged in a fixed order to form a two-dimensional feature matrix. The feature matrix is then expanded row by row into a one-dimensional feature vector and output as a solder joint feature vector. It should be noted that the fixed order is determined according to the spatial scanning order of the abrupt change regions in the image to ensure that the feature vector structure of different solder joints is consistent.
[0030] Specifically, the steps for generating solder joint anomaly scores using multidimensional similarity matching are as follows: S134, the feature matching similarity is obtained by performing cosine distance calculation on the feature vector of the solder joint and the feature vector of the training template; The solder joint feature vector and the training template feature vector are treated as high-dimensional vectors respectively. The cosine of the angle between the two is used as the feature matching similarity. The smaller the angle, the higher the similarity. It should be noted that the training template feature vector was constructed by manually annotating qualified solder joint image samples before the system was deployed.
[0031] S135, perform a weighted summation based on the feature matching similarity and the label weights of the training template to obtain the abnormal matching score; The anomaly matching score is obtained by multiplying the feature matching similarity by the label weight of the corresponding training template and then summing them. It should be noted that the label weights are statistically derived from the results of manual annotation of historical sample quality levels.
[0032] S136, Perform normalization processing based on the anomaly matching score and the score normalization coefficient of the training template to generate solder joint anomaly score values, and output the solder joint anomaly score values as quality judgment score data. In one specific embodiment, the abnormal matching score is divided by a preset scoring normalization coefficient, and the result is output as the solder joint abnormal score value and used as the input source for subsequent quality judgment scoring data. It should be noted that the score normalization coefficient is determined by the sum of the weights of all labels in the training template set, and is used to unify the score range under different numbers of templates.
[0033] The defect judgment module S14 is used to construct a solder joint time sequence quality record based on the solder joint abnormality score value and the image acquisition timestamp; to determine whether the current solder joint abnormality score value exceeds the dynamic defect judgment threshold; if so, the current capacitor solder joint is marked as a cold solder joint defect. Specifically, the steps for constructing solder joint timing quality records are as follows: S141, by combining the image acquisition timestamp and the solder joint anomaly score value to construct a time score pair, and combine all time score pairs in the order of timestamps to form a solder joint quality score sequence; In one specific embodiment, the image acquisition timestamp of each target view image is combined with its corresponding solder joint anomaly score value to form a time score pair, and then all time score pairs are arranged in ascending order of timestamp to form a solder joint quality score sequence. It should be noted that the image acquisition timestamp is written to the image metadata by the industrial camera when image acquisition is triggered, in order to ensure the consistency of the time sequence.
[0034] S142, extract continuous abnormal scoring segments based on the solder joint quality scoring sequence and mark the segment range, and combine the solder joint quality scoring sequence and abnormal scoring segments into a solder joint time series quality record; In a specific embodiment, the solder joint quality scoring sequence is searched for segments in which the abnormal score values of solder joints in multiple consecutive frames are higher than the initial threshold for abnormality. The start and end positions of these consecutive segments are marked as the segment ranges, and the solder joint quality scoring sequence and the marked abnormal score segments are combined into a solder joint timing quality record. It should be noted that the initial threshold for anomaly judgment is set by analyzing the image scores of historical samples that have been confirmed to have poor welding defects, and is used to determine the initial screening boundary for segment extraction.
[0035] Specifically, the steps for identifying cold solder joint defects are as follows: S143, obtain the score ratio by comparing the current weld point abnormality score value with the dynamic defect judgment threshold; In one specific embodiment, the current solder joint anomaly score is divided by the dynamic defect judgment threshold to obtain the score ratio, which is used to characterize the degree of deviation of the current score from the threshold. The formula for calculating the rating ratio is as follows: In the formula, This is the scoring ratio. This is the current weld joint anomaly score. The threshold for dynamic defect judgment; The formula for calculating the dynamic defect judgment threshold is: in, The average score is the global score. For the first Each solder joint abnormality score value The global standard deviation of the score. These are preset dimensionless weighting factors. Global score mean The calculation formula is: Global rating standard deviation The calculation formula is: It should be noted that the dynamic defect judgment threshold is dynamically updated by the system during operation based on the global score distribution, in order to adapt to the overall quality differences between different batches of samples, and the weighting factors... Used to adjust the leniency of the dynamic defect judgment threshold relative to the global score distribution.
[0036] S144. Determine whether the dynamic defect judgment threshold is exceeded based on the score ratio. If the dynamic defect judgment threshold is exceeded, mark the current capacitor solder joint as a cold solder joint defect and write the cold solder joint defect marking result into the solder joint timing quality record. In a specific embodiment, when the score ratio is greater than 1, it is determined that the dynamic defect judgment threshold is exceeded, the current capacitor solder joint is marked as a cold solder defect, and the cold solder defect marking result, along with its corresponding image acquisition timestamp and solder joint abnormal score value, is written into the solder joint timing quality record. It should be noted that the results of the cold solder joint defect marking are used as input items for the subsequent production traceability system to record the final quality status of each solder joint.
[0037] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired or wireless network. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a hard disk or a solid-state drive.
[0038] In the several embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only one method, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0039] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0040] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0041] Some of the data in the above formula are calculated by removing dimensions and taking their numerical values. The formula is the closest to the real situation obtained by software simulation of a large amount of collected data. The preset parameters and preset thresholds in the formula are set by those skilled in the art according to the actual situation or obtained through simulation of a large amount of data.
[0042] The above embodiments are only used to illustrate the technical methods of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical methods of the present invention without departing from the spirit and scope of the technical methods of the present invention.
Claims
1. A machine vision-based online inspection system for capacitor welding quality, characterized in that, The system includes: The viewpoint filtering module S11 is used to acquire multi-view images at the capacitor welding station, and extract the mean gray level distribution and the mean frequency domain energy of each image; calculate the ambiguity factor value based on the mean gray level distribution and the mean frequency domain energy, and filter images with ambiguity factor values lower than the preset ambiguity threshold as target viewpoint images; The feature extraction module S12 is used to perform region boundary reconstruction and brightness suppression processing based on the high-reflection region in the target view image to generate a reflection compensation image; the reflection compensation image is input into the preset solder joint structure enhancement model to extract the gradient change region at the edge of the solder joint and generate a solder joint morphology change response map. The anomaly scoring module S13 is used to construct a solder joint feature vector based on the gradient mutation width and edge closure degree extracted from the solder joint morphology mutation response map; and to perform multi-dimensional similarity matching between the solder joint feature vector and the training template feature vector to generate a solder joint anomaly score value. The defect judgment module S14 is used to construct a solder joint time sequence quality record based on the solder joint abnormality score value and the image acquisition timestamp; it determines whether the current solder joint abnormality score value exceeds the dynamic defect judgment threshold, and if so, marks the current capacitor solder joint as a cold solder defect.
2. The online inspection system for capacitor welding quality based on machine vision according to claim 1, characterized in that, The steps for extracting the mean of grayscale distribution and the mean of frequency domain energy are as follows: S111, by performing grayscale preprocessing on multi-view images at the capacitor welding station, the pixel grayscale matrix of each image is obtained; S112, calculate the average gray level of all pixels in the image according to the row and column directions based on the pixel gray level matrix to obtain the mean gray level distribution; S113: By performing a fast Fourier transform on the pixel grayscale matrix, the sum of squared amplitudes of each frequency component is extracted to obtain the mean energy value in the frequency domain.
3. The online inspection system for capacitor welding quality based on machine vision according to claim 2, characterized in that, The steps for calculating the ambiguity factor value are as follows: S114, normalization is performed on the mean of grayscale distribution and the mean of frequency domain energy respectively to obtain the normalized grayscale value and the normalized energy value; S115, perform a weighted calculation based on the grayscale normalized value and the energy normalized value to obtain the fusion sharpness score; S116, convert the fusion sharpness score into a fuzziness factor value based on a preset fuzziness conversion function.
4. The online inspection system for capacitor welding quality based on machine vision according to claim 3, characterized in that, The steps for filtering images from the target viewpoint are as follows: S117, By comparing the blur factor value of each image with the preset blur threshold, images with blur factor values higher than the blur threshold are filtered out; S118, sort the remaining images after filtering in ascending order of acquisition timestamp to generate a clear image candidate set; S119, based on the spatial viewpoint difference in the clear image candidate set, extract a subset of images covering the entire viewpoint range, and use the subset of images as the target viewpoint image.
5. The online inspection system for capacitor welding quality based on machine vision according to claim 4, characterized in that, The steps for performing region boundary reconstruction and brightness suppression are as follows: S121, extract the boundary pixels of the highlight reflection region based on the brightness value distribution in the target view image; S122, Reconstruct the region boundary contour using spline interpolation based on the boundary pixels to generate boundary contour data; S123 suppresses overexposure in highlight areas by performing local brightness normalization and histogram cropping within the boundary contour, and outputs the processed target view image as a reflection compensation image.
6. The online inspection system for capacitor welding quality based on machine vision according to claim 5, characterized in that, The steps for extracting gradient abrupt change regions at the solder joint edges are as follows: S124, Input the reflection compensation image into the preset solder joint structure enhancement model to obtain the feature map of the enhanced solder joint area; S125, Calculate the image gradient distribution and extract the gradient magnitude matrix based on the feature map of the solder joint area; S126. By locating abrupt change points exceeding the local threshold in the gradient magnitude matrix and performing edge connectivity analysis, the gradient abrupt change region at the solder joint edge is obtained, and the gradient abrupt change region at the solder joint edge is converted into a solder joint morphology abrupt change response map.
7. The online inspection system for capacitor welding quality based on machine vision according to claim 6, characterized in that, The steps for constructing the solder joint feature vector are as follows: S131, Extract the contour length data of the edge closed region based on the solder joint morphology abrupt change response map; S132, Calculate the gradient mutation width distribution data within the mutation region based on the solder joint morphology mutation response diagram; S133 combines the contour length data and gradient mutation width distribution data into a multidimensional feature matrix, and outputs the multidimensional feature matrix as a weld point feature vector.
8. The online inspection system for capacitor welding quality based on machine vision according to claim 7, characterized in that, The steps for generating solder joint anomaly scores by performing multidimensional similarity matching are as follows: S134, the feature matching similarity is obtained by performing cosine distance calculation on the feature vector of the solder joint and the feature vector of the training template; S135, perform a weighted summation based on the feature matching similarity and the label weights of the training template to obtain the abnormal matching score; S136, perform normalization processing based on the anomaly matching score and the score normalization coefficient of the training template to generate solder joint anomaly score values, and output the solder joint anomaly score values as quality judgment score data.
9. The online inspection system for capacitor welding quality based on machine vision according to claim 8, characterized in that, The steps for constructing a solder joint timing quality record are as follows: S141, by combining the image acquisition timestamp and the solder joint anomaly score value to construct a time score pair, and combine all time score pairs in the order of timestamps to form a solder joint quality score sequence; S142, extract continuous abnormal scoring segments based on the solder joint quality scoring sequence and mark the segment range, and combine the solder joint quality scoring sequence and abnormal scoring segments into a solder joint time series quality record.
10. The online inspection system for capacitor welding quality based on machine vision according to claim 9, characterized in that, The steps to determine a cold solder joint defect are as follows: S143, obtain the score ratio by comparing the current weld point abnormality score value with the dynamic defect judgment threshold; S144. Determine whether the dynamic defect judgment threshold is exceeded based on the score ratio. If the dynamic defect judgment threshold is exceeded, mark the current capacitor solder joint as a cold solder joint defect and write the cold solder joint defect marking result into the solder joint timing quality record.