A groove excavation measurement method based on binocular vision remote sensing image

By using a deep learning model based on binocular vision remote sensing images, combined with adaptive windows and improved stereo matching methods, the problems of low efficiency and insufficient accuracy of traditional trench excavation surveying in complex terrain are solved, and high-precision and high-efficiency trench excavation and backfilling construction management are realized.

CN122391324APending Publication Date: 2026-07-14HOHAI UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HOHAI UNIV
Filing Date
2026-01-21
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Traditional trench excavation surveying methods are inefficient and inaccurate in complex terrain or environmental conditions, and rely on manual operation which is easily affected by subjective factors, making it difficult to meet the construction requirements of high precision and high efficiency.

Method used

A measurement method based on binocular vision remote sensing images was adopted. The trench images were captured by UAV and the trench contour was extracted by a deep learning model. The three-dimensional information of the trench was recovered by combining an adaptive window and a stereo matching method that integrates Genus transform and gradient feature fusion.

Benefits of technology

It enables high-precision and high-efficiency trench excavation measurement in complex terrain, reduces manual intervention, improves the refined management and safety of construction, and enhances the monitoring capabilities of construction progress and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122391324A_ABST
    Figure CN122391324A_ABST
Patent Text Reader

Abstract

The application discloses a kind of trench excavation measurement methods based on binocular vision remote sensing image, comprising: obtaining the binocular image of the place to be detected, and correcting left and right eye images;By contour detection model, the left eye image and the right eye image of the corrected trench are extracted, and the corresponding left eye image and right eye image trench contour chart is obtained respectively;According to the trench contour chart of left and right eye images, the corresponding matching points on the contour line are found using the adaptive window combined with the improved Gensus transformation and gradient feature fusion stereo matching method, and the disparity map of two groups of images is obtained;According to the disparity map, the trench three-dimensional information is recovered, which provides a basis for subsequent backfill work.The application uses unmanned aerial vehicle to take aerial photograph of the trench, and uses deep learning model to extract the contour of the trench image, which saves the labor cost while ensuring the accuracy of measurement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of engineering surveying, specifically relating to a trench excavation measurement method based on binocular vision remote sensing images. Background Technology

[0002] Trench excavation is a crucial construction step in civil engineering, infrastructure development, and underground pipeline laying. Traditional trench excavation surveying typically relies on manual surveying and equipment such as total stations and laser rangefinders. These methods have limitations in terms of accuracy and efficiency. In complex terrain or environmental conditions, manual surveying faces challenges such as inconvenience, low data acquisition efficiency, and long operation times. Furthermore, traditional surveying methods require a high level of experience and operational skill from the surveyors, and the results may be influenced by subjective factors, leading to construction errors.

[0003] In recent years, technologies such as deep learning and satellite remote sensing have been increasingly applied in the field of surveying. Remote sensing images can cover large areas and provide rich geographic information and terrain features. However, a single remote sensing image often fails to provide sufficient depth information, limiting its application in 3D measurement. To address this issue, binocular vision technology has gradually been applied to the field of remote sensing surveying. Binocular vision captures the same target from two perspectives, extracting the target's depth information and generating 3D point cloud data, thereby enabling accurate terrain measurement.

[0004] Binocular vision-based remote sensing image measurement technology has advantages such as high automation, high accuracy, and strong adaptability. Especially in trench excavation measurement in complex terrain, it can significantly improve operational efficiency and measurement accuracy. Therefore, developing a trench excavation measurement method based on binocular vision remote sensing images is of great significance for improving the automation level of engineering surveying, reducing manual intervention, and improving construction accuracy. Summary of the Invention

[0005] Purpose of the invention: In order to overcome the shortcomings of existing measurement technologies, this invention provides a trench excavation measurement method based on binocular vision remote sensing images. The method uses a drone to take aerial photos of the trench and a deep learning model to extract the contour of the trench image, which saves labor costs while ensuring measurement accuracy.

[0006] Technical Solution: To achieve the above objectives, this invention provides a trench excavation measurement method based on binocular vision remote sensing images, comprising the following steps:

[0007] S1: Acquire binocular images of the points to be measured, and correct the left and right eye images;

[0008] S2: Extract the contour information of the groove from the left and right eye images of the groove after correction in step S1 using the contour detection model, and obtain the groove contour maps of the left and right eye images respectively.

[0009] S3: Based on the groove contour maps of the left and right images, the corresponding matching points on the contour lines are found using an adaptive window combined with an improved Gensus transform and gradient feature fusion stereo matching method, and the disparity maps of the two sets of images are obtained.

[0010] S4: Restore the three-dimensional information of the trench based on the parallax map, and obtain the difference between the actual trench excavation depth and width and the excavation depth and width in the construction plan, so as to provide a basis for subsequent backfilling work.

[0011] Furthermore, the specific process of correcting the left and right eye images in step S1 is as follows:

[0012] S11: Perform dual-target positioning:

[0013] The Zhang calibration method based on the checkerboard pattern is used, specifically: multiple checkerboard images are taken from different angles, and the intrinsic and extrinsic parameter matrices of the two cameras are obtained by extracting the corner coordinates and solving the least squares problem, and then the fundamental matrix is ​​calculated.

[0014] S12: Perform distortion correction.

[0015] Assuming that in the pinhole camera model, a point in space corresponds to a point in the physical coordinate system of the image as (x, y), and based on the radial and tangential distortion coefficients of the lens obtained in S11, the imaging point is determined by (x, y). T It becomes (x) corrected y corrected ) T ,Right now:

[0016]

[0017] In the formula, k1, k2, and k3 are radial distortion parameters, and p1 and p2 are tangential distortion parameters;

[0018] S13: Perform polar correction:

[0019] By rotating the two cameras and redefining the new image planes, the epipolar lines are made collinear and parallel to a coordinate axis (usually the horizontal axis) of the image plane. Specifically, the cameras are rotated so that the left and right image planes are parallel to each other and both parallel to the camera baseline; therefore, the rotation matrix R is redefined. n After obtaining the rotation matrix, redefine the intrinsic parameter matrix K of the image plane. n This ensures that both cameras have the same intrinsic parameter matrix, guaranteeing that the left and right image planes are coplanar; the calculated R... n and Kn By combining the results, a new projection matrix M after epipolar correction is obtained. n Based on the projection matrices M and M before and after epipolar line correction n Calculate the transformation matrix T, which represents the transformation relationship between the image pixel coordinates of a certain pixel before and after epipolar correction. Therefore, after obtaining the transformation matrix T, we can obtain the relationship between the image coordinates of a certain pixel p before and after epipolar correction.

[0020] Furthermore, the contour detection model in step S2 is a depth-separable convolution-based contour detection model, which mainly includes a feature extraction module, a multi-scale fusion module, a feature fusion module, and a feature decoding module.

[0021] Furthermore, the specific process for extracting the contour features of the grooved binocular image in step S2 is as follows:

[0022] S21: Input the captured left eye image I of the groove into the contour detection model, I∈R H×W×C , where I is the left eye image, H and W are the height and width respectively, and C=3 represents the number of RGB channels;

[0023] S22: A 5-layer EfficientNet network is used as the encoding network. Since grooves typically exhibit fine local features (width, angle, and edges, etc.), more convolutional layers are used in the first three layers of the network to focus on extracting local texture and edge information. A feature extraction module is used to extract features from the input image, resulting in five feature maps with different resolutions. l =EfficientNet1(I), l∈{1,2,3,4,5}, where It is the feature map of the l-th layer, H l W l C l These represent the height, width, and number of channels of the feature map, respectively.

[0024] S23: Apply the Canny operator to the feature maps of specific intermediate layers (layers 2 and 3) to extract edge features and fuse them with the original feature maps. First, the feature maps are converted to grayscale to obtain grayscale feature maps. Applying the Canny operator to the grayscale feature map yields the edge feature map E. l =Canny(F l gray T low T high Then it is extended to multi-channel and fused with the original features;

[0025] S24: The feature maps with different resolutions obtained in S23 are sent to the multi-scale fusion module. By utilizing channel-level information and depthwise separable convolution, the contextual information is enhanced, so that clearer groove contour edge information is learned.

[0026] S25: Use bilinear upsampling to upsample the low-resolution feature maps obtained in S24 to a high-resolution feature image of the same size as the original image.

[0027] S26: Since shallow networks extract low-level features such as edges and angles, while deep networks extract high-level detail features, feature maps of the same size obtained in S25 are added layer by layer and fused to obtain modules M1-M5.

[0028] S27: Concatenate the M1-M5 modules obtained in S26, and fuse the concatenated feature maps to obtain a fused feature map;

[0029] S28: Input the right eye image of the groove into the contour detection model, and repeat steps S22 to S27 to obtain the groove prediction contour map of the right eye image.

[0030] Furthermore, the specific method of the multi-scale fusion module in step S24 is as follows:

[0031] A1: Input the feature map F (size C×H×W) into the module for processing, where C represents the number of channels, and H and W represent the height and width of the feature map, respectively;

[0032] A2: Apply global average pooling to the input feature map F to obtain the global average value Favg for each channel (size C×1×1). Use two 1×1 convolutional layers and the ReLU6 activation function to perform a non-linear transformation on Favg to generate channel weights. Apply these channel weights to the input feature map F to generate a weighted feature map Fatt. The formula for calculating the global average value Favg is as follows:

[0033]

[0034] A3: Multi-scale feature extraction is performed on the weighted feature map Fatt using three parallel branches. The feature maps from branches 1, 2, and 3 are added pixel-by-pixel to generate a fused feature map Fsum;

[0035] A4: Add the fused feature map Ffused to the input feature map F through a residual connection to generate the final output feature map Fout.

[0036] Furthermore, the specific steps in step S3 of finding the corresponding matching points on the contour line using an adaptive window combined with an improved Genus transform and gradient feature fusion stereo matching method are as follows:

[0037] S31: First, create an initial 9×9 window centered at pixel p. Calculate the grayscale changes within this window to determine the size of the transformation window. If the grayscale variance is large, it indicates significant grayscale changes within the window, so a smaller window should be selected; if the grayscale variance is small, it indicates relatively gentle grayscale changes within the window, so a larger window should be selected. The formula for the grayscale variance is:

[0038]

[0039] In the formula: p i I(p) represents the value of each pixel within the window, N is the total number of pixels within the window, and I(p) represents the value of each pixel within the window. i ) represents the grayscale value of each pixel within the window, and M(p) represents the average grayscale value within the initial window;

[0040] The adaptive window W centered on pixel p is determined based on the gray-level mean square error. Adapt (p) Window size, its transform window size is:

[0041]

[0042] In the formula: T1, T2, and T3 are three set mean square error thresholds, and the corresponding window size is selected according to the magnitude of the mean square error;

[0043] S32: Traverse the reference and target images to be matched using the window determined in S31 to construct the window-based matching cost. The first constraint term C1(p, d) represents the Gensus matching cost, which is the XOR operation performed on the bit strings corresponding to the reference image and the target image, and the number of bits that are 1 is accumulated. T p and T p-d These represent the bit strings representing the corresponding window neighborhoods of the reference image and the target image, respectively. This value is used as the matching cost based on the Gensus transform, and its mathematical expression is:

[0044]

[0045] Cx(p, d) = Hamming(T) p T p-d )

[0046] Where p and q are the center pixel of the window and its neighboring pixels;

[0047] The latter constraint term C2(p, d) represents the gradient matching cost, used to describe the rate of gray-level change and directional information in the image. and I represents the gradient information of pixel p in the x and y directions, respectively. l and I r Representing the reference image and the target image respectively, their mathematical expressions are:

[0048]

[0049] Where C(p, d) represents the matching cost calculation function. It is the normalization function, λ c , λ a These are normalized control parameters;

[0050] S33: The matching cost calculation in S32 only considers the local relevant information of a single pixel, and the cost values ​​between adjacent pixels lack correlation. Therefore, the matching cost in S32 is aggregated using four paths (top, bottom, left, right), and the cost values ​​obtained from the four paths are summed to obtain the final aggregated matching cost value S(p, d), which is expressed as follows:

[0051]

[0052] Where: L r (p, d) represents the cost of pixel p along path r when the disparity is d, L r The expression for (p, d) is as follows:

[0053]

[0054] In the formula: the first term C(p, d) is the initial matching cost calculated in S2; the second term represents the minimum cost of a matching pixel pr in the path r direction (no penalty term is needed when the disparity value of pixel pr is d; a penalty term P1 is added when the disparity value is d±1; a penalty term P2 is added when the disparity value is other values); the third term is a suppression term to prevent the aggregation cost from being too large.

[0055] S34: To prevent the captured image from being obstructed or affected by noise, the initial disparity map is optimized using the following formula to obtain the optimal disparity map:

[0056]

[0057] In the formula: d sub d represents the disparity map after optimization, c0, c1, and c2 represent the matching cost corresponding to the current fitting point, the disparity map before the fitting point, and the disparity map after the fitting point, respectively.

[0058] Furthermore, the specific steps of step S4, which involves recovering 3D information based on the disparity map, are as follows:

[0059] Assume that the coordinates of point Q in 3D space on the two imaging planes of the stereo camera are Q1(x1, y1) and Q2(x2, y2), and the world coordinates of point Q are Q(x1, y1) and Q2(x2, y2), respectively. c ,Y c Z c In an ideal stereo camera model, the ordinates of Q1 and Q2 are the same. According to the principle of similar triangles, the relationship between these three coordinates is as follows:

[0060]

[0061] Where (X1-x2) represents parallax, b represents the distance between the parallel optical axes of the two cameras, and f represents the focal length of the left and right cameras.

[0062] Beneficial effects: Compared with the prior art, the present invention has the following advantages:

[0063] 1. This invention uses a contour detection model based on depthwise separable convolution and adds the Canny operator in the intermediate stage to enhance the edge information of the feature map, which can effectively improve the accuracy of extracting contour details and overall structure in complex scenes.

[0064] 2. This invention uses an adaptive window combined with an improved Gennuse and gradient features, which can dynamically adjust the window size of the Gennuse transform according to the gradient information of the image. This can adapt well to the shape of the groove, making the stereo matching of the groove edge and the internal region more accurate and the recovered three-dimensional information more accurate.

[0065] 3. This invention can save labor costs while ensuring the accuracy of trench depth and width measurements, further improving the level of refined management of trench excavation and backfilling construction, strengthening the monitoring ability of construction progress and quality, and enhancing the response efficiency to sudden construction problems, thereby significantly improving construction safety and project management efficiency. Attached Figure Description

[0066] Figure 1 This is a flowchart of the trench excavation measurement method based on binocular vision remote sensing images described in this invention;

[0067] Figure 2 This is a network diagram of the groove contour extraction model GCEM described in this invention;

[0068] Figure 3 This is the network diagram of the Multi-Scale Fusion Module (MAF) in the trench profile model. Detailed Implementation

[0069] The present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. After reading this invention, any modifications of the invention in various equivalent forms by those skilled in the art will fall within the scope defined by the appended claims.

[0070] This invention provides a trench excavation measurement method based on binocular vision remote sensing images, such as... Figure 1 As shown, it includes the following steps:

[0071] S1: Acquire binocular images of the points to be measured, and correct the left and right eye images;

[0072] S2: Extract the contour information of the groove from the left and right eye images of the groove after correction in step S1 using the contour detection model, and obtain the groove contour maps of the left and right eye images respectively.

[0073] S3: Based on the groove contour maps of the left and right images, the corresponding matching points on the contour lines are found using an adaptive window combined with an improved Gensus transform and gradient feature fusion stereo matching method, and the disparity maps of the two sets of images are obtained.

[0074] S4: Restore the three-dimensional information of the trench based on the parallax map, and obtain the difference between the actual trench excavation depth and width and the excavation depth and width in the construction plan, so as to provide a basis for subsequent backfilling work;

[0075] Reference Figure 2 The specific steps of step S2 in this example are as follows:

[0076] S21: Input the captured left eye image I of the groove into the contour detection model, I∈R H×W×C , where I is the left eye image, H and W are the height and width respectively, and C=3 represents the number of RGB channels;

[0077] S22: A 5-layer EfficientNet network is used as the encoding network. Since grooves typically exhibit fine local features (width, angle, and edges, etc.), more convolutional layers are used in the first three layers of the network to focus on extracting local texture and edge information. A feature extraction module is used to extract features from the input image, resulting in five feature maps with different resolutions. l =EfficientNet l (I), l∈{1, 2, 3, 4, 5}, where It is the feature map of the l-th layer, H l W l C l These represent the height, width, and number of channels of the feature map, respectively.

[0078] S23: Apply the Canny operator to the feature maps of specific intermediate layers (layers 2 and 3) to extract edge features and fuse them with the original feature maps. First, the feature maps are converted to grayscale to obtain grayscale feature maps. Applying the Canny operator to the grayscale feature map yields the edge feature map E. l =Canny(F l gray T low T High Then it is extended to multi-channel and fused with the original features;

[0079] S24: The feature maps with different resolutions obtained in S23 are sent to the multi-scale fusion module. By utilizing channel-level information and depthwise separable convolution, the contextual information is enhanced, so that clearer groove contour edge information is learned.

[0080] S25: Use bilinear upsampling to upsample the low-resolution feature maps obtained in S24 to a high-resolution feature image of the same size as the original image.

[0081] S26: Since shallow networks extract low-level features such as edges and angles, while deep networks extract high-level detail features, feature maps of the same size obtained in S25 are added layer by layer and fused to obtain modules M1-M5.

[0082] S27: Concatenate the M1-M5 modules obtained in S26, and fuse the concatenated feature maps to obtain a fused feature map;

[0083] S28: Input the right eye image of the groove into the contour detection model, and repeat steps S22 to S27 to obtain the groove prediction contour map of the right eye image.

[0084] Reference Figure 3 The specific method for step S24 in this example is as follows:

[0085] A1: Input the feature map F (size C×H×W) into the module for processing, where C represents the number of channels, and H and W represent the height and width of the feature map, respectively;

[0086] A2: Apply global average pooling to the input feature map F to obtain the global average value Favg for each channel (size C×1×1). Use two 1×1 convolutional layers and the ReLU6 activation function to perform a non-linear transformation on Favg to generate channel weights. Apply these channel weights to the input feature map F to generate a weighted feature map Fatt. The formula for calculating the global average value Favg is as follows:

[0087]

[0088] A3: Multi-scale feature extraction is performed on the weighted feature map Fatt using three parallel branches. The feature maps from branches 1, 2, and 3 are added pixel-by-pixel to generate a fused feature map Fsum;

[0089] A4: Add the fused feature map Ffused to the input feature map F through a residual connection to generate the final output feature map Fout.

Claims

1. A trench excavation measurement method based on binocular vision remote sensing images, characterized in that, Includes the following steps: S1: Acquire binocular images of the points to be measured, and correct the left and right eye images; S2: Extract the contour information of the groove from the left and right eye images of the groove after correction in step S1 using the contour detection model, and obtain the groove contour maps of the left and right eye images respectively. S3: Based on the groove contour maps of the left and right images, the corresponding matching points on the contour lines are found using an adaptive window combined with an improved Gensus transform and gradient feature fusion stereo matching method, and the disparity maps of the two sets of images are obtained. S4: Restore the three-dimensional information of the trench based on the parallax map, and obtain the difference between the actual trench excavation depth and width and the excavation depth and width in the construction plan, so as to provide a basis for subsequent backfilling work.

2. The trench excavation measurement method based on binocular vision remote sensing images according to claim 1, characterized in that, The specific process of correcting the left and right eye images in step S1 is as follows: S11: Perform dual-target positioning: The Zhang calibration method based on the checkerboard pattern is used, specifically: multiple checkerboard images are taken from different angles, and the intrinsic and extrinsic parameter matrices of the two cameras are obtained by extracting the corner coordinates and solving the least squares problem, and then the fundamental matrix is ​​calculated. S12: Perform distortion correction. Assuming that in the pinhole camera model, the point in the physical coordinate system of the image corresponding to a certain point in space is (x, y), and based on the radial and tangential distortion coefficients of the lens obtained in S11, the imaging point is (x, y). T It becomes (x) corrected y corrected ) T ,Right now: In the formula, k1, k2, and k3 are radial distortion parameters, and p1 and p2 are tangential distortion parameters; S13: Perform polar correction: By rotating the two cameras and redefining the new image plane, the epipolar lines are made collinear and parallel to a coordinate axis (usually the horizontal axis) of the image plane. Specifically, the cameras are rotated so that the left and right image planes are parallel to each other and both parallel to the camera baseline; therefore, the rotation matrix R is redefined. n After obtaining the rotation matrix, redefine the intrinsic parameter matrix K of the image plane. n This ensures that both cameras have the same intrinsic parameter matrix, guaranteeing that the left and right image planes are coplanar; the calculated R... n and K n By combining the results, a new projection matrix M after epipolar correction is obtained. n Based on the projection matrices M and M before and after epipolar line correction n Calculate the transformation matrix T, which represents the transformation relationship between the image pixel coordinates of a certain pixel before and after epipolar correction. Therefore, after obtaining the transformation matrix T, we can obtain the relationship between the image coordinates of a certain pixel p before and after epipolar correction.

3. The trench excavation measurement method based on binocular vision remote sensing images according to claim 1, characterized in that, The contour detection model in step S2 is a depth-separable convolution-based contour detection model, which mainly includes a feature extraction module, a multi-scale fusion module, a feature fusion module, and a feature decoding module.

4. The method for measuring pipeline trench excavation based on binocular vision remote sensing images according to claim 1, characterized in that, The specific steps for extracting the contour features of the grooved binocular image in step S2 are as follows: S21: Input the captured left eye image I of the groove into the contour detection model, I∈R H×W×C , where I is the left eye image, H and W are the height and width respectively, and C=3 represents the number of RGB channels; S22: A 5-layer EfficientNet network is used as the encoding network. Since grooves typically exhibit fine local features (width, angle, and edges, etc.), more convolutional layers are used in the first three layers of the network to focus on extracting local texture and edge information. A feature extraction module is used to extract features from the input image, resulting in five feature maps with different resolutions. l =EfficientNet l (I), l∈{1, 2, 3, 4, 5}, where It is the feature map of the l-th layer, H l W l C l These represent the height, width, and number of channels of the feature map, respectively. S23: Apply the Canny operator to the feature maps of specific intermediate layers (layers 2 and 3) to extract edge features and fuse them with the original feature maps. First, the feature maps are converted to grayscale to obtain grayscale feature maps. Applying the Canny operator to the grayscale feature map yields the edge feature map. Then it is extended to multi-channel and fused with the original features; S24: The feature maps with different resolutions obtained in S23 are sent to the multi-scale fusion module. By utilizing channel-level information and depthwise separable convolution, the contextual information is enhanced, so that clearer groove contour edge information is learned. S25: Use bilinear upsampling to upsample the low-resolution feature maps obtained in S24 to a high-resolution feature image of the same size as the original image. S26: Since shallow networks extract low-level features such as edges and angles, while deep networks extract high-level detail features, feature maps of the same size obtained in S25 are added layer by layer and fused to obtain modules M1-M5. S27: Concatenate the M1-M5 modules obtained in S26, and fuse the concatenated feature maps to obtain a fused feature map; S28: Input the right eye image of the groove into the contour detection model, and repeat steps S22 to S27 to obtain the groove prediction contour map of the right eye image.

5. The trench excavation measurement method based on binocular vision remote sensing images according to claim 1, characterized in that, The specific method of the multi-scale fusion module in step S24 is as follows: A1: Input the feature map F (size C×H×W) into the module for processing, where C represents the number of channels, and H and W represent the height and width of the feature map, respectively; A2: Apply global average pooling to the input feature map F to obtain the global average value Favg (size C×1×1) for each channel. Then, use two 1×1 convolutional layers and the ReLU6 activation function to perform a non-linear transformation on Favg to generate channel weights. Apply these channel weights to the input feature map F to generate a weighted feature map Fatt. The formula for calculating the global average value Favg is as follows: A3: Multi-scale feature extraction is performed on the weighted feature map Fatt through three parallel branches. The feature maps of branch 1, branch 2 and branch 3 are added pixel by pixel to generate the fused feature map Fsum; A4: Add the fused feature map Ffused to the input feature map F through a residual connection to generate the final output feature map Fout.

6. The trench excavation measurement method based on binocular vision remote sensing images according to claim 1, characterized in that, The specific steps in step S3 of finding the corresponding matching points on the contour line using an adaptive window combined with an improved Genus transform and gradient feature fusion stereo matching method are as follows: S31: First, create an initial 9×9 window centered at pixel p. Calculate the grayscale changes within this window to determine the size of the transformation window. If the grayscale variance is large, it indicates significant grayscale changes within the window, so a smaller window should be selected; if the grayscale variance is small, it indicates relatively gentle grayscale changes within the window, so a larger window should be selected. The formula for the grayscale variance is: In the formula: p i I(p) represents the value of each pixel within the window, N is the total number of pixels within the window, and I(p) represents the value of each pixel within the window. i ) represents the grayscale value of each pixel within the window, and M(p) represents the average grayscale value within the initial window; The adaptive window W centered on pixel p is determined based on the gray-level mean square error. Adapt (p) Window size, its transform window size is: In the formula: T1, T2, and T3 are three set mean square error thresholds, and the corresponding window size is selected according to the magnitude of the mean square error. S32: Traverse the reference and target images to be matched using the window determined in S31 to construct the window-based matching cost. The first constraint term C1(p, d) represents the Gensus matching cost, which is the XOR operation performed on the bit strings corresponding to the reference image and the target image, and the number of bits that are 1 is accumulated. T p and T p-d These represent the bit strings representing the corresponding window neighborhoods of the reference image and the target image, respectively. This value is used as the matching cost based on the Gensus transform, and its mathematical expression is: C1(p,d)=Hamming(T p ,T p-d ) Where p and q are the center pixel of the window and its neighboring pixels; The latter constraint term C2(p, d) represents the gradient matching cost, used to describe the rate of gray-level change and directional information in the image. and I represents the gradient information of pixel p in the x and y directions, respectively. l and I r Representing the reference image and the target image respectively, their mathematical expressions are: Where C(p, d) represents the matching cost calculation function. It is the normalization function, λ c , λ a These are normalized control parameters; S33: The matching cost calculation in S32 only considers the local relevant information of a single pixel, and the cost values ​​between adjacent pixels lack correlation. Therefore, the matching cost in S32 is aggregated using four paths (top, bottom, left, right), and the cost values ​​obtained from the four paths are summed to obtain the final aggregated matching cost value S(p, d), which is expressed as follows: Where: L r (p, d) represents the cost of pixel p along path r when the disparity is d, L r The expression for (p, d) is as follows: In the formula: the first term C(p, d) is the initial matching cost calculated in S2; the second term represents the minimum cost of a matching pixel pr in the path r direction (no penalty term is needed when the disparity value of pixel pr is d; a penalty term P1 is added when the disparity value is d±1; a penalty term P2 is added when the disparity value is other values); the third term is a suppression term to prevent the aggregation cost from being too large. S34: To prevent the captured image from being obstructed or affected by noise, the initial disparity map is optimized using the following formula to obtain the optimal disparity map: In the formula: d sub d represents the disparity map after optimization, c0, c1, and c2 represent the matching cost corresponding to the current fitting point, the disparity map before the fitting point, and the disparity map after the fitting point, respectively.

7. The trench excavation measurement method based on binocular vision remote sensing images according to claim 1, characterized in that, The specific steps of step S4, which involves restoring 3D information based on the disparity map, are as follows: Assume that the coordinates of point Q in 3D space on the two imaging planes of the stereo camera are Q1(x1, y1) and Q2(x2, y2), and the world coordinates of point Q are Q(x1, y1) and Q2(x2, y2), respectively. c Y c Z c In an ideal binocular camera model, the ordinates of Q1 and Q2 are the same. According to the principle of similar triangles, the relationship between these three coordinates is as follows: Where (x1-x2) represents parallax, b represents the distance between the parallel optical axes of the two cameras, and f represents the focal length of the left and right cameras.

8. The trench excavation measurement method based on binocular vision remote sensing images according to claim 1, characterized in that, The specific steps for obtaining the difference between the actual trench excavation depth and width and the excavation depth and width in the construction plan in step S4 are as follows: The obtained three-dimensional information of the trench and the standard location information in the construction plan are input into the visualization data analysis software to provide a basis for subsequent backfilling work.