A Laser Cladding Layer Surface Quality Detection Method Based on Image Mosaic and Image Recognition

By employing image stitching and recognition methods, and utilizing SIFT and dense optical flow algorithms to correct geometric deviations in the surface detection of laser cladding layers, the problem of inaccurate defect identification caused by image stitching errors in existing technologies is solved, thus achieving efficient defect detection and quality assessment.

CN123118564APending Publication Date: 2026-11-17HUADIAN QINGDAO POWER GENERATION COMPANY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611365633.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-04
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In the surface inspection of laser cladding layers, existing image stitching methods are difficult to adapt to complex working conditions, resulting in geometric errors that affect the accuracy of defect identification, causing positional shifts, morphological distortions, or duplicate mappings, which in turn lead to missed detections, false detections, and distorted quality assessments.

Method used

A method based on image stitching and image recognition is adopted. Key feature points are extracted by SIFT algorithm, global affine transformation matrix is ​​calculated and dense optical flow algorithm is used to correct motion vector field. Combined with local weighted affine transformation and gradient difference sequence analysis, geometric deviation is corrected to improve the geometric realism of stitched image.

Benefits of technology

It improves the accuracy and stability of surface defect identification in laser cladding layers, reduces the risk of missed and false detections, makes the test results more realistically reflect the quality status of the laser cladding layer, and enhances the reliability of the test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123118564A_ABST
    Figure CN123118564A_ABST
Patent Text Reader

Abstract

This invention discloses a method for detecting the surface quality of laser cladding layers based on image stitching and image recognition, belonging to the fields of industrial vision inspection and laser cladding surface quality detection technology. The method includes: acquiring local images of the laser cladding layer surface using multiple cameras; extracting key feature points from adjacent images using the SIFT algorithm to obtain a set of matching point pairs in the overlapping area; calculating a global affine transformation matrix based on the set of matching point pairs to obtain a preliminary geometric transformation model of the stitched image, determining the spatial correspondence of each pixel; calculating the pixel motion vector field of the overlapping area of ​​the stitched image using a dense optical flow algorithm, and analyzing and correcting the geometric deformation deviation of the stitched area based on the motion vector field. This invention can improve the geometric realism and boundary consistency of laser cladding layer surface image stitching, improve the accuracy and stability of defect identification and localization, and reduce the risk of missed and false detections.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial visual inspection technology, specifically to a method for inspecting the surface quality of laser cladding layers based on image stitching and image recognition. Background Technology

[0002] Laser cladding technology is a surface strengthening technique that uses a high-energy laser beam to rapidly melt and solidify the cladding material and the substrate surface. It is widely used in metal surface repair, wear-resistant layer preparation, corrosion-resistant layer preparation, and remanufacturing of critical components. During the laser cladding process, defects such as cracks, pores, inclusions, incomplete fusion, surface protrusions, depressions, and uneven weld overlap may occur on the laser cladding surface due to factors such as laser power, scanning speed, powder feeding stability, protective gas flow, substrate surface condition, and heat input distribution.

[0003] In existing technologies, to achieve continuous inspection of the entire surface of a laser cladding layer, multiple industrial cameras are typically used to image the surface of the laser cladding layer in different regions. These regional images are then stitched together to create a complete image of the laser cladding layer surface. Defect identification and quality assessment are then performed based on this stitched image. However, the production and inspection conditions of laser cladding layers are complex. The surface of the laser cladding layer often exhibits uneven temperature distribution, uneven oxide or oxide adhesion, significant differences in surface reflectivity, and interference from water vapor, dust, or steam. Furthermore, the laser cladding layer may experience vibration, swaying, and speed fluctuations during transport or inspection. This causes dynamic changes in the geometric shape, grayscale distribution, and spatial correspondence of the regional images acquired by different cameras, thus affecting the accuracy of multi-camera image stitching and subsequent surface defect identification. Under these conditions, existing image stitching methods often rely on feature point matching or fixed geometric transformation models, which are difficult to adapt to the complex deformations of both global and local areas. This can easily lead to geometric inconsistencies in overlapping camera fields of view, such as local stretching, compression, misalignment, or discontinuous stitching seams. These geometric errors not only affect the visual continuity of the stitched image, but more importantly, they disrupt the correspondence between pixel positions in the stitched image and the actual surface positions of the laser cladding layer. Since the identification of surface defects in the laser cladding layer highly depends on the actual location and morphological information of the defects in the image, when geometric deviations exist in the stitched image, defects that actually exist on the surface of the laser cladding layer may be shifted in position, distorted in shape, or repeatedly mapped in the stitched image, leading to inaccurate defect localization. Furthermore, ghosting, breaks, or missing information in the stitched area may mask real defects or create false defects. These problems directly affect subsequent image-based defect detection and classification results, causing missed detections, false detections, or distorted quality assessments, making the detection results unreliable as a basis for judging the quality of the laser cladding layer. Summary of the Invention

[0004] The purpose of this invention is to provide a method for detecting the surface quality of laser cladding layers based on image mosaicking and image recognition, thereby solving the problems existing in the prior art.

[0005] To achieve the above objectives, the present invention provides the following technical solution: a method for detecting the surface quality of laser cladding layers based on image mosaicking and image recognition, comprising: S1. Acquire local images of the laser cladding layer surface using multiple cameras, and extract key feature points from adjacent images using the SIFT algorithm to obtain a set of matching point pairs in the overlapping area; S2. Calculate the global affine transformation matrix based on the set of matching point pairs to obtain the preliminary geometric transformation model of the stitched image and determine the spatial correspondence of each pixel; S3. The dense optical flow algorithm is used to calculate the pixel motion vector field of the overlapping area of ​​the stitched image, and the results of motion vector direction distribution uniformity analysis and motion vector length consistency detection are obtained. S4. Determine whether there is a sudden change point location region in the motion vector field. If there is a sudden change point location region, apply a local weighted affine transformation to adjust the sudden change point location region to obtain the adjusted stitched image. S5. By calculating the motion vector density region division and motion vector field smoothness evaluation of the overlapping region in the adjusted stitched image, the spatial gradient change of deviation amplitude and the segmentation result of deviation region connectivity in the geometric deformation deviation distribution map are obtained. S6. Based on the spatial gradient change of the deviation amplitude and the segmentation results of the deviation region connectivity, extract the deviation peak position identifier and deviation boundary sharpness measurement data. Use the pixel gradient direction continuity comparison method to calculate the gradient difference sequence at the gap and judge the convergence characteristics of the gradient difference sequence.

[0006] Preferably, S1 includes: Local images of the laser cladding layer surface were acquired using multiple cameras, and the temperature distribution differences of the laser cladding layer were corrected using a time-synchronized acquisition method to obtain temperature-corrected images. For temperature-corrected images, acquire ambient light variation parameters, adjust image brightness distribution, and determine uniformly illuminated images; Extract SIFT key feature points from uniformly illuminated images and construct a feature descriptor set; By matching overlapping regions of adjacent images based on the feature descriptor subset, the consistency of feature points is determined, and a set of matching point pairs is obtained.

[0007] Preferably, S2 includes: Obtain the overlapping region matching parameters from the set of matching point pairs, calculate the global affine transformation matrix through the coordinate transformation corresponding to the matching parameters, and obtain the preliminary geometric transformation model; For the preliminary geometric transformation model, the image brightness distribution is adjusted, and the temperature distribution difference of the laser cladding layer is fused by the brightness distribution equalization to determine the illumination change parameters; Based on the illumination change parameters, a synchronous acquisition method is used to correct the local image acquisition data, and the consistency of feature points is judged by comparing the corrected data. By establishing the consistency of feature points, a pixel correspondence is constructed, and the spatial correspondence of each pixel in the preliminary geometric transformation model of the stitched image is obtained.

[0008] Preferably, S3 includes: By dividing the overlapping region, the target overlapping part is extracted from the local image of the surface of the laser cladding layer to be stitched. The dense optical flow algorithm is used to generate the initial pixel motion vector field. The vector field distribution is preliminarily sorted to obtain the basic motion trend capture result. Based on the basic motion trend capture results, the parameter distribution of uniform direction detection in the vector field is analyzed to obtain the direction deviation data. At the same time, combined with the length consistency verification, the range of vector length deviation is determined. For the vector length deviation range and direction deviation data, perform local deviation correction, adjust the outliers of pixel motion estimation in the overlapping area, and obtain the corrected spatial mapping relationship; By constructing a dynamic boundary adjustment scheme for overlapping regions through spatial mapping relationships, and integrating the smoothing treatment of regional boundaries, the final motion vector field distribution characteristics are obtained.

[0009] Preferably, S4 includes: Based on the results of vector direction uniformity detection and length consistency detection, the criteria for judging abrupt change points in the motion vector field are determined. If the direction deviation exceeds the preset threshold, it is determined that there is an abrupt change point, and the regional positioning analysis results are obtained. Based on the regional positioning analysis results, a local weighted affine transformation is used to adjust the overlapping areas. The local weighted affine transformation calculates the pixel displacement through a weighting matrix to obtain the spatial mapping relationship. By constructing a boundary adjustment scheme based on spatial mapping relationships, the parameters for constructing distribution characteristics are determined; Dynamic boundary fusion data is extracted from parameters constructed from distribution features to obtain pixel motion estimation correction values; Based on the pixel motion estimation correction value, the image stitching is optimized by fusion to obtain the adjusted stitched image.

[0010] Preferably, S5 includes: The motion vector density is obtained by calculating the overlapping region, and the region division result is determined from the motion vector density; Based on the region division results, a smoothness evaluation value is obtained by using vector field smoothing evaluation, and the deviation distribution map is determined based on the smoothness evaluation value; Extract spatial gradient changes from the deviation distribution map to obtain amplitude spatial changes; Based on the amplitude space variation, the geometric deformation deviation is determined. If the geometric deformation deviation exceeds the preset threshold, connectivity segmentation is performed. Based on connectivity segmentation, the results of biased region segmentation are obtained.

[0011] Preferably, S6 includes: The deviation peak position identifier is extracted from the deviation amplitude spatial gradient change and deviation region connectivity segmentation results. The boundary sharpness measurement data is obtained by using the pixel gradient direction continuity comparison method to determine the gradient direction continuity. To ensure gradient direction continuity, the gradient difference sequence at the gap is calculated using a pixel gradient direction continuity comparison method, and the sequence convergence analysis is obtained. Based on sequence convergence analysis, the peak position identifier of the deviation is extracted from the connectivity segmentation result of the deviation region to determine the convergence characteristics of the gradient difference sequence. If the convergence characteristic meets the preset threshold, the deviation distribution evaluation is obtained by calculating the deviation boundary sharpness measurement data. For the deviation distribution assessment, the spatial gradient change of the deviation amplitude is integrated to determine the geometric deformation deviation correction.

[0012] Preferably, it also includes S7, determining the position offset vector based on the convergence characteristics of the gradient difference sequence and the peak position identifier of the deviation, and obtaining the cumulative energy statistics of the deviation and the mapping results of the deviation and the overlapping area in the overall position authenticity index, specifically including: By using the convergence characteristics of the gradient difference sequence and the location identifier of the deviation peak, the position offset vector is determined, and the deviation vector calibration fusion is obtained. For deviation vector calibration fusion, the spatial gradient change method is used to calculate the cumulative energy of deviation and obtain the statistical value of the realism index. The spatial gradient change method obtains the total energy by summing the gradient vector differences between pixels. Based on the statistical analysis of the authenticity index, the corresponding relationships of overlapping regions are extracted from the connectivity segmentation results of the deviation region to determine the deviation mapping results; Obtain the deviation mapping results, fuse the boundary sharpness measurement data, and determine the geometric deviation correction; During geometric deviation correction, the cumulative energy statistics of deviation in the overall position accuracy index are obtained by mapping the deviation to the overlapping area.

[0013] Preferably, it also includes S8: if the cumulative energy statistics of the deviation in the overall positional authenticity index are lower than a preset threshold and the mapping between the deviation and the overlapping area meets the consistency requirements, then the stitched image that has passed the verification is output; otherwise, the dense optical flow algorithm is iteratively executed on the deviation peak position marker area to recalculate the motion vector field and obtain the final stitched image with consistent geometric authenticity verification, specifically including: For the cumulative energy statistics of deviation, the deviation distribution data of key areas is extracted from the overall location authenticity index. A pre-established threshold comparison method is used to compare the magnitude of the deviation distribution data with the threshold to determine whether the deviation meets the preliminary verification standard and obtain the initial verification conclusion. If the cumulative energy of the deviation is lower than the preset threshold, the subsequent mapping and comparison process will proceed. Based on the initial verification conclusion, the overlapping area mapping data is obtained. The mapping results are compared with the consistency verification requirements. By checking the degree of matching of the mapping data in the geometric dimension, it is determined whether the mapping meets the geometric consistency condition, and the area mapping judgment result is obtained. Based on the region mapping determination results, motion vector calculation is performed on the region corresponding to the deviation peak identifier. Dense optical flow processing is adopted, which takes the optical flow vector between image pixels as input and outputs the iterative vector field. The vector field data is iteratively updated to obtain the adjusted vector distribution information. The adjusted vector distribution information is obtained and combined with the region boundary smoothing process, which achieves smoothing by adjusting the gradient of the boundary pixels. The geometric authenticity of the stitched image is then verified to determine whether the boundary transition meets the consistency standard, and the final stitched image that passes the verification is obtained.

[0014] Preferably, it also includes S9: based on the stitched images consistent with geometric authenticity verification, performing image recognition of surface defects in the laser cladding layer, extracting the type, location, and size information of the defects, and outputting the full surface quality inspection results of the laser cladding layer based on the defect recognition results, specifically including: To obtain a stitched image, for stitched images that are consistent with geometric authenticity verification, the edge gradient value is calculated by summing the pixel gradient differences using the boundary sharpness measurement method to obtain a consistent image. By verifying consistent images, surface defects of the laser cladding layer are identified. The YOLO algorithm is used to extract defect regions with image pixels as input, resulting in a set of defect regions. For a set of defective regions, type features are extracted from the region connectivity segmentation results obtained based on pixel connectivity to determine the defect type classification and obtain defect type information. Based on the defect type information, the location coordinates are extracted and the size parameters are calculated to determine the defect location and size information; The system acquires information on the location and size of defects, integrates surface quality assessment and quality index statistics calculated from the defect information to output the full surface quality inspection results of the laser cladding layer.

[0015] As can be seen from the above technical solution, the present invention has the following beneficial effects: This laser cladding layer surface quality inspection method, based on image stitching and image recognition, introduces a geometric authenticity verification mechanism during multi-camera image stitching. This mechanism effectively identifies and corrects local geometric distortions, positional shifts, and stitching inconsistencies caused by laser cladding layer production and inspection conditions in the stitched images. While ensuring the overall continuity of the stitched images, it improves the accuracy of the correspondence between pixel spatial positions in the stitched images and the actual surface positions of the laser cladding layer. Based on this, using the geometrically consistent stitched images for surface defect recognition of the laser cladding layer reduces problems such as defect positional shifts, morphological distortions, duplicate mappings, or defect masking caused by stitching errors. This improves the accuracy and stability of defect identification and localization, reduces the risk of missed and false detections, and allows the inspection results to more realistically reflect the quality status of the entire laser cladding layer surface. This enhances the reliability and practicality of laser cladding layer surface quality inspection results in production control and quality judgment. Attached Figure Description

[0016] Figure 1 This is a flowchart of the laser cladding layer full surface quality inspection method of the present invention. Detailed Implementation

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

[0018] like Figure 1 As shown, the present invention provides a technical solution: a method for detecting the surface quality of laser cladding layers based on image mosaicking and image recognition, comprising: S1. Acquire local images of the laser cladding layer surface using multiple cameras, and extract key feature points from adjacent images using the SIFT algorithm to obtain a set of matching point pairs in the overlapping area; S2. Calculate the global affine transformation matrix based on the set of matching point pairs to obtain the preliminary geometric transformation model of the stitched image and determine the spatial correspondence of each pixel; S3. The dense optical flow algorithm is used to calculate the pixel motion vector field of the overlapping area of ​​the stitched image, and the results of motion vector direction distribution uniformity analysis and motion vector length consistency detection are obtained. S4. Determine whether there is a sudden change point location region in the motion vector field. If there is a sudden change point location region, apply a local weighted affine transformation to adjust the sudden change point location region to obtain the adjusted stitched image. S5. By calculating the motion vector density region division and motion vector field smoothness evaluation of the overlapping region in the adjusted stitched image, the spatial gradient change of deviation amplitude and the segmentation result of deviation region connectivity in the geometric deformation deviation distribution map are obtained. S6. Based on the spatial gradient change of the deviation amplitude and the segmentation results of the deviation region connectivity, extract the deviation peak position identifier and deviation boundary sharpness measurement data. Use the pixel gradient direction continuity comparison method to calculate the gradient difference sequence at the gap and judge the convergence characteristics of the gradient difference sequence.

[0019] S7. Determine the position offset vector based on the convergence characteristics of the gradient difference sequence and the peak position identifier of the deviation, and obtain the cumulative energy statistics of the deviation and the mapping results of the deviation and the overlapping area in the overall position authenticity index. S8. If the cumulative energy of the deviation in the overall position authenticity index is lower than the preset threshold and the mapping between the deviation and the overlapping area meets the consistency requirements, then output the stitched image that has passed the verification. Otherwise, iteratively execute the dense optical flow algorithm to recalculate the motion vector field for the peak position of the deviation and obtain the stitched image with consistent geometric authenticity. S9. Based on the stitched images that are consistent with geometric authenticity verification, perform image recognition of surface defects in the laser cladding layer, extract the type, location and size information of the defects, and output the full surface quality inspection results of the laser cladding layer according to the defect recognition results.

[0020] In the above embodiment, multiple cameras are positioned above, to the side, or around the laser cladding layer detection station, creating overlapping areas between the fields of view of adjacent cameras. During the detection process, the laser cladding layer moves along the transport direction, and each camera acquires local images of the laser cladding layer surface in a synchronous triggering manner to reduce image position deviations caused by different acquisition times. Because the laser cladding layer surface may have melt channel textures, local reflections, oxide adhesion, uneven temperature distribution, and transport vibrations, there may be grayscale differences and geometric correspondence deviations between the local images acquired by different cameras. Therefore, the SIFT algorithm is first used to extract key feature points with scale invariance and rotation invariance from adjacent images, and feature descriptor matching is used to obtain a set of matching point pairs in the overlapping area, providing basic data for subsequently establishing spatial transformation relationships between images.

[0021] In the above implementation, a global affine transformation matrix between adjacent images is calculated based on the pixel coordinates of each matching point in the matching point pair set within the adjacent images. This global affine transformation matrix characterizes the translation, rotation, scaling, and shearing relationships between adjacent local images. Using this global affine transformation matrix, multiple local images of the laser cladding layer surface are mapped to a unified stitching coordinate system, resulting in a preliminary geometric transformation model of the stitched image and determining the spatial correspondence of each pixel between the original local image and the stitched image. This spatial correspondence represents the position of a pixel in the local image within the stitched image of the entire laser cladding layer surface, providing a basis for subsequent geometric deviation analysis.

[0022] In the above embodiments, the preliminary geometric transformation model can achieve overall alignment of multiple local images. However, for local deformations caused by local undulations on the laser cladding layer surface, differences in camera viewing angles, transport vibrations, or changes in surface reflection, relying solely on global affine transformation is insufficient to completely eliminate subtle misalignments in overlapping areas. Therefore, a dense optical flow algorithm is further employed in the overlapping areas of the preliminary stitched images to calculate the pixel motion vector field between adjacent images. The pixel motion vector field represents the displacement direction and displacement length of each pixel or pixel neighborhood within the overlapping area between adjacent images. By statistically analyzing the direction distribution of motion vectors, the uniformity analysis results of the motion vector direction distribution can be obtained; by comparing the consistency of motion vector lengths within local areas, the consistency detection results of motion vector lengths can be obtained.

[0023] In the above implementation, when there is a significant local deflection in the direction distribution of the motion vector, or a significant abrupt change in the length of the motion vector relative to its neighboring vectors, it indicates that the corresponding region may have geometric deformations such as local stretching, compression, misalignment, repeated mapping, or discontinuities in the stitching seams. In this case, the region is identified as the abrupt change point location region. For the abrupt change point location region, a local weighted affine transformation adjustment method is adopted. A weighted matrix is ​​established based on the distance between the abrupt change point and its neighboring pixels, the matching confidence, and the consistency of the motion vectors. This weighted matrix is ​​then used to calculate the local pixel displacement correction value. Through local weighted affine transformation, the abrupt change point location region can be locally smoothed and corrected without destroying the overall stitching structure, thereby obtaining the adjusted stitched image.

[0024] In the above implementation, the motion vector density within the overlapping region is further calculated for the adjusted stitched image. The motion vector density represents the number and distribution of effective motion vectors per unit area or unit pixel neighborhood. Based on the intensity and spatial distribution differences of the motion vector density, the overlapping region is divided into stable regions, transition regions, and abnormal regions. The smoothness of the motion vector field is further evaluated to determine whether the motion vector changes between adjacent pixels or adjacent regions are continuous. Based on the motion vector density region division results and the motion vector field smoothness evaluation results, a geometric deformation deviation distribution map is generated, and the spatial gradient change of the deviation amplitude is extracted from the geometric deformation deviation distribution map. For regions where the deviation amplitude exceeds a preset threshold and is spatially continuous, deviation region connectivity segmentation is performed to obtain the deviation region connectivity segmentation result.

[0025] In the above implementation, the spatial gradient change of the deviation amplitude is used to represent the direction and intensity of the change in geometric deformation deviation in spatial location, and the connectivity segmentation result of the deviation region is used to determine the continuous distribution range of the geometric deformation deviation. Based on the above results, the peak position identifier of the deviation can be extracted, which can determine the location of the most obvious geometric deviation in the stitched image. Further, the gray-level abrupt change, gradient change, or edge strength at the boundary of the deviation region is evaluated using deviation boundary sharpness measurement data. A pixel gradient direction continuity comparison method is used to compare the gradient directions of corresponding pixels on both sides of the stitching seam and calculate the gradient difference sequence at the seam. If the gradient difference sequence gradually decreases or tends to stabilize with the change of pixel position, it is judged that the gradient difference sequence has convergence characteristics, indicating that the image transition on both sides of the stitching seam is relatively continuous; if the gradient difference sequence fluctuates continuously or has obvious abrupt changes, it indicates that there is still boundary discontinuity or geometric mapping deviation in the corresponding region.

[0026] In the above embodiments, by combining SIFT feature point matching, global affine transformation, dense optical flow vector field analysis, abrupt change point localization, local weighted affine transformation, motion vector density region division, vector field smoothness evaluation, and gradient difference sequence convergence judgment, global and local deviations in multi-camera stitched images of the laser cladding layer surface can be jointly detected and corrected. This method can improve the accuracy of the correspondence between pixel spatial positions in the stitched image and the actual surface positions of the laser cladding layer, reduce the impact of stitching gaps, local misalignments, morphological distortions, and repeated mappings on subsequent surface defect identification, thereby improving the reliability and stability of the laser cladding layer surface quality detection results.

[0027] In the above embodiments, the camera can be an area array industrial camera, a line array industrial camera, or a combination of area array and line array industrial cameras; the number of cameras, installation angle, field of view overlap ratio, acquisition frequency, and image resolution can be adjusted according to the size, surface morphology, conveying speed, and detection accuracy requirements of the laser cladding layer. The SIFT algorithm can be replaced by ORB, SURF, or other feature point extraction algorithms; the dense optical flow algorithm can be the Farneback optical flow algorithm, the TV-L1 optical flow algorithm, or a deep learning-based optical flow estimation algorithm; the weights in the local weighted affine transformation can be Gaussian weights, inverse distance weights, or combined weights based on matching confidence.

[0028] S1 includes: acquiring local images of the laser cladding layer surface using multiple cameras, correcting the temperature distribution differences of the laser cladding layer using a time-synchronized acquisition method, and obtaining a temperature-corrected image; for the temperature-corrected image, acquiring ambient light variation parameters, adjusting the image brightness distribution, and determining a uniformly illuminated image. SIFT key feature points are extracted from uniformly illuminated images to construct a feature descriptor set. The feature descriptor set is then matched with overlapping regions of adjacent images to determine the consistency of feature points, resulting in a set of matching point pairs.

[0029] In this embodiment, multiple cameras are positioned at different imaging locations within the laser cladding layer inspection station. Overlapping areas are maintained between the fields of view of adjacent cameras. Each camera is controlled by the same trigger unit for acquisition, ensuring that each local image corresponds to the same inspection time. The allowable error for synchronous acquisition is determined based on the maximum conveying speed of the laser cladding layer, the actual length corresponding to a single pixel, and the allowable error for defect location. Specifically, the allowable error for defect location is first converted into an allowable pixel offset, and then the maximum allowable acquisition time difference between cameras is calculated in conjunction with the maximum conveying speed. Images with acquisition time differences not exceeding this maximum acquisition time difference are retained, while images exceeding this maximum acquisition time difference are not included in subsequent matching. This reduces local image position deviations caused by the movement of the laser cladding layer.

[0030] After acquiring synchronously acquired images, the temperature distribution differences in the laser cladding layer are corrected. The grayscale compensation relationship required for temperature correction is obtained through pre-calibration. During calibration, standard metal surface images at different temperatures are acquired under the same exposure time, light source intensity, and camera gain. The average grayscale change trend corresponding to each temperature is recorded, and the influence of temperature change on image grayscale is determined from this trend. In actual testing, the median temperature of the overlapping area of ​​each camera is used as the reference temperature. The difference between the temperature of each pixel and the reference temperature is converted into a grayscale compensation amount, and this grayscale compensation amount is subtracted or compensated from the original grayscale value to obtain the temperature-corrected image. After this processing, the grayscale shift caused by uneven residual heat on the laser cladding layer surface is weakened.

[0031] For the temperature-corrected images, ambient lighting variation parameters are further calculated. These parameters are determined by the average brightness of the effective image region, the dispersion of brightness distribution, and the low-frequency brightness background. Before calculation, overexposed pixels, dark noise pixels, and significantly occluded areas are removed from the effective region. The low-frequency brightness background is obtained by smoothing the image; the smoothing scale is larger than the maximum width of the defect to be identified, ensuring that defect edges and melt flow textures are not subtracted as part of the lighting background. Subsequently, the median value of the average brightness of the effective regions from multiple cameras is used as the baseline brightness. Brightness gain is adjusted for each temperature-corrected image, and the non-uniform components in the low-frequency brightness background are subtracted to obtain a uniformly illuminated image. This processing reduces the impact of local reflections, light source attenuation, lens response differences, and smoke / dust obstruction on feature extraction.

[0032] After obtaining a uniformly illuminated image, a scale-invariant feature transform algorithm is used to extract key feature points. Specifically, the uniformly illuminated image is first smoothed at multiple scales, and the gray-level changes between adjacent scale images are compared to find candidate points that exhibit local maxima or minima in both the spatial and scale neighborhoods. After the candidate points are determined, they are screened for stability. The contrast screening threshold is determined by samples of smooth regions without defects or obvious melt flow boundaries. The average gray-level change response of such regions plus three times the fluctuation level is taken as the screening standard, and candidate points below this standard are eliminated. The edge response screening threshold is determined by the edge response distribution of stable matching points in historical qualified samples. The high percentile value of the edge response of stable matching points is taken as the screening standard, and candidate points exceeding this standard and exhibiting an excessively strong single edge response are eliminated. After screening, the retained key feature points are used to characterize stable structures such as melt flow boundaries, texture abrupt changes, defect edges, and oxide contours.

[0033] For each key feature point, the direction and intensity of grayscale changes in each pixel within its neighborhood are calculated, and the dominant direction is statistically analyzed and used as the directional reference for the key feature point. Subsequently, the neighborhood is normalized using this directional reference, and then divided into multiple sub-regions. The grayscale change distribution in different directions within each sub-region is statistically analyzed to form a set of feature descriptors. After the descriptors are generated, they are normalized, and excessively large local responses are truncated and normalized again to reduce the impact of strong reflections, bright oxide edges, and local noise on the descriptors.

[0034] Within the overlapping region of adjacent images, matching is performed based on the set of feature descriptors. During matching, the similarity between a feature descriptor and each candidate descriptor in adjacent images is first calculated, and the most similar descriptor and the second most similar descriptor are compared. When the most similar result has sufficient discriminative power relative to the second most similar result, the corresponding feature point is selected as a candidate matching point pair. This discriminative threshold is determined using laser cladding layer sample images with known correspondences. The similarity difference distribution between true matching points and false matching points is statistically analyzed, and the boundary value that can distinguish most true matching points from false matching points is taken as the threshold.

[0035] Candidate matching point pairs also need to undergo consistency judgment. First, the temporary geometric transformation relationship between adjacent images is estimated based on the candidate matching point pairs. Then, the candidate points in one image are projected onto another image, and the pixel distance between the projected position and the actual candidate point position is calculated. The allowable threshold for this pixel distance is determined by the camera calibration template image, taking the average level of the projection error of the true corresponding points plus three times the fluctuation level as the judgment standard. At the same time, the principal direction difference and scale difference of the candidate matching point pairs are also compared. The principal direction difference threshold and scale difference threshold are both determined by the statistical distribution of historical true matching points. Only when a candidate matching point simultaneously meets the requirements of projection position error, principal direction difference, and scale difference are they judged to have feature point consistency and retained in the matching point pair set.

[0036] Through the above processing, the local images of the laser cladding layer surface acquired by multiple cameras are first processed by synchronous acquisition control, temperature grayscale compensation and illumination equalization, and then key feature point extraction, descriptor construction, overlapping region matching and consistency screening are performed. This ensures that the final set of matching point pairs can eliminate abnormal matching caused by acquisition time difference, temperature unevenness, illumination change, local reflection, smoke and dust occlusion and weak texture areas, providing a reliable data foundation for subsequent calculation of the global affine transformation matrix.

[0037] S2 includes: Obtain the overlapping region matching parameters from the set of matching point pairs, calculate the global affine transformation matrix through the coordinate transformation corresponding to the matching parameters, and obtain the preliminary geometric transformation model; For the preliminary geometric transformation model, the image brightness distribution is adjusted, and the temperature distribution difference of the laser cladding layer is fused by the brightness distribution equalization to determine the illumination change parameters; Based on the illumination change parameters, a synchronous acquisition method is used to correct the local image acquisition data, and the consistency of feature points is judged by comparing the corrected data. By establishing the consistency of feature points, a pixel correspondence is constructed, and the spatial correspondence of each pixel in the preliminary geometric transformation model of the stitched image is obtained.

[0038] In this embodiment, overlapping region matching parameters are extracted from the set of matching point pairs. These parameters include the pixel coordinates of the matching points in local images of adjacent laser cladding layers, matching confidence, scale information, and orientation information. When calculating the global affine transformation matrix, the coordinates of the matching points in one local image are used as the coordinates before transformation, and the coordinates of the corresponding matching points in adjacent local images are used as the coordinates after transformation. Horizontal and vertical coordinate transformation relationships are established respectively. Weights are then assigned based on the matching confidence of each matching point pair, with higher weights for matching point pairs with high matching confidence and located in the middle of the overlapping region, and lower weights for matching point pairs with low matching confidence or located at the edge of the overlapping region. Subsequently, the global affine transformation matrix is ​​obtained with the objective of minimizing the sum of the coordinate deviations of all matched point pairs after transformation. This global affine transformation matrix includes translation, rotation, scaling, and shearing parameters, which are used to map adjacent local images to the same stitched coordinate system, resulting in a preliminary geometric transformation model.

[0039] After obtaining the preliminary geometric transformation model, the matching point pairs are reverse-verified. Specifically, the matching points in the image before transformation are mapped to the coordinate system of the adjacent image according to the global affine transformation matrix, and the pixel distance between the mapped position and the actual corresponding matching point position is calculated. This pixel distance is used as the reprojection error. The reprojection error threshold is determined by the camera calibration template and the standard sample of the laser cladding layer. The average value of the reprojection error of the actual corresponding points plus 3 times the standard deviation is taken as the judgment value, and this judgment value is ensured not to exceed 0.5 times the number of pixels corresponding to the defect location allowable error. Matching point pairs whose reprojection error exceeds this judgment value are discarded, and the remaining matching point pairs are re-involved in the calculation of the global affine transformation matrix until the reprojection error meets the requirements.

[0040] For the preliminary geometric transformation model, when adjusting the image brightness distribution, adjacent local images are first mapped to the same stitching coordinate system according to the preliminary geometric transformation model, and corresponding pixels are determined within the overlapping area. Then, overexposed pixels, dark noise pixels, and occluded pixels are removed. The overexposed pixel threshold is determined by the starting point of the camera's gray-scale saturation region, and the dark noise pixel threshold is determined by adding three times the standard deviation to the average gray level of the dark field image. The brightness difference at the corresponding positions is calculated for the remaining effective pixels, and the gray-scale shift caused by temperature distribution differences is deducted based on the laser cladding layer temperature correction results. The remaining brightness difference is used as the ambient light variation.

[0041] When determining the illumination variation parameters, the overall brightness shift, block brightness shift, and low-frequency background brightness shift of the effective pixels in the overlapping area are used as the calculation basis. The overall brightness shift is obtained from the average gray-level difference of the effective pixels in the overlapping area; the block brightness shift is obtained by calculating the average gray-level difference of each block after dividing the overlapping area into blocks; the low-frequency background brightness shift is obtained by comparing the background gray-level difference after smoothing the image, with the smoothing scale being greater than three times the number of pixels corresponding to the maximum width of the defect to be detected. Based on the above illumination variation parameters, brightness gain compensation and background brightness compensation are performed on the local image to ensure that the gray-level distribution of adjacent local images in the overlapping area remains consistent.

[0042] After correcting the local image acquisition data based on illumination variation parameters, the corrected data is compared with the synchronous acquisition time. The allowable error for synchronous acquisition is determined based on the maximum delivery speed of the laser cladding layer, the actual length corresponding to a single pixel, and the allowable error for defect location; images exceeding the allowable error for synchronous acquisition are not included in the current stitching. For local images that meet the synchronization requirements, the grayscale texture, principal direction, scale, and descriptor similarity of the neighborhood of the matching points are re-compared. The principal direction difference threshold, scale difference threshold, and descriptor difference threshold are all obtained from the statistics of historical real matching points, and the average value of the corresponding statistics plus 3 times the standard deviation is taken as the judgment value; matching point pairs exceeding any judgment value are identified as inconsistent matching points and discarded.

[0043] After the feature point consistency requirement is met, pixel correspondence is constructed. Specifically, according to the preliminary geometric transformation model, the coordinates of each pixel in the local image of the laser cladding layer surface are transformed point by point, converting the original image coordinates into stitching coordinates. When the transformed coordinates fall at a non-integer pixel position, interpolation is performed according to the gray values ​​of adjacent pixels to obtain the pixel value at that stitching position. When pixels from multiple local images are mapped to the same stitching position, pixels with smaller reprojection errors, smaller brightness correction residuals, and greater distance from the image edge are prioritized. Thus, the source image, original coordinates, stitching coordinates, reprojection error, and brightness correction residual corresponding to each stitched pixel are recorded to obtain the spatial correspondence of each pixel in the preliminary geometric transformation model of the stitched image.

[0044] The S3 includes: by dividing the overlapping region, extracting the target overlapping part from the local image of the surface of the laser cladding layer to be spliced, generating an initial pixel motion vector field using a dense optical flow algorithm, and performing preliminary sorting of the vector field distribution to obtain the basic motion trend capture result; Based on the basic motion trend capture results, the parameter distribution of uniform direction detection in the vector field is analyzed to obtain the direction deviation data. At the same time, combined with the length consistency verification, the range of vector length deviation is determined. For the vector length deviation range and direction deviation data, perform local deviation correction, adjust the outliers of pixel motion estimation in the overlapping area, and obtain the corrected spatial mapping relationship; By constructing a dynamic boundary adjustment scheme for overlapping regions through spatial mapping relationships, and integrating the smoothing treatment of regional boundaries, the final motion vector field distribution characteristics are obtained.

[0045] In this embodiment, the overlapping region division is based on the pixel spatial correspondence obtained from the preliminary geometric transformation model. First, local images of the surfaces of two adjacent laser cladding layers to be stitched are mapped to the same stitching coordinate system. Then, the intersection region where both images contain valid pixels is selected as the candidate overlapping region. Overexposed pixels, dark noise pixels, and occluded pixels within the candidate overlapping region are not included in the calculation. The overexposure judgment value is determined by the camera's grayscale saturation starting point; the dark noise judgment value is determined by adding three times the standard deviation to the average grayscale of the dark field image; and occluded pixels are determined based on continuous pixel blocks with abrupt changes in neighborhood grayscale and interrupted texture direction. After removing invalid pixels, the region with a continuous distribution of valid pixels is retained as the target overlapping part.

[0046] When generating the initial pixel motion vector field within the target overlapping region, the overlapping region of one local image is used as the reference image, and the corresponding overlapping regions of adjacent local images are used as the images to be registered. For each valid pixel in the reference image, the neighborhood gray-level distribution, gradient direction, and texture change trend are compared within a limited search window of the image to be registered. The position with the smallest gray-level difference, the smallest gradient direction difference, and the most consistent neighborhood structure is selected as the corresponding position. The lateral and vertical displacements required for the reference pixel to move to the corresponding position constitute the motion vector of that pixel. After traversing all valid pixels within the target overlapping region, the initial pixel motion vector field is formed.

[0047] When initially organizing the vector field distribution, the length and direction distribution of motion vectors within the local neighborhood are first statistically analyzed. Isolated outlier vectors are determined by adding three times the standard deviation to the average length of neighborhood vectors; vectors exceeding this threshold and whose direction deviates from the main direction of the neighborhood are discarded. For the missing locations resulting from these discards, valid vectors that meet the requirements of consistent direction and length are selected from the surrounding area, and compensation vectors are calculated according to decreasing weights from nearest to farthest. The organized vector field is used to characterize the main displacement directions and amplitudes within the overlapping area, thereby obtaining the basic motion trend capture results.

[0048] When performing directional uniformity detection based on the basic motion trend capture results, the overlapping area of ​​the target is divided into several detection blocks. Within each detection block, the principal direction and directional deviation of the effective motion vectors are statistically analyzed. The principal direction is taken as the direction in which the vector directions are most concentrated within the detection block, and the directional deviation is obtained by statistically analyzing the deviation of each vector direction relative to the principal direction. The directional deviation judgment value is determined from historical qualified splicing samples; the average directional deviation of the qualified samples plus three times the standard deviation is taken as the judgment value. Detection blocks exceeding this judgment value are recorded as directional deviation areas, and the degree of directional deviation data is obtained accordingly.

[0049] Vector length consistency verification and orientation uniformity detection are performed simultaneously. The average and fluctuation values ​​of the effective vector length within each detection block are calculated, and the vector length of a single pixel is compared with the length statistics of the current and adjacent detection blocks. The vector length judgment value is determined by camera calibration samples and laser cladding layer standard samples, taking the average value of the vector length fluctuation in the actual overlapping area plus three times the standard deviation as the judgment value. Pixels or continuous regions exceeding this judgment value are recorded as length anomaly regions, and the spatial range of the length anomaly regions determines the vector length deviation range.

[0050] Local deviation correction is performed on the vector length deviation range and direction deviation data. Pixels that simultaneously satisfy both direction and length anomalies are directly identified as abnormal motion estimation points. Regions with a single anomaly but continuously distributed with adjacent abnormal pixels are included in the same correction region. During correction, effective vectors with stable direction, stable length, and high matching confidence around the correction region are used as references. The corrected displacement is calculated according to the rules of greater weight for closer distance, greater weight for higher matching confidence, and greater weight for smaller direction difference, and this corrected displacement replaces the abnormal motion estimation value. After replacement, the vector direction difference and length difference on both sides of the correction region boundary are compared; if both do not exceed the corresponding judgment value, the local deviation correction is confirmed to be complete.

[0051] When obtaining the corrected spatial mapping relationship, the position of each pixel in the stitched coordinate system is combined with the corrected motion vector to determine its corresponding position in adjacent local images. When the corresponding position falls at a non-integer pixel, interpolation is performed based on the grayscale of neighboring pixels to obtain the corresponding pixel value. When multiple pixels are mapped to the same position, pixel correspondences with smaller vector residuals, smaller brightness differences, and higher neighborhood orientation consistency are preferentially retained, thus forming the corrected spatial mapping relationship.

[0052] A dynamic boundary adjustment scheme is constructed based on the corrected spatial mapping relationship. First, stable and abnormal regions within the overlapping area are determined according to the degree of directional deviation, the range of vector length deviation, and the effective vector density. Then, the stitching and fusion boundary is set within the stable region. For boundary segments that must pass through abnormal regions, the boundary position is moved along the direction of decreasing vector residual, and the grayscale difference, gradient direction difference, and vector length difference of pixels on both sides of the boundary are compared until all of the above differences are lower than the average value of the corresponding statistics of historical qualified stitching samples plus 3 times the standard deviation.

[0053] After dynamic boundary adjustment, the boundaries of the overlapping areas are smoothed. Transition bands are set along both sides of the splicing boundary, and fusion weights are assigned according to the distance from the pixel to the boundary to ensure a continuous transition in grayscale values ​​of pixels near the boundary. For gradient abrupt changes, gradient compensation is performed using neighboring pixels with the same texture direction as both sides of the boundary. After the above processing, the final motion vector field distribution features are obtained, which include the corrected vector direction distribution, vector length distribution, abnormal vector positions, dynamic boundary positions, and boundary smoothing results.

[0054] The S4 includes: determining the criteria for identifying abrupt change points in the motion vector field based on the vector direction uniformity detection results and length consistency detection results; if the direction deviation exceeds a preset threshold, it is determined that there is an abrupt change point, and the regional positioning analysis results are obtained. Based on the regional positioning analysis results, a local weighted affine transformation is used to adjust the overlapping areas. The local weighted affine transformation calculates the pixel displacement through a weighting matrix to obtain the spatial mapping relationship. By constructing a boundary adjustment scheme based on spatial mapping relationships, the parameters for constructing distribution characteristics are determined; Dynamic boundary fusion data is extracted from parameters constructed from distribution features to obtain pixel motion estimation correction values; Based on the pixel motion estimation correction value, the image stitching is optimized by fusion to obtain the adjusted stitched image.

[0055] In this embodiment, the determination of abrupt change points is based on the results of vector direction uniformity detection and length consistency detection. During processing, the overlapping area is divided into multiple detection blocks of the same size, and the concentration direction, direction deviation, average length, and length fluctuation of the motion vectors within each detection block are statistically analyzed. The direction deviation is obtained by statistically analyzing the difference between the direction of each motion vector within the detection block and the concentration direction, and the length fluctuation is obtained by statistically analyzing the deviation of the length of each motion vector within the detection block from the average length. The direction deviation threshold is determined by adding three times the standard deviation to the average of the direction deviations in historical qualified stitched images, and the length consistency threshold is determined by adding three times the standard deviation to the average of the length fluctuations in historical qualified stitched images. When the direction deviation within a detection block exceeds the direction deviation threshold, and the length fluctuation of consecutive pixels within that detection block exceeds the length consistency threshold, the area containing those consecutive pixels is determined as the abrupt change point location area, and the area location analysis result is output.

[0056] Based on the regional location analysis results, a local weighted affine transformation adjustment is performed on the mutation point location region. Specifically, neighboring pixels outside the mutation point location region that are directionally and length-stable and have a matching confidence level meeting the requirements are selected as reference pixels. The matching confidence threshold is determined by the boundary value of the confidence distribution between true matching samples and false matching samples. A weighted matrix is ​​established based on the distance between the reference pixel and the pixel to be corrected, the matching confidence of the reference pixel, and the degree of deviation of the reference pixel's motion vector from the neighborhood convergence direction. Reference pixels with closer distances, higher matching confidence, and smaller directional deviations have higher weights. Subsequently, the lateral and longitudinal displacements of the reference pixels are weighted and summed to obtain the displacement adjustment amount of the pixel to be corrected. This displacement adjustment amount is then superimposed on the original stitched coordinates of the pixel to be corrected to obtain the corrected spatial mapping relationship.

[0057] When constructing a boundary adjustment scheme using spatial mapping relationships, the vector residual, grayscale difference, and gradient direction difference of the mutation point location region and its adjacent regions are first calculated. The vector residual is obtained by statistically analyzing the changes in length and direction of the motion vector before and after correction. The grayscale difference is obtained by statistically analyzing the grayscale differences of corresponding pixels on both sides of the boundary. The gradient direction difference is obtained by statistically analyzing the main gradient direction difference of the pixel neighborhood on both sides of the boundary. All three types of judgment values ​​are determined by adding three times the standard deviation to the average of the corresponding statistics of historical qualified stitched images. During boundary adjustment, the fusion boundary is moved from areas where the vector residual, grayscale difference, or gradient direction difference exceeds the judgment value to areas that meet the judgment value requirements, thereby determining the distribution feature construction parameters. The distribution feature construction parameters include the mutation point location region range, the corrected vector direction distribution, the corrected vector length distribution, the candidate fusion boundary position, the grayscale difference on both sides of the boundary, the gradient direction difference on both sides of the boundary, and the vector residual distribution.

[0058] When extracting dynamic boundary fusion data from the parameters constructed from distribution features, a comprehensive evaluation value is calculated for each candidate fusion boundary position. The comprehensive evaluation value is obtained by weighting the vector residual, gray-level difference, gradient direction difference, and distance to the peak position of the abrupt change point. The smaller the vector residual, gray-level difference, and gradient direction difference, and the farther the distance to the peak position of the abrupt change point, the better the evaluation result of the corresponding candidate boundary. The weights are determined by the proportion of influence of each parameter on boundary misalignment in historical qualified stitched images. The candidate boundary with the best evaluation result is selected as the dynamic fusion boundary, and based on the corrected spatial mapping relationship of pixels on both sides of the boundary, the lateral displacement correction and vertical displacement correction of the boundary's neighboring pixels are calculated to obtain the pixel motion estimation correction value.

[0059] When optimizing image stitching based on pixel motion estimation correction values, pixels within the abrupt change location area are remapped to the stitching coordinate system according to the corrected displacement. For pixels whose mapped positions fall at non-integer pixels, the pixel value is obtained by interpolation based on the grayscale of neighboring pixels. If multiple pixels are mapped to the same stitching position, the pixel value with the smallest reprojection error, smallest brightness correction residual, and highest neighborhood vector consistency is retained. After remapping, transition bands are set on both sides of the dynamic fusion boundary, and fusion weights are allocated according to the distance from the pixel to the boundary, ensuring a continuous transition of grayscale and texture on both sides of the boundary, ultimately resulting in the adjusted stitched image.

[0060] S5 includes: calculating and obtaining motion vector density through overlapping regions, and determining the region division result from the motion vector density; Based on the region division results, a smoothness evaluation value is obtained by using vector field smoothing evaluation, and the deviation distribution map is determined based on the smoothness evaluation value; Extract spatial gradient changes from the deviation distribution map to obtain amplitude spatial changes; Based on the amplitude space variation, the geometric deformation deviation is determined. If the geometric deformation deviation exceeds the preset threshold, connectivity segmentation is performed. Based on connectivity segmentation, the results of biased region segmentation are obtained.

[0061] In this embodiment, the motion vector density is calculated within the overlapping area of ​​the adjusted stitched image. During processing, the overlapping area is traversed sequentially using a fixed-size window. The number of valid motion vectors that pass the direction consistency and length consistency checks within each window is counted. Then, the number of valid motion vectors is compared with the number of valid pixels within the window to obtain the motion vector density of that window. When dividing the region, the average value of the motion vector density in historical qualified stitched images is used as the benchmark value. The average value minus three times the standard deviation is used as the stable region judgment value. Regions with a motion vector density not lower than the judgment value are determined as stable regions, regions with a motion vector density lower than the judgment value and continuously distributed are determined as abnormal regions, and regions located between stable regions and abnormal regions are determined as transition regions, thus obtaining the region division result.

[0062] Specifically, for the region segmentation results, the vector field smoothness of each region is calculated separately. During calculation, the motion vector of each pixel is compared with the motion vectors in its neighborhood, obtaining the direction difference and length difference respectively. The direction difference is determined by the difference between the current pixel vector direction and the direction of the neighborhood vector set, and the length difference is determined by the difference between the current pixel vector length and the average length of the neighborhood vectors. Then, the direction difference and length difference are weighted according to their respective influence on the stitching error in historical qualified stitched images to obtain the smoothing deviation value for that pixel. The smoothing deviation values ​​of all pixels in the same region are then averaged to obtain the smoothness evaluation value. The smoothness judgment value is the average smoothing deviation value in historical qualified stitched images plus three times the standard deviation. Regions exceeding this judgment value are marked as deviation regions, and a deviation distribution map is formed accordingly.

[0063] When extracting spatial gradient changes from the deviation distribution map, the deviation amplitudes of adjacent pixels are compared along the horizontal, vertical, and stitching boundary normals of the stitched image. The difference in deviation amplitude between adjacent pixels represents the intensity of the deviation change at that location, and the direction in which the deviation amplitude increases is taken as the direction of deviation change. The deviation change results along the horizontal, vertical, and stitching boundary normals are then combined to obtain the amplitude spatial change. This amplitude spatial change characterizes the location, direction, and intensity of geometric deviation changes within the overlapping region.

[0064] When determining geometric deformation deviation based on amplitude space variation, motion vector density, smoothness evaluation value, and amplitude space variation are all used as the judgment criteria. Pixels with motion vector density lower than the stable region judgment value, smoothness evaluation value higher than the smoothness judgment value, and amplitude space variation exceeding the gradient judgment value are identified as pixels with geometric deformation deviation. The gradient judgment value is determined by adding three times the standard deviation to the average of the deviation amplitude variation in historical qualified stitched images. The judgment value of geometric deformation deviation is determined by camera calibration samples and historical qualified stitched images, taking the average of the geometric deviation statistics of the actual overlapping area plus three times the standard deviation, and not exceeding the number of pixels corresponding to the defect location allowable error. Pixels exceeding this judgment value are entered into connectivity segmentation.

[0065] When performing connectivity segmentation, the positional adjacency and magnitude continuity of the deviation pixels are used as the segmentation criteria. Pixels that are adjacent in the horizontal, vertical, or diagonal directions, and whose deviation magnitude difference does not exceed the average deviation of adjacent pixels in historical qualified stitched images plus three times the standard deviation, are classified into the same deviation connected region. The region area, boundary range, peak deviation, and average deviation are calculated for the segmented connected regions; isolated regions with an area smaller than the pixel area corresponding to the minimum effective defect size are discarded. After the above processing, the deviation region segmentation result is obtained, which includes the deviation region location, region area, peak deviation location, average deviation, boundary range, and corresponding overlapping region number.

[0066] Specifically, S6 includes: The deviation peak position identifier is extracted from the deviation amplitude spatial gradient change and deviation region connectivity segmentation results. The boundary sharpness measurement data is obtained by using the pixel gradient direction continuity comparison method to determine the gradient direction continuity. To ensure gradient direction continuity, the gradient difference sequence at the gap is calculated using a pixel gradient direction continuity comparison method, and the sequence convergence analysis is obtained. Based on sequence convergence analysis, the peak position identifier of the deviation is extracted from the connectivity segmentation result of the deviation region to determine the convergence characteristics of the gradient difference sequence. If the convergence characteristic meets the preset threshold, the deviation distribution evaluation is obtained by calculating the deviation boundary sharpness measurement data. For the deviation distribution assessment, the spatial gradient change of the deviation amplitude is integrated to determine the geometric deformation deviation correction.

[0067] In this embodiment, the deviation peak position identifier is obtained jointly by the spatial gradient change of the deviation amplitude and the connectivity segmentation result of the deviation region. During processing, the deviation amplitude of each pixel is first read within each deviation connected region, and the deviation amplitude changes between adjacent pixels are compared in pixel coordinate order; the pixel with the largest deviation amplitude is determined as the peak position of that deviation connected region. If multiple identical peaks exist within the same deviation connected region, the average deviation amplitude in the neighborhood of each peak position is compared, and the position with the larger average neighborhood deviation amplitude is determined as the peak position. Subsequently, the stitching coordinates of the peak position, its overlapping region, deviation amplitude, deviation change direction, and the boundary of the connected region are recorded to form the deviation peak position identifier.

[0068] When acquiring boundary sharpness measurement data using the pixel gradient direction continuity comparison method, the pixels on both sides of the boundary of the deviation connected region are taken as the objects. The direction of the most obvious gray-level change in the neighborhood on both sides of the boundary is calculated, and the difference between the gray-level change directions on both sides is compared. At the same time, the gray-level difference on both sides of the boundary, the neighborhood contrast, and the edge change intensity are statistically analyzed. The larger the gray-level difference on both sides of the boundary, the higher the neighborhood contrast, and the more concentrated the edge change, the higher the boundary sharpness measurement value. The gradient direction continuity judgment value is determined by adding 3 times the standard deviation to the average gradient direction difference on both sides of the boundary in historical qualified stitched images; when the gradient direction difference at the current boundary position does not exceed this judgment value, the boundary position is determined to meet the gradient direction continuity requirement.

[0069] For boundary locations that meet the requirement of gradient direction continuity, a gradient difference sequence at the seam is calculated. During processing, equidistant pixels are selected on both sides of the seam along its normal direction, and the gradient direction difference and gradient intensity difference of corresponding pixels are compared point by point in order of distance from the seam. The comparison results of each corresponding point are arranged sequentially to obtain the gradient difference sequence. To avoid the influence of isolated noise, when the difference between a single sequence value and its preceding and following adjacent sequence values ​​exceeds the average fluctuation value of a single point in historical qualified stitched images plus three times the standard deviation, the average result of its preceding and following adjacent sequence values ​​is used to replace the single-point sequence value, thus obtaining the sequence convergence analysis result.

[0070] Specifically, when judging the convergence characteristics of the gradient difference sequence based on sequence convergence analysis, the changing trend of the gradient difference sequence is compared along the direction away from the stitching seam. If the change amplitude between adjacent sequence values ​​continuously decreases, and several consecutive sequence values ​​at the end of the sequence do not exceed the convergence judgment value, then the gradient difference sequence is determined to meet the convergence characteristics. The convergence judgment value is determined by adding three times the standard deviation to the average gradient difference on both sides of the seam in historical qualified stitched images; the number of consecutive points participating in the judgment at the end of the sequence is determined according to the number of pixels corresponding to the width of the stitching seam, and is not less than twice that number of pixels. If the sequence value continues to increase, fluctuates repeatedly, or the end sequence value exceeds the convergence judgment value, then a boundary transition anomaly is determined to exist at that position.

[0071] When the convergence characteristics of the gradient difference sequence meet the judgment requirements, the deviation distribution evaluation is calculated based on the deviation boundary sharpness measurement data. During the calculation, for each deviation connected region, the boundary sharpness measurement value, deviation peak value, deviation average value, region area, and the convergence degree of the gradient difference sequence are statistically analyzed. The higher the boundary sharpness measurement value, the larger the deviation peak value, the larger the region area, and the lower the convergence degree, the higher the corresponding deviation distribution evaluation value. The weights for each calculation are determined by comparing historical qualified stitched images and misaligned stitched images, and are allocated according to the magnitude of each parameter's influence on the stitching error judgment result.

[0072] Based on the deviation distribution assessment results, the geometric deformation deviation correction is determined by fusing the spatial gradient change of the deviation amplitude. During processing, the peak position of the deviation is used as the correction center, and the correction extension range is determined along the direction of the decreasing deviation amplitude. Pixels whose deviation distribution assessment value exceeds the correction judgment value enter the correction area. The correction judgment value is determined by adding three times the standard deviation to the average deviation distribution assessment value in historical qualified stitched images, and it is not greater than the number of pixels corresponding to the defect location allowable error. For pixels entering the correction area, the position correction amount is determined according to their deviation amplitude, boundary sharpness measurement value, and deviation amplitude spatial gradient direction, and is used to correct the geometric deformation deviation in the stitched image.

[0073] It also includes S7, determining the position offset vector based on the convergence characteristics of the gradient difference sequence and the peak position identifier of the deviation, and obtaining the cumulative energy statistics of the deviation and the mapping results of the deviation and the overlapping area in the overall position authenticity index, specifically including: By using the convergence characteristics of the gradient difference sequence and the location identifier of the deviation peak, the position offset vector is determined, and the deviation vector calibration fusion is obtained. For deviation vector calibration fusion, the spatial gradient change method is used to calculate the cumulative energy of deviation and obtain the statistical value of the realism index. The spatial gradient change method obtains the total energy by summing the gradient vector differences between pixels. Based on the statistical analysis of the authenticity index, the corresponding relationships of overlapping regions are extracted from the connectivity segmentation results of the deviation region to determine the deviation mapping results; Specifically, the deviation mapping results are obtained, the boundary sharpness measurement data are fused, and the geometric deviation correction is determined. During geometric deviation correction, the cumulative energy statistics of deviation in the overall position accuracy index are obtained by mapping the deviation to the overlapping area.

[0074] In this embodiment, the position offset vector is determined based on the convergence characteristics of the gradient difference sequence and the location identifier of the deviation peak. During processing, the splicing coordinates of the deviation peak location, the deviation amplitude, the direction of deviation change, and the terminal residual of the gradient difference sequence at the corresponding gap are first read. The lower the convergence of the gradient difference sequence, the more significant the boundary transition error at that location; the larger the deviation peak, the greater the geometric offset at that location. Starting from the deviation peak location, the offset direction is determined along the direction of decreasing deviation amplitude, and the offset distance is determined jointly based on the deviation peak, the terminal residual, and the boundary sharpness measurement value, thus obtaining the position offset vector.

[0075] Specifically, after obtaining the position offset vectors, multiple position offset vectors within the same deviation connected region are calibrated and fused. During calibration, the main offset direction and average offset distance of each position offset vector within the deviation connected region are first calculated; vectors whose direction is opposite to the main offset direction and whose offset distance exceeds the average offset distance of the region plus three times the standard deviation are discarded. The remaining vectors are weighted and averaged according to the following rules: the closer to the peak position of the deviation, the higher the weight; the higher the boundary sharpness, the higher the weight; and the lower the convergence degree of the gradient difference sequence, the higher the weight. The resulting deviation vector calibration and fusion result is obtained. The weights are determined by comparing historical qualified stitched images and misaligned stitched images, and are allocated according to the proportion of influence of each parameter on the position offset judgment result.

[0076] For the deviation vector calibration and fusion results, the spatial gradient variation method is used to calculate the cumulative deviation energy. During processing, within each deviation connected region, the gradient direction difference, gradient intensity difference, and calibrated offset distance of adjacent pixels are compared sequentially according to pixel position. The larger the gradient direction difference, gradient intensity difference, and offset distance, the greater the deviation energy corresponding to that pixel position. Then, the deviation energies of all pixel positions within the deviation connected region are summed to obtain the cumulative deviation energy of that region. Finally, the cumulative deviation energies of all deviation connected regions within the same overlapping region are summarized to obtain the authenticity index statistics. The cumulative deviation energy judgment value is determined by adding three times the standard deviation to the average cumulative deviation energy of historical qualified stitched images, and it is not greater than the energy upper limit corresponding to the defect location allowable error.

[0077] Based on the accuracy index statistics, the correspondence between overlapping regions is extracted from the connectivity segmentation results of the deviation regions. Specifically, the boundary range, peak position, and pixel coordinates of each deviation connected region are mapped back to the overlapping field of view of the adjacent camera to determine the camera number, overlapping region number, and original image coordinate range corresponding to the deviation connected region. If the mapped region is within the camera calibration range and corresponds to the stitched overlapping region or fusion boundary, the deviation region is determined to have a valid mapping relationship; if the mapped position exceeds the camera calibration range or cannot correspond to a valid overlapping region, it is determined to be an invalid mapping. This yields the mapping results between deviations and overlapping regions.

[0078] After obtaining the deviation mapping results, the boundary sharpness measurement data is fused to determine the geometric deviation correction. For deviation regions with effective mapping relationships, their cumulative deviation energy, position offset vector, boundary sharpness measurement value, and corresponding overlapping region number are read. Regions with high cumulative deviation energy and high boundary sharpness are prioritized for correction processing. During correction, the pixel correction direction is determined by the position offset vector, the correction magnitude is determined by the cumulative deviation energy, and the boundary transition range is determined by the boundary sharpness measurement value. The upper limit of the correction magnitude is determined by the defect positioning allowable error, ensuring that the corrected defect morphology does not change due to excessive pixel movement.

[0079] During geometric deviation correction, the cumulative deviation energy in the overall positional accuracy index is recalculated based on the mapping results between the deviation and the overlapping region. In processing, the corrected deviation region is remapped to the corresponding overlapping region, and the gradient direction difference, gradient intensity difference, and remaining offset distance of adjacent pixels within that region are recalculated, then summed to obtain the corrected cumulative deviation energy. If the corrected cumulative deviation energy is lower than the corresponding judgment value, and the deviation region still maintains a valid mapping relationship with the original overlapping region, then the region meets the positional accuracy requirements; if it still exceeds the corresponding judgment value, then the region is used as the target for subsequent iterations of correction. The final overall positional accuracy index includes the cumulative deviation energy statistics for each overlapping region, the peak deviation position, the position offset vector, and the mapping results between the deviation and the overlapping region.

[0080] It also includes S8: If the cumulative energy statistics of the deviation in the overall positional authenticity index are lower than a preset threshold and the mapping between the deviation and the overlapping area meets the consistency requirements, then the stitched image that passes the verification is output; otherwise, the dense optical flow algorithm is iteratively executed for the deviation peak position marker area to recalculate the motion vector field and obtain the final stitched image that meets the geometric authenticity verification. Specifically, this includes: For the cumulative energy statistics of deviation, the deviation distribution data of key areas is extracted from the overall location authenticity index. A pre-established threshold comparison method is used to compare the magnitude of the deviation distribution data with the threshold to determine whether the deviation meets the preliminary verification standard and obtain the initial verification conclusion. If the cumulative energy of the deviation is lower than the preset threshold, the subsequent mapping and comparison process will proceed. Specifically, based on the initial verification conclusion, the overlapping area mapping data is obtained, and the mapping results are compared with the consistency verification requirements. By checking the degree of matching of the mapping data in the geometric dimension, it is determined whether the mapping meets the geometric consistency condition, and the area mapping judgment result is obtained. Based on the region mapping determination results, motion vector calculation is performed on the region corresponding to the deviation peak identifier. Dense optical flow processing is adopted, which takes the optical flow vector between image pixels as input and outputs the iterative vector field. The vector field data is iteratively updated to obtain the adjusted vector distribution information. The adjusted vector distribution information is obtained and combined with the region boundary smoothing process, which achieves smoothing by adjusting the gradient of the boundary pixels. The geometric authenticity of the stitched image is then verified to determine whether the boundary transition meets the consistency standard, and the final stitched image that passes the verification is obtained.

[0081] In this embodiment, deviation distribution data for key regions is extracted from the overall positional accuracy index based on the cumulative deviation energy statistics. Key regions include the region where the deviation peak is located, the splicing and fusion boundary neighborhood, and the deviation-connected regions where the cumulative deviation energy is higher than that of adjacent regions. During extraction, the cumulative deviation energy, peak deviation, region area, remaining position offset, boundary sharpness measurement value, and the corresponding overlapping region number of each key region are read. The threshold is determined based on historical qualified splicing images. The average value of the corresponding deviation statistics in the qualified splicing images plus three times the standard deviation is taken as the judgment value, ensuring that this judgment value does not exceed the upper limit of the pixel offset corresponding to the defect location allowable error. The deviation distribution data of the current key region is compared with this judgment value. Regions below the judgment value are deemed to meet the preliminary verification standard, while regions exceeding the judgment value are deemed not to meet the preliminary verification standard, thus obtaining the initial verification conclusion.

[0082] Specifically, if the cumulative deviation energy is below a preset threshold, the subsequent mapping comparison process begins. This preset threshold is determined by the camera calibration error, the allowable error for locating defects on the laser cladding layer surface, and the distribution of cumulative deviation energy in historical qualified stitched images. To determine this threshold, the camera calibration error and the allowable defect location error are first converted into allowable pixel offset ranges. Then, the normal fluctuation range of cumulative deviation energy in historical qualified stitched images is statistically analyzed, and the upper limit of the energy not exceeding the allowable pixel offset range is taken as the preset threshold. When the current cumulative deviation energy is below this preset threshold, it indicates that the overall geometric deviation of the stitched image is within the allowable range, and the consistency judgment of the overlapping area mapping can continue.

[0083] When obtaining overlapping region mapping data based on the initial verification conclusion, the pixel coordinates, deviation peak positions, and boundary ranges of key regions are reverse-mapped to the original local image coordinate system of adjacent cameras, resulting in camera number, original image coordinate range, stitched image coordinate range, and overlapping region number. When comparing the mapping results, the coordinate deviation, scale deviation, orientation deviation, and boundary range deviation of the same laser cladding layer surface position in adjacent local images are calculated. Each deviation judgment value is determined by the camera calibration template and historical qualified stitched images, taking the average of the geometric deviations of the corresponding actual regions plus three times the standard deviation as the judgment value. If none of the above deviations exceed the corresponding judgment value, the mapping is deemed to meet the geometric consistency condition; if any deviation exceeds the corresponding judgment value, the region is deemed not to meet the geometric consistency condition, and the region mapping judgment result is obtained.

[0084] Based on the region mapping determination results, the motion vector calculation is re-performed for the region corresponding to the deviation peak identifier. During processing, the area centered on the deviation peak position is expanded outward to include the complete deviation connected region and its boundary transition zone, serving as the dense optical flow iteration calculation region. Dense optical flow processing uses the grayscale changes, gradient directions, and texture structures between corresponding pixels in adjacent images as matching criteria, calculating the lateral and vertical displacements pixel by pixel to obtain the iterated motion vector field. For vectors whose directional deviation exceeds the average directional deviation of historical qualified stitched images plus three standard deviations, or whose length exceeds the average length of the neighborhood plus three standard deviations, effective vectors with stable direction and length within the neighborhood are used for weighted correction. After each iteration, the vector directional deviation, length fluctuation, and cumulative deviation energy are recalculated; when the cumulative deviation energy is lower than a preset threshold, or when the decrease in cumulative deviation energy after two consecutive iterations is lower than the average energy fluctuation in historical qualified stitched images, the iteration stops, and the adjusted vector distribution information is obtained.

[0085] Specifically, after obtaining the adjusted vector distribution information, the geometric authenticity of the stitched image is verified by combining region boundary smoothing processing. During boundary smoothing, a transition band is set on both sides of the stitching boundary, and fusion weights are assigned according to the distance from the pixel to the boundary, so that the gray level at the boundary transitions continuously from one side of the image to the other side. At the same time, the gradient direction and gradient intensity of the pixels on both sides of the boundary are compared, and the gradient abrupt change positions are compensated according to the gradient direction of the neighborhood. Then, the gray level difference, gradient direction difference, vector length difference, and boundary sharpness change on both sides of the boundary are recalculated and compared with the average value of the corresponding statistics of historical qualified stitched images plus 3 times the standard deviation. If the above differences do not exceed the corresponding judgment value, and the cumulative energy of the adjusted deviation is lower than the preset threshold, and the mapping between the deviation and the overlapping area meets the geometric consistency condition, then the boundary transition is judged to meet the consistency standard, and the stitched image that finally passes the verification is obtained; otherwise, the corresponding deviation peak area continues to be used as the object of the next round of dense optical flow iteration calculation.

[0086] It also includes S9, image recognition of surface defects in the laser cladding layer based on spliced ​​images consistent with geometric authenticity verification, extraction of defect type, location, and size information, and output of full surface quality inspection results of the laser cladding layer based on the defect recognition results, specifically including: To obtain a stitched image, for stitched images that are consistent with geometric authenticity verification, the edge gradient value is calculated by summing the pixel gradient differences using the boundary sharpness measurement method to obtain a consistent image. By verifying consistent images, surface defects of the laser cladding layer are identified. The YOLO algorithm is used to extract defect regions with image pixels as input, resulting in a set of defect regions. For a set of defective regions, type features are extracted from the region connectivity segmentation results obtained based on pixel connectivity to determine the defect type classification and obtain defect type information. Based on the defect type information, the location coordinates are extracted and the size parameters are calculated to determine the defect location and size information; The system acquires information on the location and size of defects, integrates surface quality assessment and quality index statistics calculated from the defect information to output the full surface quality inspection results of the laser cladding layer.

[0087] In this embodiment, a stitched image that has passed geometric authenticity verification is first acquired, and the edge sharpness of the stitching boundary and its neighborhood is measured. During processing, equal-width pixel bands are selected along both sides of the stitching boundary, and the grayscale change intensity between adjacent pixels is calculated point by point. The gradient direction difference between corresponding pixels on both sides of the boundary is compared. Then, the gradient differences of each pixel in the boundary neighborhood are accumulated to obtain the edge gradient value. The edge gradient judgment value is determined by the stitched images that have passed historical verification. The average value of the edge gradient statistics in the historical samples plus three times the standard deviation is taken as the judgment value. When the edge gradient value of the current stitched image does not exceed this judgment value, the stitched image is confirmed to meet the geometric authenticity verification requirements, and a verified consistent image is obtained.

[0088] When identifying surface defects in laser cladding layers using verified images, the verified images are input into a pre-trained YOLO detection model. The YOLO detection model is trained using sample images of laser cladding layer surfaces labeled with defect types, locations, and bounding boxes. After feature extraction from the input image, the model outputs candidate defect boxes, defect categories, and category confidence scores. The confidence score of the candidate defect boxes is determined by the verification samples, using a threshold value that ensures the actual defect detection rate meets the detection requirements while keeping the number of false positives within acceptable limits. Overlapping candidate boxes are filtered according to the intersection-union ratio (IU / U), retaining candidate boxes with higher confidence scores and removing duplicate boxes to obtain a set of defect regions.

[0089] For the defect region set, type features are extracted from the region connectivity segmentation results obtained based on pixel connectivity. During processing, interconnected abnormal pixels within each defect region are used as statistical objects to calculate the area, aspect ratio, boundary curvature, mean grayscale value, grayscale contrast, texture direction variation, and boundary sharpness of the connected region. Crack-type defects are judged based on elongated regions, continuous boundaries, and abrupt grayscale changes; porosity-type defects are judged based on nearly circular connected regions, local dark spots, and closed boundaries; inclusion-type defects are judged based on grayscale anomalies, irregular contours, and texture differences; and non-fusion and uneven weld line overlap defects are judged based on interrupted weld line boundaries, discontinuous texture direction, and abnormal region scale. The feature judgment values ​​for each type are determined statistically from labeled training and validation samples. The feature distribution range of the corresponding defect type's real samples is used as the classification basis to obtain defect type information.

[0090] Based on defect type information, the location and size of defects are determined by fusing location coordinate extraction and size parameter calculation. The defect location is based on the pixel coordinates of the defect region's center point, boundary points, and the point of maximum abnormal response in the stitched image, and is converted to the actual coordinates of the laser cladding layer surface using camera calibration parameters. Defect size is calculated based on the pixel area of ​​the defect region, the length and width of the bounding rectangle, the contour length, and the actual length corresponding to a single pixel. For crack-type defects, the length along the principal axis is used as the crack length, and the average width perpendicular to the principal axis is used as the crack width. For pore, inclusion, and depression-type defects, the area of ​​the connected region and the equivalent diameter are used as size parameters.

[0091] After obtaining the location and size information of defects, surface quality assessment and quality index statistics are performed. During processing, quality deduction values ​​are calculated according to defect type, number of defects, defect area, defect size, defect distribution density, and defect location. The deduction weight for each defect type is determined by the laser cladding layer quality judgment standard or the degree of influence of defects on product pass rate in historical production samples; the larger the area, the longer the size, the more numerous the defects, or the more concentrated the distribution of the same defect, the higher the corresponding deduction value. All defect deduction values ​​are deducted from the initial quality score to obtain the laser cladding layer surface quality score, and the total number of defects, the number of defects of each type, the maximum defect size, the defect density per unit area, and the defect distribution area are simultaneously calculated.

[0092] Finally, based on the defect identification results, the full surface quality inspection results of the laser cladding layer are output. These results include a consistent image, a set of defect areas, defect type information, defect location coordinates, defect size parameters, quality score, and quality grade. The quality grade judgment value is determined by product acceptance standards or the distribution of quality scores from historical qualified samples. If the quality score reaches the qualified judgment value, the surface quality of the laser cladding layer is deemed qualified. If the quality score is lower than the qualified judgment value, the corresponding defect type, defect location, and defect size are output for production process adjustment, rework, and quality traceability. 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 detecting the surface quality of laser cladding layers based on image mosaicking and image recognition, characterized in that, include: S1. Acquire local images of the laser cladding layer surface using multiple cameras, and extract key feature points from adjacent images using the SIFT algorithm to obtain a set of matching point pairs in the overlapping area; S2. Calculate the global affine transformation matrix based on the set of matching point pairs to obtain the preliminary geometric transformation model of the stitched image and determine the spatial correspondence of each pixel; S3. The dense optical flow algorithm is used to calculate the pixel motion vector field of the overlapping area of ​​the stitched image, and the results of motion vector direction distribution uniformity analysis and motion vector length consistency detection are obtained. S4. Determine whether there is a sudden change point location region in the motion vector field. If there is a sudden change point location region, apply a local weighted affine transformation to adjust the sudden change point location region to obtain the adjusted stitched image. S5. By calculating the motion vector density region division and motion vector field smoothness evaluation of the overlapping region in the adjusted stitched image, the spatial gradient change of deviation amplitude and the segmentation result of deviation region connectivity in the geometric deformation deviation distribution map are obtained. S6. Based on the spatial gradient change of the deviation amplitude and the segmentation results of the deviation region connectivity, extract the deviation peak position identifier and deviation boundary sharpness measurement data. Use the pixel gradient direction continuity comparison method to calculate the gradient difference sequence at the gap and judge the convergence characteristics of the gradient difference sequence.

2. The laser cladding layer surface quality detection method based on image mosaicking and image recognition according to claim 1, characterized in that: S1 includes: Local images of the laser cladding layer surface were acquired using multiple cameras, and the temperature distribution differences of the laser cladding layer were corrected using a time-synchronized acquisition method to obtain temperature-corrected images. For temperature-corrected images, acquire ambient light variation parameters, adjust image brightness distribution, and determine uniformly illuminated images; Extract SIFT key feature points from uniformly illuminated images and construct a feature descriptor set; By matching overlapping regions of adjacent images based on the feature descriptor subset, the consistency of feature points is determined, and a set of matching point pairs is obtained.

3. The laser cladding layer surface quality detection method based on image mosaicking and image recognition according to claim 1, characterized in that: S2 includes: Obtain the overlapping region matching parameters from the set of matching point pairs, calculate the global affine transformation matrix through the coordinate transformation corresponding to the matching parameters, and obtain the preliminary geometric transformation model; For the preliminary geometric transformation model, the image brightness distribution is adjusted, and the temperature distribution difference of the laser cladding layer is fused by the brightness distribution equalization to determine the illumination change parameters; Based on the illumination change parameters, a synchronous acquisition method is used to correct the local image acquisition data, and the consistency of feature points is judged by comparing the corrected data. By establishing the consistency of feature points, a pixel correspondence is constructed, and the spatial correspondence of each pixel in the preliminary geometric transformation model of the stitched image is obtained.

4. The laser cladding layer surface quality detection method based on image mosaicking and image recognition according to claim 1, characterized in that: S3 includes: By dividing the overlapping region, the target overlapping part is extracted from the local image of the surface of the laser cladding layer to be stitched. The dense optical flow algorithm is used to generate the initial pixel motion vector field. The vector field distribution is preliminarily sorted to obtain the basic motion trend capture result. Based on the basic motion trend capture results, the parameter distribution of uniform direction detection in the vector field is analyzed to obtain the direction deviation data. At the same time, combined with the length consistency verification, the range of vector length deviation is determined. For the vector length deviation range and direction deviation data, perform local deviation correction, adjust the outliers of pixel motion estimation in the overlapping area, and obtain the corrected spatial mapping relationship; By constructing a dynamic boundary adjustment scheme for overlapping regions through spatial mapping relationships, and integrating the region boundary smoothing process, the final motion vector field distribution characteristics are obtained.

5. The laser cladding layer surface quality detection method based on image mosaicking and image recognition according to claim 1, characterized in that: S4 includes: Based on the results of vector direction uniformity detection and length consistency detection, the criteria for judging abrupt change points in the motion vector field are determined. If the direction deviation exceeds the preset threshold, it is determined that there is an abrupt change point, and the regional positioning analysis results are obtained. Based on the regional positioning analysis results, a local weighted affine transformation is used to adjust the overlapping areas. The local weighted affine transformation calculates the pixel displacement through a weighting matrix to obtain the spatial mapping relationship. By using spatial mapping relationships, a boundary adjustment scheme is constructed, and the parameters for constructing distribution characteristics are determined; Dynamic boundary fusion data is extracted from parameters constructed from distribution features to obtain pixel motion estimation correction values; Based on the pixel motion estimation correction value, the image stitching is optimized by fusion to obtain the adjusted stitched image.

6. The laser cladding layer surface quality detection method based on image mosaicking and image recognition according to claim 1, characterized in that: S5 includes: The motion vector density is obtained by calculating the overlapping region, and the region division result is determined from the motion vector density; Based on the region division results, a smoothness evaluation value is obtained by using vector field smoothing evaluation, and the deviation distribution map is determined based on the smoothness evaluation value; Extract spatial gradient changes from the deviation distribution map to obtain amplitude spatial changes; Based on the amplitude space variation, the geometric deformation deviation is determined. If the geometric deformation deviation exceeds the preset threshold, connectivity segmentation is performed. Based on connectivity segmentation, the results of biased region segmentation are obtained.

7. The laser cladding layer surface quality detection method based on image mosaicking and image recognition according to claim 1, characterized in that: S6 includes: The deviation peak position identifier is extracted from the deviation amplitude spatial gradient change and deviation region connectivity segmentation results. The boundary sharpness measurement data is obtained by using the pixel gradient direction continuity comparison method to determine the gradient direction continuity. To ensure gradient direction continuity, the gradient difference sequence at the gap is calculated using a pixel gradient direction continuity comparison method, and the sequence convergence analysis is obtained. Based on sequence convergence analysis, the peak position identifier of the deviation is extracted from the connectivity segmentation result of the deviation region to determine the convergence characteristics of the gradient difference sequence. If the convergence characteristic meets the preset threshold, the deviation distribution evaluation is obtained by calculating the deviation boundary sharpness measurement data. For the deviation distribution assessment, the spatial gradient change of the deviation amplitude is integrated to determine the geometric deformation deviation correction.

8. The laser cladding layer surface quality detection method based on image mosaicking and image recognition according to claim 1, characterized in that, It also includes S7, determining the position offset vector based on the convergence characteristics of the gradient difference sequence and the peak position identifier of the deviation, and obtaining the cumulative energy statistics of the deviation and the mapping results of the deviation and the overlapping area in the overall position authenticity index, specifically including: By using the convergence characteristics of the gradient difference sequence and the location identifier of the deviation peak, the position offset vector is determined, and the deviation vector calibration fusion is obtained. For deviation vector calibration fusion, the spatial gradient change method is used to calculate the cumulative energy of deviation and obtain the statistical value of the realism index. The spatial gradient change method obtains the total energy by summing the gradient vector differences between pixels. Based on the statistical analysis of the authenticity index, the corresponding relationships of overlapping regions are extracted from the connectivity segmentation results of the deviation region to determine the deviation mapping results; Obtain the deviation mapping results, fuse the boundary sharpness measurement data, and determine the geometric deviation correction; During geometric deviation correction, the cumulative energy statistics of deviation in the overall position accuracy index are obtained by mapping the deviation to the overlapping area.

9. The laser cladding layer surface quality detection method based on image mosaicking and image recognition according to claim 8, characterized in that, It also includes S8: If the cumulative energy statistics of the deviation in the overall positional authenticity index are lower than a preset threshold and the mapping between the deviation and the overlapping area meets the consistency requirements, then the stitched image that passes the verification is output; otherwise, the dense optical flow algorithm is iteratively executed for the deviation peak position marker area to recalculate the motion vector field and obtain the final stitched image that meets the geometric authenticity verification. Specifically, this includes: For the cumulative energy statistics of deviation, the deviation distribution data of key areas is extracted from the overall location authenticity index. A pre-established threshold comparison method is used to compare the magnitude of the deviation distribution data with the threshold to determine whether the deviation meets the preliminary verification standard and obtain the initial verification conclusion. If the cumulative energy of the deviation is lower than the preset threshold, the subsequent mapping and comparison process will proceed. Based on the initial verification conclusion, the overlapping area mapping data is obtained. The mapping results are compared with the consistency verification requirements. By checking the degree of matching of the mapping data in the geometric dimension, it is determined whether the mapping meets the geometric consistency condition, and the area mapping judgment result is obtained. Based on the region mapping determination results, motion vector calculation is performed on the region corresponding to the deviation peak identifier. Dense optical flow processing is adopted, which takes the optical flow vector between image pixels as input and outputs the iterative vector field. The vector field data is iteratively updated to obtain the adjusted vector distribution information. The adjusted vector distribution information is obtained and combined with the region boundary smoothing process, which achieves smoothing by adjusting the gradient of the boundary pixels. The geometric authenticity of the stitched image is then verified to determine whether the boundary transition meets the consistency standard, and the final stitched image that passes the verification is obtained.

10. The laser cladding layer surface quality detection method based on image mosaicking and image recognition according to claim 9, characterized in that, It also includes S9, image recognition of surface defects in the laser cladding layer based on spliced ​​images consistent with geometric authenticity verification, extraction of defect type, location, and size information, and output of full surface quality inspection results of the laser cladding layer based on the defect recognition results, specifically including: To obtain a stitched image, for stitched images that are consistent with geometric authenticity verification, the edge gradient value is calculated by summing the pixel gradient differences using the boundary sharpness measurement method to obtain a consistent image. By verifying consistent images, surface defects of the laser cladding layer are identified. The YOLO algorithm is used to extract defect regions with image pixels as input, resulting in a set of defect regions. For a set of defective regions, type features are extracted from the region connectivity segmentation results obtained based on pixel connectivity to determine the defect type classification and obtain defect type information. Based on the defect type information, the location coordinates are extracted and the size parameters are calculated to determine the defect location and size information; The system acquires information on the location and size of defects, integrates surface quality assessment and quality index statistics calculated from the defect information to output the full surface quality inspection results of the laser cladding layer.