A method for underwater robot reshaping trajectory planning for shallow dam defect repair

By using an adaptive hierarchical trajectory planning algorithm and 3D reconstruction technology, the instability problem of trajectory planning for underwater robots in the repair of shallow defects in dams was solved, achieving high-precision and high-stability repair results.

CN123070431APending Publication Date: 2026-11-10CHINA YANGTZE POWER
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611094703.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-22
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

Existing underwater robots struggle to generate repair trajectories that match the actual shape of defects in shallow dam repair operations. This results in problems such as overcutting, undercutting, trajectory discontinuity, and sudden changes in tool posture, and the repair quality is inconsistent.

Method used

An improved equidistant contour offset trajectory planning algorithm based on adaptive hierarchical structure is adopted, which combines 3D reconstruction and image processing techniques to generate continuous shaping trajectories, including image preprocessing, stereo matching, depth estimation, 3D reconstruction, trajectory planning and execution optimization.

Benefits of technology

It improves the accuracy and stability of underwater robot shaping operations, ensures consistency in shaping quality and automation level, and reduces reliance on human experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123070431A_ABST
    Figure CN123070431A_ABST
Patent Text Reader

Abstract

A method for underwater robot reshaping trajectory planning for repairing shallow defects in dams belongs to the field of intelligent detection and repair technology for underwater engineering structures. The method first uses an underwater robot to acquire left-right image pairs or video data of the shallow underwater defect area of ​​the dam and its surrounding normal dam surface area. Then, combining binocular camera calibration parameters, underwater imaging refraction compensation parameters, and the underwater robot's pose information, stereo matching, depth estimation, and 3D reconstruction of the shallow defect area are performed. Next, combining preset repair process parameters and reshaping module parameters, and based on the target reshaping area model, an improved equidistant contour offset trajectory planning algorithm based on adaptive layering is used to generate layered reshaping trajectories. The layered reshaping trajectories are then connected, smoothed, and optimized for execution constraints to obtain a continuous reshaping trajectory executable by the underwater robot. This allows the reshaping module onboard the underwater robot to perform reshaping operations on the shallow underwater defect area of ​​the dam.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent detection and repair technology for underwater engineering structures, and specifically relates to an underwater robot trajectory planning method for repairing shallow defects in dams. Background Technology

[0002] As crucial hydraulic structures, dams directly impact the safety of reservoir operation, flood control, and the safety of life and property in downstream areas. During long-term service, the underwater concrete structure of a dam is continuously subjected to various factors, including water erosion, sediment abrasion, freeze-thaw cycles, chemical erosion, biological adhesion, temperature stress, and changes in water pressure. This can lead to defects such as cracks, honeycombing, pitting, erosion, cavitation, exposed aggregate, spalling, and shallow pits on the dam surface and in localized areas. While these shallow defects may not cause significant structural damage initially, if left untreated, they can easily expand and weaken the concrete cover and local load-bearing capacity, affecting the dam's structural durability and operational safety.

[0003] When repairing shallow defects in dams, it is usually necessary to first reshape the shallow pit area to create a more regular, stable, and easily filled or attached repair interface on the irregular defect surface. Traditional underwater reshaping operations rely heavily on divers using handheld tools, which presents problems such as high operational risks, significant influence from water depth and current, inconsistent reshaping quality, and difficulty in quantifying and controlling the defect treatment process.

[0004] Underwater robots, characterized by remote control capabilities, suitability for complex underwater environments, and the ability to carry sensing equipment and tools, can be used for underwater defect detection and repair in dams. However, the reshaping of shallow defects in dams is not a simple matter of fixed-point grinding or straight-line cutting. The irregular boundaries and uneven depth distribution of shallow pit defects, coupled with the limitations imposed by buoyancy, current disturbances, positioning errors, and the installation posture of the reshaping module, make it difficult for underwater robots to consistently generate a reshaping trajectory that matches the true shape of the defect. This can easily lead to problems such as overcutting, missed cuts, discontinuous trajectories, or sudden changes in tool posture.

[0005] Therefore, there is an urgent need to propose an underwater robot reshaping trajectory planning method and system for the repair of shallow defects in dams, so as to realize the automatic identification of shallow underwater defects in dams, the construction of target reshaping surfaces and the planning of reshaping trajectories, thereby improving the automation level, reshaping accuracy and repair quality of underwater robot repair operations. Summary of the Invention

[0006] The technical problem to be solved by this invention is to provide an underwater robot reshaping trajectory planning method for repairing shallow defects in dams. On the one hand, it solves the problems of irregular defect boundaries, difficulty in accurately determining the reshaping depth, reliance on human experience for trajectory planning, and poor consistency of reshaping quality in existing underwater robot reshaping operations. On the other hand, it combines defect three-dimensional morphology analysis, target reshaping surface model reconstruction, layered reshaping trajectory generation, and adaptive adjustment of trajectory parameters to realize automatic planning and dynamic optimization of the reshaping trajectory for shallow defects in dams, thereby improving the accuracy, stability, and subsequent repair quality of underwater robot reshaping operations.

[0007] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A method for planning the shaping trajectory of an underwater robot for repairing shallow defects in dams, comprising the following steps: S1. The underwater robot acquires left and right image pairs or video data of the shallow underwater defect area of ​​the dam and the surrounding normal dam surface area, and acquires the underwater robot's pose information. The left and right image pairs or video data are preprocessed, binocularly corrected, and subjected to CLAHE underwater image enhancement processing. CLAHE stands for Limit Contrast Adaptive Histogram Equalization. S2. Based on the enhanced left and right image pairs or video data, combined with the binocular camera calibration parameters, underwater imaging refraction compensation parameters and underwater robot pose information, stereo matching, depth estimation and three-dimensional reconstruction of the shallow defect area are performed to obtain the depth map, three-dimensional point cloud or three-dimensional mesh model of the shallow defect area. S3. Based on the three-dimensional reconstruction results, construct the local reference surface of the dam body and extract the boundary, location, size, depth distribution, surface normal and morphological features of shallow defects; S4. Based on the boundary, depth distribution, surface normal and morphological features of the shallow defects, and combined with the preset repair process parameters and shaping module parameters, construct a target shaping area model. S5. Based on the target shaping region model, an improved equidistant contour offset trajectory planning algorithm based on adaptive layering (full name "adaptive layering improved equidistant contour offset trajectory planning algorithm") is used to generate layered shaping trajectories, and the layered shaping trajectories are connected, smoothed and optimized for execution constraints to obtain a continuous shaping trajectory that can be executed by the underwater robot. S6. Output the continuous shaping trajectory and trajectory parameters to the underwater robot execution unit to control the shaping module carried by the underwater robot to perform shaping operations on the shallow underwater defect area of ​​the dam.

[0008] Preferably, in step S1, the underwater robot moves in the underwater area of ​​the dam to be repaired, and collects multi-angle, multi-frame left-right image pairs or video data of the same shallow defect area. At the same time, it collects left-right image pairs or video data of the normal dam surface area around the shallow defect, forming underwater image data containing the shallow defect area and the normal dam surface area. The underwater image data is used for three-dimensional reconstruction of the shallow defect, construction of the local reference surface of the dam body, and generation of the target repair area model.

[0009] Preferably, in step S1, the preprocessing includes denoising, size normalization, brightness correction, distortion correction, and binocular correction; the CLAHE underwater image enhancement process includes dividing the left and right image pairs into multiple local regions, performing histogram equalization with contrast limitation on each local region, and applying consistent enhancement parameters or synchronous enhancement methods to the left and right images in the same left and right image pair.

[0010] Preferably, in step S2, the three-dimensional reconstruction includes: performing stereo correction on the left and right image pairs according to the binocular camera calibration parameters and underwater imaging refraction compensation parameters; calculating the disparity map using a stereo matching algorithm; and optimizing the disparity map by left-right consistency detection, hole filling, noise filtering, and edge preservation; and converting two-dimensional pixels into three-dimensional points in a spatial coordinate system according to the disparity map, the binocular camera baseline distance, focal length parameters, and underwater robot pose information to generate a three-dimensional point cloud or three-dimensional mesh model of the shallow defect area.

[0011] Preferably, the three-dimensional point cloud or three-dimensional mesh model is subjected to point cloud denoising, outlier removal, voxel downsampling, point cloud registration, surface smoothing, and local completion processing; wherein, when the video data contains multiple consecutive left and right image pairs, the reconstructed point clouds of multiple frames are registered and fused according to the underwater robot pose information to improve the integrity of the three-dimensional morphology model of shallow defects.

[0012] Preferably, in step S3, constructing the local reference surface of the dam body includes: selecting normal dam surface points unaffected by the shallow defect around the shallow defect; eliminating candidate points whose curvature is greater than a preset curvature threshold, whose surface normal deviation is greater than a preset angle threshold, whose residual from the point to the initial fitted surface is greater than a preset residual threshold, and those located in gray-scale or texture abrupt change regions; and constructing the local reference surface of the dam body based on the remaining normal dam surface points using least squares fitting, random sampling consistency fitting, or B-spline surface fitting methods; comparing each sampling point in the shallow defect area with the local reference surface of the dam body, calculating the normal distance of each sampling point relative to the local reference surface of the dam body, and using the normal distance as the indentation depth value of the shallow defect.

[0013] Preferably, in step S3, the morphological features include geometric features, morphological features, and spatial features; wherein, the geometric features include the length, width, area, maximum depth, average depth, and volume estimate of the shallow defect; the morphological features include boundary curvature, contour complexity, boundary regularity, bottom surface undulation, and depth variation rate; the spatial features include the location of the shallow defect, the surface normal of each sampling point within the defect area, the concave distribution of the defect relative to the local reference surface of the dam body, and the transition relationship between the defect edge and the surrounding normal dam surface.

[0014] Preferably, in step S4, constructing the target shaping region model includes: expanding the shallow defect boundary based on the shallow defect boundary, the cutting blade radius, the underwater robot positioning error, the minimum adhesion width of the repair material, and the safety margin to obtain an expanded shaping boundary; determining the target shaping bottom surface based on the shallow defect depth distribution, the maximum allowable shaping depth, the minimum effective filling thickness of the repair material, and the filling margin of the repair material; constructing an edge transition surface connecting the target shaping bottom surface and the surrounding normal dam surface based on the height difference between the shallow defect edge and the surrounding normal dam surface, the edge transition slope, and the edge rounded corner radius; and forming the target shaping region model together with the expanded shaping boundary, the target shaping bottom surface, and the edge transition surface.

[0015] Preferably, in step S5, generating the layered shaping trajectory includes: calculating the maximum shaping depth, depth distribution, and depth change rate of the shallow defect area based on the depth deviation between the three-dimensional morphology model of the shallow defect and the local reference surface of the dam body, and determining the initial number of shaping layers in combination with the single allowable cutting depth of the cutting blade; adaptively adjusting the layer thickness of each shaping layer according to the depth change rate, surface curvature, and bottom surface undulation of different areas; within each shaping layer, projecting the cross-sectional contour of the target shaping area model on the current shaping layer onto the local parameter plane, constructing a directed distance field based on the defect boundary, and determining the contour offset spacing according to the effective cutting width of the cutting blade and the path overlap rate, and generating equidistant offset contours sequentially from the outside to the inside or from the inside to the outside according to the contour offset spacing; performing topology correction, short side removal, sharp corner rounding, and arc transition processing on the generated equidistant offset contours to generate a layered shaping trajectory that continuously covers the target shaping area.

[0016] An underwater robot trajectory planning system for repairing shallow defects in dams includes a communication module, a data processing module, a 3D reconstruction module, a defect morphology analysis module, a trajectory planning module, an execution control module, and an interface display module; wherein: The communication module is used to enable command interaction and data transmission between the underwater robot and the host computer; The data processing module is used to preprocess, perform binocular correction, and CLAHE underwater image enhancement on left and right image pairs or video data of the underwater shallow defect area of ​​the dam and its surrounding normal dam surface area. The 3D reconstruction module is used to perform stereo matching, depth estimation and 3D reconstruction on enhanced left and right image pairs or video data to generate depth maps, 3D point clouds or 3D mesh models of shallow defect areas. The defect morphology analysis module is used to construct a local reference surface of the dam body based on the 3D reconstruction results, extract the boundary, location, size, depth distribution, surface normal and morphology features of shallow defects, and generate the data required for constructing the target shaping area model; The trajectory planning module is used to generate layered shaping trajectories based on the target shaping area model, cutting disc geometric parameters, single cutting depth, path overlap rate, and underwater robot operation constraints, using an improved equidistant contour offset trajectory planning algorithm based on adaptive layering. The module then performs trajectory connection, smoothing, and execution constraint optimization on the layered shaping trajectories to obtain a continuous shaping trajectory that can be executed by the underwater robot. The execution control module is used to convert the continuous shaping trajectory into control commands that the underwater robot execution unit can recognize, control the shaping module on the underwater robot to perform underwater shallow surface defect shaping operations on the dam, and adaptively correct the position, attitude, movement speed, single cutting depth or trajectory spacing of subsequent trajectory points based on the underwater robot pose information, trajectory tracking information, shaping module status information and local image information. The interface display module is used to visualize the results of shallow defect 3D reconstruction, defect morphology analysis, target shaping area model, and shaping trajectory planning. The present invention can achieve the following beneficial effects: 1. This invention uses an underwater robot to acquire left and right image pairs or video data of the shallow underwater defect area of ​​the dam and the surrounding normal dam surface area, and simultaneously acquires the underwater robot's pose information, so that the shallow defect reshaping trajectory planning can be based on the real image data on site and the robot's spatial state, reducing the reliance on manual underwater observation and experience judgment.

[0017] 2. In the image processing stage, this invention performs noise reduction, size normalization, brightness correction, distortion correction, and binocular correction on left and right image pairs or video data. Furthermore, it adopts CLAHE underwater image enhancement processing, which can improve problems such as low contrast, blurred boundaries, uneven lighting, and interference from suspended particles in underwater images, thereby improving the stability of subsequent stereo matching and 3D reconstruction.

[0018] 3. In the CLAHE underwater image enhancement process, the present invention uses consistent enhancement parameters or synchronous enhancement processing methods for the same left and right image pairs, so that the enhanced left and right images maintain good grayscale consistency and texture correspondence, which helps to reduce binocular matching error.

[0019] 4. This invention combines binocular camera calibration parameters, underwater imaging refraction compensation parameters, and underwater robot pose information for stereo matching, depth estimation, and 3D reconstruction. It can compensate for the effects of underwater imaging refraction and robot posture changes, and improve the spatial accuracy of shallow defect depth maps, 3D point clouds, or 3D mesh models.

[0020] 5. When the video data contains multiple consecutive left and right image pairs, the present invention performs registration and fusion of the reconstructed point clouds of multiple frames based on the pose information of the underwater robot, which can improve the integrity of the three-dimensional morphology model of shallow defects and reduce the reconstruction loss caused by occlusion, turbidity or insufficient local texture of single frame images.

[0021] 6. By selecting normal dam surface points unaffected by shallow defects around the defects and eliminating candidate points with abnormal curvature, excessive normal deviation, excessive fitting residual, and abrupt changes in grayscale or texture, this invention can construct a local reference surface that is closer to the real dam surface, providing a reliable reference for defect depth calculation and shaping target determination.

[0022] 7. This invention compares each sampling point in the shallow defect area with the local reference surface of the dam body, calculates the normal distance of each sampling point relative to the local reference surface of the dam body, and uses it as the depression depth value. This can quantitatively obtain the depth distribution of shallow defects and avoid determining the shaping depth based solely on the two-dimensional image contour.

[0023] 8. This invention can extract the boundary, location, size, depth distribution, surface normal and morphological features of shallow defects, so that the geometric features, morphological features and spatial features of shallow defects can be quantitatively expressed, providing a data foundation for the construction of target shaping area models and trajectory planning.

[0024] 9. Based on the shallow defect boundary, the radius of the cutting disc, the positioning error of the underwater robot, the minimum adhesion width of the repair material, and the safety margin, the present invention expands the defect boundary outward, which enables the repair area to cover the defect edge and its necessary surrounding area, reducing the problem of insufficient adhesion area of ​​subsequent repair material or incomplete edge treatment.

[0025] 10. The present invention determines the target bottom surface for repair based on the shallow defect depth distribution, the maximum allowable repair depth, the minimum effective filling thickness of the repair material, and the filling margin of the repair material, and constructs an edge transition surface connecting the target bottom surface for repair and the surrounding normal dam surface, so that the defect area after repair has a more regular bottom surface and a continuous transition edge, which facilitates subsequent filling, bonding or attachment of repair materials.

[0026] 11. The present invention adopts an improved equidistant contour offset trajectory planning algorithm based on adaptive layering. The number and thickness of the shaping layers are adaptively determined according to the maximum shaping depth, depth change rate, surface curvature and bottom surface undulation. This allows for finer layering in areas with large depth changes or obvious boundary undulations, reducing the risk of overcutting, missing cutting and insufficient local shaping.

[0027] 12. In each shaping layer, the present invention generates an equidistant offset profile based on the effective cutting width of the cutting blade and the path overlap rate, and performs topology correction, short side removal, sharp corner rounding and arc transition processing on the offset profile, which can improve the continuity and executability of trajectory coverage and reduce trajectory breakage or sharp corner abrupt changes caused by irregular defect boundaries.

[0028] 13. This invention performs trajectory connection, smoothing and execution constraint optimization on the layered shaping trajectory, and combines the underwater robot's maximum motion speed, maximum acceleration, attitude adjustment range, trajectory tracking error and safe distance from the dam surface to constrain the generated continuous shaping trajectory, making it more suitable for the actual execution of the underwater robot.

[0029] 14. During the shaping process, the present invention can adaptively correct the position, attitude, movement speed, single cutting depth or trajectory spacing of subsequent trajectory points based on the underwater robot's pose information, trajectory tracking information, shaping module status information and local image information, thereby reducing the impact of water flow disturbance, positioning error and execution deviation on shaping quality.

[0030] 15. After the reshaping is completed, the present invention can re-acquire the left and right image pairs or video data of the reshaping area and perform local three-dimensional reconstruction. The reshaping result is compared with the target reshaping area model to determine whether a local compensation reshaping trajectory needs to be generated, thereby forming a closed-loop reshaping process of detection, modeling, planning, execution and verification. Attached Figure Description

[0031] The present invention will be further described below with reference to the accompanying drawings and embodiments: Figure 1 This is an overall flowchart of an underwater robot trajectory planning method for repairing shallow defects in dams, according to an embodiment of the present invention. Figure 2 This is a schematic diagram of an underwater image acquisition, preprocessing, and enhancement process according to an embodiment of the present invention; Figure 3 This is a schematic diagram illustrating the process of three-dimensional reconstruction of a shallow underwater defect area of ​​a dam and construction of a target shaping area model according to an embodiment of the present invention. Figure 4 This is a flowchart of an improved equidistant contour offset shaping trajectory planning method based on adaptive layering, according to an embodiment of the present invention. Figure 5This is a functional module structure diagram of an underwater robot trajectory planning system for repairing shallow defects in dams, according to an embodiment of the present invention. Detailed Implementation

[0032] The present invention will be further described below with reference to the accompanying drawings and embodiments. Without departing from the concept of the present invention, any equivalent substitutions or conventional adjustments made by those skilled in the art regarding the underwater robot model, the installation method of the binocular image acquisition device, image enhancement parameters, 3D reconstruction algorithm, shaping module specifications, and trajectory execution parameters should fall within the protection scope of the present invention.

[0033] like Figure 1 As shown, this invention provides a method for underwater robot reshaping trajectory planning for repairing shallow defects in dams. This method uses left-right image pairs or video data of the shallow underwater defect area and its surrounding normal dam surface area as a basis, combined with underwater robot pose information, binocular camera calibration parameters, and underwater imaging refraction compensation parameters, to complete image preprocessing, binocular correction, CLAHE underwater image enhancement processing, stereo matching, depth estimation, and 3D reconstruction. Subsequently, based on the 3D reconstruction results, a local reference surface of the dam body is constructed, and the boundaries, locations, sizes, depth distributions, surface normals, and morphological features of the shallow defects are extracted. Then, based on the morphology of the shallow defects and the repair process requirements, a target reshaping area model is constructed, and a continuously reshaping trajectory is generated using an improved equidistant contour offset trajectory planning algorithm based on adaptive layering. Finally, the continuously reshaping trajectory and trajectory parameters are output to the underwater robot execution unit, controlling the reshaping module onboard the underwater robot to perform reshaping operations on the shallow underwater defect area of ​​the dam.

[0034] In this embodiment, the shallow defects include at least one of the following on the underwater concrete surface of the dam: cracks, honeycombing, pitting, erosion, cavitation, exposed aggregate, spalling, shallow pits, and locally irregular damaged areas. The shaping refers to the underwater robot using a shaping module to perform layered cutting, boundary trimming, bottom surface leveling, and edge transition processing on the shallow defect area, transforming the irregular defect surface into a regularized repair interface that meets the requirements for subsequent filling, bonding, or adhesion. The shaping module may include an underwater motor, transmission mechanism, cutting disc, grinding disc, or milling cutter, with the geometric parameters, single allowable cutting depth, and effective cutting width of the cutting disc serving as trajectory planning input parameters.

[0035] S1. Underwater image acquisition, preprocessing, and CLAHE underwater image enhancement processing refer to Figure 1 and Figure 2As shown, the underwater robot moves within the underwater area of ​​the dam to be repaired. It acquires left-right image pairs or video data of the shallow underwater defect area and the surrounding normal dam surface area using its onboard binocular image acquisition device, and simultaneously acquires the underwater robot's pose information. This pose information includes at least one of the following: the underwater robot's position, attitude angle, velocity, angular velocity in the robot's body coordinate system, the dam's local coordinate system, or the world coordinate system; and the installation pose transformation parameters of the binocular image acquisition device relative to the underwater robot's body.

[0036] During data acquisition, the underwater robot collects multi-angle, multi-frame left-right image pairs or video data of the same shallow defect area, while simultaneously acquiring left-right image pairs or video data of the normal dam surface area surrounding the shallow defect, thus forming underwater image data that includes both the shallow defect area and the normal dam surface area. This underwater image data is used for subsequent 3D reconstruction of the shallow defect, construction of local reference surfaces of the dam body, and generation of target shaping area models. For areas with turbid water, uneven lighting, or unclear defect boundaries, image coverage quality can be improved by reducing the underwater robot's movement speed, increasing the number of acquisition frames, or adjusting the supplementary lighting angle.

[0037] The data processing module preprocesses the left and right image pairs or video data. The preprocessing includes denoising, size normalization, brightness correction, distortion correction, and binocular correction. Denoising reduces random interference caused by suspended particles in water, scattered light, and image transmission noise; size normalization ensures consistent resolution across different frames; brightness correction reduces the impact of locally dark or overexposed areas on matching; distortion correction corrects lens distortion in the binocular camera; and binocular correction ensures corresponding points in the left and right images lie on the same epipolar line.

[0038] Furthermore, the left and right image pairs after binocular correction are subjected to CLAHE underwater image enhancement processing. The CLAHE underwater image enhancement processing is a contrast-limited adaptive histogram equalization process. Figure 2 As shown, the CLAHE underwater image enhancement process includes: dividing the left and right image pairs into multiple local regions; calculating the gray-level histogram of each local region; cropping the histogram portion exceeding a preset cropping threshold and redistributing the cropped gray values ​​to each gray level; performing histogram equalization on each local region; and then obtaining the enhanced left image and the enhanced right image through interpolation fusion between adjacent local regions.

[0039] For the left and right images in the same left-right image pair, consistent enhancement parameters or synchronous enhancement processing methods are applied. The consistent enhancement parameters include at least one of the following: local region segmentation size, cropping threshold, number of gray levels, and interpolation method, so that the enhanced left and right images maintain gray level consistency and texture correspondence, thereby improving the stability of stereo matching.

[0040] As one implementation method, CLAHE underwater image enhancement processing can be performed in the luminance color space. The left and right images are converted from the RGB color space to the luminance color space, and the luminance channels are extracted. Contrast-limited local histogram equalization is then performed on the luminance channels. Finally, the enhanced luminance channels are recombine with the original color channels to obtain the enhanced left and right image pair. This processing can improve the problems of insufficient contrast in underwater images, blurred boundaries of shallow defects, and unclear dam surface texture, and provides stable image input for subsequent stereo matching, depth estimation, and 3D reconstruction.

[0041] S2, stereo matching, depth estimation, and 3D reconstruction Combination Figure 3 As shown, based on the enhanced left and right image pairs or video data, combined with the binocular camera calibration parameters, underwater imaging refraction compensation parameters and underwater robot pose information, stereo matching, depth estimation and 3D reconstruction are performed on the shallow defect area to obtain the depth map, 3D point cloud or 3D mesh model of the shallow defect area.

[0042] The binocular camera calibration parameters include one or more of the following: left camera intrinsic parameters, right camera intrinsic parameters, left camera distortion parameters, right camera distortion parameters, rotation matrix and translation vector between the left and right cameras, binocular baseline distance, focal length parameters, binocular correction mapping parameters, and installation pose transformation parameters of the binocular image acquisition device relative to the underwater robot's body coordinate system. The underwater imaging refraction compensation parameters include one or more of the following: water refractive index, refractive index of the waterproof compartment's transparent window, thickness of the waterproof compartment's transparent window, normal or installation angle of the waterproof compartment's transparent window, distance from the camera's optical center to the waterproof compartment's transparent window, equivalent focal length correction coefficient, depth scale correction coefficient, and refraction error compensation coefficient.

[0043] In the stereo matching process, the left and right image pairs are first stereo corrected based on the binocular camera calibration parameters and underwater imaging refraction compensation parameters. Then, a stereo matching algorithm is used to calculate the disparity map. The stereo matching algorithm can be a semi-global matching algorithm, a block matching algorithm, a deep learning stereo matching algorithm, or a multi-scale feature matching algorithm. After obtaining the disparity map, left-right consistency detection, hole filling, noise filtering, and edge preservation optimization are performed on the disparity map to reduce the impact of mismatches, low-texture regions, and boundary blurring on the depth estimation results.

[0044] For the pixels in the enhanced left and right image pairs The depth value is calculated based on the parallax value:

[0045] In the formula, For pixels The corresponding depth value; The equivalent focal length after underwater imaging refraction compensation; This is the equivalent binocular baseline distance after underwater imaging refraction compensation; For pixels disparity value; This is used to avoid positive numbers with a denominator of zero.

[0046] Based on pixels The image coordinates and depth values ​​are used to convert two-dimensional pixels into three-dimensional points in a spatial coordinate system. As one implementation method, pixels... The three-dimensional coordinates in the camera coordinate system can be represented as:

[0047] In the formula, For pixels Three-dimensional coordinates in the camera coordinate system; and Each pixel The horizontal and vertical pixel coordinates; and These are the horizontal and vertical coordinates of the camera's principal point, respectively. and These are the focal length parameters of the camera in the horizontal and vertical directions, respectively; Same as the definition above.

[0048] By combining the underwater robot's pose information, the 3D points in the camera coordinate system are transformed to the local coordinate system or the world coordinate system of the dam body:

[0049] In the formula, For pixels Three-dimensional coordinates in the world coordinate system or the local coordinate system of the dam body; This is the homogeneous transformation matrix from the camera coordinate system to the underwater robot's body coordinate system; This is the homogeneous transformation matrix from the underwater robot's body coordinate system to the world coordinate system or the dam's local coordinate system; Same as the definition above.

[0050] The 3D points obtained by converting all valid pixels are combined to generate a 3D point cloud of the shallow defect area. The 3D point cloud or 3D mesh model is then processed with point cloud denoising, outlier removal, voxel downsampling, point cloud registration, surface smoothing, and local completion. When the video data contains multiple consecutive left-right image pairs, the reconstructed point clouds from multiple frames are registered and fused based on the underwater robot's pose information to improve the integrity of the 3D morphology model of the shallow defect. For areas where the point cloud is missing due to water turbidity, reflection, or insufficient texture, local completion can be performed based on the point clouds of adjacent areas, the local reference surface of the dam body, and the continuity of the defect boundary.

[0051] S3. Construction of local reference surfaces of the dam body and extraction of shallow defect morphology features Based on the 3D reconstruction results, a local reference surface of the dam body is constructed, and the boundary, location, size, depth distribution, surface normal and morphological features of shallow defects are extracted.

[0052] Specifically, in combination Figure 3 It is known that normal dam surface points unaffected by shallow defects are first selected around the shallow defects. The selection process for normal dam surface points includes: determining the shallow defect candidate region based on the local curvature, surface normal consistency, gray-level or texture abrupt change characteristics, and residual from the point to the initial fitted surface of each sampling point in the 3D point cloud or 3D mesh model; forming a safety exclusion zone by expanding the shallow defect candidate region outward by a preset distance; selecting normal dam surface candidate points in the annular or strip-shaped neighborhood outside the safety exclusion zone; eliminating candidate points with curvature greater than a preset curvature threshold, surface normal deviation greater than a preset angle threshold, residual from the point to the initial fitted surface greater than a preset residual threshold, and those located in gray-level or texture abrupt change regions; and selecting the remaining sampling points that meet the requirements of smoothness, continuity, and normal consistency as normal dam surface points.

[0053] A local reference surface of the dam body is constructed based on the normal dam surface points using least squares fitting, random sample consistency fitting, or B-spline surface fitting methods. Taking B-spline surface fitting as an example, the local reference surface of the dam body can be represented as:

[0054] In the formula, For parameters and parameters Corresponding local reference surface points of the dam body; and These are the two parameter directional coordinates of the local reference surface of the dam body; and These are the control point indices; and These are the maximum indices of the control points in the two parameter directions, respectively; For the first line, number The three-dimensional coordinates of the column control points; For the first indivual B-spline basis functions; For the first indivual B-spline basis functions.

[0055] Each sampling point within the shallow defect area is compared with the local reference surface of the dam body. The normal distance of each sampling point relative to the local reference surface of the dam body is calculated, and the normal distance is used as the indentation depth value of the shallow defect.

[0056] In the formula, Sampling points The depth of the depression relative to the local reference surface of the dam body; The three-dimensional coordinates of the sampling points within the shallow defect area; and Sampling points The parameter coordinates corresponding to the projection onto the local reference surface of the dam body; Sampling points Corresponding local reference surface points of the dam body; For the local reference surface of the dam body in parametric coordinates and Unit normal vector at; symbol This represents the dot product of vectors.

[0057] The depth distribution is segmented based on a preset indentation threshold to determine the boundary between the shallow defect area and the normal dam surface area, and the outer contour of the shallow defect is extracted as the shallow defect boundary. Further, the geometric, morphological, and spatial features of the shallow defect are extracted. Geometric features include the length, width, area, maximum depth, average depth, and volume estimate of the shallow defect; morphological features include boundary curvature, contour complexity, boundary regularity, bottom surface undulation, and depth change rate; spatial features include the location of the shallow defect, the surface normal of each sampling point within the defect area, the indentation distribution of the defect relative to the local reference surface of the dam body, and the transition relationship between the defect edge and the surrounding normal dam surface.

[0058] As one implementation method, the maximum depth and average depth of shallow defects can be determined as follows:

[0059]

[0060] In the formula, This represents the maximum depth of shallow defects. The average depth of shallow defects; This is the set of sampling points within the shallow defect area; This represents the number of sampling points within the shallow defect area. For sampling point index; Same as the definition above.

[0061] The estimated volume of shallow defects can be determined as follows:

[0062] In the formula, This is an estimate of the volume of shallow defects; Sampling points The corresponding local area weight; and Same as the definition above. The above-mentioned shallow defect morphology features are used to subsequently determine the outer expansion and shaping boundary, the target shaping bottom surface, the edge transition surface, the number of shaping layers, the trajectory spacing, and the cutting disc's operating posture.

[0063] S4. Construction of the target shaping region model Based on the boundary, depth distribution, surface normal, and morphological characteristics of the shallow defects, and combined with preset repair process parameters and shaping module parameters, a target shaping area model is constructed.

[0064] like Figure 3 As shown, the target shaping region model includes an outward shaping boundary, a target shaping bottom surface, and an edge transition surface. The outward shaping boundary is used to determine the shaping coverage area; the target shaping bottom surface is used to define the bottom repair interface formed after the defect area is shaped; the edge transition surface is used to connect the target shaping bottom surface with the surrounding normal dam surface, so that the edge of the shaped defect area has a continuous transition shape.

[0065] Specifically, based on the shallow defect boundary, the cutting disc radius, the underwater robot positioning error, the minimum adhesion width of the repair material, and the safety margin, the shallow defect boundary is expanded outward to obtain the expanded repair boundary. The expansion distance can be expressed as:

[0066] In the formula, This represents the outward extension distance of the shallow defect boundary; The radius of the cutting blade; This refers to the positioning error of the underwater robot. Minimum adhesion width for repair material; This is for a safety margin.

[0067] After obtaining the outer expansion and shaping boundary, the target shaping bottom surface is determined based on the shallow defect depth distribution, maximum allowable shaping depth, minimum effective filling thickness of the repair material, and filling margin of the repair material. For areas where the original shallow defect bottom surface has large undulations, the target shaping bottom surface can be constructed as a smooth surface with a stable normal distance relative to the local reference surface of the dam body; for areas near the defect boundary, an edge transition surface is generated based on the edge transition slope and edge fillet radius to avoid abrupt height changes between the target shaping bottom surface and the surrounding normal dam surface.

[0068] As one implementation method, the target depth of the target shaping bottom surface can be determined in the following way:

[0069] In the formula, The target depth of the bottom surface of the target shaping relative to the local reference surface of the dam body; This represents the maximum depth of shallow defects. Minimum effective filling thickness of the repair material; Allowance for filling with repair material; This represents the maximum permissible reshaping depth.

[0070] An edge transition surface is constructed between the outwardly expanded shaping boundary and the target shaping bottom surface. The edge transition surface can be generated using linear transition, circular arc transition, or spline surface transition. For areas with large edge curvature or significant changes in the normal direction of the surrounding dam surface, a larger transition width and a smaller slope change rate are used for the edge transition surface; for areas with gentle boundaries, a smaller transition width can be used to reduce unnecessary shaping area. The target shaping region model is formed by the outwardly expanded shaping boundary, the target shaping bottom surface, and the edge transition surface.

[0071] S5. Improved equidistant contour offset trajectory planning based on adaptive hierarchical structure Based on the target shaping region model, an improved equidistant contour offset trajectory planning algorithm based on adaptive layering is used to generate layered shaping trajectories. The layered shaping trajectories are then connected, smoothed, and subjected to execution constraint optimization to obtain a continuous shaping trajectory that can be executed by the underwater robot.

[0072] like Figure 4 As shown, trajectory planning first calculates the maximum repair depth, depth distribution, and depth change rate of the shallow defect area based on the depth deviation between the three-dimensional morphology model of the shallow defect and the local reference surface of the dam body. Then, it determines the initial number of repair layers by combining this with the allowable single-pass cutting depth of the cutting blade.

[0073] In the formula, This represents the initial number of reshaping layers; The target depth for shaping the bottom surface; This refers to the allowable depth of cut for a single pass of the cutting blade. This is the floor function.

[0074] The thickness of each shaping layer is adaptively adjusted based on the depth variation rate, surface curvature, and bottom surface undulation in different regions. As one implementation method, the shaping layer thickness in the current region can be expressed as:

[0075] In the formula, For the first The thickness of each shaping layer; Number the shaping layers; Same as the definition above; This represents the rate of change of depth in the current region. This refers to the surface curvature index of the current region. This is the weighting coefficient for the rate of change of depth; This is the surface curvature weighting coefficient; Minimum allowable shaping layer thickness; This is a function that limits the input values ​​to a preset range. Through the above adjustments, regions with large depth variations or pronounced boundary undulations use a smaller layer thickness, while regions with gentle depth variations use a larger layer thickness.

[0076] Within each shaping layer, the cross-sectional profile of the target shaping region model on the current shaping layer is projected onto the local parameter plane, and a directed distance field is constructed based on the defect boundary. The profile offset spacing is determined according to the effective cutting width of the cutting disc and the path overlap rate.

[0077] In the formula, This is the outline offset spacing; This refers to the effective cutting width of the cutting blade; For path overlap rate, and .

[0078] Equidistant offset contours are generated sequentially from the outside to the inside or from the inside to the outside according to the aforementioned contour offset spacing. To address issues such as self-intersection, breakage, sharp corner abrupt changes, and abnormal local trajectory spacing that occur during the contour offset process of irregular shallow defect boundaries, the generated equidistant offset contours undergo topology correction, short side removal, sharp corner rounding, and arc transition processing to generate a layered shaping trajectory that continuously covers the target shaping area.

[0079] After obtaining the intra-layer trajectory of each shaping layer, the trajectories of each layer are connected according to the distance between adjacent trajectory endpoints, the cutting blade lifting distance, the underwater robot's attitude change, and the trajectory execution order to generate an initial three-dimensional shaping trajectory. Subsequently, the initial three-dimensional shaping trajectory is smoothed using a cubic spline curve or a B-spline curve. Taking a B-spline curve as an example, the smoothed continuous shaping trajectory can be represented as:

[0080] In the formula, For parameters The corresponding continuous shaping trajectory points; These are trajectory parameters; For control point indexing; Maximum index of control points; For the first The three-dimensional coordinates of each trajectory control point; For the first indivual B-spline basis functions.

[0081] The continuous shaping trajectory is optimized by execution constraints. These constraints include the underwater robot's maximum speed, maximum acceleration, attitude adjustment range, trajectory tracking error, and safe distance from the dam surface. These execution constraints can be expressed as:

[0082] In the formula, The first derivative of the continuously modified trajectory; The second derivative of the continuously modified trajectory; This represents the maximum speed of the underwater robot. This represents the maximum acceleration of the underwater robot. Trajectory parameters Establish a safe distance between the underwater robot or shaping module and non-target areas on the dam surface; The minimum safe distance is preset.

[0083] The cutting blade's working posture is determined based on the surface normal of the target shaping region model at the shaping trajectory point. This ensures the cutting plane of the cutting blade maintains a preset angle with the local surface of the target shaping region model, and constrains the positional and posture changes between adjacent trajectory points to not exceed preset thresholds. This prevents abrupt trajectory changes, posture changes, or local overcutting during underwater robot execution. After the above processing, a continuous shaping trajectory executable by the underwater robot is obtained.

[0084] S6, Continuous shaping trajectory output and underwater robot execution The continuous shaping trajectory and trajectory parameters are output to the underwater robot execution unit to control the shaping module on the underwater robot to perform shaping operations on the shallow underwater defect area of ​​the dam.

[0085] Specifically, the continuous shaping trajectory is discretized into a sequence of trajectory points, and each trajectory point is assigned corresponding position coordinates, attitude angle, movement speed, single cutting depth, path overlap rate, safe avoidance distance, and cutting blade rotation speed. The underwater robot execution unit converts the above trajectory point sequence into control commands that can be recognized by the underwater robot control system. The underwater robot moves to the trajectory start position according to the control commands, ensuring that the cutting blade in the shaping module maintains a preset working distance and preset working posture with the shallow underwater defect area of ​​the dam.

[0086] During the shaping operation, the underwater robot performs layered cutting, boundary trimming, bottom surface leveling, and edge transition processing on shallow defect areas in a sequence from shallow to deep, from outside to inside, or from inside to outside. After completing the current shaping layer, the underwater robot adjusts the working position and posture of the cutting blade according to the trajectory point coordinates and single cutting depth of the next shaping layer, and continues to execute the next layer's shaping trajectory until all the shaping areas corresponding to the target shaping area model are completed.

[0087] Furthermore, during execution, the underwater robot acquires its own pose information, trajectory tracking information, shaping module status information, and local image information in real time, and adaptively corrects the position, attitude, speed, single cutting depth, or trajectory spacing of subsequent trajectory points based on feedback information. When the deviation between the actual trajectory position and the planned trajectory position exceeds a preset trajectory error threshold, the position, attitude, or speed of subsequent trajectory points is corrected; when the distance between the underwater robot and the dam surface is less than a preset safety distance, the current trajectory execution is paused or the underwater robot's attitude is adjusted; when the actual shaping depth is less than the target shaping depth, the number of repeated coverages in the local area of ​​the subsequent trajectory is increased, the trajectory spacing is reduced, or the underwater robot's speed is decreased; when the actual shaping depth is close to or exceeds the maximum allowable shaping depth, the single cutting depth is reduced, the cutting blade's working attitude is adjusted, or the shaping operation in the corresponding area is stopped.

[0088] After completing all the shaping trajectories, the underwater robot re-acquires left and right image pairs or video data of the shaped area and performs local 3D reconstruction of the shaped area to obtain shaping result information. The shaping result information is compared with the target shaped area model to determine whether the shaped defect area meets the preset shaping requirements. If the preset requirements are met, the shaping completion result is output; if there are still areas that are not properly shaped, have discontinuous boundaries, or have bottom surface undulations exceeding the preset range, a new local compensation shaping trajectory is generated based on the detection results, and the underwater robot is controlled to supplement the shaping of the areas that do not meet the requirements.

[0089] like Figure 5 As shown, the present invention also provides an underwater robot trajectory planning system for repairing shallow defects in dams, used to implement the aforementioned underwater robot trajectory planning method for repairing shallow defects in dams. The system includes a communication module, a data processing module, a 3D reconstruction module, a defect morphology analysis module, a trajectory planning module, an execution control module, and an interface display module.

[0090] The communication module is used to realize command interaction and data transmission between the underwater robot and the host computer, including the transmission of left and right image pairs or video data, the transmission of pose information, the issuance of shaping trajectory planning commands, and the reception of execution feedback information.

[0091] The data processing module is used to preprocess, perform binocular correction, and CLAHE underwater image enhancement on the left and right image pairs or video data of the underwater shallow defect area of ​​the dam and the surrounding normal dam surface area, and then send the enhanced left and right image pairs or video data to the three-dimensional reconstruction module.

[0092] The 3D reconstruction module is used to perform stereo matching, depth estimation, and 3D reconstruction on enhanced left and right image pairs or video data, generating depth maps, 3D point clouds, or 3D mesh models of shallow defect areas, and performing point cloud denoising, outlier removal, voxel downsampling, point cloud registration, surface smoothing, and local completion processing on the 3D point cloud or 3D mesh model.

[0093] The defect morphology analysis module is used to construct a local reference surface of the dam body based on the 3D reconstruction results, extract the boundary, location, size, depth distribution, surface normal, and morphological features of shallow defects, and generate the data required for constructing the target shaping region model. The trajectory planning module is used to generate layered shaping trajectories based on the target shaping region model, cutting disc geometric parameters, single cutting depth, path overlap rate, and underwater robot operation constraints, using an improved equidistant contour offset trajectory planning algorithm based on adaptive layering. The module then performs trajectory connection, smoothing, and execution constraint optimization on the layered shaping trajectories to obtain a continuous shaping trajectory executable by the underwater robot.

[0094] The execution control module converts the continuous shaping trajectory into control commands that the underwater robot's execution unit can recognize. This commands control the shaping module onboard the underwater robot to perform shaping operations on shallow underwater defects in the dam. Based on the underwater robot's pose information, trajectory tracking information, shaping module status information, and local image information, the module adaptively corrects the position, attitude, speed, single-cut depth, or trajectory spacing of subsequent trajectory points. The interface display module visualizes the 3D reconstruction results of the shallow defects, the defect morphology analysis results, the target shaping area model, and the shaping trajectory planning results.

[0095] Example 1: This embodiment focuses on the repair of shallow pits on the underwater concrete surface of a hydroelectric dam. An underwater robot is equipped with a binocular image acquisition device and a reshaping module. The binocular image acquisition device acquires left and right image pairs of the shallow pit area and the surrounding normal dam surface area. The reshaping module includes an underwater motor and a cutting blade. The cutting blade has a radius of 25mm, an effective cutting width of 40mm, a single allowable cutting depth of 2mm, a path overlap rate of 30%, and a minimum safe distance of 80mm between the underwater robot and the dam surface.

[0096] During operation, the underwater robot first slowly moves along the underwater area of ​​the dam to be repaired, acquiring multiple left-right image pairs for the same shallow defect area, and simultaneously recording the robot's pose information. The data processing module performs denoising, size normalization, brightness correction, distortion correction, binocular correction, and CLAHE underwater image enhancement on the left-right image pairs. The enhanced left-right image pairs are input into the 3D reconstruction module, which generates a depth map and 3D point cloud of the shallow defect area through stereo matching and depth estimation. Based on the pose information of multiple frames, the point cloud of multiple frames is registered and fused to obtain a 3D topographic model of the shallow defect.

[0097] The defect morphology analysis module selects normal dam surface points around the shallow defect and constructs a local reference surface of the dam body using the B-spline surface fitting method. The depth distribution of the shallow defect is obtained by calculating the normal distance of the sampling points within the shallow defect area relative to the local reference surface of the dam body. The calculation shows that the maximum depth of the shallow defect is 9 mm, the average depth is 4.5 mm, the boundary is an irregular ellipse, and the local boundary curvature is relatively large. Based on the cutting blade radius, underwater robot positioning error, minimum adhesion width of the repair material, and safety margin, the defect boundary is expanded outward to generate an expanded repair boundary. A target repair bottom surface is generated based on the maximum allowable repair depth and repair material filling requirements, and an edge transition surface connecting the target repair bottom surface and the surrounding normal dam surface is constructed to form the target repair area model.

[0098] The trajectory planning module determines the initial number of shaping layers to be 5 based on the target shaping depth and the allowable single cutting depth of the cutting blade. For areas with large defect boundary curvature and significant bottom surface undulations, the local layer thickness and trajectory spacing are reduced; for areas with gentle bottom surfaces, a larger trajectory spacing is used to reduce repeated cutting. Within each shaping layer, an intra-layer trajectory is generated using an equidistant contour offset method from the outside in. Short sides, sharp corners, and local self-intersections generated during the offset process are corrected, and the trajectories of each layer are smoothed using B-spline curves. After constraint optimization, a continuous shaping trajectory is obtained, and the trajectory point coordinates, trajectory execution sequence, cutting blade working posture, movement speed, single cutting depth, and path overlap rate are output.

[0099] After receiving the continuous shaping trajectory, the underwater robot execution unit controls the underwater robot to move to the trajectory's starting position and guides the cutting blade towards the shallow underwater defect area of ​​the dam according to the planned posture. The underwater robot executes the shaping trajectory layer by layer from shallow to deep, performing layered cutting, boundary trimming, bottom surface leveling, and edge transition processing on the defect area. During execution, the underwater robot corrects trajectory tracking errors based on its own pose information and local image information. After completing the entire trajectory, the underwater robot re-acquires left and right images of the shaped area and performs local 3D reconstruction. The shaped result is compared with the target shaped area model; if the boundary continuity, bottom surface flatness, and shaping depth all meet the preset requirements, the shaped result is output.

[0100] The above implementation method uses shallow pits on the underwater concrete surface of a dam as an example. For other shallow defects such as cracks, honeycombing, pitting, erosion, cavitation, exposed aggregate, and spalling, the outward expansion boundary, target repair bottom surface, layer thickness, trajectory spacing, path overlap rate, and cutting blade operating posture can be adjusted according to the defect boundary morphology, depth distribution, and repair material requirements. Any implementation method that employs underwater image acquisition and enhancement, binocular 3D reconstruction, construction of local reference surfaces of the dam body, construction of the target repair area model, improved equidistant contour offset trajectory planning based on adaptive layering, and underwater robot execution control falls under the scope of this invention.

Claims

1. A method for planning the shaping trajectory of an underwater robot for repairing shallow defects in dams, characterized in that, Includes the following steps: S1. The underwater robot acquires left and right image pairs or video data of the shallow underwater defect area of ​​the dam and the surrounding normal dam surface area, and acquires the underwater robot's pose information. The left and right image pairs or video data are preprocessed, binocularly corrected, and subjected to CLAHE underwater image enhancement processing. CLAHE stands for Limit Contrast Adaptive Histogram Equalization. S2. Based on the enhanced left and right image pairs or video data, combined with the binocular camera calibration parameters, underwater imaging refraction compensation parameters and underwater robot pose information, stereo matching, depth estimation and three-dimensional reconstruction of the shallow defect area are performed to obtain the depth map, three-dimensional point cloud or three-dimensional mesh model of the shallow defect area. S3. Based on the three-dimensional reconstruction results, construct the local reference surface of the dam body and extract the boundary, location, size, depth distribution, surface normal and morphological features of shallow defects; S4. Based on the boundary, depth distribution, surface normal and morphological features of the shallow defects, and combined with the preset repair process parameters and shaping module parameters, construct a target shaping area model. S5. Based on the target shaping region model, an improved equidistant contour offset trajectory planning algorithm based on adaptive layering is used to generate a layered shaping trajectory, and the layered shaping trajectory is connected, smoothed and optimized for execution constraints to obtain a continuous shaping trajectory that can be executed by the underwater robot. S6. Output the continuous shaping trajectory and trajectory parameters to the underwater robot execution unit to control the shaping module carried by the underwater robot to perform shaping operations on the shallow underwater defect area of ​​the dam.

2. The underwater robot trajectory planning method for repairing shallow defects in dams according to claim 1, characterized in that, In step S1, the underwater robot moves in the underwater area of ​​the dam to be repaired, and collects multi-angle, multi-frame left-right image pairs or video data of the same shallow defect area. At the same time, it collects left-right image pairs or video data of the normal dam surface area around the shallow defect, forming underwater image data containing the shallow defect area and the normal dam surface area. The underwater image data is used for three-dimensional reconstruction of the shallow defect, construction of the local reference surface of the dam body, and generation of the target repair area model.

3. The underwater robot trajectory planning method for repairing shallow defects in dams according to claim 1, characterized in that, In step S1, the preprocessing includes noise reduction, size normalization, brightness correction, distortion correction, and binocular correction. The CLAHE underwater image enhancement process includes dividing the left and right image pairs into multiple local regions, performing histogram equalization with contrast limitation on each local region, and applying consistent enhancement parameters or synchronous enhancement methods to the left and right images in the same left and right image pair.

4. The underwater robot trajectory planning method for repairing shallow defects in dams according to claim 1, characterized in that, In step S2, the three-dimensional reconstruction includes: performing stereo correction on the left and right image pairs according to the binocular camera calibration parameters and underwater imaging refraction compensation parameters; calculating the disparity map using a stereo matching algorithm; and optimizing the disparity map by left-right consistency detection, hole filling, noise filtering, and edge preservation. Based on the disparity map, the binocular camera baseline distance, focal length parameters, and underwater robot pose information, the two-dimensional pixels are converted into three-dimensional points in a spatial coordinate system to generate a three-dimensional point cloud or three-dimensional mesh model of the shallow defect area.

5. The underwater robot trajectory planning method for repairing shallow defects in dams according to claim 4, characterized in that, The three-dimensional point cloud or three-dimensional mesh model is subjected to point cloud denoising, outlier removal, voxel downsampling, point cloud registration, surface smoothing and local completion processing; wherein, when the video data contains multiple consecutive left and right image pairs, the reconstructed point clouds of multiple frames are registered and fused according to the underwater robot pose information to improve the integrity of the three-dimensional morphology model of shallow defects.

6. The underwater robot trajectory planning method for repairing shallow defects in dams according to claim 1, characterized in that, In step S3, constructing the local reference surface of the dam body includes: selecting normal dam surface points unaffected by the shallow defect around the shallow defect; eliminating candidate points with curvature greater than a preset curvature threshold, surface normal deviation greater than a preset angle threshold, residual from the point to the initial fitted surface greater than a preset residual threshold, and those located in gray-scale or texture abrupt change regions; and constructing the local reference surface of the dam body based on the remaining normal dam surface points using least squares fitting, random sampling consistency fitting, or B-spline surface fitting methods; comparing each sampling point in the shallow defect area with the local reference surface of the dam body, calculating the normal distance of each sampling point relative to the local reference surface of the dam body, and using the normal distance as the indentation depth value of the shallow defect.

7. The underwater robot trajectory planning method for repairing shallow defects in dams according to claim 6, characterized in that, In step S3, the morphological features include geometric features, morphological features, and spatial features; wherein, the geometric features include the length, width, area, maximum depth, average depth, and volume estimate of the shallow defect; the morphological features include boundary curvature, contour complexity, boundary regularity, bottom surface undulation, and depth change rate; the spatial features include the location of the shallow defect, the surface normal of each sampling point within the defect area, the concavity distribution of the defect relative to the local reference surface of the dam body, and the transition relationship between the defect edge and the surrounding normal dam surface.

8. The underwater robot trajectory planning method for repairing shallow defects in dams according to claim 7, characterized in that, In step S4, constructing the target shaping region model includes: expanding the shallow defect boundary based on the shallow defect boundary, cutting blade radius, underwater robot positioning error, minimum adhesion width of repair material, and safety margin to obtain an expanded shaping boundary; determining the target shaping bottom surface based on the shallow defect depth distribution, maximum allowable shaping depth, minimum effective filling thickness of repair material, and filling margin of repair material; constructing an edge transition surface connecting the target shaping bottom surface and the surrounding normal dam surface based on the height difference between the shallow defect edge and the surrounding normal dam surface, edge transition slope, and edge rounded corner radius; and forming the target shaping region model together with the expanded shaping boundary, the target shaping bottom surface, and the edge transition surface.

9. The underwater robot trajectory planning method for repairing shallow defects in dams according to claim 8, characterized in that, In step S5, generating the layered shaping trajectory includes: calculating the maximum shaping depth, depth distribution, and depth change rate of the shallow defect area based on the depth deviation between the three-dimensional morphology model of the shallow defect and the local reference surface of the dam body, and determining the initial number of shaping layers in combination with the single allowable cutting depth of the cutting blade; adaptively adjusting the layer thickness of each shaping layer according to the depth change rate, surface curvature, and bottom surface undulation of different areas; within each shaping layer, projecting the cross-sectional contour of the target shaping area model on the current shaping layer onto the local parameter plane, constructing a directed distance field based on the defect boundary, and determining the contour offset spacing according to the effective cutting width of the cutting blade and the path overlap rate, and generating equidistant offset contours sequentially from the outside to the inside or from the inside to the outside according to the contour offset spacing; performing topology correction, short side removal, sharp corner rounding, and arc transition processing on the generated equidistant offset contours to generate a layered shaping trajectory that continuously covers the target shaping area.

10. A trajectory planning system for underwater robots used in the repair of shallow defects in dams, characterized in that, It includes a communication module, a data processing module, a 3D reconstruction module, a defect morphology analysis module, a trajectory planning module, an execution control module, and an interface display module; among which: The communication module is used to enable command interaction and data transmission between the underwater robot and the host computer; The data processing module is used to preprocess, perform binocular correction, and CLAHE underwater image enhancement on left and right image pairs or video data of the underwater shallow defect area of ​​the dam and its surrounding normal dam surface area. The 3D reconstruction module is used to perform stereo matching, depth estimation and 3D reconstruction on enhanced left and right image pairs or video data to generate depth maps, 3D point clouds or 3D mesh models of shallow defect areas. The defect morphology analysis module is used to construct a local reference surface of the dam body based on the 3D reconstruction results, extract the boundary, location, size, depth distribution, surface normal and morphology features of shallow defects, and generate the data required for constructing the target shaping area model; The trajectory planning module is used to generate layered shaping trajectories based on the target shaping area model, cutting disc geometric parameters, single cutting depth, path overlap rate, and underwater robot operation constraints, using an improved equidistant contour offset trajectory planning algorithm based on adaptive layering. The module then performs trajectory connection, smoothing, and execution constraint optimization on the layered shaping trajectories to obtain a continuous shaping trajectory that can be executed by the underwater robot. The execution control module is used to convert the continuous shaping trajectory into control commands that the underwater robot execution unit can recognize, control the shaping module on the underwater robot to perform underwater shallow surface defect shaping operations on the dam, and adaptively correct the position, attitude, movement speed, single cutting depth or trajectory spacing of subsequent trajectory points based on the underwater robot pose information, trajectory tracking information, shaping module status information and local image information. The interface display module is used to visualize the results of shallow defect 3D reconstruction, defect morphology analysis, target shaping area model, and shaping trajectory planning.