Method for detecting abnormal defects of terminal welding
By employing multi-source image acquisition and processing technology, the problem of light and dust interference in terminal welding defect detection has been solved, achieving high-precision defect identification.
Patent Information
- Application Number
- CN202511546126.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-28
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2045-10-28
AI Technical Summary
Traditional methods for detecting terminal welding defects are easily affected by light and dust, resulting in insufficient detection accuracy.
By employing a multi-source image acquisition module combined with photometric stereo algorithm, enhanced kernel function filtering, Fourier transform, HSV color space conversion, and image fusion technology, defect features of terminal welding parts are extracted through multi-angle image acquisition and processing.
It effectively reduces interference from light and dust, improves the accuracy of terminal welding defect detection, and accurately identifies minute defects.
Smart Images

Figure CN121033022B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image data processing, and in particular to a terminal welding abnormal defect detection method. BACKGROUND
[0002] A terminal, also known as a terminal, is an important connecting component widely used in electronic and electrical equipment. The main function of the terminal is to provide a connection point for the circuit, so that the wire or cable can be connected or disconnected through the point, and at the same time, additional protection can be provided for the circuit connection to prevent the line from falling off or loosening, thereby improving the stability and durability of the equipment and ensuring the normal operation of various electronic and electrical equipment. The terminal not only increases the stability of the electrical signal and current transmission, but also makes the connection and fixation of the circuit between different devices more convenient and fast, reducing the workload required for the installation and maintenance of electronic equipment. In recent years, with the rapid development of China's electronic and electrical industry, the popularization of electronic products and the rapid increase in the complexity of electrical equipment, the market demand for terminals has also been increasing, resulting in a large number of terminals of various types and functions, and the performance and quality requirements for terminals are also increasing.
[0003] At present, the Chinese invention patent with application number CN202310993735.8 discloses a method for detecting defects in the production of electrical terminals. The detection method includes: collecting the surface image of the electrical terminal to be detected, and determining whether the collected surface image contains a suspicious connected domain; if the collected surface image contains a suspicious connected domain, calculating a first trust factor according to the gray level distribution characteristics of the pixel points in the suspicious connected domain; calculating a second trust factor according to the texture characteristics of the pixel points in the suspicious connected domain; determining the trust degree of the suspicious connected domain based on the first trust factor and the second trust factor; and determining whether the electrical terminal to be detected has defects based on the trust degree of the suspicious connected domain. The method of the application analyzes and calculates the distribution of the gray level in the region and the texture characteristics, realizes the detection and identification of defects. However, due to the characteristics of a large number of types and different shapes of terminals, the application mainly detects the terminal recess problem, so the application scope is limited. In addition, in specific applications, defects in the welding position of the terminal are the most common problem affecting the quality of the terminal, and the types of abnormal defects in the terminal welding include craters, welding bumps, undercut, deformation and cracks. Since the size and specifications of most terminals are within a few centimeters, the corresponding welding abnormal defects are usually very small. Therefore, when using traditional methods to collect and detect images of terminals, errors may occur due to adverse effects such as light and dust, resulting in insufficient accuracy of defect detection. SUMMARY
[0004] The technical problem solved by the present application is that when using a traditional method to collect images and detect terminals, errors are prone to occur due to light, dust and other adverse effects, resulting in insufficient accuracy of defect detection.
[0005] To solve the above technical problems, the present application provides the following technical solutions.
[0006] An abnormal defect detection method for terminal welding, specifically comprising the following steps:
[0007] Step one: image acquisition of the welding part of the terminal to be detected by a multi-light source image acquisition module to obtain a single light source image and a uniform light source image;
[0008] Step two: calculating the reflectivity image of the single light source image by a photometric stereo algorithm, obtaining the reflection grayscale image by bilateral filtering and nonlinear transformation of the enhancement kernel function, obtaining the logarithmic amplitude-frequency characteristics by Fourier transform of the reflection grayscale image, obtaining the frequency domain interest map by mean filtering and difference calculation, obtaining the logic image by binary matrix sampling of the reflection grayscale image, obtaining the two-dimensional interest map by feature extraction of the conditional probability model, and obtaining the texture interest map by twice pixel point screening and maximum value suppression operation on the reflection grayscale image;
[0009] Step three: HSV color space conversion of the uniform light source image, filtering of the chroma channel, and color interest map calculation by norm distance model;
[0010] Step four: interest image fusion, threshold segmentation and defect labeling of the fused image, and completion of the surface defect recognition of the texture image.
[0011] As a preferred scheme of the abnormal defect detection method for terminal welding, the multi-light source image acquisition module for image acquisition of the welding part of the terminal to be detected specifically comprises:
[0012] Four identical bar-shaped high uniform LED lights, a CCD camera fixed vertically above the detection table, and the detection table, wherein the four bar-shaped high uniform LED lights are fixed equidistantly on a plane with the camera as the center, and form an included angle of 60 degrees with the camera in the horizontal direction respectively, the horizontal height, illumination intensity and vertical direction illumination incident angle of the four bar-shaped high uniform LED lights are the same, and the vertical direction illumination incident angle is 60 degrees. .
[0013] When the multi-light source image acquisition module obtains an image, four bar-shaped high-uniform LED lights are simultaneously turned on to acquire one uniform light source image, and one bar-shaped high-uniform LED light is sequentially turned on to acquire four single light source images. That is, five images, including one uniform light source image and four single light source images, are acquired for the welding part of each terminal to be detected. In addition, the CCD camera is fixed at a distance of ten to fifteen centimeters from the center of the detection table, and the near-distance irradiation and shooting can effectively reduce the total reflection caused by light irradiation, and effectively improve the accuracy of the Lambertian reflection model in subsequent image processing. Moreover, the terminal volume is usually small, and the near-distance shooting does not affect the image acquisition.
[0014] As a preferred scheme of the terminal welding abnormal defect detection method, a linear equation group is established by using the Lambertian reflection model, the reflectivity value of the pixel point is calculated by using the least square method, and a reflectivity image is obtained, and the calculation expression is as follows:
[0015] , ;
[0016]
[0017] wherein, represents the brightness of the pixel point in the i-th single light source image, represents the reflectivity, represents the unit directional vector of the i-th light source, the surface unit normal vector, represents the brightness matrix of the pixel point in the four single light source images, represents the matrix composed of the four light source unit directional vectors, and T represents the matrix transpose, represents the Euclidean norm.
[0018] As a preferred scheme of the terminal welding abnormal defect detection method, a bilateral filter with enhanced spatial kernel is used to denoise the reflectivity image, and a reflectivity gray scale image is obtained by performing nonlinear transformation on the denoised reflectivity image, and the calculation expression is as follows:
[0019]
[0020]
[0021] wherein, D represents an enhanced spatial domain kernel, represents a center pixel, represents a neighborhood pixel,
[0022] represents a normal standard deviation, represents a coordinate The pixel gray value of the image, represents reflectivity, c represents compensation coefficient, represents gray mapping index, e represents natural constant, represents norm distance.
[0023] As a preferred scheme of the terminal welding abnormal defect detection method, the image amplitude is obtained by performing Fourier transform on the reflected gray image, the natural logarithm of the image amplitude is taken, and then median filtering is performed, and the frequency domain interest map is calculated by difference calculation, and the calculation expression is:
[0024]
[0025] Wherein, represents the reflected gray image, represents the frequency domain interest map, represents Fourier transform, represents mean filtering, represents natural logarithm.
[0026] As a preferred scheme of the terminal welding abnormal defect detection method, the logical image is obtained by performing binary matrix sampling operation on the reflected gray image, the feature is extracted by conditional probability model, and the two-dimensional interest map is obtained, and the calculation expression is:
[0027]
[0028] Wherein, represents the two-dimensional interest map, represents the logical image, represents feature prominence, represents the distribution probability of the logical image under the condition of input reflected gray image, represents integral operation, d represents differential symbol.
[0029] As a preferred scheme of the terminal welding abnormal defect detection method, the candidate feature points are obtained by performing primary screening on the reflected gray image pixel points, the selected feature points are obtained by secondary screening, the texture interest map is obtained by non-maximum suppression on the selected feature points, and the specific steps include:
[0030] The to-be-detected pixel points are subjected to primary screening, the to-be-detected pixel points are taken as the center, a circle with a pixel point length as the radius is made, eight pixel points on the circle are selected, and difference operation is performed on the to-be-detected pixel points to obtain eight gray difference values, and the absolute values of the eight gray difference values are compared with the threshold value respectively, when there are three or more gray difference values whose absolute values are greater than or equal to the threshold value When the absolute value of the gray scale difference value is greater than or equal to a threshold value, the pixel point is determined as a candidate feature point.
[0031] The candidate feature point is subjected to secondary screening, a circle is drawn with the candidate feature point as the center and a three-pixel length as the radius, sixteen pixel points on the circumference are selected, and difference operation is performed on the sixteen pixel points and the candidate feature point to obtain sixteen gray scale difference values. When the absolute value of the gray scale difference value is greater than or equal to a threshold value, the pixel point is determined as a candidate feature point.
[0032] The candidate feature point is subjected to secondary screening, a circle is drawn with the candidate feature point as the center and a three-pixel length as the radius, sixteen pixel points on the circumference are selected, and difference operation is performed on the sixteen pixel points and the candidate feature point to obtain sixteen gray scale difference values.
[0033] As a preferred scheme of the terminal welding abnormal defect detection method, the uniform light source image is subjected to HSV color space conversion, the chroma channel is subjected to Gaussian filtering, and a color interest map is obtained through a norm distance model, and the calculation expression is:
[0034]
[0035] wherein, represents the chroma feature, represents the average chroma, represents the scaling weight, represents the chroma value of the pixel point with coordinates represents the Gaussian filtering, represents the Euclidean norm.
[0036] As a preferred scheme of the terminal welding abnormal defect detection method, the uniform light source image is subjected to HSV color space conversion, the chroma channel is subjected to Gaussian filtering, and a color interest map is obtained through a norm distance model, and the calculation expression is:
[0037]
[0038] wherein, represents the defect feature map, represents the frequency domain interest map, represents the two-dimensional interest map, represents the texture interest map, represents the reflectivity image, represents the color interest map. represents a normalization function, represents a weight parameter, represents a matrix element multiplication operation, represents a matrix element addition operation.
[0039] As a preferred scheme of the terminal welding abnormal defect detection method, the threshold segmentation is performed on the defect feature map to obtain a binary image, the defect pixel points are marked by a connected domain marking method to obtain an output defect image, an empty stack is created for the connected domain marking and a counter for marking the connected domain is set. Starting from the top left corner of the image, each pixel point is scanned in the order from left to right and from top to bottom. When an unmarked pixel point is scanned, its coordinates are pressed into the stack, and a unique mark is assigned to the connected domain in the data structure. The connected domain marking is performed, a pixel point coordinate is taken out from the stack and the pixel points in the 4-neighborhood of the pixel point are checked. If the neighborhood pixel point has the same value as the pixel point and is not marked, the coordinates of the neighborhood pixel point are pressed into the stack, and the neighborhood pixel point is marked as the same connected domain as the current pixel in the data structure. The pixel points that have been marked are skipped in the scanning process to avoid repeated marking. The above process is repeated until the stack is empty. The remaining part of the image is continuously scanned, and the above steps are repeated for the unmarked pixel points, and finally the defect marking is completed and the image is output. The threshold segmentation calculation expression is:
[0040]
[0041] wherein, represents the gray value of the pixel point with coordinates in the output defect image, represents the gray value of the pixel point with coordinates in the binary image, represents the segmentation threshold.
[0042] The beneficial effects of the present application are as follows: the multi-angle images of the terminal welding part are obtained by the multi-light source image acquisition module, which is beneficial to reduce the light errors, such as excessive reflection and excessive shadow interference, which are prone to occur in the traditional image acquisition method. Meanwhile, considering that the three-dimensional structure of the terminal welding point has the characteristics of non-uniformity and irregularity, the reflectivity map is obtained by the partial selection photometric stereo algorithm, avoiding the three-dimensional reconstruction operation in the complete photometric stereo algorithm, that is, the multi-angle light source image information is fully utilized, and the calculation complexity is effectively reduced. The reflectivity image is denoised by the bilateral filtering of the enhanced spatial kernel function, which is beneficial to subsequent image analysis and processing. The frequency domain interest map, the two-dimensional interest map, the texture interest map and the color interest map are obtained by defect feature extraction from different angles, the texture interest map effectively highlights all possible defect parts in the reflection gray scale map, the two-dimensional interest map effectively identifies the micro-defects, and the frequency domain interest map effectively distinguishes the interference of defects and dust stains. The frequency domain interest map, the two-dimensional interest map and the texture interest map are obtained by processing the reflectivity map, and the color interest map obtained by processing the uniform light source image is beneficial to supplement the defect features from the image chroma angle. Through the image acquisition and processing method of the present application, the errors caused by light and dust and other adverse factors can be overcome, and the detection accuracy of the abnormal defects of the terminal welding is effectively improved. BRIEF DESCRIPTION OF DRAWINGS
[0043] Figure 1 The basic framework schematic diagram provided for an embodiment of the present application is shown in the figure.
[0044] Figure 2 The flowchart provided for an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0045] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application will be described in detail below with reference to the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments.
[0046] Embodiment 1, refer to Figure 1 and Figure 2 An abnormal defect detection method for terminal welding is provided for an embodiment of the present application, which comprises:
[0047] Step one: image acquisition of the welding part of the terminal to be detected is carried out by a multi-light source image acquisition module, and single light source images and uniform light source images are obtained;
[0048] Step two: calculate the reflectivity image by the photometric stereo algorithm on the single light source image, get the reflectance gray image by the bilateral filtering and nonlinear transformation of the enhanced kernel function, get the logarithmic amplitude-frequency characteristics by Fourier transform on the reflectance gray image, get the frequency domain interest map by mean filtering and difference calculation, get the logic image by binary matrix sampling on the reflectance gray image, get the two-dimensional interest map by feature extraction through the conditional probability model, select the feature pixel points by twice pixel point screening and maximum value suppression operation on the reflectance gray image, and get the texture interest map;
[0049] Step three: perform HSV color space conversion on the uniform light source image, filter the chroma channel, and calculate the color interest map by the norm distance model;
[0050] Step four: get the defect feature map by weighted fusion of the obtained interest maps, perform threshold segmentation on the defect feature map and mark the defects, and complete the identification of the terminal welding defects.
[0051] In the embodiment, the welding part of the terminal to be detected is imaged by the multi-light source image acquisition module, and the multi-light source image acquisition module specifically comprises:
[0052] four same bar-shaped high uniform LED lights, a CCD camera fixed vertically above the detection table, and the detection table;
[0053] Among them, the four bar-shaped high uniform LED lights are fixed on the plane with the camera as the center and form horizontal direction included angles of 90° with the camera respectively, the illumination intensity, horizontal height and vertical incident angle of the four bar-shaped high uniform LED lights are the same, and the vertical incident angle is selected to achieve the best lighting effect;
[0054] The welding part image of each terminal to be detected is obtained by the multi-light source image acquisition module, and four bar-shaped high uniform LED lights are turned on at the same time to acquire one uniform light source image, and one bar-shaped high uniform LED light is turned on in turn to acquire four single light source images. In addition, the CCD camera is fixed at a distance of ten to fifteen centimeters from the center of the detection table, and the total reflection caused by the close-range irradiation and shooting can effectively improve the accuracy of the Lambertian reflection model in the subsequent image processing. And the volume of the terminal is usually small, and the close-range shooting does not affect the image acquisition.
[0055] The multi-light source image acquisition module can irradiate the terminal to be detected from four angles, and the single light source irradiation can highlight the small defects that are difficult to identify under uniform illumination through the shadow, but at the same time, it can also increase the probability of misidentification due to the shadow. By sequentially illuminating from multiple angles through multiple light sources, small abnormal defects can be fully detected and misidentification can be reduced.
[0056] In this embodiment, a system of linear equations is established using the Lambert reflection model, and the reflectance value of each pixel is calculated using the least squares method to obtain a reflectance image. The calculation expression is as follows:
[0057] , ;
[0058]
[0059] in, This represents the brightness of a pixel in the i-th single-light source image. Indicates reflectivity, Let represent the unit direction vector of the i-th light source. Surface unit normal vector This represents the brightness matrix of pixels in four single-light source images. This represents a matrix consisting of the unit direction vectors of the four light sources, and T represents the matrix transpose. This indicates taking the Euclidean norm.
[0060] The reflectance map is obtained by partially selecting the photometric stereo algorithm, thus avoiding the three-dimensional reconstruction operation in the complete photometric stereo algorithm. This fully utilizes the image information from multiple light sources and effectively reduces the computational complexity.
[0061] In this embodiment, the reflectance image is denoised by bilateral filtering with enhanced spatial kernel function, and the denoised reflectance image is then subjected to nonlinear transformation to obtain a reflectance grayscale image, the calculation expression of which is:
[0062]
[0063]
[0064] Where D represents the enhanced spatial domain kernel, Indicates the center pixel, Represents neighboring pixels,
[0065] This represents the standard deviation of the normal distribution. Indicates coordinates as The pixel grayscale value, c represents reflectivity, and c represents the compensation coefficient. The index represents the grayscale mapping exponent, and e represents the natural constant. This represents the normal distance.
[0066] In this embodiment, the image amplitude is obtained by performing a Fourier transform on the reflection grayscale image, and then the natural logarithm of the image amplitude is taken followed by median filtering. The frequency domain interest map is obtained by calculating the difference, and its calculation expression is as follows:
[0067]
[0068] wherein, represents a reflected gray scale image, represents a frequency domain interest map, represents a Fourier transform, represents a mean filter, represents a natural logarithm. The target defects and dust stains are effectively distinguished by the frequency domain features.
[0069] In the embodiment, a logical image is obtained by performing a binary matrix sampling operation on the reflected gray scale image, and a two-dimensional interest map is obtained by performing feature extraction by a conditional probability model, and a calculation expression thereof is:
[0070]
[0071] wherein, represents a two-dimensional interest map, represents a logical image, represents a feature saliency, represents a distribution probability of the logical image under the condition of the input reflected gray scale image, and is beneficial to the identification of the micro defects.
[0072] In the embodiment, candidate feature points are obtained by performing a primary screening on the reflected gray scale image pixels, and selected feature points are obtained by performing a secondary screening, and a texture interest map is obtained by performing a non-maximum suppression on the selected feature points, and the specific steps include:
[0073] The to-be-detected pixel point is subjected to a primary screening, a circle is made with the to-be-detected pixel point as the center and a one-pixel-length radius, eight pixel points on the circumference are selected, and difference operations are performed on the to-be-detected pixel point to obtain eight gray scale difference values, and the absolute values of the eight gray scale difference values are compared with a threshold value When there are three or more gray scale difference values whose absolute values are greater than or equal to the threshold value , it is determined that the to-be-detected pixel point is a candidate feature point.
[0074] The to-be-detected pixel point is subjected to a secondary screening, a circle is made with the candidate feature point as the center and a three-pixel-length radius, sixteen pixel points on the circumference are selected, and difference operations are performed on the candidate feature point to obtain sixteen gray scale difference values, and when there are eight or more continuous gray scale difference values whose absolute values are greater than or equal to a threshold value , it is determined that the candidate feature point is a selected feature point.
[0075] The winning feature points are subjected to non-maximum suppression, and the sixteen gray scale difference values obtained by the winning feature points in the corresponding secondary screening are subjected to absolute value operation, and the influence coefficient is obtained by accumulation. The other winning feature points on the circumference are selected and compared with the winning feature point at the center of the circle one by one, and when the influence coefficient of the winning feature point at the center of the circle is the largest, it is reserved. All pixel points are traversed to obtain the texture interest map. The image size of the terminal welding part is usually small, and the secondary screening is beneficial to efficiently detect all possible defect parts in the image.
[0076] In the embodiment, the uniform light source image is subjected to HSV color space conversion, the chroma channel is subjected to Gaussian filtering, and the color interest map is obtained by norm distance model, and the calculation expression is:
[0077]
[0078] Among them, represents the chroma feature, represents the average chroma, represents the scaling weight, represents the chroma value of the pixel point with coordinates , represents Gaussian filtering, represents the Euclidean norm. The reflectance image is calculated based on the brightness of the reflected light, and the color interest map is beneficial to supplement the defect recognition from the chroma angle of the image.
[0079] In the embodiment, the frequency domain interest map, the two-dimensional interest map, the texture interest map and the color interest map are subjected to image weighted fusion to obtain the defect feature map, and the calculation expression is:
[0080]
[0081] Among them, represents the defect feature map, represents the frequency domain interest map, represents the two-dimensional interest map, represents the texture interest map, represents the reflectance image, represents the color interest map, represents the normalization function, represents the weight parameter, represents the matrix element multiplication operation, represents the matrix element addition operation.
[0082] In this embodiment, the defect feature map is threshold segmented to obtain a binary image, and the defect pixel points are labeled to obtain an output defect image by a connected domain labeling method. An empty stack is created for the connected domain labeling, and a counter for labeling the connected domain is set. Starting from the top left corner of the image, each pixel point is scanned in the order from left to right and from top to bottom. When an unmarked pixel point is scanned, its coordinates are pressed into the stack, and a unique label is assigned to the connected domain in the data structure. The connected domain labeling is performed, a pixel point coordinate is taken out from the stack, and the pixel points in the 4-neighborhood of the pixel point are checked. If the neighborhood pixel point has the same value as the pixel point and is not marked, the coordinates of the neighborhood pixel point are pressed into the stack, and the neighborhood pixel point is labeled as the same connected domain as the current pixel in the data structure. In the scanning process, the marked pixel is skipped to avoid repeated labeling. The above process is repeated until the stack is empty. The remaining part of the image is continuously scanned, and the above steps are repeated for the unmarked pixels to finally complete the defect labeling and output the image. The threshold segmentation calculation expression is:
[0083]
[0084] wherein, represents the gray value of the pixel point with coordinates in the output defect image, represents the gray value of the pixel point with coordinates in the binary image, represents the segmentation threshold.
[0085] In this embodiment, the multi-angle images of the terminal welding part are obtained by the multi-light source image acquisition module, which is beneficial to reduce the light errors easily generated by the traditional image acquisition method, such as excessive reflection and excessive shadow interference. At the same time, considering that the three-dimensional structure of the terminal welding point has the characteristics of non-uniformity and irregularity, the reflectivity map is obtained by partially selecting the photometric stereo algorithm to avoid the three-dimensional reconstruction operation in the complete photometric stereo algorithm, that is, the multi-angle light source image information is fully utilized, and the calculation complexity is effectively reduced. The reflectivity image is denoised by the bilateral filtering of the enhanced spatial kernel function, which is beneficial to the subsequent image analysis and processing. The frequency domain interest map, the two-dimensional interest map, the texture interest map and the color interest map are obtained by defect feature extraction from different angles, the texture interest map effectively highlights all possible defect parts in the reflection gray map, the two-dimensional interest map effectively identifies the micro defects, and the frequency domain interest map effectively distinguishes the interference of the defects and the dust stains. The frequency domain interest map, the two-dimensional interest map and the texture interest map are obtained by processing the reflectivity map, and the color interest map obtained by processing the uniform light source image is beneficial to supplement the defect features from the image chroma angle. By the image acquisition and processing method of the present application, the errors caused by light and dust and other adverse factors can be overcome, and the detection accuracy of the terminal welding abnormal defects is effectively improved.
[0086] Those skilled in the art will appreciate that embodiments of the present application can be readily used as a method, a system or a computer program product. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product on one or more computer-usable storage media (or computer- readable storage media) having computer-usable program code embodied in the medium. The medium may Figure 1 of the functions specified in the flow or flows and / or blocks. Figure 1 of the functions specified in the flow or flows and / or blocks.
[0087] It should be noted that the above-mentioned embodiments are only used to illustrate but not to limit the technical solutions of the present application. Although the present application is described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or equivalent replaced without departing from the spirit and scope of the technical solutions of the present application, which should be covered in the scope of the claims of the present application.
Claims
1. A method of detecting abnormal defects of terminal welding, characterized by, The method comprises the following steps: Step 1: image acquisition of the welding part of the terminal to be detected by a multi-light source image acquisition module to obtain a single light source image and a uniform light source image; Step 2: calculation of the reflectivity image of the single light source image by a photometric stereo algorithm, the reflection gray scale image obtained by bilateral filtering of the enhanced kernel function and nonlinear transformation, the logarithmic amplitude-frequency characteristics obtained by Fourier transform of the reflection gray scale image, the frequency domain interest map obtained by mean filtering and difference calculation, the logic image obtained by binary matrix sampling of the reflection gray scale image, the two-dimensional interest map obtained by feature extraction by the conditional probability model, and the texture interest map obtained by selecting the feature pixel points by twice pixel point screening and maximum value suppression of the reflection gray scale image; Step 3: HSV color space conversion of the uniform light source image, filtering of the chroma channel, and calculation of the color interest map by the norm distance model; Step 4: weighted fusion of the frequency domain interest map, the two-dimensional interest map, the texture interest map and the color interest map to obtain a defect feature map, threshold segmentation and defect marking of the defect feature map to complete the identification of the terminal welding defects; Four identical bar-shaped high-uniform LED lights, a CCD camera fixed vertically above the detection table and the detection table; ; wherein, represents a reflected gray scale map, represents a frequency domain interest map, represents a Fourier transform, represents a mean filter, represents a natural logarithm; Image acquisition of the welding part of the terminal to be detected by the multi-light source image acquisition module, which specifically comprises: ; wherein, represents a two-dimensional interest map, represents a logical image, represents a feature saliency, represents a distribution probability of a logical image under an input reflection grayscale map condition, represents an integral operation, d represents a differential symbol; Four identical bar-shaped high-uniform LED lights, a CCD camera fixed vertically above the detection table and the detection table; ; wherein, denotes a chroma feature, denotes an average chroma, denotes a scaling weight, denotes a pixel point chroma value with coordinates , denotes a Gaussian filter, denotes taking the Euclidean norm.
2. The method of claim 1, wherein: Image acquisition of the welding part of the terminal to be detected by the multi-light source image acquisition module, which specifically comprises: Four identical bar-shaped high-uniform LED lights, a CCD camera fixed vertically above the detection table and the detection table; Four bar-shaped high-uniform LED lamps are fixed on a plane with a CCD camera as a center and form horizontal angles with the CCD camera The light intensity, horizontal height and vertical incident angle of the four bar-shaped high-uniform LED lamps are the same. Bilateral filtering of the enhanced spatial kernel function for noise reduction of the reflectivity image, nonlinear transformation of the denoised reflectivity image to obtain the reflection gray scale image, candidate feature points obtained by primary screening of the reflection gray scale image, selected feature points obtained by secondary screening, and the texture interest map obtained by non-maximum suppression of the selected feature points, comprising the following steps:
3. The method of claim 1, wherein: A linear equation set is established by Lambert reflection model, and the reflectivity value of the pixel point is calculated by least square method to obtain the reflectivity image, and the calculation expression is: , ; ; wherein, represents the brightness of the pixel point in the i-th single light source image, represents the reflectivity, represents the unit directional vector of the i-th light source, surface unit normal vector, represents the brightness matrix of the pixel points in the single light source image, represents the matrix composed of the unit directional vectors of the four light sources, T represents the matrix transposition operation, represents the Euclidean norm.
4. The method of claim 1, wherein: Non-maximum suppression of the selected feature points, absolute value operation of the sixteen gray scale difference values obtained by the selected feature points in the corresponding secondary screening, accumulation to obtain the influence coefficient, selection of other selected feature points on the circumference with the selected feature point at the center as the center and three pixel points as the radius, comparison of the influence coefficients of the selected feature points at the center and the selected feature points on the circumference one by one, and retention when the influence coefficient of the selected feature point at the center is the largest to obtain the texture interest map. ; ; Where D represents the enhanced spatial domain kernel, Indicates the center pixel, Represents neighboring pixels, This represents the standard deviation of the normal distribution. Indicates coordinates as The pixel grayscale value, c represents reflectivity, and c represents the compensation coefficient. The index represents the grayscale mapping exponent, and e represents the natural constant. This represents the normal distance.
5. The method of claim 1, wherein: the terminal weld is a spot weld; and the abnormality is a lack of fusion. The to-be-detected pixel point is subjected to primary screening, a circle is made with the to-be-detected pixel point as the center and a pixel length as the radius, eight pixel points on the circumference are selected, difference operations are respectively performed on the to-be-detected pixel point and the eight pixel points to obtain eight gray difference values, and absolute values of the eight gray difference values are respectively compared with a threshold value When there are three or more gray difference values whose absolute values are greater than or equal to the threshold value , it is judged that the to-be-detected pixel point is a candidate feature point. The pixel point to be detected is subjected to secondary screening, a circle is made with the candidate feature point as the center and three-pixel length as the radius, sixteen pixel points on the circumference are selected to respectively perform difference operation with the candidate feature point to obtain sixteen gray scale difference values, and when there are eight or more continuous gray scale difference values whose absolute values are greater than or equal to a threshold value , the candidate feature point is judged as a selected feature point. 6. The method of claim 1, wherein: The frequency domain interest map, the two-dimensional interest map, the texture interest map and the color interest map are image weighted fused to obtain a defect feature map, and a calculation expression is as follows: ; wherein, represents a defect feature map, represents a frequency domain interest map, represents a two-dimensional interest map, represents a texture interest map, represents a reflectance image, represents a color interest map, represents a normalization function, represents a weight parameter, represents a matrix element multiplication operation, represents a matrix element addition operation.
7. The method of claim 1, wherein the method further comprises: determining a threshold value for the defect feature map; and segmenting the defect feature map using the threshold value to obtain a binary image. The defect feature map is threshold segmented to obtain a binary image, and the pixel points in the binary image are marked by a connected domain marking method to obtain an output defect image, and a calculation expression is as follows: ; wherein, represents the gray value of the pixel point with coordinates in the output defect image, represents the gray value of the pixel point with coordinates in the binarized image, represents the segmentation threshold.
Citation Information
Patent Citations
A method for detecting manufacturing defects in electrical terminals
CN116758056B
Metal surface defect detection method and system based on multi-angle image exposure fusion
CN117115610A
Chip surface defect detection system and method based on photometric stereoscopic vision
CN118483237A