A Machine Vision-Based Method for Weld Defect Identification

CN122573871APending Publication Date: 2026-08-14河南省锅炉压力容器检验技术科学研究院
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610719765.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-25
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0002]随着承压类特种设备在石油化工、能源电力等工业场景中的广泛应用,焊缝作为关键承载结构,其质量检测对于保障设备安全运行具有重要意义,为提升检测精度与结果稳定性,现有焊缝检测系统逐步引入基于机器视觉的自动识别技术,通过工业相机对焊缝表面进行图像采集,并结合图像处理算法或深度学习模型对缺陷进行识别与分类,多采用统一图像处理流程与固定模型结构,即对采集图像按照预设方式进行滤波增强、特征提取及模型推理,并基于整体图像特征输出缺陷识别结果,然而,在实际工业检测环境中,由于焊缝表面存在反光、噪声干扰及背景纹理复杂等因素,且不同类型缺陷在形态、尺度及灰度分布上存在显著差异,焊缝缺陷特征在空间分布及表现形式上呈现出非均匀性与动态变化特征,而现有基于统一处理流程及固定特征表达的方式难以对该类复杂变化进行有效刻画,使得缺陷特征在提取与识别过程中存在表达不足及信息丢失的问题,由此导致:

Benefits of technology

本发明通过引入显像扩散行为的时空演化分析机制,以无缺陷区域的显像连续性及扩展一致性为参照,构建参考显像响应关系,并基于实际显像与参考响应之间的偏离程度实现异常显像的精确定位,从而有效区分由缺陷引起的显像异常与由表面状态、光照变化等因素导致的干扰信号,通过对异常显像行为的结构化解析以及空间连通性与时间持续性的联合约束,实现候选缺陷区域的稳定提取,结合异常响应强度及其跨帧变化稳定性进行一致性评估,提升缺陷识别结果的可靠性,利用不同缺陷类型在显像演化过程中的响应差异进行判别,有效增强对微小缺陷、弱显像缺陷及复杂背景下缺陷的识别能力,从而整体提高焊缝缺陷检测的准确性、稳定性及抗干扰能力,满足复杂工况下的高精度自动化检测需求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122573871A_ABST
    Figure CN122573871A_ABST
Patent Text Reader

Abstract

This invention relates to the field of non-destructive testing of welds and discloses a machine vision-based method for weld defect identification. The method includes: continuously acquiring images of the weld surface to form change data; calculating the amplitude of image intensity variation and the displacement of the expansion boundary between adjacent frames based on the image continuity and expansion consistency of defect-free areas in the change data, and constructing a reference image response relationship; comparing the actual image response with the reference image response relationship for abnormal image segments appearing in the actual image changes to form an abnormal image response distribution; analyzing the abnormal image behavior based on the abnormal image response distribution to determine candidate defect regions; and evaluating the consistency of the defect response of the candidate defect regions based on the abnormal response intensity and the stability of its variation in consecutive frames, outputting the category and location of the weld defect. This invention has the advantages of improving detection accuracy and stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of non-destructive testing of welds, specifically a method for identifying weld defects based on machine vision. Background Technology

[0002] With the widespread application of pressure-bearing special equipment in industrial settings such as petrochemicals and energy power, welds, as critical load-bearing structures, are crucial for ensuring the safe operation of equipment through quality inspection. To improve inspection accuracy and result stability, existing weld inspection systems are gradually introducing automatic recognition technology based on machine vision. This involves acquiring images of the weld surface using industrial cameras and combining image processing algorithms or deep learning models to identify and classify defects. These systems often employ a unified image processing flow and fixed model structure, filtering and enhancing the acquired images according to preset methods, extracting features, and performing model inference, outputting defect identification results based on overall image features. However, in actual industrial inspection environments, factors such as reflectivity, noise interference, and complex background textures on the weld surface, along with significant differences in morphology, scale, and grayscale distribution among different types of defects, result in non-uniform and dynamically changing spatial distribution and manifestations of weld defect features. Existing methods based on unified processing flows and fixed feature expressions struggle to effectively characterize these complex variations, leading to insufficient representation and information loss during defect feature extraction and recognition. This results in: Firstly, under complex lighting and reflective interference conditions, the contrast between the defect area and the background area is reduced, making it difficult to effectively enhance key features, resulting in the missed detection of minor or weak feature defects. Secondly, defects of different scales and types are difficult to express differently under a unified feature extraction and model structure, resulting in insufficient feature representation ability, which in turn leads to false detection or inaccurate classification. Third, in actual detection processes, deep learning models often introduce complex network structures to improve accuracy, resulting in a large amount of computation. In embedded devices or real-time on-site detection scenarios, it is difficult to balance detection speed and recognition accuracy, which affects the engineering application effect of the system. Summary of the Invention

[0003] To address the shortcomings of existing technologies, this invention provides a machine vision-based method for weld defect identification, which has the advantages of improving detection accuracy and stability, and solves the problems mentioned in the background technology.

[0004] To achieve the aforementioned goals of improving detection accuracy and stability, this invention provides the following technical solution: a weld defect identification method based on machine vision, comprising the following steps: Under the imaging state formed by the imaging medium on the weld surface, continuous image acquisition is performed on the weld surface to form data on the changes in the imaging in the time dimension and spatial distribution. Based on the imaging continuity and expansion consistency of defect-free regions in the changing data, the amplitude of the imaging intensity change and the displacement of the expansion boundary between adjacent frames are calculated. The imaging diffusion direction and expansion rate are determined according to the amplitude of change and the displacement, and a reference imaging response relationship is constructed to describe the imaging diffusion behavior. For abnormal imaging segments that appear in actual imaging changes, the relationship between the actual imaging response and the reference imaging response is compared. Based on the degree of difference between the actual extended state and the reference extended state and the continuity interruption, the deviation degree of each region is calculated to form the abnormal imaging response distribution. Based on the distribution of abnormal imaging responses, abnormal imaging behavior is analyzed, and imaging interruption features, local clustering anomaly features, and expansion obstruction features are extracted. The abnormal regions are integrated by combining spatial connectivity and temporal persistence to determine candidate defect regions. Based on the intensity of abnormal response and the stability of its changes in consecutive frames, the consistency of the defect response in the candidate defect region is evaluated, and the different types of defects are classified and judged according to the differences in response during the imaging process, and the category and location of the weld defect are output.

[0005] Preferably, the process of generating change data of the image in terms of time dimension and spatial distribution is as follows: The adhesion and distribution of the developing medium on the weld surface are initialized and recorded, and the acquisition triggering conditions are established in combination with the initial uniformity of the developer diffusion. Based on the acquisition trigger conditions, the weld surface is continuously imaged in multiple frames, and the consistency of the imaging stability between adjacent frames is verified. Based on the imaging stability verification results, the acquired frames are filtered for validity, and the valid frames are spatially registered in chronological order to form spatiotemporally aligned image data. Based on spatiotemporally aligned image data, we extract the grayscale distribution and reflectance response features of the image to construct data on the changes in the image in the time dimension and spatial distribution.

[0006] Preferably, the process of calculating the magnitude of image intensity change and the displacement of the extended boundary between adjacent frames is as follows: A baseline region is selected for the defect-free areas in the changing data, and a reference imaging stability region is constructed based on the selection results; The difference in grayscale response between adjacent frames within the reference image stability region is calculated to obtain the magnitude of image intensity change. The image extension boundary is located based on the edge response gradient change, and the boundary migration distance between adjacent frames is calculated to obtain the extension boundary displacement. The variation range of imaging intensity and the displacement of the expansion boundary are jointly characterized to form the basic parameters of imaging diffusion.

[0007] Preferably, the process of constructing a reference imaging response relationship to describe the imaging diffusion behavior is as follows: Based on the fundamental parameters of image diffusion, the temporal correspondence between the magnitude of image intensity change and the displacement of the expansion boundary is analyzed to determine the direction of image diffusion. The image spreading rate is determined based on the changes in the fundamental parameters of image diffusion over time. Based on the correspondence between the imaging diffusion direction and the diffusion rate, a rule for describing imaging diffusion behavior is constructed; Based on the imaging diffusion behavior description rules, combined with the imaging diffusion direction and expansion rate, a consistent constraint description is made for the imaging diffusion behavior in defect-free areas, forming a reference imaging response relationship.

[0008] Preferably, the process of comparing the actual display response with the reference display response is as follows: The actual imaging change data is divided into regions to determine candidate abnormal imaging segments; The imaging intensity variation characteristics and extended boundary evolution characteristics of candidate abnormal imaging segments are mapped and matched with the corresponding characteristics of the reference imaging response. Based on the mapping matching results, the consistency difference between the actual image and the reference image is quantitatively calculated to obtain the regional response deviation index.

[0009] Preferably, the process of forming an abnormal imaging response distribution is as follows: Based on the regional response deviation index, the spatial distribution of the deviation index is analyzed to extract the differential features that reflect the deviation of the imaging extension state. Based on the changing trend of the regional response deviation index between adjacent frames, the imaging continuity interruption factor is calculated; By jointly weighting the difference characteristics with the continuity interruption factor, an index of regional deviation is obtained; Spatial mapping and aggregation are performed based on the regional deviation index to form the distribution of imaging anomaly response.

[0010] Preferably, the process of extracting imaging interruption features, local aggregation anomaly features, and expansion obstruction features is as follows: Based on the distribution of abnormal imaging responses, the abnormal response regions are divided into connected components to determine the abnormal imaging sub-regions. The abnormal imaging behavior is decomposed and analyzed by focusing on the changes in the spatial distribution and boundary evolution of the imaging response within the abnormal imaging sub-region; Based on the abrupt changes in grayscale response, imaging interruption features are extracted; based on the concentration of local grayscale response, local aggregation anomaly features are extracted; and based on the degree of restriction of boundary expansion changes, expansion obstruction features are extracted. The extracted abnormal features are uniformly expressed and processed to obtain abnormal imaging behavior features.

[0011] Preferably, the process of determining candidate defect regions is as follows: Based on the consistency of spatial connectivity and abnormal imaging behavior characteristics, spatial aggregation analysis is performed on the abnormal imaging sub-regions to form initial candidate regions. By combining the variation amplitude of abnormal imaging behavior characteristics in consecutive frames, the temporal persistence of the initial candidate region is screened for stability. Regions that meet the constraints of spatial connectivity and temporal persistence are merged and integrated to determine candidate defect regions.

[0012] Preferably, the process of evaluating the consistency of defect response in candidate defect regions is as follows: Statistical analysis of the abnormal response intensity within the candidate defect region yields response characteristics that characterize the intensity distribution. The stability is evaluated based on the changes in abnormal responses in consecutive frames, and a response stability index is obtained. Based on response characteristics and response stability indicators, the response consistency of candidate defect regions is comprehensively judged to obtain the defect response consistency evaluation result.

[0013] Preferably, the process for outputting the type and location of weld defects is as follows: Based on the results of the defect response consistency evaluation, a set of imaging response features characterizing candidate defect regions is extracted. Based on the differences in imaging intensity variation characteristics, boundary evolution characteristics, and spatial distribution characteristics of different defect types, defect type discrimination rules are constructed. The imaging response features are compared with the defect type discrimination rules to determine the defect category of the candidate defect area. Combined with the spatial location and range information, the category and location of the weld defect are output.

[0014] Compared with existing technologies, the present invention provides a machine vision-based method for weld defect identification, which has the following advantages: This invention introduces a spatiotemporal evolution analysis mechanism for imaging diffusion behavior. Using the imaging continuity and expansion consistency of defect-free regions as a reference, a reference imaging response relationship is constructed. Based on the deviation between the actual imaging and the reference response, precise localization of abnormal imaging is achieved. This effectively distinguishes between imaging anomalies caused by defects and interference signals caused by surface conditions, illumination changes, and other factors. Through structured analysis of abnormal imaging behavior and joint constraints of spatial connectivity and temporal persistence, stable extraction of candidate defect regions is achieved. Consistency evaluation is performed by combining the intensity of abnormal responses and their cross-frame variation stability, improving the reliability of defect identification results. The differences in response during the imaging evolution process of different defect types are used for discrimination, effectively enhancing the identification ability of minute defects, weakly imaging defects, and defects in complex backgrounds. This comprehensively improves the accuracy, stability, and anti-interference capability of weld defect detection, meeting the high-precision automated detection requirements under complex working conditions. Attached Figure Description

[0015] Figure 1 This is a schematic diagram of the method of the present invention. Detailed Implementation

[0016] 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.

[0017] Example 1: Please refer to Figure 1 As shown in the figure, a machine vision-based weld defect identification method according to an embodiment of the present invention includes the following steps: S1: Under the imaging state formed by the imaging medium on the weld surface, continuous image acquisition is performed on the weld surface to form data on the changes in the imaging in the time dimension and spatial distribution.

[0018] The process by which the image in S1 is formed shows the changes in the temporal dimension and spatial distribution of the data: The adhesion distribution of the developing medium on the weld surface is initialized and recorded, and the acquisition trigger condition is established in combination with the initial uniformity of the developing agent diffusion. The developing medium is sprayed or coated on the weld surface, and the initial image of the weld area is acquired by an industrial camera. The adhesion distribution of the developing medium on the weld surface is recorded. Based on the acquired images, the gray mean, gray variance and regional uniformity index are calculated to evaluate the diffusion uniformity of the developing agent in the weld and its neighborhood. When the uniformity index of several consecutive frames meets the preset threshold condition, it is determined that the diffusion state of the developing agent has reached the stable condition and subsequent imaging acquisition is triggered. If the stable condition is not met, the acquisition and judgment are repeated after a preset time until the stability constraint is met, thereby ensuring the consistency and comparability of the acquired data in the development distribution. Based on the acquisition trigger conditions, the weld surface is continuously imaged in multiple frames, and the consistency of imaging stability between adjacent frames is checked. After the acquisition is triggered, the weld area is continuously imaged using an industrial camera at a fixed frame rate. The stability consistency is checked between adjacent frames. On the one hand, the gray-scale difference mean and the global brightness change rate are calculated. On the other hand, the edge or corner features of the weld are extracted and matched. The pixel displacement of the feature points in adjacent frames is calculated. When the brightness change rate is lower than the threshold and the feature point displacement does not exceed the set range, the frame pair is determined to be stable. If there is a sudden change in illumination or the displacement exceeds the limit, the corresponding frame is marked as an unstable frame and the reason label is recorded to ensure the consistency of the input sequence in terms of illumination and spatial position. Based on the imaging stability verification results, the acquired frames are screened for validity, and the valid frames are spatially registered in chronological order to form spatiotemporally aligned image data. According to the verification results, frames marked as unstable are removed, and only stable frames are retained as valid frames. Spatial registration is performed on the valid frames. First, corner points or edge features are extracted to establish inter-frame matching relationships. Then, an affine transformation model is used to solve the geometric transformation parameters and map each frame to the same reference coordinate system. During the registration process, the optimization objectives are to minimize the reprojection error of matching points or maximize the structural consistency of overlapping areas. Iterative optimization is performed when necessary. After completion, spatially aligned image data is obtained, thereby eliminating the influence of equipment micro-vibration or workpiece micro-movement and providing a unified benchmark for spatiotemporal analysis. Based on spatiotemporally aligned image data, the grayscale distribution and reflectance response features of the image are extracted to construct the change data of the image in the temporal and spatial dimensions. After obtaining the spatially aligned image data, image feature extraction is performed on each frame to calculate the pixel-level grayscale distribution and reflectance response features. Edge information is extracted by gradient operators. Cross-frame difference is performed on the same spatial location in the temporal dimension to obtain the change of image intensity over time. At the same time, the positional change of the image boundary in consecutive frames is recorded. The spatial distribution features and temporal change features are uniformly organized to form change data that characterizes the evolution law of the image in the temporal and spatial dimensions, providing basic input for diffusion behavior analysis and anomaly judgment.

[0019] S2: Based on the imaging continuity and expansion consistency of defect-free areas in the changing data, calculate the amplitude of imaging intensity change and the displacement of expansion boundary between adjacent frames, and determine the imaging diffusion direction and expansion rate according to the amplitude of change and the displacement, and construct a reference imaging response relationship to describe the imaging diffusion behavior.

[0020] The process of calculating the magnitude of image intensity change and the displacement of the extended boundary between adjacent frames in S2 is as follows: A baseline region is selected from the defect-free areas in the changing data, and a reference imaging stable region is constructed based on the selection results. Candidate baseline regions are selected from the changing data. The weld area is divided into grids, and the gray-level mean change rate, gray-level variance, and edge density index are calculated for each sub-block in consecutive frames. Sub-blocks with gray-level change rate below a set threshold, gray-level variance within a stable range, and small edge density changes are identified as stable candidate regions. Furthermore, through connectivity constraints, adjacent sub-blocks that meet the conditions are aggregated to form several continuously distributed stable regions. From these, regions with larger areas and uniform distribution are selected as reference imaging stable regions to characterize the imaging diffusion baseline behavior under defect-free conditions. Differential calculations are performed on the grayscale responses of adjacent frames within the reference stable imaging region to obtain the amplitude of image intensity change. Within the reference stable imaging region, pixel-by-pixel grayscale differential processing is performed on adjacent frame images to obtain the amount of grayscale change of each pixel between consecutive frames. To reduce the influence of random noise on the calculation results, local averaging or median filtering is applied to the amount of grayscale change. Statistical analysis is performed on the processed grayscale change in each frame to calculate the average amplitude or median value of grayscale change in the region, which is used as an index of image intensity change amplitude. The amplitude of change is normalized according to the grayscale level of the initial frame to reduce the influence of different lighting conditions. This is used to characterize the intensity change characteristics of the image during the stable diffusion process, providing a quantitative basis for subsequent analysis of image diffusion behavior. The image expansion boundary is located based on the edge response gradient change, and the boundary migration distance between adjacent frames is calculated to obtain the expansion boundary displacement. For the image boundary in the stable area of ​​the reference image, the edge response image is first extracted using a gradient operator, and the image expansion boundary is filtered out by setting a gradient threshold. The boundary pixel set is obtained by contour extraction of each frame boundary. The migration distance of the boundary position is calculated between adjacent frames by the nearest neighbor point matching or contour centroid tracking. For irregular boundaries, the displacement of multiple boundary points can be averaged or statistically analyzed as the expansion boundary displacement of the region. This process can reflect the expansion speed and direction change of the image in space, and provide key geometric information for diffusion modeling. The magnitude of image intensity variation and the displacement of the expansion boundary are jointly characterized to form the basic parameters of image diffusion. The magnitude of image intensity variation and the displacement of the expansion boundary are jointly characterized, and the basic parameters used to describe the image diffusion behavior are formed by constructing a correspondence or combining them according to preset weights. The basic parameters are tracked and recorded in consecutive frames to reflect the evolution characteristics of the image in both the intensity variation and spatial expansion dimensions. This provides a unified quantitative basis for establishing the reference image response relationship and analyzing abnormal deviations.

[0021] The process of constructing the reference imaging response relationship to describe the imaging diffusion behavior in S2 is as follows: Based on the fundamental parameters of image diffusion, the temporal correspondence between the magnitude of image intensity change and the displacement of the expansion boundary is analyzed to determine the image diffusion direction. Using the fundamental parameters of image diffusion, multiple consecutive frames of images are selected within the reference image stability region, and the position of the image boundary in each frame is extracted. By pairing the boundary positions of adjacent frames, the overall migration trend of the boundary is calculated, and the dominant direction of boundary movement is determined by fitting the centroid displacement or principal direction. To improve stability, the boundary displacement direction is statistically analyzed in several consecutive frames, and the direction with the highest frequency or the most stable change is taken as the image diffusion direction. At the same time, consistency constraints are set on the direction results to avoid misjudgment caused by local disturbances, thereby obtaining stable and reliable image diffusion direction results. The image spreading rate is determined based on the changes in the fundamental parameters of image diffusion over time. After determining the direction of image diffusion, the changes in the fundamental parameters of image diffusion over time are further analyzed. By statistically analyzing the displacement changes of the spreading boundary along the diffusion direction in consecutive frames and combining the inter-frame time interval, the boundary spreading distance per unit time is calculated. To reduce the influence of random fluctuations, the spreading distance of several frames is processed by moving average or median to obtain a smoothed spreading rate. At the same time, a reasonable range constraint is set on the spreading rate to ensure that the obtained spreading rate reflects the true change level under stable diffusion conditions, thereby forming a reliable image spreading rate parameter. Based on the correspondence between the imaging diffusion direction and the expansion rate, a rule for describing the imaging diffusion behavior is constructed. Based on the imaging diffusion direction and the expansion rate, the imaging diffusion behavior in the defect-free area is analyzed. The range of change of diffusion direction and the fluctuation range of expansion rate in consecutive frames are statistically analyzed. The direction change threshold and the rate fluctuation threshold are established respectively. The amplitude of the imaging intensity change and the expansion rate are analyzed to determine the relationship between the two during normal diffusion. The direction change range, the rate fluctuation range and the intensity change correspondence are combined to form a constraint rule for describing the imaging diffusion behavior. Based on the image diffusion behavior description rules, combined with the image diffusion direction and expansion rate, a consistent constraint description is applied to the image diffusion behavior in defect-free areas to form a reference image response relationship. Based on these constraint rules, the image diffusion process in defect-free areas is uniformly expressed. The magnitude of image intensity change, expansion rate, and diffusion direction are jointly recorded in consecutive frames, and diffusion processes that satisfy the constraint rules are selected as valid samples. Multiple valid samples are statistically summarized to form a correspondence reflecting the temporal change and spatial expansion of the image, thereby constructing a reference image response relationship, which serves as a comparison benchmark for anomaly detection.

[0022] S3: For abnormal imaging segments that appear in actual imaging changes, compare the relationship between the actual imaging response and the reference imaging response, and calculate the degree of deviation of each region based on the degree of difference between the actual extended state and the reference extended state and the continuity interruption, to form the abnormal imaging response distribution.

[0023] The process of comparing the actual image response with the reference image response in S3 is as follows: The actual imaging change data is divided into regions to identify candidate abnormal imaging segments. Based on the obtained imaging change data, the weld area is regularly divided, for example, into blocks according to a fixed-size grid. These blocks are then marked based on the weld centerline position. The imaging intensity changes and expansion boundary changes of each block in consecutive frames are statistically analyzed, and their magnitude and stability are calculated. When a block deviates significantly from the overall change level in consecutive frames, it is marked as an abnormal candidate region. Further, through spatial connectivity analysis, adjacent abnormal candidate blocks are merged to form candidate abnormal imaging segments with continuous spatial distribution, thus achieving preliminary localization of the abnormal region. The imaging intensity variation characteristics and extended boundary evolution characteristics of candidate abnormal imaging segments are mapped and matched with the corresponding characteristics of the reference imaging response relationship. For candidate abnormal imaging segments, their imaging intensity variation characteristics and extended boundary evolution characteristics are extracted, and the above characteristics are matched and analyzed with the corresponding standard characteristics in the reference imaging response relationship. Specifically, by comparing the consistency between the actual characteristics and the reference characteristics in terms of variation trend and value range, it is determined whether they conform to normal diffusion behavior. During the matching process, the intensity variation characteristics and boundary evolution characteristics can be independently compared and their respective matching degree is recorded, thereby obtaining the matching results that reflect the differences between the actual imaging behavior and the reference behavior.

[0024] Based on the mapping matching results, the consistency difference between the actual image and the reference image is quantitatively calculated to obtain a regional-level response deviation index. After obtaining the mapping matching results, the deviation of the image intensity change characteristics and the evolution characteristics of the extended boundary in each candidate abnormal image segment from the response relationship of the reference image is uniformly quantified. The deviation degree of image intensity change and the deviation degree of extended boundary change are normalized and combined according to preset weights to form the corresponding comprehensive deviation. The comprehensive deviation is tracked and statistically analyzed within a continuous frame range, and its change stability is constrained. Abnormal changes caused by short-term fluctuations are eliminated, and persistent deviation characteristics are retained. The comprehensive deviation after stability constraint is used as the regional-level response deviation index to characterize the consistency difference between the actual image response and the response relationship of the reference image, thereby providing a quantitative basis for abnormal image identification and defect judgment.

[0025] The process of forming the imaging anomaly response distribution in S3 is as follows: Based on the regional-level response deviation index, the spatial distribution of the deviation index is analyzed to extract the differential features reflecting the deviation of the imaging expansion state. Based on the regional-level response deviation index, the spatial distribution of the weld area is analyzed, the deviation index is organized according to a predetermined grid or connected region, and the spatial variation of the deviation index in each region is statistically analyzed. The deviation variation amplitude between adjacent regions and the consistency level of variation within the region are calculated. Regions with large deviation variation amplitude and uneven variation are marked and filtered based on their spatial distribution continuity to extract differential features that reflect the deviation of the imaging expansion state from the reference response, thereby obtaining spatial feature results characterizing the abnormal expansion trend of the imaging. Based on the changing trend of the regional response deviation index between adjacent frames, the imaging continuity interruption factor is calculated. The change of the regional response deviation index in consecutive frames is analyzed in the time dimension. For each spatial region, the deviation change trend between adjacent frames is statistically analyzed, and the stability of the deviation change is calculated. When a certain region has a sudden change or a discontinuous change trend in consecutive frames, its change degree is quantified, and the degree of continuity disruption is used as the imaging continuity interruption factor. At the same time, occasional fluctuations that occur in a short period of time are screened out, and only the interruption features that persist in multiple consecutive frames are retained, so as to obtain time feature parameters that can stably reflect the continuity disruption of the imaging process. By jointly weighting the difference features and the continuity interruption factor, a regional deviation index is obtained. After obtaining the difference features and the imaging continuity interruption factor, the two are uniformly quantified. The spatial deviation represented by the difference features and the temporal discontinuity represented by the continuity interruption factor are normalized and combined according to preset weights to form a regional deviation quantity that comprehensively reflects the degree of imaging anomaly. The regional deviation quantity is tracked and statistically analyzed within a continuous frame range, and its change stability is constrained to eliminate interference caused by short-term fluctuations and retain the abnormal deviation features with continuity, thereby forming a stable and reliable regional deviation index. Spatial mapping and aggregation are performed based on the regional deviation index to form an abnormal imaging response distribution. Based on the regional deviation index, the weld area is spatially mapped, and the deviation of each region is reconstructed according to its spatial location. Aggregation analysis is performed on the deviation between adjacent regions, and regions that are adjacent in location and have similar deviation are merged. Boundary optimization processing is performed on the aggregated regions to form a continuous abnormal region distribution with a clear spatial range. Finally, the spatial distribution of the above abnormal regions is uniformly expressed to form an abnormal imaging response distribution, which is used to characterize the abnormal change region in the weld surface imaging process and provide a basis for defect identification.

[0026] S4: Based on the distribution of abnormal imaging responses, analyze the abnormal imaging behavior, extract imaging interruption features, local clustering anomaly features, and expansion obstruction features, and integrate the abnormal regions by combining spatial connectivity and temporal persistence to determine candidate defect regions.

[0027] The process of extracting imaging interruption features, local aggregation anomaly features, and expansion obstruction features in S4 is as follows: Based on the distribution of abnormal imaging responses, the abnormal response regions are divided into connected components to determine abnormal imaging sub-regions. Based on the established distribution of abnormal imaging responses, regions with deviations exceeding a set threshold are marked, and connected component division is performed on these regions according to pixel adjacency. Spatially continuous abnormal regions are merged into several independent sub-regions. During the division process, discrete regions with too small an area or that only appear in a single frame are removed, and only regions that are spatially continuous and have a certain degree of persistence in adjacent frames are retained as abnormal imaging sub-regions, thereby obtaining anomaly analysis units with clear structures and stable existence. This study decomposes and analyzes the abnormal imaging behavior by focusing on the changes in the spatial distribution and boundary evolution of the imaging response within the abnormal imaging sub-regions. After obtaining the abnormal imaging sub-regions, the changes in the spatial distribution and boundary evolution of the imaging response within each sub-region are analyzed. The spatial distribution characteristics of the grayscale response within the region and the changing trend of the boundary in consecutive frames are statistically analyzed. Through joint analysis of the changes within the region and the boundary, the abnormal imaging behavior is divided into two levels: grayscale change anomaly and boundary evolution anomaly. The changes at each level are quantitatively recorded, thus forming a structured analysis result of the abnormal imaging behavior. Based on the abrupt changes in grayscale response, display interruption features are extracted; based on the concentration of local grayscale response, local clustering anomaly features are extracted; and based on the degree of restriction on boundary expansion, expansion obstruction features are extracted. Based on the above analysis results, features are extracted for different types of abnormal behavior within the abnormal display sub-regions. For regions where grayscale response shows significant spatial abrupt changes, display interruption features are extracted by statistically analyzing the grayscale change amplitude between adjacent pixels and identifying abrupt change locations exceeding a threshold. For cases where grayscale response is highly concentrated in a local region, local clustering anomaly features are extracted by calculating the concentration of grayscale distribution within the region and identifying regions where the concentration exceeds a set range. For cases where boundary expansion is restricted or changes are significantly slowed in consecutive frames, expansion obstruction features are extracted by analyzing the temporal trend of boundary movement distance and identifying regions with restricted expansion. Thus, corresponding feature results for different types of abnormal behavior are obtained. The extracted abnormal features are uniformly expressed to obtain abnormal imaging behavior features. After extracting various abnormal features, the imaging interruption features, local clustering abnormal features, and expansion obstruction features are uniformly expressed. Different features are mapped according to their regional locations, and each feature is normalized to be on a uniform quantization scale. The features are jointly organized within a continuous frame range and integrated according to their spatial distribution relationship to form abnormal imaging behavior features that can simultaneously characterize multiple abnormal behaviors.

[0028] The process of determining candidate defect regions in S4 is as follows: Based on spatial connectivity and consistency of abnormal imaging behavior characteristics, spatial aggregation analysis is performed on abnormal imaging sub-regions to form initial candidate regions. Based on the obtained abnormal imaging sub-regions and their corresponding abnormal imaging behavior characteristics, spatial adjacency analysis is performed on each sub-region. Sub-regions that are spatially adjacent and have similar abnormal imaging behavior characteristics are merged. During the merging process, the consistency of the characteristics of each sub-region is compared. When they show similar performance in one or more of the imaging interruption characteristics, local aggregation anomaly characteristics, and expansion obstruction characteristics, and the differences are within a preset range, they are merged into the same analysis unit. The boundaries of the merged regions are reconstructed to form a continuous and complete region range, thereby obtaining the initial candidate regions. This ensures that the candidate regions are spatially coherent and have consistent abnormal feature expressions. By combining the variation amplitude of abnormal imaging behavior characteristics in consecutive frames, the temporal persistence of the initial candidate regions is screened for stability. After obtaining the initial candidate regions, the temporal dimension analysis of their changes in consecutive frames is performed. For each candidate region, the position change, area change, and variation amplitude of abnormal imaging behavior characteristics in adjacent frames are statistically analyzed, and the duration of its existence in consecutive frames is calculated. When a region exists continuously in consecutive frames and its position and feature change amplitude are within a preset stable range, it is determined to be a region with stable abnormal behavior. Regions that only appear in individual frames or change drastically are eliminated, thereby screening out candidate regions with persistence and stability in the temporal dimension and avoiding the influence of instantaneous noise or interference on subsequent judgments. Regions satisfying spatial connectivity and temporal persistence constraints are fused and integrated to determine candidate defect regions. After temporal persistence screening, candidate regions satisfying spatial connectivity and temporal stability constraints are fused and integrated. Spatially adjacent regions that exhibit consistent temporal behavior are further merged, and the boundaries of the fused regions are optimized to form a continuous, complete regional structure with a clear spatial range. During the fusion process, the abnormal imaging behavior characteristics within the regions are comprehensively evaluated to ensure that the fused regions maintain consistent abnormal feature expression. Finally, the fused and integrated regions are determined as candidate defect regions for defect response consistency assessment and defect classification.

[0029] S5: Based on the abnormal response intensity and the stability of changes in consecutive frames, the candidate defect region is evaluated for defect response consistency, and different defect types are classified and judged according to the response differences in the imaging process, and the category and location of weld defects are output.

[0030] The process of evaluating the consistency of defect response in candidate defect regions in S5 is as follows: Statistical analysis is performed on the abnormal response intensity within the candidate defect region to obtain response features characterizing the intensity distribution. For the identified candidate defect region, statistical analysis is performed on the abnormal response intensity within the region. The response values ​​of each pixel or sub-region within the region are summarized, and the response intensity is statistically graded to obtain the proportion of different intensity intervals. At the same time, the dispersion and distribution uniformity of the response values ​​are calculated, and the spatial distribution concentration of the response intensity is analyzed to identify local high response clusters and the overall distribution pattern, thereby forming response features used to characterize the response intensity distribution state within the candidate defect region. The stability is evaluated based on the changes in abnormal responses in consecutive frames to obtain a response stability index. After obtaining the response characteristics, the changes in abnormal responses of candidate defect regions in consecutive frames are analyzed in the time dimension. For the same candidate region, the changes in response intensity, region location, and region range in adjacent frames are statistically analyzed, and the continuity of the above changes is judged. When a region continues to exist in consecutive frames and its response changes are within a set range, it is determined to be a stable response region. Regions that only appear briefly or change drastically are eliminated. The response changes in consecutive frames are comprehensively statistically analyzed to form a response stability index that characterizes the stability of the region response in the time dimension. Based on response characteristics and response stability indices, the response consistency of candidate defect regions is comprehensively judged to obtain the defect response consistency evaluation result. After obtaining the response characteristics and response stability indices, the two are uniformly quantified. The spatial consistency reflected by the response intensity distribution and the temporal consistency reflected by the response stability indices are normalized and combined according to preset weights to form a comprehensive consistency quantity. The comprehensive consistency quantity is tracked and analyzed within a continuous frame range. Short-term fluctuations are suppressed, and only the continuous and stable consistency performance is retained. The processed comprehensive consistency quantity is used as the defect response consistency evaluation result of the candidate defect region to characterize the stability and reliability of the defect response in that region.

[0031] The process of outputting the type and location of weld defects in S5 is as follows: Based on the results of the defect response consistency evaluation, a set of imaging response features characterizing candidate defect regions is extracted. Based on the obtained results of the defect response consistency evaluation, features of the imaging response within the candidate defect regions are extracted. The distribution of response intensity, boundary changes, and spatial distribution morphology within the regions are statistically analyzed in a unified manner. The response intensity is classified according to a set interval, and the proportion of each interval and its spatial concentration are calculated. At the same time, the changes of the region boundary in consecutive frames are recorded to form boundary evolution features. The spatial morphological features of the regions are described, including area size, shape continuity, and distribution range. The above features are normalized and organized by region to form a feature set that can characterize the imaging behavior of candidate defect regions. By combining the differences in imaging intensity variation characteristics, boundary evolution characteristics, and spatial distribution characteristics of different defect types, defect type discrimination rules are constructed. After obtaining the imaging response feature set, the characteristics of different types of weld defects are summarized and organized according to their performance differences in the imaging process. The imaging intensity variation characteristics, boundary evolution characteristics, and spatial distribution characteristics are combined and analyzed to establish discrimination conditions for various types of defects under the above feature dimensions. Corresponding feature ranges and feature combination relationships are set for different defect types, so that each type of defect corresponds to a set of distinguishable feature constraints. The discrimination conditions are uniformly organized to form a defect type discrimination rule system for distinguishing different defect types. The imaging response features are compared with the defect type discrimination rules to determine the defect category of the candidate defect region. Combined with spatial location and range information, the category and location of the weld defect are output. After the discrimination rules are constructed, the imaging response features of the candidate defect region are matched with each type of defect type discrimination rule. Regions that meet a certain discrimination condition are assigned a corresponding defect category label. When a region meets multiple discrimination conditions, the matching degree of each condition is compared, and the category with the highest matching degree is selected as the final defect type of the region. Based on the determination of the defect category, the location and range of the defect are located by combining the spatial coordinates and coverage of the candidate defect region in the image. Finally, the defect category information and the corresponding spatial location information are integrated to output the category and location results of the weld defect.

[0032] 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.

[0033] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for weld defect identification based on machine vision, characterized in that, Includes the following steps: Under the imaging state formed by the imaging medium on the weld surface, continuous image acquisition is performed on the weld surface to form data on the changes in the imaging in the time dimension and spatial distribution. Based on the imaging continuity and expansion consistency of defect-free regions in the changing data, the amplitude of the imaging intensity change and the displacement of the expansion boundary between adjacent frames are calculated. The imaging diffusion direction and expansion rate are determined according to the amplitude of change and the displacement, and a reference imaging response relationship is constructed to describe the imaging diffusion behavior. For abnormal imaging segments that appear in actual imaging changes, the relationship between the actual imaging response and the reference imaging response is compared. Based on the degree of difference between the actual extended state and the reference extended state and the continuity interruption, the deviation degree of each region is calculated to form the abnormal imaging response distribution. Based on the distribution of abnormal imaging responses, abnormal imaging behavior is analyzed, and imaging interruption features, local clustering anomaly features, and expansion obstruction features are extracted. The abnormal regions are integrated by combining spatial connectivity and temporal persistence to determine candidate defect regions. Based on the intensity of abnormal response and the stability of its changes in consecutive frames, the consistency of the defect response in the candidate defect region is evaluated, and the different types of defects are classified and judged according to the differences in response during the imaging process, and the category and location of the weld defect are output.

2. The method for weld defect identification based on machine vision according to claim 1, characterized in that, The process of forming the data showing the changes in the temporal and spatial distribution of the image is as follows: The adhesion and distribution of the developing medium on the weld surface are initialized and recorded, and the acquisition triggering conditions are established in combination with the initial uniformity of the developer diffusion. Based on the acquisition trigger conditions, the weld surface is continuously imaged in multiple frames, and the consistency of the imaging stability between adjacent frames is verified. Based on the imaging stability verification results, the acquired frames are filtered for validity, and the valid frames are spatially registered in chronological order to form spatiotemporally aligned image data. Based on spatiotemporally aligned image data, we extract the grayscale distribution and reflectance response features of the image to construct data on the changes in the image in the time dimension and spatial distribution.

3. The method for weld defect identification based on machine vision according to claim 2, characterized in that, The process of calculating the magnitude of image intensity variation and the displacement of the extended boundary between adjacent frames is as follows: A baseline region is selected for the defect-free areas in the changing data, and a reference imaging stability region is constructed based on the selection results; The difference in grayscale response between adjacent frames within the reference image stability region is calculated to obtain the magnitude of image intensity change. The image extension boundary is located based on the edge response gradient change, and the boundary migration distance between adjacent frames is calculated to obtain the extension boundary displacement. The variation range of imaging intensity and the displacement of the expansion boundary are jointly characterized to form the basic parameters of imaging diffusion.

4. The method for weld defect identification based on machine vision according to claim 3, characterized in that, The process of constructing a reference imaging response relation to describe the imaging diffusion behavior is as follows: Based on the fundamental parameters of image diffusion, the temporal correspondence between the magnitude of image intensity change and the displacement of the expansion boundary is analyzed to determine the direction of image diffusion. The image spreading rate is determined based on the changes in the fundamental parameters of image diffusion over time. Based on the correspondence between the imaging diffusion direction and the diffusion rate, a rule for describing imaging diffusion behavior is constructed; Based on the imaging diffusion behavior description rules, combined with the imaging diffusion direction and expansion rate, a consistent constraint description is made for the imaging diffusion behavior in defect-free areas, forming a reference imaging response relationship.

5. The method for weld defect identification based on machine vision according to claim 4, characterized in that, The process of comparing the actual image response with the reference image response is as follows: The actual imaging change data is divided into regions to determine candidate abnormal imaging segments; The imaging intensity variation characteristics and extended boundary evolution characteristics of candidate abnormal imaging segments are mapped and matched with the corresponding characteristics of the reference imaging response. Based on the mapping matching results, the consistency difference between the actual image and the reference image is quantitatively calculated to obtain the regional response deviation index.

6. The method for weld defect identification based on machine vision according to claim 5, characterized in that, The process of forming an abnormal imaging response distribution is as follows: Based on the regional response deviation index, the spatial distribution of the deviation index is analyzed to extract the differential features that reflect the deviation of the imaging extension state. Based on the changing trend of the regional response deviation index between adjacent frames, the imaging continuity interruption factor is calculated; By jointly weighting the difference characteristics with the continuity interruption factor, an index of regional deviation is obtained; Spatial mapping and aggregation are performed based on the regional deviation index to form the distribution of imaging anomaly response.

7. The method for weld defect identification based on machine vision according to claim 6, characterized in that, The process of extracting imaging interruption features, local aggregation anomaly features, and expansion obstruction features is as follows: Based on the distribution of abnormal imaging responses, the abnormal response regions are divided into connected components to determine the abnormal imaging sub-regions. The abnormal imaging behavior is decomposed and analyzed by focusing on the changes in the spatial distribution and boundary evolution of the imaging response within the abnormal imaging sub-region; Based on the abrupt changes in grayscale response, imaging interruption features are extracted; based on the concentration of local grayscale response, local aggregation anomaly features are extracted; and based on the degree of restriction of boundary expansion changes, expansion obstruction features are extracted. The extracted abnormal features are uniformly expressed and processed to obtain abnormal imaging behavior features.

8. The method for weld defect identification based on machine vision according to claim 7, characterized in that, The process of determining candidate defect regions is as follows: Based on the consistency of spatial connectivity and abnormal imaging behavior characteristics, spatial aggregation analysis is performed on the abnormal imaging sub-regions to form initial candidate regions. By combining the variation amplitude of abnormal imaging behavior characteristics in consecutive frames, the temporal persistence of the initial candidate region is screened for stability. Regions that meet the constraints of spatial connectivity and temporal persistence are merged and integrated to determine candidate defect regions.

9. The method for weld defect identification based on machine vision according to claim 8, characterized in that, The process of evaluating the consistency of defect response in candidate defect regions is as follows: Statistical analysis of the abnormal response intensity within the candidate defect region yields response characteristics that characterize the intensity distribution. The stability is evaluated based on the changes in abnormal responses in consecutive frames, and a response stability index is obtained. Based on response characteristics and response stability indicators, the response consistency of candidate defect regions is comprehensively judged to obtain the defect response consistency evaluation result.

10. A method for weld defect identification based on machine vision according to claim 9, characterized in that, The process of outputting the type and location of weld defects is as follows: Based on the results of the defect response consistency evaluation, a set of imaging response features characterizing candidate defect regions is extracted. Based on the differences in imaging intensity variation characteristics, boundary evolution characteristics, and spatial distribution characteristics of different defect types, defect type discrimination rules are constructed. The imaging response features are compared with the defect type discrimination rules to determine the defect category of the candidate defect area. Combined with the spatial location and range information, the category and location of the weld defect are output.