Weldment welding seam automatic detection method and device based on machine vision

By constructing a standardized image feature dataset and a multi-dimensional fusion evaluation index system, the problems of incorrect extraction of weld contour and blurred defect boundaries in existing weld detection methods are solved, and efficient and reliable automatic detection of weld areas is achieved.

CN121120603APending Publication Date: 2025-12-12WUXI TIENENG PRECISION MASCH CO LTD

Patent Information

Application Number
CN202511349525.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-22
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

Existing weld inspection methods are weak in identifying uneven lighting, strong surface reflection, and heat-affected zones, leading to incorrect weld contour extraction, blurred defect boundaries, and a tendency for false detections and missed detections. They also lack integrated modeling of weld center axis symmetry, boundary continuity, and heat-affected zone structural consistency.

Method used

By constructing a standardized image feature dataset, combining edge intensity distribution and contour coherence to evaluate the clarity of weld area boundaries, dynamically adjusting the main contour extraction range, and performing anomaly focusing feature analysis on candidate areas, a multi-dimensional fusion evaluation index system is constructed to verify the structural consistency and morphological stability of suspected defect areas.

Benefits of technology

It enhances the reliability of detection results, reduces the false detection rate, improves the ability to identify the contours of heat-affected zones and high-reflectivity areas, enhances the sensitivity to identify minute defects, and realizes the fully automated processing of welding defects from discovery to confirmation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121120603A_ABST
    Figure CN121120603A_ABST
Patent Text Reader

Abstract

The invention discloses a weldment welding seam automatic detection method and device based on machine vision, and relates to the technical field of machine vision intelligent detection. The weldment welding seam automatic detection method and device based on machine vision comprises the steps that S1, surface images and forming feature data of a weldment are collected and preprocessed to construct a standardized image feature data set; s2, the boundary clearness of the weld joint is evaluated by combining the edge strength and the contour coherence, and the main contour extraction range is dynamically adjusted; s3, analyzing abnormal focusing characteristics of the candidate area, and adjusting a defect labeling range and a detection priority; and S4, integrating the boundary definition and the abnormal focusing features, analyzing the structure abnormality, and dynamically controlling and verifying a resource allocation strategy. The problems that in the weldment detection process, obvious light reflection and texture blurring phenomena exist in a heat affected area at a weld joint, a traditional image enhancement and edge extraction algorithm is difficult to stably recognize microdefects, and the credibility of a detection result is reduced are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision intelligent inspection technology, specifically to an automatic inspection method and device for weld seams of welded parts based on machine vision. Background Technology

[0002] With the continuous improvement of intelligent manufacturing and quality control, welding quality inspection technology is gradually evolving from manual visual inspection to automatic recognition methods based on machine vision. Current mainstream weld inspection solutions mostly rely on industrial cameras to acquire images of the weldment surface, combining edge extraction, grayscale distribution analysis, and region segmentation algorithms to identify and locate the weld's geometric shape, continuity, and surface defects. In scenarios with simple structures, clear backgrounds, and regular weld morphology, this type of method can achieve relatively stable defect detection results and is widely used in automated welding production lines and quality re-inspection processes.

[0003] For example, the invention patent with announcement number CN113034452B discloses a method for detecting the contour of a weldment, including the following steps: 1. Image enhancement preprocessing, 2. Image histogram equalization processing, 3. Image denoising, 4. Image background interference removal, and 5. Image edge improvement. This invention uses image enhancement to preprocess the weldment image, improving the accuracy of edge detection; it introduces histogram equalization to improve the dynamic range of gray levels, increasing image contrast and making the image clearer; it uses median filtering technology for image denoising, which is simple to operate and easy to implement, filtering out isolated noise points while preserving the image's edge information; and it uses probabilistic Hough transform to determine and connect broken pixels at image edges, requiring less computation, being highly practical, and efficient.

[0004] For example, the invention patent with announcement number CN109934819B discloses a method for sub-pixel detection of curved edges in images of laser-welded workpieces, belonging to the field of visual inspection. First, the image of the workpiece is Gaussian filtered, and the Sobel operator is applied to find pixel-level edge points. A coordinate system is established with the center of each pixel-level edge point as the origin. A curve is fitted using the pixel-level edge point and four adjacent pixel-level edge points, and the fitted curve is translated along the y-axis. Then, pixels within a 5x5 range are selected centered on the pixel-level edge point. After translation, the curve divides the pixels within the 5x5 range into two regions with the same grayscale value. The curve translation amount is calculated from the actual grayscale value of the pixels within the selected 5x5 range. Finally, the sub-pixel edge point position is determined by the intersection of the line connecting the grayscale centroid of the pixels within the 5x5 range and the origin with the translated curve. By sequentially selecting each pixel-level edge point and repeating the above process, the sub-pixel edge points corresponding to each pixel-level edge point can be obtained. This method features fast computation speed, high reliability, and good robustness.

[0005] However, the existing method generally relies on image edge sharpness and texture contrast, and has weak recognition ability for structure blurred area caused by uneven illumination, strong surface reflection and heat effect, especially in high-reflective metal weld, complex contour splicing or area with residual stress deformation, which is easy to cause weld contour mis-extraction, defect boundary blur, even mis-detection and missed detection and other problems. In addition, some methods only rely on single-scale image features for weld defect judgment, lack of fusion modeling of weld center axis symmetry, boundary continuity and heat affected zone structure consistency, resulting in great limitations in micro-defect recognition, contour closure verification and structure noise exclusion.

[0006] In view of the above problems, there is an urgent need for a welding seam automatic detection method and device based on machine vision. SUMMARY

[0007] Technical problems solved

[0008] In view of the deficiencies of the prior art, the present application provides a welding seam automatic detection method and device based on machine vision, which solves the problem of significant reflection and texture blur phenomenon in the heat affected zone of the welding seam during the welding detection process, and the traditional image enhancement and edge extraction algorithm is difficult to stably identify the micro-defects, which reduces the reliability of the detection result.

[0009] Technical scheme

[0010] To achieve the above purpose, the present application is implemented by the following technical scheme: a welding seam automatic detection method and device based on machine vision, comprising S1, collecting surface image data of the welding part, obtaining forming feature data, and preprocessing the collected surface image data and forming feature data to construct a standardized image feature data set; S2, based on the standardized image feature data set, the boundary sharpness of the welding seam area is evaluated in combination with the edge intensity distribution and contour continuity, and the welding seam main contour extraction range is dynamically adjusted based on the evaluation result; S3, based on the standardized image feature data set, the abnormal focusing features of the candidate area are analyzed, and the defect labeling range is adjusted and the processing priority of the detection area is refined based on the analysis result; S4, taking the boundary sharpness evaluation result and the abnormal focusing feature analysis result as input, the structure abnormality of the candidate area is comprehensively analyzed, and the allocation strategy of the verification resource is dynamically controlled based on the analysis result.

[0011] Further, the specific steps for acquiring surface image data of the welded part and obtaining forming feature data are as follows: Acquiring surface image data of the welded part, including pixel distance, the starting position of the current sliding window on the image, image grayscale value, and regional brightness value of each area; recording the total number of candidate detection areas and the average brightness of the overall area; acquiring forming feature data, including grayscale distribution features, local texture structure, edge direction consistency, and local gradient abrupt change amplitude. Specifically, grayscale distribution features are obtained by statistically calculating the image grayscale value; the local texture structure is obtained by directly extracting the grayscale matrix of local windows in the surface image data and combining it with a Gabor filter to quantitatively analyze texture directionality, contrast, and roughness; based on... The Canny operator extracts the edge gradient direction from the surface image data, and calculates the edge direction consistency using principal direction statistics and angle aggregation coefficients. The Sobel operator extracts the gradient intensity from the surface image data, performs statistical analysis on local pixel gradient values, and calculates the maximum gradient amplitude change, average mutation rate, and outlier density to obtain the local gradient mutation amplitude. Simultaneously, the Sobel gradient algorithm analyzes and processes the gray-level distribution characteristics and local texture structure perturbation degree within each sliding window in the surface image data, extracts the local gray-level standard deviation and texture structure change values, performs normalized weighted fusion to obtain the regional texture fluctuation value, calculates the overall regional texture fluctuation average value, and records the sliding window length and the average continuous length of the boundary in the image.

[0012] Further, the specific steps for preprocessing the acquired surface image data and shaping feature data to construct a standardized image feature dataset are as follows: For different image channels, calculate the distribution density of reflection anomaly regions in the surface image data, and extract the spatial coverage of brightness abrupt change regions and specular interference bands; construct a brightness-guided response mask based on the distribution density of reflection anomaly regions, use the local texture structure as input, perform local contrast enhancement on blurred and reflective regions based on the multi-scale Retinex enhancement algorithm, restore weak edges and texture details through multi-scale filters, adopt a gray-scale texture joint modeling strategy driven by gray-scale distribution features, fuse the response features of surface image data to construct an edge-preserving feature response model, and output the enhanced surface image data and shaping feature data; after completing the enhancement processing, normalize the surface image data and shaping feature data, extract the maximum gray value, minimum gray value and local mean interval of the whole image to construct a gray-scale mapping function, and introduce an edge protection factor to perform edge-preserving scaling on the contour region; store the surface image data and shaping feature data to construct a standardized image feature dataset.

[0013] Furthermore, the specific steps for evaluating the boundary clarity of the weld region based on a standardized image feature dataset, combined with edge intensity distribution and contour coherence, are as follows: Using the current pixel as the center, statistically analyze the image grayscale values ​​of all pixels within the sliding window region. First, calculate the average image grayscale value of the region. Then, calculate the difference between the grayscale value of each pixel and the average image grayscale value. Finally, take the average of the squared differences as the image grayscale variance of the region. The discontinuous jump distance between adjacent edge points in the weld contour is statistically analyzed using a contour-tracking-based connectivity consistency algorithm, and their lengths are accumulated to obtain the local boundary fracture length. The length of each adjacent sliding window is calculated sequentially. The edge direction grayscale change rate is obtained by taking the absolute value of the ratio of the image grayscale difference between windows and the pixel distance, divided by the pixel distance; the boundary crack correlation value is obtained by subtracting the ratio of the local boundary fracture length to the average continuous length of the boundary from the image grayscale variance within the sliding window; the edge direction grayscale change rate is multiplied by the boundary crack correlation value to obtain the local texture perturbation value; starting from the starting position of the current sliding window on the image, the local texture perturbation value of each pixel position within the length of the sliding window is continuously accumulated, divided by the length of the sliding window, and multiplied by the corresponding edge direction guiding factor to obtain the weld boundary response value.

[0014] Furthermore, the specific steps for dynamically adjusting the main contour extraction range of the weld seam based on the evaluation results are as follows: Real-time comparison of the weld seam boundary response value with the weld seam boundary threshold of the current candidate region: When the weld seam boundary response value is less than or equal to the weld seam boundary threshold, a local reflection interference suppression mechanism is automatically triggered. The grayscale structure of the region is re-evaluated using a grayscale mapping function and marked as a non-structured texture area. Simultaneously, the defect discrimination process for the region is terminated, and the region data is transferred to the texture artifact cache pool. When the weld seam boundary response value is greater than the weld seam boundary threshold, a fine-grained sliding window is automatically allocated, and the boundary disturbance point focusing analysis process is activated. Contour jump points are dynamically extracted, and a refined weld seam orientation mask is constructed. Simultaneously, the fusion consistency of the boundary is verified using thermal diffusion gradient information, and the defect response enhancement zone is locked.

[0015] Furthermore, the specific steps for analyzing the abnormal focusing features of candidate regions based on the standardized image feature dataset are as follows: Using a one-dimensional sliding window variance algorithm based on the edge coordinate sequence, the edge undulation stability of each region is obtained by statistically analyzing the positional fluctuation of edge pixels in the main direction; the initial defect visibility is obtained by multiplying the amplitude of local gradient abrupt changes in the current region by the edge direction consistency; the current region brightness value is extracted, and the difference between the current brightness value and the overall region brightness average value is calculated and the absolute value is taken, then added to the reciprocal of the edge undulation stability to obtain the region brightness deviation value; the initial defect visibility of the current region is divided by the region brightness deviation value to obtain the region focus intensity value; the region focus intensity values ​​of all candidate regions are accumulated to obtain the micro-defect focusing judgment value.

[0016] Furthermore, the specific steps for adjusting the defect annotation range and refining the processing priority of the detection area based on the analysis results are as follows: Within the current image analysis batch, the micro-defect focus judgment values ​​of all candidate detection areas are sorted from largest to smallest to obtain a focus sequence. Defect response priorities are then divided according to the sorting interval within the focus sequence: When the micro-defect focus judgment value is within the top 30% of the focus sequence, a high-resolution boundary tracking window is enabled to perform pixel-level contour fitting on the suspicious area. High-density perturbation core areas are marked in the mask structure, and the image perturbation trajectory within the current sliding window cycle is recorded. Image enhancement and defect verification resources are allocated preferentially, and the area is included in the defect... The following are suggested repair points: When the micro-defect focus judgment value is in the middle 40% to 70% of the focus sequence, the interference extension window is dynamically expanded around the region. A boundary consistency evaluation mechanism is introduced to compare the deviation from the direction of adjacent stable regions. Instead of directly entering the defect annotation process, it is cached in the abnormal layer candidate pool. The stability change trend is compared in subsequent multi-frame images. When the continuous disturbance increases, it is promoted to a high-risk candidate point. When the micro-defect focus judgment value is in the last 30% of the focus sequence, the defect extraction and closure processing of the region is skipped. It is only marked as a texture noise reference area and the region is automatically removed from the defect generation path to avoid redundant annotation resources.

[0017] Furthermore, the specific steps for comprehensively analyzing the structural anomaly performance of the candidate region using the boundary clarity assessment results and anomaly focusing feature analysis results as input are as follows: Using structural projection and morphological skeleton extraction algorithms, the distance from the geometric centroid of the candidate region to the weld center axis is extracted and denoted as the offset degree; the weld boundary response value and micro-defect focusing judgment value are obtained; the weld boundary response value and micro-defect focusing judgment value are multiplied together, and the product of the weld boundary response value and micro-defect focusing judgment value is further multiplied by the absolute value of the difference between the current region texture fluctuation value and the overall region texture fluctuation average value to obtain the perturbation-weighted fusion value; the offset degree is incremented by one to obtain the offset normalization value; the perturbation-weighted fusion value is divided by the offset normalization value and then the logarithm is taken to obtain the multidimensional fusion evaluation value of the current region.

[0018] Furthermore, the specific steps of the dynamic control strategy for allocating verification resources based on the analysis results are as follows: Real-time comparison of the multidimensional fusion evaluation value and the fusion threshold of the current region. The fusion threshold is divided into a first fusion threshold and a second fusion threshold. When the multidimensional fusion evaluation value is less than or equal to the second fusion threshold, the region is determined to be a low-stability background interference segment. The reflection suppression layer and the heat-affected zone masking layer are automatically invoked, and boundary entropy filtering and grayscale compensation reconstruction are performed on the region. Defect judgment is temporarily suspended, and the region is moved to the abnormal interference buffer area, while its image interference distribution parameters are recorded. When the multidimensional fusion evaluation value is greater than the second fusion threshold and less than or equal to the first fusion threshold, the region is determined to be a structurally suspicious transition segment. It exhibits disturbance concentration and boundary instability. A dynamic contrast enhancement algorithm is loaded within the region, and the stability of the contour response is re-examined by combining previous and subsequent image frames and multiple light source channels. The structural offset tolerance is adjusted based on the interference intensity of the reflective mask. When the multi-dimensional fusion evaluation value is greater than the first fusion threshold, the region is determined to be a highly abnormal focusing segment, directly triggering the defect structure closure process: the region is marked as a high-confidence output region, and the defect coordinates are located, the boundary is drawn, and the anomaly type is assigned. At the same time, the image frame number and the thermally affected area number are bound, serving as an effective verification area for identifying real defects in weld images under strong reflective or thermally blurred interference backgrounds, and included in the final output atlas and annotation report.

[0019] The second aspect of this invention provides an automatic weld seam inspection device based on machine vision, comprising: a vision data acquisition terminal for acquiring surface image data and forming feature data of the welded component, and preprocessing the acquired surface image data and forming feature data to construct a standardized image feature dataset; a weld seam region dynamic boundary extraction module for evaluating the boundary clarity of the weld seam region based on the standardized image feature dataset, combined with edge intensity distribution and contour coherence, and dynamically adjusting the main contour extraction range of the weld seam based on the evaluation results; a micro-defect focusing analysis module for analyzing the abnormal focusing features of candidate regions based on the standardized image feature dataset, and adjusting the defect annotation range and refining the processing priority of the detection region based on the analysis results; and an abnormal region multi-dimensional structure verification module for comprehensively analyzing the structural anomaly performance of candidate regions using the boundary clarity evaluation results and abnormal focusing feature analysis results as input, and dynamically controlling the allocation strategy of verification resources based on the analysis results.

[0020] Beneficial effects

[0021] The present invention has the following beneficial effects:

[0022] (1) The automatic detection method and device for weld seams of welded parts based on machine vision constructs a multi-dimensional fusion evaluation index system by integrating boundary clarity and abnormal focusing results, and performs structural consistency and morphological stability verification on suspected defect areas, thereby enhancing the reliability of detection results and effectively solving the problems of high false detection rate and inability to quantify defect credibility in existing methods.

[0023] (2) The automatic detection method and device for weld seams based on machine vision evaluates the clarity of weld seam boundaries by combining edge intensity distribution and contour continuity, and dynamically adjusts the main contour extraction range, thereby enhancing the contour recognition capability of heat-affected zones and high reflectivity areas, and effectively solving the problems of easy interference in boundary extraction and high defect omission rate in the prior art.

[0024] (3) The automatic detection method and device for weld seams of welded parts based on machine vision, by dynamically analyzing the abnormal focusing features of the candidate area, extracting the disturbance features and directional offset trends, and constructing a micro-defect focusing judgment mechanism, effectively improves the sensitivity of identifying micro-defects such as undercut and porosity, and solves the problem of weak recognition ability of traditional algorithms for weak texture defects.

[0025] (4) The automatic detection method and device for weld seams of welded parts based on machine vision realizes the full-process automation of welding defects from discovery to confirmation by constructing a closed-loop processing flow of image preprocessing, boundary extraction, defect focusing, structural verification and annotation output, which effectively improves detection efficiency and recognition accuracy and solves the problem of low efficiency caused by reliance on manual analysis in existing detection methods.

[0026] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description

[0027] Figure 1 This is a flowchart of an automatic weld seam detection method for welded parts based on machine vision according to the present invention.

[0028] Figure 2 This is a structural diagram of an automatic weld seam detection device for welded parts based on machine vision according to the present invention.

[0029] Figure 3 This is a line graph of the multidimensional fusion evaluation values ​​involved in this invention;

[0030] Figure 4 This is a heat map of micro-defects involved in the present invention. Detailed Implementation

[0031] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0032] Please see Figures 1-4 This invention provides a technical solution: an automatic inspection method and apparatus for weld seams of welded parts based on machine vision, comprising: S1, acquiring surface image data of the welded parts, obtaining forming feature data, and preprocessing the acquired surface image data and forming feature data to construct a standardized image feature dataset; S2, evaluating the boundary clarity of the weld seam region based on the standardized image feature dataset, combining edge intensity distribution and contour coherence, and dynamically adjusting the extraction range of the main contour of the weld seam based on the evaluation results; S3, analyzing the abnormal focusing features of candidate regions based on the standardized image feature dataset, and adjusting the defect annotation range and refining the processing priority of the detection region based on the analysis results; S4, comprehensively analyzing the structural anomaly performance of candidate regions using the boundary clarity evaluation results and abnormal focusing feature analysis results as input, and dynamically controlling the allocation strategy of verification resources based on the analysis results.

[0033] Specifically, the steps for acquiring surface image data of the welded parts and obtaining forming feature data are as follows: acquire surface image data of the welded parts, including: pixel distance, the starting position of the current sliding window on the image, image grayscale value, and regional brightness value of each area, and record the spatial position relationship of each pixel in the image matrix in combination with row and column indexes for subsequent fine feature extraction of local areas; at the same time, count the total number of candidate detection areas and calculate the average brightness of the overall area for constructing a basic reference standard.

[0034] The forming feature data is obtained, including gray-level distribution features, local texture structure, edge orientation consistency, and local gradient abrupt change amplitude. Specifically, the gray-level value distribution histogram of the image is statistically calculated, and the gray-level mean, standard deviation, and kurtosis parameters are extracted to constitute the gray-level distribution features. The gray-level matrix of the local window in the surface image data is directly extracted, and the texture response results in each direction are analyzed in the frequency domain using a Gabor filter to quantify the texture directionality, contrast, and roughness indices, thereby obtaining the local texture structure of the region.

[0035] The edge gradient direction in the surface image data is extracted based on the Canny edge detection operator. The concentration of edge directions is calculated using the principal direction histogram statistical method and angle aggregation coefficient, and the consistency of the edge direction of the output region is output. The horizontal and vertical gradients of each pixel in the image are extracted by the Sobel operator. The local gradient intensity map is traversed by a sliding window and the change value is counted. The maximum gradient amplitude change, the average change rate and the change point density are calculated to obtain the local gradient change amplitude.

[0036] Meanwhile, the Sobel gradient algorithm is used to jointly analyze the gray-level distribution features and the degree of local texture structure perturbation in each sliding window of the surface image data. The local gray-level standard deviation and texture response change value are extracted respectively, and normalized weighted fusion is performed to generate regional texture fluctuation values. Furthermore, the average level of regional texture fluctuation values ​​is calculated on the whole image scale to obtain the average texture fluctuation value of the whole region. The spatial span of the current sliding window and the average continuous length of the main edge direction in the image are recorded as auxiliary parameters for weld structure stability modeling and input into the subsequent analysis process.

[0037] In this implementation scheme, a forming feature representation structure incorporating multi-source information including grayscale, texture, edge, and gradient is constructed. Fine-grained structural change features of the welding area within a sliding window are extracted, providing standardized and quantifiable high-resolution data input for subsequent analysis steps such as weld boundary response value calculation, micro-defect focusing judgment, and multi-dimensional fusion evaluation. Through grayscale statistics, texture directionality analysis, edge direction consistency extraction, and gradient abrupt change detection of the weldment surface image, the structural forming state within the area is comprehensively characterized. Simultaneously, by normalizing and weighting the grayscale standard deviation and texture perturbation intensity within the sliding window, regional texture fluctuation values ​​are dynamically generated, and the global average fluctuation level and boundary coherence parameters are calculated concurrently, providing fundamental data support for difference detection and defect prioritization.

[0038] Specifically, the steps for preprocessing the collected surface image data and forming feature data to construct a standardized image feature dataset are as follows:

[0039] For different image channels, the distribution density of reflective abnormal regions in the surface image data is calculated to measure the degree of brightness abnormality in local areas of the image caused by the high reflectivity of the material and uneven lighting. Specifically, it is calculated by extracting the pixel density and spatial clustering of the high-brightness frequency band in the brightness histogram. The spatial coverage of the brightness abrupt change region and the highlight interference band is extracted by combining the continuity of the high-brightness pixels and the diffusion boundary.

[0040] A luminance-guided response mask is constructed based on the distribution density. The luminance-guided response mask is used to suppress the tendency of misjudgment of specular interference during edge extraction and texture enhancement. It is defined as the grayscale suppression weight with the reflection abnormal area as the dominant region, and the intensity of the filter enhancement response is dynamically adjusted within the mask region.

[0041] Using local texture structure as input, a multi-scale Retinex enhancement algorithm is used to enhance the local contrast of blurred and reflective areas. This algorithm combines the response capabilities of multi-scale difference Gaussian filtering to different spatial frequency features and integrates the brightness-reflection separation model from Retinex theory to achieve dynamic correction of weak, blurred, and overexposed areas. During enhancement, a multi-scale filter combination is used to weightedly fuse edge responses at different resolutions to restore weak edges and texture details. Subsequently, a gray-scale texture joint modeling strategy driven by gray-scale distribution features is introduced, constructing a joint feature representation by quantizing gray-scale histogram uniformity, texture direction contrast, and local autocorrelation.

[0042] Finally, the response features of each channel are integrated to construct an edge-preserving feature response model. The feature response model is defined as a filter response that is enhanced along the edge normal and suppressed along the edge tangential direction during the image enhancement process, with the edge gradient direction as the constraint condition, thereby preserving the original image edge structure and improving the response sensitivity of defective areas. This is based on the edge-preserving principle of GuidedFilter.

[0043] After the enhancement process is completed, the surface image data and the forming feature data are normalized. The maximum gray value, minimum gray value and local mean range of the whole image are extracted to construct a gray-scale mapping function, which is used to compress the dynamic range and improve the visual perception consistency. At the same time, an edge protection factor is introduced to perform edge-preserving scaling on the contour area. That is, by adjusting the gradient amplitude change rate in the area, the degree of boundary morphology destruction in image scaling and mapping operations is constrained.

[0044] Finally, the enhanced surface image data and forming feature data are stored to construct a unified standardized image feature dataset, which serves as a high-quality input for subsequent calculation of weld boundary response values ​​and micro-defect focusing judgment values.

[0045] In this implementation scheme, by constructing a brightness-guided response mask and introducing an edge-preserving feature response model, the influence of reflective interference and blurred areas on feature extraction accuracy is effectively suppressed, the distinguishability of weld boundaries and micro-defect areas in the image is improved, the ability of image data to express local abnormal structures is enhanced, and high-quality enhanced feature input is provided for subsequent weld contour extraction and defect focusing analysis.

[0046] Specifically, based on a standardized image feature dataset, the evaluation of the boundary clarity of the weld region is carried out by combining edge intensity distribution and contour coherence. The specific steps are as follows: taking the current pixel as the center, the image gray values ​​of all pixels within the sliding window region are counted. First, the average image gray value of the region is calculated, then the difference between the image gray value of each pixel and the average image gray value is calculated, and finally the average of the squared differences is taken as the image gray variance of the region. The discontinuous jump distance between adjacent edge points in the weld contour is counted and its length is accumulated through a contour tracking-based connection consistency algorithm to obtain the local boundary fracture length. The boundary fracture length is calculated sequentially for each adjacent sliding window region. The edge direction grayscale change rate is obtained by taking the absolute value of the ratio of the image grayscale difference to the pixel distance and dividing it by the pixel distance. The boundary crack correlation value is obtained by subtracting the ratio of the local boundary fracture length to the average continuous length of the boundary from the image grayscale variance within the sliding window and taking the absolute value. The edge direction grayscale change rate is multiplied by the boundary crack correlation value to obtain the local texture perturbation value. Starting from the starting position of the current sliding window on the image, the local texture perturbation value of each pixel position within the length of the sliding window is continuously accumulated, divided by the length of the sliding window, and multiplied by the corresponding edge direction guiding factor to obtain the weld boundary response value.

[0047] The formula for calculating the weld boundary response value is:

[0048] ;

[0049] In the formula: The sliding window length is used to limit the number of pixels covered in each gradient calculation. It is a range parameter for the statistical analysis of grayscale information in the window area and is derived from preset parameters based on image size and weld features. It indicates the starting position of the current sliding window on the image, used to locate the starting point of the pixel sequence currently involved in the calculation. It is the starting index position in the row and column coordinates of the image, which comes from the sliding index control during the window traversal process. Represents pixel distance, used to measure the spatial positional difference between adjacent pixels. It is a spatial scale factor for calculating local gray-level gradients and is derived from the actual arrangement distance between image pixels. This represents the image grayscale value at position j, used to characterize the brightness level of the current pixel. It is a direct numerical value of the image brightness feature, derived from the corresponding pixel value in the original image grayscale matrix. The image grayscale variance at position j is used to measure the degree of brightness change in the neighborhood of the current pixel. It is a structural parameter of grayscale fluctuation within the sliding window. Centered on the current pixel, the image grayscale values ​​of all pixels within the sliding window area are counted. First, the average image grayscale value of the area is calculated, then the difference between the image grayscale value of each pixel and the average image grayscale value is calculated, and finally the average of the squared differences is taken as the image grayscale variance of the area. It represents the length of local boundary fracture, used to quantify the strength of continuous fracture at the edge of the location. It is a linear index of the integrity of the boundary structure. It is obtained by statistically analyzing the discontinuous jump distance between adjacent edge points in the weld contour and accumulating its length through a connection consistency algorithm based on contour tracking. It represents the average continuous length of the boundary in the current image, used to standardize the influence of crack length at different locations on the response value, and is the average baseline value of edge fracture within the region. The edge direction guidance factor, ranging from 0.6 to 1.4, is used to adjust the directional weight of the edge intensity response within the sliding window. It is a structural coefficient that measures the consistency between the current pixel gradient direction and the main weld contour direction, derived from the angular deviation between the local edge direction distribution and the global weld contour direction in the current image. In the specific calculation, firstly, pixel-level edge directions are extracted based on gradient operators within a local area of ​​the image, and a local direction distribution within the sliding window is constructed. Then, by angular matching with the reference direction of the main weld contour, the direction consistency index of the current window is extracted, including direction concentration, main direction offset rate, and boundary gradient response ratio. Next, the local consistency index is compared with the overall image direction field to generate a direction guidance coefficient matrix. Finally, the direction weight of each pixel in the edge response calculation is dynamically adjusted through the coefficients, effectively enhancing the response contribution of the direction-consistent region and suppressing interference caused by non-main direction disturbances. When the edge direction within the sliding window changes drastically, jumps frequently, and deviates significantly from the main edge direction, the value of the edge direction guiding factor increases, enhancing the weight of the gradient change response in the edge abrupt change region and improving the ability to identify weak contour protrusions and rapid turning points. Conversely, when the edge direction has good continuity, the angle distribution is concentrated, and it is highly consistent with the global main edge direction, the value of the edge direction guiding factor decreases accordingly to avoid the edge enhancement process from over-responding to the background texture, thereby improving the robustness and accuracy control of the boundary extraction stage under complex background interference.

[0050] In this implementation scheme, the response intensity of the weld boundary region in the image is quantified, serving as a crucial basis for weld contour extraction and defect identification. The formula extracts the brightness jump features at the weld boundary by differentiating pixel grayscale values ​​within a sliding window, thus locating abrupt edge changes. By combining local grayscale variance and a perturbation suppression factor, the amplitude of boundary perturbation is weighted and corrected, effectively suppressing high-frequency noise interference. Furthermore, the ratio of the local boundary fracture length to the average crack reference length is introduced to enhance the response sensitivity of the edge distortion region caused by micro-cracks. The boundary response value, as a standardized indicator, provides a stable input basis for subsequent weld contour recognition, defect focusing, and anomalous structure verification, contributing to improved accuracy and robustness of boundary structure identification in complex backgrounds.

[0051] Specifically, the steps for dynamically adjusting the main contour extraction range of the weld seam based on the evaluation results are as follows: Real-time comparison of the weld seam boundary response value with the weld seam boundary threshold of the current candidate region:

[0052] When the weld boundary response value is less than or equal to the weld boundary threshold, a local reflection interference suppression mechanism is immediately triggered. The grayscale distribution of the region is reconstructed and evaluated using a grayscale mapping function to identify brightness heterogeneity and boundary ambiguity features, marking them as unstructured texture areas. Because these areas lack stable structural boundaries, they are unsuitable for defect identification; therefore, the discrimination process is terminated directly, and the region data is transferred to a texture artifact cache pool. This cache pool centrally manages non-standard texture blocks caused by artifacts such as reflection, shadows, and blurring, providing a basis for removal in subsequent image preprocessing and avoiding redundant interference.

[0053] When the weld boundary response value exceeds the weld boundary threshold, a fine-grained sliding window is automatically assigned. This fine-grained sliding window, defined at the pixel level, allows for precise focusing on micro-disturbance areas at the weld structure edge, improving boundary feature resolution. Subsequently, the boundary disturbance point focusing analysis process is activated, dynamically capturing contour jump points and locating the dominant direction of boundary abrupt changes. A refined orientation mask highly consistent with the weld geometry is constructed. Furthermore, thermal diffusion gradient information is used to verify the fusion consistency of the boundary region, ensuring consistency between texture continuity and physical structure connectivity. Ultimately, a high-confidence defect response enhancement zone is identified, laying the foundation for accurate defect extraction and subsequent processing.

[0054] In this implementation scheme, the clarity of weld boundaries is determined in real time by dynamically comparing the weld boundary response value of candidate regions with the weld boundary threshold. Based on this, subsequent processing paths for the region are categorized, and an image analysis grading strategy based on response intensity is constructed. When the response value is insufficient to meet the boundary clarity criterion, a reflection interference removal mechanism is immediately activated. The grayscale structure of the image is re-estimated using a grayscale mapping function, identifying it as a texture abnormality region and exiting the defect analysis process to avoid misjudgment and resource waste. When the response value exceeds the threshold, a high-resolution sliding window and boundary perturbation focusing process are automatically scheduled to extract contour transition points, generate a directional mask, and link thermal diffusion gradient features to complete boundary fusion consistency verification, providing a structural basis for high-confidence defect enhancement.

[0055] Specifically, based on a standardized image feature dataset, the analysis of abnormal focusing features in candidate regions involves the following steps: A one-dimensional sliding window variance algorithm based on edge coordinate sequences is used to obtain the edge undulation stability of each region by statistically analyzing the positional fluctuations of edge pixels in the main direction; the initial defect visibility is obtained by multiplying the amplitude of local gradient abrupt changes within the current region by the edge direction consistency; the current region brightness value is extracted, and the difference between the current brightness value and the overall region brightness average is calculated, with the absolute value taken, and then added to the reciprocal of the edge undulation stability to obtain the region brightness deviation value; the initial defect visibility of the current region is divided by the region brightness deviation value to obtain the region focus intensity value; and the region focus intensity values ​​of all candidate regions are accumulated to obtain the micro-defect focusing judgment value.

[0056] The formula for calculating the micro-defect focus judgment value is as follows:

[0057] ;

[0058] In the formula: This represents the total number of candidate detection regions, used to determine the number of iterations for focusing. It is an overall parameter reflecting the number of suspicious regions in the image, derived from the set of candidate detection regions extracted during the initial image screening stage. The local gradient abrupt change amplitude in region u is used to measure the severity of brightness changes within the region. It is a key feature for identifying the degree of texture anomalies in potential defective regions. The gradient intensity in the surface image data is extracted by the Sobel operator, and the local pixel gradient values ​​are statistically analyzed to calculate the maximum gradient amplitude change, average abrupt change rate, and anomaly density. It represents the edge orientation consistency of the u-th region, used to evaluate the continuity and regularity of the edge structure. It is a morphological index reflecting the degree of edge disturbance in the micro-defect region. It is derived from the edge gradient direction extracted from the surface image data based on the Canny operator, and the consistency between the region boundary direction vector and the global main boundary direction is calculated using the main direction statistics and angle aggregation coefficient. represents the brightness value of the u-th region, used to characterize the illumination intensity of the region. It is a fundamental variable for evaluating the stability of the region under the influence of reflective interference and is derived from the average pixel grayscale value of the region in the original image. It represents the average brightness of the entire area, used to normalize the brightness of a single area, and serves as a reference baseline for measuring the degree of brightness deviation in an area. It is derived from the arithmetic mean of the brightness values ​​of all candidate areas. The edge undulation stability of the u-th region is used to evaluate the texture continuity of the edge. It is a statistical factor that reflects the degree of perturbation and fluctuation of the boundary line in the main direction. The edge undulation stability is obtained by using a one-dimensional sliding window variance algorithm based on the edge coordinate sequence, which is obtained by statistically analyzing the positional fluctuation of the edge pixels in the main direction.

[0059] In this implementation scheme, the focusing characteristics of potential micro-defects in the candidate detection region are quantified. By improving the response of regions with high boundary clarity, significant brightness deviation, and concentrated edge direction, suspected defect regions with typical microstructural features are given higher priority in focusing determination. This effectively removes interference regions such as texture noise and blurred edges, enhancing the sensitivity and discriminative ability to subtle perturbation features in subsequent defect identification processes. The final results can be used to construct a priority sequence of candidate regions, driving dynamic resource scheduling in the defect verification and closure extraction process, thereby improving the accuracy and efficiency of micro-defect identification.

[0060] Specifically, the steps for adjusting the defect annotation range and refining the processing priority of the detection area based on the analysis results are as follows: Within the image analysis batch, the micro-defect focus judgment values ​​of all candidate detection areas are globally sorted from largest to smallest to construct a complete focus sequence. The focus sequence is generated based on the concentration of abnormal intensity, the amplitude of edge perturbation, and the degree of coupling of texture abrupt changes within the area, serving as the core basis for determining the defect processing priority. The response strategy and resource allocation path of each area are dynamically adjusted according to the relative position of the current micro-defect focus judgment value in the focus sequence.

[0061] When the micro-defect focusing judgment value is in the first 30% of the focusing sequence, i.e., it belongs to the high-intensity focusing response region, a high-resolution boundary tracking window is activated to perform pixel-level contour fitting on the region, identifying local gradient jump points and boundary nonlinear deflection features. The high-density perturbation core area is marked in the structural mask image, and the image perturbation trajectory within the current sliding window cycle is recorded simultaneously. Such regions will be prioritized in the image enhancement link and defect verification process, and registered as high-priority repair targets in the defect handling suggestions, serving as an important basis for the formulation of subsequent weld repair strategies.

[0062] When the micro-defect focusing judgment value is in the middle 40% to 70% range of the focusing sequence, it is considered a medium-intensity response region. An interference extension window is actively added outside its edge to expand the search range and detect potential disturbance migration trends. At this point, a boundary consistency evaluation mechanism is introduced to compare the directional deviation, texture similarity, and gradient continuity of the region's boundary with those of its adjacent stable regions to assess its true disturbance probability. The region does not immediately enter the defect annotation process but is temporarily stored in the anomaly layer candidate pool. When multiple frames of images are composited in subsequent steps, the evolution of the disturbance trend is used to determine whether it has upgraded to a high-risk candidate point, improving the temporal consistency and robustness of subsequent judgments.

[0063] When the micro-defect focusing judgment value is in the last 30% of the focusing sequence, it is a weak response region. Because its boundary perturbation amplitude is small and the texture jump is not obvious, it is only treated as a low-confidence interference segment. The defect extraction and closure correction steps are skipped directly, and it is marked as a texture noise reference area in the image annotation process to construct a non-defect feature template. The region will be removed from the defect generation link to avoid redundant resource allocation and false defect interference, thereby improving the overall image processing efficiency and judgment accuracy.

[0064] like Figure 4 The image shows a micro-defect focus heatmap provided in this application example. Based on the micro-defect focus judgment value, a response heatmap is generated. For each candidate region, an index is calculated to determine its edge perturbation intensity, brightness fluctuation amplitude, and directional consistency to construct a focus score. Red and yellow areas in the image represent high-focus value areas, indicating high-risk areas with potential defect characteristics, which will be prioritized for defect structure closure and hierarchical identification. Dark areas represent low-perturbation areas, automatically marked as background reference areas, and will not enter the main defect analysis path. The micro-defect focus heatmap intuitively demonstrates a threshold-free, ranking-driven defect response mechanism, effectively improving the accuracy and stability of defect extraction and providing clear visual explanations for subsequent analysis.

[0065] In this implementation scheme, candidate regions are prioritized and their processing paths are adjusted based on the micro-defect focusing judgment value. By constructing a focusing sorting sequence, high-precision contour fitting, interference extension analysis and noise removal mechanisms are triggered in layers to achieve classification and treatment of regions with different risk levels in the image, thereby improving the resource scheduling efficiency, processing accuracy and dynamic stability in the image enhancement and defect recognition process.

[0066] Specifically, using the boundary clarity assessment results and anomaly focusing feature analysis results as inputs, the comprehensive analysis of the structural anomaly performance of the candidate region is carried out through the following steps: The distance from the geometric centroid of the candidate region to the weld center axis is extracted using structural projection and morphological skeleton extraction algorithms, and denoted as the offset degree. The weld boundary response value and micro-defect focusing judgment value are obtained. These values ​​are multiplied, and the product is further multiplied by the absolute value of the difference between the current region texture fluctuation value and the overall region texture fluctuation average value to obtain the perturbation-weighted fusion value. The offset degree is incremented by one to obtain the offset normalization value. The perturbation-weighted fusion value is divided by the offset normalization value and then the logarithm is taken to obtain the multidimensional fusion evaluation value of the current region.

[0067] The formula for calculating the multidimensional fusion evaluation value is:

[0068] ;

[0069] In the formula: This represents the weld boundary response value, used to measure the intensity of boundary perturbation in the weld region in the image. It is a weighted response result that combines the edge direction guiding factor, gray-level gradient difference, and perturbation response factor. The micro-defect focusing judgment value is used to reflect the focusing characteristics of microstructural anomalies in the candidate region. It is a response index obtained by multi-factor joint weighted calculation of local gradient mutation, edge consistency, brightness deviation degree and boundary stability. This represents the texture fluctuation value of the current region, used to characterize the degree of texture intensity perturbation in the current detection region. It is a statistical result of the amplitude and frequency characteristics of pixel gray-level changes in the region. It is derived from the analysis and processing of gray-level distribution characteristics and local texture structure perturbation in each sliding window of the surface image data by Sobel gradient algorithm, extracting local gray-level standard deviation and texture structure change value and performing normalized weighted fusion. It represents the average texture fluctuation of the entire region and is used to provide a baseline level of the overall texture perturbation of the current detected image. It is the average texture fluctuation obtained by statistics in the global area of ​​the image and is extracted from the average texture perturbation value of all detected regions in the standardized image feature dataset. This indicates the degree of offset from the axis, used to quantify the positional deviation of the current candidate region relative to the main axis of the weld. It is the normalized distance from the centroid of the region to the central axis of the weld, obtained by extracting the distance from the geometric centroid of the candidate region to the central axis of the weld through structural projection and morphological skeleton extraction algorithms.

[0070] In this implementation example, the weld boundary response value of Example 1 is set to 1.48, the micro-defect focus judgment value is set to 1.52, the current area texture fluctuation value is 0.72, the average texture fluctuation value is 0.21, and the offset degree is 0.20.

[0071] In Example 2, the weld boundary response value was set to 1.62, the micro-defect focus judgment value was set to 1.35, the current area texture fluctuation value was 0.65, the average texture fluctuation value was 0.18, and the offset from the axis was 0.18.

[0072] In Example 3, the weld boundary response value is set to 1.40, the micro-defect focus judgment value is set to 1.46, the current area texture fluctuation value is 0.68, the average texture fluctuation value is 0.22, and the offset from the axis is 0.25.

[0073] In Example 4, the weld boundary response value was set to 1.55, the micro-defect focus judgment value was set to 1.32, the current area texture fluctuation value was 0.76, the average texture fluctuation value was 0.19, and the offset from the axis was 0.22.

[0074] In Example 5, the weld boundary response value is set to 1.60, the micro-defect focus judgment value is set to 1.50, the current area texture fluctuation value is 0.70, the average texture fluctuation value is 0.20, and the offset from the axis is 0.30.

[0075] In Example 6, the weld boundary response value was set to 1.43, the micro-defect focus judgment value was set to 1.38, the current area texture fluctuation value was 0.75, the average texture fluctuation value was 0.25, and the offset from the axis was 0.21.

[0076] In Example 7, the weld boundary response value was set to 1.50, the micro-defect focusing judgment value was set to 1.41, the current area texture fluctuation value was 0.80, the average texture fluctuation value was 0.24, and the off-axis offset was 0.27. The multidimensional fusion evaluation value for each example was calculated, as shown in Table 1.

[0077] Table 1. Multidimensional Fusion Evaluation Value Data Table

[0078]

[0079] like Figure 3 As shown in Table 1, this is a line graph of the multidimensional fusion evaluation values ​​provided in this application example. Figure 3 As can be seen, Example 2 has the highest multidimensional fusion evaluation value, indicating that the region exhibits high consistency and recognition focus in terms of weld boundary clarity, micro-defect focusing performance, texture disturbance intensity, and offset characteristics. This comprehensively reflects its obvious structural anomaly features, stable imaging quality, and controllable positional deviation, making it suitable as a target area for priority defect labeling and high-resolution detection. Example 6 has the lowest multidimensional fusion evaluation value. Although its weld boundary and defect focusing performance are good, the region has a high texture fluctuation value and a large global mean, resulting in weak overall fusion consistency. It is suitable as a low-priority auxiliary detection area to avoid interfering with detection resources. The multidimensional fusion evaluation value line graph clearly shows the fusion response level of each region under the multidimensional features of boundary clarity, defect focusing, texture consistency, and positional offset. Higher values ​​indicate better overall recognition conditions and are more suitable as candidate regions for subsequent high-priority defect review and location processing.

[0080] Specifically, the steps for dynamically controlling the allocation strategy of verification resources based on the analysis results are as follows:

[0081] Real-time comparison of the multidimensional fusion evaluation value and fusion threshold of the current region. The fusion threshold is divided into a first fusion threshold and a second fusion threshold, which are used to characterize the structural response distribution characteristics under different stability levels.

[0082] When the multidimensional fusion evaluation value is less than or equal to the second fusion threshold, the region is determined to be a low-stability background interference segment. The region is usually accompanied by significant texture perturbation and edge blurring, and it is impossible to construct a continuous structural feature chain. At this time, the reflection suppression layer and the heat-affected area masking mask are automatically called. The former is composed of a brightness anomaly marker map formed by high brightness abrupt change region, and the latter is based on the thermal diffusion model to extract the local temperature rise distortion range. Then, the region is subjected to boundary entropy filtering to remove non-structural abrupt change edges, and compensation reconstruction is performed in combination with the region grayscale statistical model. This process does not enter the defect discrimination process, but transfers the region data to the abnormal interference buffer area for subsequent cross-frame stability verification. At the same time, the image interference distribution parameters such as the interference center position, coverage area and average interference entropy value are recorded.

[0083] When the multidimensional fusion evaluation value is greater than the second fusion threshold and less than or equal to the first fusion threshold, the region is determined to be a structurally suspicious transition segment. Such regions exhibit significant fluctuations in structural continuity and texture consistency, and possess characteristics of disturbance concentration and boundary instability. In this case, a dynamic contrast enhancement algorithm is loaded within the region to improve edge gradient contrast, and a cross-temporal contour consistency evaluation sequence is formed by combining the preceding and following image frames. The contour response stability is re-examined by combining the illumination compensation mechanism of the multi-source light source channel to eliminate the false structural response caused by illumination changes. Furthermore, the structural offset tolerance is adjusted based on the interference intensity gradient in the reflective mask, and the boundary fitting sensitivity is dynamically relaxed and tightened.

[0084] When the multidimensional fusion evaluation value is greater than the first fusion threshold, the region is determined to be a highly anomalous focusing segment. The region exhibits characteristics of high structural closure, dense texture response, and severe interference abrupt changes, and has significant defect characterization. The defect structure closure process is immediately triggered, and contour stitching, boundary tracking, and anomaly intensity calibration operations are performed. The region is marked as a high-confidence output region, and defect coordinate positioning, boundary drawing, and anomaly type assignment are completed. The image frame number and thermally affected area number are bound to form a linkage mapping between defect positioning and thermal interference. The region serves as an effective verification area for identifying real defects in weld images under strong reflective and thermally blurred interference backgrounds. It is included in the final output atlas and image annotation report for high-confidence model optimization and example backtracking.

[0085] In this implementation scheme, based on the interval distribution characteristics of multi-dimensional fusion evaluation values, candidate detection regions are dynamically classified and graded. By dividing into three types—low-stability background interference segments, structurally suspicious transition segments, and highly abnormal focusing segments—the scheme achieves accurate identification, differentiated processing, and priority ranking of potential defect regions in weld images. During the processing, the scheme jointly utilizes reflective suppression layers, heat-affected zone masks, boundary entropy filtering, and contrast enhancement algorithms to complete the abnormal interference filtering, structural stability verification, and high-confidence defect output process, thereby improving the robustness, stability, and accuracy of defect discrimination under complex imaging conditions.

[0086] The second aspect of this invention provides an automatic weld seam detection device for welded parts based on machine vision, comprising: a vision data acquisition terminal for acquiring surface image data and forming feature data of the welded parts; the surface image data includes image grayscale values, pixel distribution density, regional brightness values, and initial values ​​of boundary contours; the forming feature data includes grayscale distribution features, local texture structure, edge direction consistency, and gradient abrupt change amplitude; the terminal preprocesses the acquired images based on an adaptive exposure adjustment mechanism and dynamic contrast compensation technology, and simultaneously constructs a sliding window image block sequence, performing normalization, noise reduction, and edge preservation enhancement processing on each image region to generate a standardized image feature dataset;

[0087] The dynamic boundary extraction module for weld areas is used to evaluate the boundary clarity of weld areas based on a standardized image feature dataset, combining edge intensity distribution and contour coherence. Edge intensity distribution is obtained through Sobel edge gradient mapping, and contour coherence is calculated through Canny orientation consistency matching and boundary overlap. According to the boundary clarity index, the module dynamically adjusts the extraction range of the main weld contour, uses a fine-grained sliding window to delineate local areas, and introduces an orientation guiding factor to optimize the main contour mask generation strategy.

[0088] The micro-defect focusing analysis module is used to analyze the abnormal focusing features of candidate regions based on a standardized image feature dataset. The focusing features include texture perturbation density, gradient anomaly point aggregation degree and thermal diffusion entropy value change trend. The module performs sliding period perturbation trajectory tracking based on the focusing intensity factor, evaluates the stability of interference perturbation by combining the texture noise attenuation model, further adjusts the defect annotation range, and refines the processing priority of the detection area based on the region's historical focusing level and response trend map.

[0089] The multi-dimensional structure verification module for abnormal regions is used to comprehensively analyze the structural anomalies of candidate regions by taking the boundary clarity assessment results and anomaly focusing feature analysis results as inputs. It integrates input variables to construct a multi-dimensional fusion evaluation model and introduces boundary perturbation offset, structural texture blur rate and center deviation index as evaluation factors. The module dynamically allocates image enhancement, boundary verification and response comparison computing resources according to different evaluation intervals to realize a real-time adjustment strategy for processing granularity, allocation frequency and resource coverage.

[0090] In this implementation plan, the visual data acquisition terminal collects surface image data and forming feature data of the welded parts under the current inspection environment. Through normalization preprocessing, edge enhancement and noise suppression, a standardized image feature dataset is constructed for subsequent defect identification and structural evaluation, ensuring that the input data has a unified standard and analytical compatibility in terms of grayscale structure, texture characteristics and contour clarity.

[0091] The dynamic boundary extraction module for weld areas evaluates the clarity of the current weld area boundary based on the edge intensity distribution and contour coherence index in the image feature dataset, dynamically adjusts the extraction range of the main weld contour, and generates a high-resolution contour mask to guide subsequent boundary anomaly detection, structural stability analysis, and orientation offset control.

[0092] The micro-defect focusing analysis module identifies small-scale disturbance clustering phenomena in candidate detection areas. By sorting the intensity of focusing features and tracking abnormal trajectories, it dynamically refines the region division, improves the accuracy of defect labeling, delineates priority processing areas, optimizes detection resource allocation and labeling strategies, and supports the fine identification of high-confidence defect areas.

[0093] The multi-dimensional structural verification module for abnormal areas integrates the weld boundary clarity assessment results with focused analysis features to construct a multi-factor analysis model of structural anomalies. It performs multi-dimensional structural consistency verification on candidate areas and adjusts resource allocation strategies based on the analysis results, thereby achieving efficient execution of dynamic control of key areas under resource-constrained conditions and priority verification strategies for structural anomalies.

[0094] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0095] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.

Claims

1. An automatic inspection method for weld seams in welded parts based on machine vision, characterized in that: include: S1. Collect surface image data and forming feature data of the welded parts, and preprocess the collected surface image data and forming feature data to construct a standardized image feature dataset; S2, based on a standardized image feature dataset, evaluates the boundary clarity of the weld area by combining edge intensity distribution and contour coherence, and dynamically adjusts the extraction range of the main contour of the weld based on the evaluation results. S3, based on a standardized image feature dataset, analyzes the abnormal focusing features of candidate regions, and adjusts the defect annotation range and refines the processing priority of detection regions based on the analysis results; S4 takes the boundary clarity assessment results and anomaly focusing feature analysis results as inputs to comprehensively analyze the structural anomaly performance of candidate regions, and dynamically controls the allocation strategy of verification resources based on the analysis results.

2. The automatic inspection method for weld seams of welded parts based on machine vision according to claim 1, characterized in that: The specific steps for acquiring the surface image data and forming feature data of the welded parts are as follows: Collect surface image data of the welded part. The surface image data includes: pixel distance, the starting position of the current sliding window on the image, the texture fluctuation value of the current area, and the image gray value. Calculate the average texture fluctuation value of the entire area, and record the length of the sliding window and the average continuous length of the boundary in the image. Standard forming feature data is extracted based on different weldment materials and welding methods. The forming feature data includes: regional brightness value of each region, edge direction consistency, local gradient change amplitude, and the total number of candidate detection regions and the average brightness of the overall region.

3. The automatic inspection method for weld seams of welded parts based on machine vision according to claim 1, characterized in that: The specific steps for preprocessing the acquired surface image data and forming feature data to construct a standardized image feature dataset are as follows: For different image channels, calculate the distribution density of abnormal reflection regions in the image, and extract the spatial coverage of brightness change regions and highlight interference bands; A brightness-guided response mask is constructed based on the distribution density of reflective anomaly regions. The global gray-level mean drift trend and local boundary fluctuation coefficient are used as inputs. A response fitting method based on local weighted fusion is adopted. The coupling effect of gray-level drift and boundary perturbation is balanced by normalization coefficient to construct a joint response model. The enhanced surface image data and forming feature data are output. Enhance texture contrast and orientation recognizability of potential edges in blurred areas, and restore weak texture structure caused by thermal effects and high reflectivity; After the enhancement process is completed, the surface image data and the forming feature data are normalized. The maximum gray value, minimum gray value and local mean range of the whole image are extracted to construct a gray-level mapping function. An edge protection factor is introduced to perform edge-preserving scaling on the contour area. The system outputs surface image data and forming feature data after boundary enhancement and normalization, and integrates and stores them as a standardized image feature dataset.

4. The automatic inspection method for weld seams of welded parts based on machine vision according to claim 1, characterized in that: The specific steps for evaluating the boundary clarity of the weld area based on the standardized image feature dataset, combined with edge intensity distribution and contour coherence, are as follows: Centered on the current pixel, the image grayscale values ​​of all pixels within the sliding window area are counted. First, the average image grayscale value of the area is calculated. Then, the difference between the image grayscale value of each pixel and the average image grayscale value is calculated. Finally, the average of the squared differences is taken as the image grayscale variance of the area. The length of local boundary fracture is obtained by statistically analyzing the discontinuous jump distance between adjacent edge points in the weld contour and accumulating their length using a contour-tracking-based connection consistency algorithm. Calculate the difference in image grayscale values ​​between each adjacent sliding window and divide it by the pixel distance. Take the absolute value of the ratio of the difference in image grayscale values ​​to the pixel distance to obtain the grayscale change rate in the edge direction. The boundary crack correlation value is obtained by subtracting the ratio of the local boundary fracture length to the average continuous length of the boundary from the image grayscale variance within the sliding window and then taking the absolute value. Multiply the gray-scale change rate in the edge direction by the boundary crack correlation value to obtain the local texture perturbation value; Starting from the current starting position of the sliding window on the image, continuously accumulate the local texture perturbation value of each pixel position within the length of the sliding window, divide it by the length of the sliding window, and multiply it by the corresponding edge direction guiding factor to obtain the weld boundary response value.

5. The automatic inspection method for weld seams of welded parts based on machine vision according to claim 1, characterized in that: The specific steps for dynamically adjusting the main contour extraction range of the weld seam based on the evaluation results are as follows: Real-time comparison of weld boundary response values ​​and weld boundary thresholds in the current candidate region: When the weld boundary response value is less than or equal to the weld boundary threshold, the local reflection interference suppression mechanism is automatically triggered. The grayscale structure of the region is re-evaluated in combination with the grayscale mapping function and marked as an unstructured texture area. At the same time, the defect discrimination process of the region is terminated and the region data is transferred to the texture artifact cache pool. When the weld boundary response value is greater than the weld boundary threshold, a fine-grained sliding window is automatically allocated and the boundary disturbance point focusing analysis process is activated to dynamically extract the contour jump points, construct a refined weld direction mask, and at the same time, the fusion consistency of the boundary is verified by combining the thermal diffusion gradient information to lock the defect response enhancement zone.

6. The automatic inspection method for weld seams of welded parts based on machine vision according to claim 1, characterized in that: The specific steps for analyzing the abnormal focusing features of candidate regions based on the standardized image feature dataset are as follows: A one-dimensional sliding window variance algorithm based on edge coordinate sequences is used to obtain the edge undulation stability of each region by statistically analyzing the positional fluctuation of edge pixels in the main direction. The initial defect visibility is obtained by multiplying the magnitude of the local gradient mutation in the current region by the consistency of the edge orientation. Extract the current brightness value of each region, calculate the difference between the current brightness value and the average brightness value of the entire region, take the absolute value, and then add it to the reciprocal of the edge undulation stability to obtain the region brightness deviation value. Divide the initial defect visibility of the current area by the area brightness deviation value to obtain the area focus intensity value; The regional focus intensity values ​​of all candidate regions are summed to obtain the micro-defect focus judgment value.

7. The automatic inspection method for weld seams of welded parts based on machine vision according to claim 1, characterized in that: The specific steps for adjusting the defect annotation range and refining the detection area processing priority based on the analysis results are as follows: Within an image analysis batch, the micro-defect focus judgment values ​​of all candidate detection regions are sorted from largest to smallest to obtain a focus sequence. The defect response priority is then determined based on the sorting interval within the focus sequence. When the micro-defect focusing judgment value is in the first 30% of the focusing sequence, the high-resolution boundary tracking window is enabled to perform pixel-level contour fitting on the suspicious area, the high-density perturbation core area is marked in the mask structure, the image perturbation trajectory in the current sliding window cycle is recorded, image enhancement and defect verification resources are allocated first, and the defect repair suggestion list is included. When the micro-defect focus judgment value is located in the middle 40% to 70% of the focus sequence, the interference extension window is dynamically expanded around the region. A boundary consistency evaluation mechanism is introduced to compare the deviation with the direction of adjacent stable regions. Instead of directly entering the defect annotation process, it is cached in the abnormal layer candidate pool. The stability change trend is compared in subsequent multi-frame images. When the continuous disturbance increases, it is promoted to a high-risk candidate point. When the micro-defect focus judgment value is located in the last 30% of the focus sequence, the defect extraction and closure processing of the region is skipped, and it is only marked as a texture noise reference area. The region is automatically removed from the defect generation path to avoid redundant annotation resources.

8. The automatic inspection method for weld seams of welded parts based on machine vision according to claim 1, characterized in that: The specific steps for comprehensively analyzing the structural anomaly performance of candidate regions, using boundary clarity assessment results and anomaly focusing feature analysis results as inputs, are as follows: The distance from the geometric centroid of the candidate region to the weld center axis is extracted using structural projection and morphological skeleton extraction algorithms, and is denoted as the degree of offset from the axis. Obtain the weld boundary response value and the micro-defect focus judgment value, multiply the weld boundary response value and the micro-defect focus judgment value, and then multiply the product of the weld boundary response value and the micro-defect focus judgment value by the absolute value of the difference between the current region texture fluctuation value and the overall region texture fluctuation average value to obtain the perturbation weighted fusion value; Add one to the offset degree to obtain the offset normalization value, divide the perturbation weighted fusion value by the offset normalization and then take the logarithm to obtain the multidimensional fusion evaluation value of the current region.

9. The automatic inspection method for weld seams of welded parts based on machine vision according to claim 1, characterized in that: The specific steps of the strategy for dynamically controlling the allocation of verification resources based on the analysis results are as follows: Real-time comparison of the multidimensional fusion evaluation value and fusion threshold of the current region. The fusion threshold is divided into a first fusion threshold and a second fusion threshold. When the multidimensional fusion evaluation value is less than or equal to the second fusion threshold, the region is determined to be a low-stability background interference segment. The reflection suppression layer and the heat-affected area masking mask are automatically invoked, and the region is subjected to boundary entropy filtering and grayscale compensation reconstruction. Defect discrimination is temporarily not performed, and the region is transferred to the abnormal interference buffer area. At the same time, its image interference distribution parameters are recorded. When the multidimensional fusion evaluation value is greater than the second fusion threshold and less than or equal to the first fusion threshold, the region is determined to be a structurally suspicious transition segment with disturbance concentration and boundary instability. A dynamic contrast enhancement algorithm is loaded in the region, and the stability of the contour response is re-examined by combining the previous and next image frames and multiple light source channels. The structural offset tolerance is adjusted based on the interference intensity of the reflective mask. When the multidimensional fusion evaluation value is greater than the first fusion threshold, the region is determined to be a highly abnormal focusing segment, directly triggering the defect structure closure process: the region is marked as a high-confidence output region, and the defect coordinate positioning, boundary delineation and anomaly type assignment are completed. At the same time, the image frame number and the thermally affected area number are bound, serving as an effective verification area for identifying real defects in weld images under strong reflective or thermally blurred interference backgrounds, and included in the final output atlas and annotation report.

10. An automatic weld seam inspection device based on machine vision as described in any one of claims 1-9, characterized in that, include: A visual data acquisition terminal is used to acquire surface image data and forming feature data of welded parts, and to preprocess the acquired surface image data and forming feature data to construct a standardized image feature dataset. The dynamic boundary extraction module for weld areas is used to evaluate the clarity of the weld area boundary based on a standardized image feature dataset, combined with edge intensity distribution and contour coherence, and dynamically adjust the extraction range of the main contour of the weld based on the evaluation results. The micro-defect focusing analysis module is used to analyze the abnormal focusing features of candidate regions based on a standardized image feature dataset, and adjust the defect annotation range and refine the processing priority of the detection region based on the analysis results. The multi-dimensional structure verification module for abnormal regions is used to comprehensively analyze the structural anomalies of candidate regions by taking the boundary clarity assessment results and anomaly focusing feature analysis results as inputs, and dynamically control the allocation strategy of verification resources based on the analysis results.

Citation Information

Patent Citations

  • A method for sub-pixel detection of curved edges in images of laser-welded workpieces

    CN109934819B

  • A method for detecting the contour of a weldment

    CN113034452B

  • Weldment contour detection method

    CN113034452A

  • Heat exchanger welding seam image enhancement processing method

    CN120451019A

Cited By

  • Titanium frame container welding seam quality detection method and system

    CN121353279A

  • Method and system for detecting defects of poor ball burning products by wire bonder

    CN121410003A

  • Intelligent defect detection system and method applied to PCBA (Printed Circuit Board Assembly)

    CN121453822A

  • Visual inspection system and method for defects of electronic components

    CN121458717A

  • Electronic component defect vision inspection system and method

    CN121458717B