A Deep Learning-Based Binocular Vision Spatial Ranging Method

By improving the binocular vision spatial ranging method, image correction and deep learning networks are used to handle the problems of repetitive textures and occlusion boundaries, thereby improving ranging accuracy and resolution and solving the problems of ranging error and insufficient resolution in the existing technology.

CN123118722APending Publication Date: 2026-11-17BEIJING HUAXIN YOUDAO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611261178.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-19
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing deep learning-based binocular vision spatial ranging methods are prone to ranging errors at repetitive textures, weak textures, and occluded boundaries, and the ranging resolution decreases in distant areas. They also lack effective utilization of matching probability distributions and parallax error processing.

Method used

By employing binocular image correction, joint representation of candidate disparity and depth interval, improved BGNet network, peak neighborhood depth weighting, and left and right image back projection verification techniques, stable three-dimensional spatial ranging results are generated through repeated texture disambiguation, distance-adaptive sampling, visible side mesh clipping, and ranging error recalculation.

Benefits of technology

It improves ranging accuracy at complex textures and occluded boundaries, reduces the mismatch rate of repeated textures, enhances ranging resolution and sub-pixel parallax accuracy in long-distance areas, and ensures the stability of spatial ranging results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123118722A_ABST
    Figure CN123118722A_ABST
Patent Text Reader

Abstract

This invention discloses a deep learning-based binocular vision spatial ranging method, belonging to the field of deep learning technology. The method includes: acquiring and preprocessing binocular ranging data to generate a ranging dataset; rearranging the ranging dataset to construct candidate disparity and depth interval sequences; extracting shared features and calculating group correlations to generate initial matching representations; inputting the data into an improved BGNet network to generate disparity ranging results; weighting the peak neighborhood depth to generate sub-pixel corrected disparity results; performing 3D backprojection on the corrected disparity results to generate a spatial ranging point set; and performing left and right backprojection verification to generate binocular vision spatial ranging results. This invention achieves high-precision binocular vision spatial ranging in complex textures, occluded boundaries, and long-distance scenes by introducing an improved BGNet network and backprojection closure verification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of deep learning technology, and in particular to a binocular vision spatial ranging method based on deep learning. Background Technology

[0002] With the development of machine vision, 3D perception, and deep learning technologies, binocular vision spatial ranging has been applied to robot navigation, industrial inspection, intelligent manufacturing, unmanned equipment, and spatial target localization. Existing methods typically employ simultaneous acquisition of binocular images of the same scene using left and right cameras. Lens distortion and epipolar correction are performed based on camera intrinsics, extrinsics, and the binocular baseline. Feature extraction and corresponding point matching are then performed on the left and right images. Disparity is determined based on the lateral positional difference of corresponding pixels, and target depth is calculated by combining the corrected focal length and the binocular baseline length. Traditional methods primarily use local window matching, semi-global matching, and manual feature descriptions to construct matching costs. Deep learning methods, through shared weight feature extraction, cost volume construction, and cost aggregation, learn the correspondence between the left and right images, generating dense disparity results. These disparity results are then back-projected onto the camera coordinate system to obtain the 3D spatial position of scene points.

[0003] Existing deep learning-based binocular vision spatial ranging methods still have shortcomings. Regions with repetitive, weak, and periodic textures tend to form multiple similar peaks along the candidate disparity direction. Determining disparity solely based on the maximum matching probability can easily lead to peak misselection, causing disparity jumps and ranging offsets. Fixed disparity step sizes correspond to different depth intervals at different distances, and distant regions are prone to sparse depth sampling and decreased ranging resolution. At occlusion boundaries, multiple left-eye pixels may map to the same right-eye position; existing cost aggregation processes struggle to distinguish between visible and occluded surfaces, easily causing boundary depth diffusion. Existing methods do not adequately utilize the depth dispersion reflected by the matching probability distribution, lacking local recalculation for ranging error locations, and processing for sub-pixel disparity correction based on peak neighborhood depth and for determining disparity error boundaries. After 3D backprojection, spatial coordinates are usually directly output, lacking joint verification of the ranging boundary projection range and the left and right backprojection closure residuals. Incorrect matching points and projection inconsistencies can easily enter the spatial ranging results, reducing ranging accuracy in complex textures, occlusion boundaries, and distant scenes.

[0004] Therefore, how to provide a deep learning-based binocular vision spatial ranging method is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] One objective of this invention is to propose a deep learning-based binocular vision spatial ranging method. This invention utilizes binocular image correction, joint representation of candidate disparity and depth interval, grouped correlation matching, an improved BGNet network, peak neighborhood depth weighting, 3D backprojection, and left-right image backprojection verification techniques. It details the binocular vision ranging data preprocessing, initial matching representation construction, repetitive texture disambiguation, distance-adaptive sampling, visible side mesh clipping, ranging error recalculation, sub-pixel disparity correction, and spatial ranging point selection processes. This enables 3D spatial ranging in complex textures, occluded boundaries, and long-distance scenes. Compared to fixed disparity sampling and direct disparity regression methods, this invention offers advantages such as low repetitive texture mismatch rate, balanced ranging resolution at different distances, minimal disparity diffusion at occluded boundaries, high sub-pixel disparity accuracy, a clear ranging error range, and high stability of spatial ranging results.

[0006] According to an embodiment of the present invention, a binocular vision spatial ranging method based on deep learning includes: Collect binocular visual ranging data and preprocess it to generate a binocular visual ranging dataset. The binocular visual ranging dataset is rearranged according to the image pair order, and candidate disparity sequences and depth interval sequences are constructed based on the calibration data and packaged into binocular ranging samples. Shared weighted feature extraction is performed on the binocular ranging samples, group correlation results are calculated along the candidate disparity sequence, and concatenated with the broadcast depth interval sequence to generate an initial matching representation; The initial matching representation is input into the improved BGNet network, which includes a repeating texture disambiguation block, a distance adaptation sampling block, a visible side mesh clipping layer, and a range deviation recalculation gate to generate disparity ranging results. Extract the peak neighborhood disparity and matching probability from the disparity ranging results, convert the peak neighborhood disparity into a depth value and weight it according to the matching probability, back-calculate the sub-pixel disparity and determine the disparity error boundary, and generate the corrected disparity result; Three-dimensional back projection is performed on the corrected parallax results to determine the ranging center point, ranging boundary point pairs and left and right matching positions, and to generate a spatial ranging point set. The spatial ranging point set is back-projected onto the left and right images. The closure residual between the back-projected position and the matching position on the left and right is calculated. The ranging center point is selected by combining the projection range of the ranging boundary point pair, and the binocular vision spatial ranging result is generated.

[0007] Optionally, the binocular visual ranging data includes left eye image data, right eye image data, image acquisition time data, image pair sequence and calibration data.

[0008] Optionally, generating the binocular vision ranging dataset includes: According to the image pair sequence, the left and right eye image data are matched, and the left and right eye image data with the same sequence and the smallest image acquisition time difference are combined into an initial image pair; Based on the calibration data, construct the left and right image correction mapping, perform lens distortion correction and epipolar correction on the initial image pair, and generate the corrected image pair; The calibration image pairs are synchronously cropped to a common effective area, the image size and channel order are unified, and the images are standardized according to the mean and standard deviation of the binocular joint pixels of the cropped image pairs. The calibration data is updated according to the cropping offset and size scaling ratio to generate standard image pairs. The standard image pairs are associated with image acquisition time data, image pair sequence, and calibration data, and encapsulated into a binocular vision ranging dataset.

[0009] Optionally, the encapsulation as a binocular ranging sample includes: The image pairs in the binocular visual ranging dataset are rearranged in ascending order according to their image pair order, and the calibration data is associated with the rearranged image pairs to generate a binocular image pair record. Based on the calibration data, determine the effective disparity lower limit and effective disparity upper limit that are greater than zero. Starting from the effective disparity lower limit, increase the disparity step by one pixel to the effective disparity upper limit to generate a candidate disparity sequence. Multiply the corrected focal length in the calibration data by the binocular baseline length, divide by each candidate disparity in the candidate disparity sequence to generate a candidate depth sequence. Use the absolute value of the difference between adjacent candidate depths as the depth interval of the previous candidate disparity, set the depth interval of the last candidate disparity as the previous depth interval, and arrange the candidate disparities in order to generate a depth interval sequence. The binocular image pair records, candidate disparity sequences, and depth interval sequences are associated according to the image pair order and encapsulated into binocular ranging samples.

[0010] Optionally, generating the initial matching representation includes: Using shared weights, layer-by-layer two-dimensional convolution, batch normalization and linear rectification are performed on the left and right eye image data in the binocular ranging samples to generate left and right eye matching feature maps with the same spatial size and number of channels. Divide the left and right eye matching feature maps into equal number of feature groups along the channel dimension. Translate the right eye feature group along the candidate disparity sequence and align it with the left eye feature group. Fill out the out-of-bounds positions with zeros to generate candidate disparity feature group pairs. The corresponding channel feature values ​​in the candidate disparity feature pairs are multiplied pixel by pixel, the sum of the products is divided by the number of channels in each group, and the calculation results are arranged according to the candidate disparity order and feature group order to generate group correlation results. Align the depth interval sequence with the candidate disparity positions of the group correlation results, broadcast each depth interval along the spatial dimension and splice it with the group correlation results along the feature channel dimension to generate an initial matching representation.

[0011] Optionally, generating the disparity ranging result includes: An improved BGNet network is constructed, which includes a repetitive texture disambiguation block, a distance-adaptive sampling block, a visible side mesh clipping layer, and a range deviation recalculation gate. The repeating texture disambiguation block receives the initial matching representation, locates local peaks along the candidate disparity sequence, calculates the difference between the matching value of the maximum peak and each local peak and the absolute difference between the disparity of each local peak and the median of the disparity of the peak in the spatial neighborhood, normalizes the two differences, sums them and takes the negative, generates disambiguation weights through Softmax processing, adjusts the initial matching representation according to the disambiguation weights, and generates a disambiguation matching representation. The distance adaptation sampling block receives the disambiguation matching representation, rounds up the ratio of each depth interval to the median of the depth interval to the number of subdivisions, subdivides adjacent candidate disparity intervals according to the number of subdivisions, interpolates matching values ​​along the disparity dimension and equally divides the corresponding depth intervals to generate the distance adaptation representation. The visible side mesh clipping layer receives the distance adaptation representation. After BGNet cost aggregation and bilateral mesh transformation, the right eye projection position is determined based on the left eye pixel horizontal coordinate and candidate disparity. The mesh vertex that maps to the same right eye pixel position and has the largest corresponding candidate disparity is determined as the visible side mesh vertex. Non-visible side mesh vertices and mesh vertices that project out of bounds are clipped. The interpolation weights of the mesh vertices are normalized and retained to generate the visible side cost representation. The ranging error calculation gate receives the visible side cost representation, calculates the matching probability and peak disparity along the disparity dimension, squares the cumulative depth interval between the candidate disparity and the peak disparity and sums them according to the matching probability, and takes the square root to obtain the depth discrepancy. The position where the depth discrepancy is greater than the depth interval corresponding to the peak disparity is determined as the error position. The cost of the error position is re-aggregated in the neighborhood of the peak disparity and the visible side spatial neighborhood, the matching probability and peak disparity are updated, and the disparity ranging result is generated. The improved BGNet network is trained based on the training set. The joint loss is obtained by weighting and summing the disparity regression error, repeating texture peak separation error, depth interval weighted ranging error, visible side projection consistency error, and out-of-tolerance position recalculation error. The trainable parameters of the improved BGNet network are updated using backpropagation. After each training round, the average absolute spatial ranging error of the validation set is calculated. Training stops when the average absolute spatial ranging error does not fall below the historical minimum for six consecutive rounds. The network parameters corresponding to the round with the minimum average absolute spatial ranging error are retained, and the training of the improved BGNet network is completed.

[0012] Optionally, the step of converting peak neighborhood disparity into depth values ​​and weighting them according to matching probability includes: The product of the corrected focal length and the binocular baseline length in the calibration data is divided by the disparity of each peak neighborhood to generate a peak neighborhood depth sequence. Arrange the corresponding matching probabilities according to the candidate disparity order of the peak neighborhood disparity, and divide each matching probability by the sum of the peak neighborhood matching probabilities to generate a neighborhood probability weight sequence. The peak neighborhood depth sequence and the neighborhood probability weight sequence are multiplied one by one according to the candidate disparity order, and the products are summed to obtain the weighted depth value.

[0013] Optionally, generating the corrected disparity result includes: The peak neighborhood disparity is transformed and weighted according to the matching probability to obtain the weighted depth value. The product of the corrected focal length and the binocular baseline length in the calibration data is divided by the weighted depth value to obtain the subpixel disparity. Calculate the square of the difference between the disparity of each peak neighborhood and the sub-pixel disparity, multiply each squared value by the corresponding matching probability, sum the products, divide by the sum of the peak neighborhood matching probabilities, and take the square root to obtain the disparity discrete quantity. The lower boundary of the disparity error is obtained by subtracting the disparity dispersion from the subpixel disparity, and the upper boundary of the disparity error is obtained by adding the disparity dispersion. The lower boundary and the upper boundary of the disparity error are truncated by the minimum and maximum values ​​of the peak neighborhood disparity, respectively. The subpixel disparity and the disparity error boundary are associated according to the pixel position to generate the corrected disparity result.

[0014] Optionally, generating the spatial ranging point set includes: The product of the corrected focal length and the binocular baseline length is divided by the subpixel disparity to obtain the ranging center depth. The difference between the left eye pixel coordinates and the left eye principal point coordinates is multiplied by the ranging center depth and then divided by the corrected focal length to obtain the lateral and longitudinal coordinates, thus generating the ranging center point. The product of the corrected focal length and the binocular baseline length is divided by the upper boundary and the lower boundary of the disparity error, respectively, to obtain the near depth and far depth. Based on the left eye pixel coordinates, the left eye principal point coordinates and the corrected focal length, three-dimensional back projection is performed on the near depth and far depth to generate ranging boundary point pairs. Using the left eye pixel coordinates as the left matching position, the right matching position is obtained by subtracting the subpixel disparity from the left eye pixel's x-coordinate while keeping the y-coordinate unchanged. The spatial ranging point set is generated by associating the ranging center point, ranging boundary point pairs, and left and right matching positions according to the pixel positions.

[0015] Optionally, generating binocular visual spatial ranging results includes: Based on the calibration data, construct the left and right camera projection matrices, convert the distance measurement center point and distance measurement boundary point pair in the spatial distance measurement point set into homogeneous coordinates and multiply them with the left and right camera projection matrices respectively. Take the ratio of the first two components to the third component of each product to obtain the back projection positions of the left and right images and generate back projection records. Based on the left and right image back projection positions and left and right matching positions corresponding to the distance measurement center point of the pixel position, the squares of the difference between the horizontal and vertical coordinates are added together and the square root is taken to obtain the position residuals of the left and right images. The larger position residual is determined as the closure residual, and a closure check record is generated. Based on the back projection record and the closure check record, the range of the left and right image back projection positions of the ranging boundary point pair is determined as the projection range, the maximum back projection distance between the ranging center point and the ranging boundary point pair is determined as the projection tolerance, and the ranging center point whose closure residual is not greater than the projection tolerance and whose left and right matching positions are located within the corresponding projection range is retained to generate a set of filtered ranging points. The ranging point set is sorted according to pixel position and associated with the corresponding ranging boundary point pairs to generate binocular vision spatial ranging results.

[0016] The beneficial effects of this invention are: This invention proposes a deep learning-based binocular vision spatial ranging method. Through binocular image correction, joint construction of candidate disparity and depth interval, shared weight feature extraction, and group correlation calculation, an initial matching representation containing image matching information and depth variation information is formed. The improved BGNet network utilizes repetitive texture disambiguation blocks to compare local peaks in candidate disparity directions and combines spatial neighborhood peak disparities to determine disambiguation weights. This reduces the probability of peak misselection in repetitive, weak, and periodic texture regions, improving the stability of left-right image matching and the accuracy of disparity calculation.

[0017] This invention reduces the depth resolution differences caused by a fixed disparity step size at different ranging distances by subdividing candidate disparity intervals according to depth intervals through distance-adaptive sampling blocks, thereby increasing the depth sampling density in distant areas. It identifies visible side grid vertices mapped to the same right eye position through a visible side grid clipping layer, and clips occluded side and projection-outbound grid vertices to reduce the propagation of error costs at occluded boundaries. It calculates depth discrete quantities and re-aggregates the cost of out-of-tolerance positions through a ranging error recalculation gate, thereby improving the reliability of disparity ranging in complex boundaries and low-confidence areas.

[0018] This invention calculates a weighted depth value based on peak neighborhood disparity and matching probability, inversely calculates sub-pixel disparity, and determines disparity error boundaries, thereby improving disparity refinement accuracy and establishing a ranging error range. It generates ranging center points and ranging boundary point pairs through 3D back projection, and then combines the back projection positions of the left and right images, the left and right matching positions, the closure residuals, and the projection range to filter the ranging center points, reducing erroneous matching points and projection inconsistencies in the final result. This invention has advantages such as low repeated texture mismatch rate, high long-distance ranging resolution, stable disparity at occlusion boundaries, high sub-pixel disparity accuracy, and high reliability of spatial ranging results, making it suitable for robot navigation, industrial inspection, unmanned equipment, and spatial target localization scenarios. Attached Figure Description

[0019] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of a binocular vision spatial ranging method based on deep learning proposed in this invention; Figure 2 This is a schematic diagram of the structure of the improved BGNet network for a binocular vision spatial ranging method based on deep learning proposed in this invention. Figure 3 This is a flowchart illustrating the peak neighborhood depth weighting and disparity correction results generated in a binocular vision spatial ranging method based on deep learning proposed in this invention. Detailed Implementation

[0020] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0021] refer to Figure 1 , Figure 2 and Figure 3 A deep learning-based binocular vision spatial ranging method includes: Collect binocular visual ranging data and preprocess it to generate a binocular visual ranging dataset. The binocular visual ranging dataset is rearranged according to the image pair order, and candidate disparity sequences and depth interval sequences are constructed based on the calibration data and packaged into binocular ranging samples. Shared weighted feature extraction is performed on the binocular ranging samples, group correlation results are calculated along the candidate disparity sequence, and concatenated with the broadcast depth interval sequence to generate an initial matching representation; The initial matching representation is input into the improved BGNet network, which includes a repeating texture disambiguation block, a distance adaptation sampling block, a visible side mesh clipping layer, and a range deviation recalculation gate to generate disparity ranging results. Extract the peak neighborhood disparity and matching probability from the disparity ranging results, convert the peak neighborhood disparity into a depth value and weight it according to the matching probability, back-calculate the sub-pixel disparity and determine the disparity error boundary, and generate the corrected disparity result; Three-dimensional back projection is performed on the corrected parallax results to determine the ranging center point, ranging boundary point pairs and left and right matching positions, and to generate a spatial ranging point set. The spatial ranging point set is back-projected onto the left and right images. The closure residual between the back-projected position and the matching position on the left and right is calculated. The ranging center point is selected by combining the projection range of the ranging boundary point pair, and the binocular vision spatial ranging result is generated.

[0022] In this embodiment, the binocular visual ranging data includes left eye image data, right eye image data, image acquisition time data, image pair sequence and calibration data.

[0023] In this embodiment, generating the binocular vision ranging dataset includes: According to the image pair sequence, the left and right eye image data are matched, and the left and right eye image data with the same sequence and the smallest image acquisition time difference are combined into an initial image pair; Based on the calibration data, a left-right image correction mapping is constructed. Lens distortion correction and epipolar correction are performed on the initial image pair to generate a corrected image pair, wherein: Generate corrected image pairs, specifically: Extract the intrinsic parameters, distortion coefficients, rotation matrix and translation vector of the left and right cameras from the calibration data. Based on the pixel position of the corrected image, reverse the transformation to the normalized coordinate domain of the left and right cameras according to the rotation matrix and translation vector. Then calculate the corresponding initial image sampling coordinates based on the camera intrinsic parameters and distortion coefficients to construct the left and right image correction mapping. Traverse the left and right image correction mappings, locate the four adjacent pixels based on the initial image sampling coordinates, calculate the interpolation weights according to the horizontal and vertical distances, sum the weighted values ​​of the four adjacent pixels, write the weighted result into the corresponding pixel position of the correction image, and mark the positions where the sampling coordinates exceed the boundary of the initial image as invalid positions; The left and right eye image data in the initial image pair are processed according to the left and right image correction mapping respectively to generate the left and right corrected images, and then the corrected image pairs are formed according to the image pair order. The calibrated image pairs are synchronously cropped to a common effective region, and the image size and channel order are unified. The images are then standardized according to the binocular joint pixel mean and binocular joint pixel standard deviation of the cropped image pairs. The calibration data is updated according to the cropping offset and size scaling ratio to generate standard image pairs, where: Generate standard image pairs, specifically: The intersection of valid regions is obtained based on the invalid positions in the left and right image correction mapping. The largest rectangle with full pixels valid is extracted from the intersection of valid regions. The horizontal and vertical cropping offsets are recorded, and the correction image pairs are cropped synchronously according to the same boundary. The corrected image pair is synchronously scaled and cropped according to the set image size. The horizontal and vertical scaling ratios are recorded, and the color channels are rearranged according to the set channel order. The pixel values ​​of the corrected image pairs after channel merging and scaling are calculated by dividing the sum of the pixel values ​​by the total number of pixels to obtain the binocular joint pixel mean. The square root of the average of the squared differences between the pixel values ​​and the binocular joint pixel mean is obtained to obtain the binocular joint pixel standard deviation. Each pixel value is then subtracted from the binocular joint pixel mean of the corresponding channel and divided by the binocular joint pixel standard deviation of the corresponding channel. Subtract the horizontal clipping offset from the horizontal principal point coordinates and multiply by the horizontal size scaling ratio. Subtract the vertical clipping offset from the vertical principal point coordinates and multiply by the vertical size scaling ratio. Multiply the horizontal focal length and vertical focal length by the corresponding size scaling ratio respectively, while keeping the binocular baseline length and distortion coefficient unchanged. The standardized left and right corrected images are combined to form a standard image pair; The standard image pairs are associated with image acquisition time data, image pair sequence, and calibration data, and encapsulated into a binocular vision ranging dataset.

[0024] In this embodiment, the encapsulation as a binocular ranging sample includes: The image pairs in the binocular visual ranging dataset are rearranged in ascending order according to their image pair order, and the calibration data is associated with the rearranged image pairs to generate a binocular image pair record. Based on the calibration data, determine the effective disparity lower limit and effective disparity upper limit (both positive to zero). Starting from the effective disparity lower limit, increase the disparity step by one pixel to the effective disparity upper limit to generate a candidate disparity sequence, where: Generate candidate disparity sequences, specifically as follows: Extract the corrected focal length, binocular baseline length, effective near-end depth of measurement, and effective far-end depth of measurement from the calibration data. Obtain the standard image width from the binocular image pair recording. Multiply the corrected focal length by the binocular baseline length to obtain the disparity conversion coefficient. Divide the parallax conversion coefficient by the effective distance measurement depth, round the result down and compare it with 1, and determine the larger value as the effective parallax lower limit; Divide the disparity conversion coefficient by the effective near-end depth of the range measurement, round the result up, and compare it with the standard image width minus 1. The smaller value is determined as the upper limit of the effective disparity. Arrange the integer disparities between the effective lower limit and the effective upper limit according to the disparity step size of one pixel to generate a candidate disparity sequence; Multiply the corrected focal length in the calibration data by the binocular baseline length, divide by each candidate disparity in the candidate disparity sequence to generate a candidate depth sequence. Use the absolute value of the difference between adjacent candidate depths as the depth interval of the previous candidate disparity, set the depth interval of the last candidate disparity as the previous depth interval, and arrange the candidate disparities in order to generate a depth interval sequence. The binocular image pair records, candidate disparity sequences, and depth interval sequences are associated according to the image pair order and encapsulated into binocular ranging samples.

[0025] In this embodiment, generating the initial matching representation includes: Using shared weights, layer-by-layer two-dimensional convolution, batch normalization, and linear rectification are performed on the left and right eye image data in the binocular ranging samples to generate left and right eye matching feature maps with the same spatial size and number of channels, where: Generate left-eye matching feature maps and right-eye matching feature maps, specifically as follows: Construct left and right feature extraction branches with shared parameters, and input left and right eye image data with height and width both being integer multiples of 4 into the corresponding branches respectively, sharing convolution kernel parameters, batch normalization parameters and channel configurations; Four 2D convolutional layers with a kernel size of 3×3 and a boundary padding width of 1 pixel are set sequentially. The stride of the first and second 2D convolutional layers is 2, and the number of output channels is 32 and 64, respectively. The stride of the third and fourth 2D convolutional layers is 1, and the number of output channels is 96 and 128, respectively. The results of each convolutional layer are batch normalized by channel, setting negative feature values ​​to 0 and retaining non-negative feature values. The outputs of the fourth two-dimensional convolutional layer of the left and right feature extraction branches are respectively determined as the left eye matching feature map and the right eye matching feature map. The height and width of the two matching feature maps are both one-quarter of the corresponding input image, and the number of channels is 128. The left and right eye matching feature maps are divided into equal number of feature groups along the channel dimension. The right eye feature group is shifted along the candidate disparity sequence and aligned with the left eye feature group. Out-of-bounds positions are filled with zeros to generate candidate disparity feature group pairs, where: Generate candidate disparity feature pairs, specifically as follows: The left and right eye matching feature maps are divided into 8 feature groups along the channel dimension according to the channel order. Each feature group contains 16 consecutive channels, and the left and right feature groups are corresponding to the same feature group order. Divide the width of the matching feature map by the width of the standard image to obtain the disparity scaling ratio. Multiply each candidate disparity in the candidate disparity sequence by the disparity scaling ratio to obtain the corresponding feature disparity. For each feature disparity, the feature disparity is subtracted from the x-coordinate of the left-eye matching feature map to obtain the right-eye sampling x-coordinate, while keeping the y-coordinate and feature group order unchanged; When the right eye sampling x-coordinate exceeds the boundary of the right eye matching feature map, the right eye sampling feature value is set to zero; When the right eye sampling x-coordinate is within the image boundary and is an integer, the right eye feature value at the corresponding position is extracted; When the right eye sampling x-coordinate is not an integer, the decimal part of the x-coordinate is used as the interpolation weight of the adjacent position on the right, and 1 minus the decimal part is used as the interpolation weight of the adjacent position on the left. The right eye feature values ​​of the two adjacent positions are then summed in weight. Based on the candidate disparity order and feature group order, each left eye feature group is paired with the aligned right eye feature group to generate candidate disparity feature group pairs; The corresponding channel feature values ​​in the candidate disparity feature pairs are multiplied pixel by pixel, the sum of the products is divided by the number of channels in each group, and the calculation results are arranged according to the candidate disparity order and feature group order to generate group correlation results. Align the depth interval sequence with the candidate disparity positions of the grouped correlation results, broadcast each depth interval along the spatial dimension, and concatenate it with the grouped correlation results along the feature channel dimension to generate an initial matching representation, where: Generate the initial matching representation, specifically as follows: According to the candidate disparity order, each depth interval is paired with the corresponding candidate disparity position in the group correlation result, and each depth interval is copied to all height and width positions of the corresponding group correlation result to form a single-channel depth interval feature map; At each candidate disparity location, the single-channel depth interval feature map is concatenated with 8 grouped related channels along the feature channel dimension. The concatenation results are arranged according to the candidate disparity order to generate an initial matching representation of each candidate disparity location containing 9 feature channels.

[0026] In this embodiment, generating the disparity ranging result includes: An improved BGNet network is constructed, which includes a repetitive texture disambiguation block, a distance-adaptive sampling block, a visible side mesh clipping layer, and a ranging error correction gate, wherein: The BGNet network is constructed and improved as follows: The cost aggregation, bilateral grid transformation and slice interpolation backbone of the traditional BGNet network are retained. The input of the original group-related cost volume is adjusted to receive the initial matching representation. Before cost aggregation, a repeating texture disambiguation block and a distance adaptation sampling block are added in sequence. The disambiguation matching representation is subdivided into candidate disparity intervals and then input into the original cost aggregation module. An embedded visible side mesh clipping layer is used between the original bilateral mesh transformation and slice interpolation. The original direct interpolation is adjusted to mesh vertex visible side determination, non-visible side vertex clipping, interpolation weight normalization and slice interpolation. By adding a ranging error correction gate at the original disparity regression output position, the original single disparity regression is adjusted to depth discrete quantity determination, local cost re-aggregation at the error position, and matching probability update. The improved BGNet network is obtained by connecting the following in the order of repeated texture disambiguation block, distance adaptation sampling block, BGNet cost aggregation, bilateral mesh transformation, visible side mesh clipping and slice interpolation, and ranging error correction gate. The repeating texture disambiguation block receives the initial matching representation, locates local peaks along the candidate disparity sequence, calculates the difference between the matching value of the maximum peak and each local peak, and the absolute difference between the disparity of each local peak and the median of the disparity of the peaks in the spatial neighborhood. These two differences are normalized, summed, and negatively divided. After Softmax processing, disambiguation weights are generated. The initial matching representation is adjusted according to these disambiguation weights to generate a disambiguated matching representation, where: Repeating texture disambiguation blocks include: Match Value Aggregator: Calculates the average value of grouped related channels; Candidate disparity scan queue: caches adjacent matching values ​​and locates local peaks; Local Peak Index Table: Records local peak disparity and matching values; Maximum Peak Register: Stores the maximum peak disparity and matching value; Neighborhood Peak Cache Table: Caches the disparity of neighboring peak values ​​and outputs the median. Double-difference normalizer: Calculates and normalizes the difference in matching values ​​and the absolute difference in disparity; Disambiguation weight generator: Summes the differences between two terms, takes the negative, and performs Softmax processing; Recalibration array: Adjust the initial matching representation according to the disambiguation weight; The process of processing repeated texture disambiguation blocks is as follows: The matching value aggregator receives an initial matching representation of size B×D×Hf×Wf×9, where B is the batch size, D is the number of candidate disparities, Hf and Wf are the height and width of the matching feature map, respectively, the first 8 channels are group correlation channels, the 9th channel is the depth interval channel, and the average of the first 8 channels is calculated to generate a matching value sequence of size B×D×Hf×Wf. The candidate disparity scanning queue slides a scanning window with a length of 3 according to the candidate disparity order. The matching value of the middle position is compared with the positions before and after. The position that is not less than two adjacent matching values ​​and is greater than at least one of the adjacent matching values ​​is determined as the local peak. The boundary matching values ​​are copied at both ends of the candidate disparity sequence to fill the scanning window. The local peak is written into the local peak index table. When no local peak is detected at the same pixel position, the position with the smallest order is selected from the candidate disparity positions with the corresponding maximum matching value as the local peak. The local peak index table records the candidate disparity order, local peak disparity, and local peak matching value according to the batch order and pixel position. It sends the local peak records at the same pixel position to the maximum peak register and records the number of local peaks at the same pixel position as K. The maximum peak register compares K local peak matching values, determines the local peak with the largest matching value as the maximum peak, and retains the local peak with the smaller candidate disparity order when the matching values ​​are the same, generating a maximum peak disparity map and a maximum peak matching value map with the same size B×Hf×Wf; The neighborhood peak cache table extracts a 3-row, 3-column spatial neighborhood from the maximum peak disparity map. The position of the spatial neighborhood that exceeds the image boundary is copied to the nearest maximum peak disparity. The 9 peak disparities are arranged in ascending order and the 5th peak disparity is selected to generate a spatial neighborhood peak disparity median map of size B×Hf×Wf. The double-difference normalizer calculates the difference between the maximum peak matching value and each local peak matching value, and calculates the absolute difference between each local peak disparity and the median of the peak disparity of the corresponding spatial neighborhood. It extracts the minimum and maximum values ​​of the two differences at the same pixel position, subtracts the corresponding minimum value from each difference, and divides it by the difference between the corresponding maximum and minimum values ​​to obtain the normalization result in the range of 0 to 1. When the maximum and minimum values ​​are the same, the corresponding normalization result is set to 0. The disambiguation weight generator sums the two normalized results corresponding to the same local peak and takes the negative. It then performs exponential operations on the K negative values ​​at the same pixel location and divides each exponential value by the sum of the K exponential values ​​to generate the disambiguation weight. The recalibration array extracts the maximum value from the K disambiguation weights at the same pixel position, divides each disambiguation weight by the maximum value to obtain the recalibration coefficient, and multiplies the 8 group correlation channels corresponding to the candidate disparity position by the recalibration coefficient according to the local peak index table. The group correlation channels and the 9th depth interval channel at the non-local peak position remain unchanged, generating a disambiguation matching representation of size B×D×Hf×Wf×9. The scanning window length of the repeating texture disambiguation block is set to 3, the spatial neighborhood is set to 3×3, the normalization range is set to 0 to 1, and no independent trainable parameters are set. The distance adaptation sampling block receives the disambiguation matching representation, rounds up the ratio of each depth interval to the median of the depth intervals to obtain the subdivision number, subdivides adjacent candidate disparity intervals according to the subdivision number, interpolates matching values ​​along the disparity dimension and equally divides the corresponding depth intervals to generate the distance adaptation representation, where: Distance adaptation sampling blocks include: Depth interval cache table: stores the depth intervals corresponding to each candidate disparity; Depth Interval Median Calculator: Calculates the median of the depth interval; Subdivision Count Generator: Calculates the subdivision count corresponding to each candidate disparity interval; Disparity Interval Subdivision: Divides adjacent candidate disparity intervals according to the number of subdivisions; Subdivision disparity index table: records the candidate disparities for subdivision and their corresponding order; Matched value interpolation array: interpolation grouping of related channels along the disparity dimension; Depth interval equalizer: equally divides the depth interval of each candidate disparity interval; Characterizing the splicer: splicing interpolation results and subdivision depth intervals; The processing procedure for distance-adaptive sampling blocks is as follows: The depth interval buffer table receives a disambiguation matching representation of size B×D×Hf×Wf×9, where B is the batch size, D is the number of candidate disparities, and Hf and Wf are the height and width of the matching feature map, respectively; the mean of the 9th channel along the height and width dimensions is calculated to generate a depth interval sequence of size B×D. The disparity index table is subdivided to obtain candidate disparity sequences that are associated with the disparity dimension of the disparity characterization and are matched with the disambiguation. An initial disparity index is then established according to the order of the candidate disparities. The depth interval median calculator removes the last depth interval that is copied and padded in the depth interval sequence, and sorts the remaining (D-1) depth intervals in ascending order. When the number of depth intervals is odd, the middle depth interval is selected. When the number of depth intervals is even, the mean of the two middle depth intervals is calculated to obtain the depth interval median of each batch of samples. The subdivision number generator divides the first (D-1) depth intervals by the median of the corresponding depth intervals, rounds the result up to obtain a subdivision number not less than 1, and arranges them according to the candidate disparity interval order to generate a subdivision number sequence of size B×(D-1). The disparity interval subdivision divides adjacent candidate disparity intervals according to the initial disparity index and the subdivision number sequence. When the subdivision number is greater than 1, the reciprocal of the candidate disparities at both ends of the interval is linearly interpolated according to the subdivision order, and then the reciprocal of the interpolation result is taken to obtain the inserted candidate disparity. The subdivision disparity index table records the left-end candidate disparity and the inserted candidate disparity in the order of the candidate disparity intervals, and appends the last candidate disparity to the last position. The sum of the subdivision quantities is then added by 1 to obtain the number of subdivision candidate disparities D′, generating a subdivision candidate disparity sequence of size B×D′. The matching value interpolation array locates the candidate disparity interval according to the subdivided candidate disparity sequence. The difference between the subdivided candidate disparity and the candidate disparity at the left end of the interval is divided by the difference between the candidate disparities at both ends of the interval to obtain the right-end interpolation weight. The right-end interpolation weight is obtained by subtracting 1 from the right-end interpolation weight. The eight grouped related channels of the candidate disparity positions at the left and right ends of the interval are multiplied by the corresponding interpolation weights and summed channel by channel to generate an interpolation result of size B×D′×Hf×Wf×8. The depth interval equalizer divides the first (D-1) depth intervals by the corresponding number of subdivisions, and copies and arranges the equalization results according to the number of subdivisions. The depth interval of the last subdivision candidate disparity is set as the previous depth interval, generating a subdivision depth interval sequence of size B×D′. The characterization splicer broadcasts the subdivided depth interval sequence along the height and width dimensions, splices it with the interpolation results along the feature channel dimension, and associates it with the subdivided candidate disparity sequence to generate a distance adaptation characterization of size B×D′×Hf×Wf×9. The distance-adaptive sampling block keeps the height, width and number of channels of the matching feature map unchanged. The number of subdivision candidate disparities D′ is dynamically determined according to the number of subdivisions. The same candidate disparity sequence and depth interval sequence are used in the same batch, and no independent trainable parameters are set. The visible side mesh clipping layer's receiving distance adaptation representation, after BGNet cost aggregation and bilateral mesh transformation, determines the right-eye projection position based on the left-eye pixel's horizontal coordinate and candidate disparity. The mesh vertex mapped to the same right-eye pixel position and corresponding to the largest candidate disparity is identified as the visible side mesh vertex. Non-visible side mesh vertices and mesh vertices projecting out of bounds are clipped. The interpolation weights of the mesh vertices are normalized and retained to generate the visible side cost representation, where: The visible side mesh clipping layer includes: Bilateral mesh vertex buffer: stores the left eye pixel position, mesh vertex position, candidate disparity, cost value, and interpolation weight; Right-eye projection calculator: Calculates the right-eye projection position corresponding to a grid vertex; Projection boundary checker: Marks grid vertices where the right eye projection position exceeds the image boundary; Projected pixel merging table: Merges grid vertices that have not exceeded the bounds and are mapped to the same right eye pixel position; Visible side disparity comparator: retains the mesh vertex corresponding to the largest candidate disparity; Mesh clipping mask: marks non-visible side mesh vertices and projected out-of-bounds mesh vertices; Interpolation weight normalizer: Normalization preserves the interpolation weights of the mesh vertices; Cost representation writer: Weighted writing preserves the cost value of mesh vertices and records the visible side mask; The processing steps for the visible side mesh clipping layer are as follows: The distance adaptation representation of size B×D′×Hf×Wf×9 is adjusted to B×9×D′×Hf×Wf. Each disparity in the subdivided candidate disparity sequence is determined as a candidate disparity. The aggregated cost feature of size B×16×D′×Hf×Wf is generated by BGNet cost aggregation. The BGNet bilateral mesh transformation module converts the aggregate cost features into a bilateral mesh of size B×D′×32×Hf×Wf, and averages the aggregate cost features along the disparity dimension. After 1×1 two-dimensional convolution, bilinear interpolation, and hyperbolic tangent activation, it generates a guide map of size B×1×H×W with a value range of -1 to 1, where H and W are the height and width of the standard image, respectively. The bilateral grid vertex buffer multiplies the left eye pixel's horizontal coordinate by (Wf-1) and divides it by (W-1), and multiplies the vertical coordinate by (Hf-1) and divides it by (H-1) to obtain the horizontal and vertical grid coordinates respectively. The guide map value is added by 1, multiplied by 31 and divided by 2 to obtain the guide dimension grid coordinates. For each candidate disparity and left eye pixel, extract the lower neighbor index and upper neighbor index of three grid coordinates and combine them into 8 grid vertices. Extract the cost value from the bilateral grid of the corresponding candidate disparity position. Use 1 minus the decimal part of each grid coordinate as the lower neighbor index weight and the decimal part of each grid coordinate as the upper neighbor index weight. Multiply the index weights of the three dimensions to obtain the initial interpolation weight. Cache the left eye pixel position, grid vertex position, candidate disparity, cost value and initial interpolation weight. The right-eye projection calculator subtracts the candidate disparity from the left-eye pixel x-coordinate to obtain the right-eye projection x-coordinate. Keeping the y-coordinate unchanged, it adds 0.5 to the right-eye projection x-coordinate and rounds down to form the right-eye pixel position with the y-coordinate. The projection boundary checker marks grid vertices with a right-view projection x-coordinate less than 0 or greater than (W-1) as out-of-bounds grid vertices. The projected pixel merging table merges grid vertices that have not exceeded the bounds and are mapped to the same right eye pixel position; The visible side disparity comparator retains the grid vertex corresponding to the largest candidate disparity in each merge group. When the candidate disparities are the same, it retains all grid vertices that participated in the interpolation and marks the remaining grid vertices as non-visible side grid vertices. The mesh clipping mask marks visible side mesh vertices as 1 and non-visible side mesh vertices and projected out-of-bounds mesh vertices as 0, generating a mesh clipping mask of size B×D′×H×W×8; The interpolation weight normalizer multiplies the initial interpolation weight by the grid clipping mask and then divides it by the sum of the weights at the same candidate disparity and left eye pixel position to obtain the normalized interpolation weight. When the sum of the weights is 0, the normalized interpolation weight is set to 0. The cost representation writer retains the cost value of the grid vertices and sums it by normalized interpolation weights to generate a visible side cost tensor of size B×D′×H×W. It marks the positions where the sum of weights is greater than 0 as 1 and the rest as 0, generates a visible side mask of the same size, and associates the visible side cost tensor, the visible side mask and the subdivision candidate disparity sequence to generate a visible side cost representation. BGNet cost aggregation and bilateral grid transformation use trainable convolution parameters, while projection merging, grid clipping and weight normalization do not have independent trainable parameters. The ranging error correction gate receives the visible side cost representation, calculates the matching probability and peak disparity along the disparity dimension, squares the cumulative depth interval between the candidate disparity and the peak disparity, and sums them weighted by the matching probability. The square root is then used to obtain the depth discrepancy. Positions where the depth discrepancy is greater than the corresponding depth interval of the peak disparity are identified as error locations. The cost of these error locations is re-aggregated within the peak disparity neighborhood and the visible side spatial neighborhood, updating the matching probability and peak disparity to generate the disparity ranging result. Where: The range measurement error recalculation gate includes: Visible side cost buffer: stores the visible side cost tensor, visible side mask, subdivision candidate disparity sequence, and subdivision depth interval sequence; Mask Probability Calculator: Eliminates invisible locations and generates matching probabilities along the disparity dimension; Peak disparity register: stores the peak disparity and peak depth interval corresponding to the maximum matching probability; Depth interval accumulator: Accumulates the subdivided depth intervals between each candidate disparity and the peak disparity; Depth Discreteness Calculator: Calculates the probability-weighted discreteness of the cumulative depth interval; Out-of-tolerance position comparator: compares the depth discreteness with the peak depth interval; Recalculated Neighborhood Index Table: Records peak disparity neighborhood and visible side spatial neighborhood; Local cost re-aggregator: re-aggregates the neighborhood cost of out-of-tolerance locations; Recalculation result writer: updates matching probability and peak disparity and generates disparity ranging results; The processing procedure for the distance measurement error recalculation gate is as follows: The visible side cost buffer receives the visible side cost representation, extracts the visible side cost tensor and visible side mask, both of size B×D′×H×W, and the subdivision candidate disparity sequence and subdivision depth interval sequence, both of size B×D′, where B is the batch size, D′ is the number of subdivision candidate disparities, and H and W are the height and width of the standard image, respectively. The mask probability calculator extracts the cost value of the visible side mask being 1, subtracts the minimum cost value of the same pixel position from each cost value, takes the negative and performs an exponential operation, and then divides it by the sum of the exponential values ​​along the disparity dimension to generate a matching probability tensor of size B×D′×H×W. The matching probability of the position where the visible side mask is 0 is set to 0. The peak disparity register determines the candidate disparity corresponding to the maximum matching probability as the peak disparity. When the matching probabilities are the same, the candidate disparity with the smaller order is retained, and the corresponding subdivision depth interval is extracted to generate a peak disparity map and a peak depth interval map with the same size of B×H×W. When the sum of the matching probabilities along the disparity dimension is 0, the peak disparity and peak depth interval are set to 0. The depth interval accumulator accumulates the subdivision depth interval from the smaller of the candidate disparity and the peak disparity to the position before the larger position for each candidate disparity and the peak disparity. When the positions are the same, the accumulated depth interval is set to 0, and an accumulated depth interval tensor of size B×D′×H×W is generated. The depth discreteness calculator squares the cumulative depth intervals and sums them by weight according to the matching probability, and takes the square root to generate a depth discreteness map of size B×H×W; The out-of-tolerance position comparator marks positions where the depth discrepancy is greater than the peak depth interval and the sum of the matching probabilities along the disparity dimension is greater than 0 as 1, and marks the remaining positions as 0, thus generating an out-of-tolerance position mask; For each out-of-range position, the recalculated neighborhood index table extracts two candidate disparities before and after the peak disparity sequence and a 3×3 spatial neighborhood centered on the out-of-range position. Positions that exceed the boundaries of the subdivided candidate disparity sequence or the image boundary, as well as positions with a visible side mask of 0, are removed to generate the recalculated neighborhood index. The local cost re-aggregator extracts the cost value corresponding to the recalculated neighborhood index for candidate disparities with a visible side mask of 1 in the peak disparity neighborhood. It accumulates the subdivision depth interval between the candidate disparity in the neighborhood and the candidate disparity to be recalculated according to the candidate disparity order. The accumulated result is divided by the peak depth interval to obtain the disparity distance term. The re-aggregation weight is determined by the sum of 1 and the absolute value of the pixel row difference, the absolute value of the pixel column difference, and the disparity distance term. Each re-aggregation weight is divided by the sum of the weights and multiplied by the corresponding cost value and summed to obtain the re-aggregation cost value. If there is no valid cost value, the original cost value is retained. The recalculation result writer writes the reaggregated cost value into the peak disparity neighborhood corresponding to the out-of-tolerance position, retains the remaining cost values, recalculates the matching probability and peak disparity according to the processing method of the mask probability calculator, retains the original matching probability and peak disparity for non-out-of-tolerance positions, generates an updated matching probability tensor of size B×D′×H×W and an updated peak disparity map of size B×H×W, retains the positions where the sum of the updated matching probability along the disparity dimension is greater than 0, associates the updated matching probability tensor, the updated peak disparity map and the subdivided candidate disparity sequence, and generates the disparity ranging result; The ranging error recalculation gate does not have independently trainable parameters. The improved BGNet network is trained on the training set. The joint loss is obtained by weighting and summing the disparity regression error, repeating texture peak separation error, depth interval weighted ranging error, visible side projection consistency error, and out-of-tolerance position recalculation error. Backpropagation is used to update the trainable parameters of the improved BGNet network. After each training round, the average absolute spatial ranging error (ASO) on the validation set is calculated. Training stops when the ASO does not fall below the historical minimum for six consecutive rounds. The network parameters corresponding to the round with the minimum ASO are retained, completing the training of the improved BGNet network. Specifically: The improved BGNet network is trained as follows: The training set, which includes standard image pairs, calibration data, true disparity, and true depth, is input into the training process in batches of 4 samples. Initial matching representations are generated through shared weight feature extraction and group correlation calculation. These representations are then input into the improved BGNet network to obtain the updated matching probability tensor. The candidate disparities are weighted and summed according to the updated matching probability to obtain the predicted disparity. The product of the corrected focal length and the binocular baseline length is divided by the candidate disparity and the predicted disparity, respectively, to obtain the candidate depth and the predicted depth. The mean absolute difference between predicted disparity and true disparity is calculated to obtain the disparity regression error. At locations with at least two local peaks, the difference between the probability of the nearest candidate disparity and the maximum probability of the remaining peaks is calculated. The probability difference less than 0.2 is subtracted from 0.2, and the rest are recorded as 0. The average value is used to obtain the repetitive texture peak separation error. The absolute difference between candidate depth and true depth is divided by the subdivision depth interval, and the average value is calculated by weighting the update matching probability to obtain the depth interval weighted ranging error. The maximum true disparity mapped to the same right eye pixel position is determined as the true visible side disparity. The mean square difference between the predicted disparity and the true visible side disparity corresponding to the right eye projection abscissa is calculated to obtain the visible side projection consistency error. The negative logarithm of the update matching probability of the nearest candidate disparity of true disparity in the out-of-tolerance location is taken and averaged to obtain the out-of-tolerance location recalculation error. When there is no out-of-tolerance location, the error is set to 0. The five errors are weighted and summed at 0.30, 0.20, 0.20, 0.15 and 0.15 respectively to obtain the joint loss. The AdamW algorithm with an initial learning rate of 0.001 and a weight decay coefficient of 0.0001 is used to backpropagate and update the trainable parameters of the improved BGNet network. In each round, the mean absolute difference between the predicted depth and the true depth on the validation set is calculated. The learning rate is halved when the depth does not fall below the historical minimum for three consecutive rounds. Training is stopped when the depth does not fall below the historical minimum for six consecutive rounds. The network parameters corresponding to the round with the minimum error are retained to complete the training of the improved BGNet network. This invention addresses the problem of parallax bias in traditional BGNet networks, which are prone to occur under repetitive textures, non-uniform depth variations, occluded boundaries, and low-confidence locations. It improves the structure of traditional BGNet networks by adding a repetitive texture disambiguation block, a distance adaptation sampling block, a visible side mesh clipping layer, and a range deviation recalculation gate. To address the issue that repeated texture regions are prone to forming multiple similar matching peaks, the repeated texture disambiguation block jointly analyzes the matching value difference between local peaks and the maximum peak, as well as the deviation between the local peak disparity and the median of the spatial neighborhood peak disparity, generates disambiguation weights and adjusts the matching representation to weaken erroneous matching peaks that do not conform to spatial continuity. To address the issue of different spatial depth intervals corresponding to the same disparity step size, the distance adaptation sampling block subdivides the candidate disparity intervals based on the ratio of the depth interval to the median depth interval, interpolates the matching values, and equally divides the depth intervals, so that the candidate disparity sampling density matches the actual spatial depth changes, thereby reducing the depth quantization error in long-distance ranging. To address the issue of non-visible side values ​​in the occluded region participating in bilateral mesh interpolation, the visible side mesh clipping layer filters visible side mesh vertices based on the left and right projection relationships, clips non-visible side mesh vertices and projection-outbound mesh vertices, and renormalizes the interpolation weights to reduce parallax aliasing caused by the propagation of occlusion values ​​to the object boundary. To address the issue of large ranging errors that can easily occur in single disparity regression at low-confidence locations, the ranging error recalculation gate calculates the depth discrete quantity based on the matching probability and cumulative depth interval, locates the error location, and re-aggregates the cost value in the peak disparity neighborhood and the visible side spatial neighborhood to correct the matching probability and peak disparity of the error location. The improved BGNet network not only retains the cost aggregation and bilateral mesh processing capabilities of the traditional BGNet network, but also achieves collaborative processing of texture matching, distance sampling, occlusion discrimination and error correction, thereby improving the accuracy and reliability of binocular vision spatial ranging in complex scenes.

[0027] In this embodiment, the step of converting peak neighborhood disparity into depth values ​​and weighting them according to matching probability includes: The product of the corrected focal length and the binocular baseline length in the calibration data is divided by the disparity of each peak neighborhood to generate a peak neighborhood depth sequence, where: Generate the peak neighborhood depth sequence, specifically: Extract and update the peak disparity map and subdivided candidate disparity sequence from the disparity ranging results, and update the candidate disparity order corresponding to the peak disparity according to the pixel position. The two candidate disparities before and after the updated peak disparity and candidate disparity order are determined as the peak neighborhood disparities, and candidate disparities that exceed the boundary of the subdivided candidate disparity sequence are removed. Multiply the corrected focal length by the binocular baseline length, divide by each peak neighborhood disparity, arrange the calculation results according to the candidate disparity order, and generate a peak neighborhood depth sequence. Arrange the matching probabilities according to the candidate disparity order of the peak neighborhood disparity, and divide each matching probability by the sum of the peak neighborhood matching probabilities to generate a neighborhood probability weight sequence.

[0028] In this embodiment, generating the corrected disparity result includes: The peak neighborhood disparity is transformed and weighted according to the matching probability to obtain the weighted depth value. The product of the corrected focal length and the binocular baseline length in the calibration data is divided by the weighted depth value to obtain the subpixel disparity. Calculate the square of the difference between the disparity of each peak neighborhood and the sub-pixel disparity, multiply each squared value by the corresponding matching probability, sum the products, divide by the sum of the peak neighborhood matching probabilities, and take the square root to obtain the disparity discrete quantity. Subtracting the disparity discrepancy from the subpixel disparity yields the lower boundary of the disparity error, while adding the disparity discrepancy back gives the upper boundary. The lower and upper boundaries of the disparity error are truncated using the minimum and maximum values ​​of the peak neighborhood disparity, respectively. The subpixel disparity and disparity error boundaries are then correlated according to pixel position to generate the corrected disparity result, where: The corrected disparity result is generated as follows: Subtracting the disparity discrepancy from the subpixel disparity based on the pixel position yields the lower boundary of the initial disparity error; adding the disparity discrepancy to the subpixel disparity yields the upper boundary of the initial disparity error. Extract the minimum and maximum values ​​of the peak neighborhood disparity for each pixel. Determine the larger of the initial disparity error lower boundary and the minimum value as the lower boundary of disparity error, and the smaller of the initial disparity error upper boundary and the maximum value as the upper boundary of disparity error. The corrected disparity result is generated by associating subpixel disparity, lower boundary of disparity error, and upper boundary of disparity error with pixel position.

[0029] In this embodiment, generating the spatial ranging point set includes: The product of the corrected focal length and the binocular baseline length is divided by the sub-pixel disparity to obtain the ranging center depth. The difference between the left eye pixel coordinates and the left eye principal point coordinates is multiplied by the ranging center depth and then divided by the corrected focal length to obtain the lateral and longitudinal coordinates, thus generating the ranging center point. The process of generating the distance measurement center point is as follows: Extract the lateral correction focal length, longitudinal correction focal length, left eye lateral principal point coordinates, left eye longitudinal principal point coordinates, and binocular baseline length from the calibration data; Multiply the lateral correction focal length by the binocular baseline length and divide by the subpixel disparity to obtain the distance measurement center depth; Multiply the difference between the left eye pixel's horizontal coordinate and the left eye's horizontal principal point coordinate by the distance measurement center depth, and then divide by the horizontal correction focal length to obtain the horizontal coordinate. Multiply the difference between the left eye pixel's ordinate and the left eye's longitudinal principal point's coordinate by the distance measurement center depth, and then divide by the longitudinal correction focal length to obtain the longitudinal coordinate. The distance measurement center point is formed in the order of horizontal coordinate, vertical coordinate, and distance measurement center depth; The product of the corrected focal length and the binocular baseline length is divided by the upper and lower boundaries of the disparity error, respectively, to obtain the near-end depth and far-end depth. Based on the left eye pixel coordinates, the left eye principal point coordinates, and the corrected focal length, three-dimensional backprojection is performed on the near-end depth and far-end depth to generate ranging boundary point pairs, where: Generate ranging boundary point pairs, specifically: Multiply the lateral correction focal length by the binocular baseline length, and divide by the upper and lower boundaries of the disparity error respectively to obtain the near depth and far depth. Multiply the difference between the left eye pixel's horizontal coordinate and the left eye's horizontal principal point coordinate by the near-end depth and the far-end depth, respectively, and then divide by the horizontal correction focal length to obtain the near-end horizontal coordinate and the far-end horizontal coordinate. Multiply the difference between the left eye pixel ordinate and the left eye longitudinal principal point ordinate by the near depth and far depth respectively, and then divide by the longitudinal correction focal length to obtain the near longitudinal coordinate and far longitudinal coordinate. The near-end lateral coordinates, near-end longitudinal coordinates, and near-end depth are used to form the near-end boundary point, and the far-end lateral coordinates, far-end longitudinal coordinates, and far-end depth are used to form the far-end boundary point. The near-end boundary point and the far-end boundary point are associated to generate a distance measurement boundary point pair. Using the left eye pixel coordinates as the left matching position, the right matching position is obtained by subtracting the subpixel disparity from the left eye pixel's x-coordinate while keeping the y-coordinate unchanged. The spatial ranging point set is generated by associating the ranging center point, ranging boundary point pairs, and left and right matching positions according to the pixel positions.

[0030] In this embodiment, generating binocular visual spatial ranging results includes: Based on the calibration data, construct the left and right camera projection matrices. Convert the distance measurement center point and distance measurement boundary point pairs in the spatial distance measurement point set into homogeneous coordinates and multiply them by the left and right camera projection matrices respectively. Take the ratio of the first two components to the third component of each product to obtain the back projection positions of the left and right images, and generate back projection records, where: The back projection record is generated as follows: Extract the intrinsic parameters, rotation matrix, and translation vector of the left and right cameras from the calibration data. Multiply the intrinsic parameters of the left camera by the extrinsic parameters of the left camera, which is a concatenation of the third-order unit rotation matrix and the three-dimensional zero translation vector, to obtain the projection matrix of the left camera. Multiply the intrinsic parameters of the right camera by the extrinsic parameters of the right camera, which is a concatenation of the rotation matrix and the translation vector, to obtain the projection matrix of the right camera. Add homogeneous components with a value of 1 to the ranging center point, near boundary point and far boundary point respectively, multiply them with the projection matrices of the left and right cameras, and divide the first and second components of each product by the third component to obtain the left and right image back projection positions of the ranging center point and ranging boundary point pair. A back projection record is generated by associating the back projection positions of the ranging center point and the ranging boundary points with the pixel positions in the spatial ranging point set. Based on the left and right image back projection positions and left and right matching positions corresponding to the distance measurement center point of the pixel position, the squares of the difference between the horizontal and vertical coordinates are added together and the square root is taken to obtain the position residuals of the left and right images. The larger position residual is determined as the closure residual, and a closure check record is generated. Based on the back projection records and closure verification records, the range of the left and right image back projection positions of the ranging boundary point pair is determined as the projection range. The maximum back projection distance between the ranging center point and the ranging boundary point pair is determined as the projection tolerance. Ranging center points whose closure residuals are not greater than the projection tolerance and whose left and right matching positions are within the corresponding projection range are retained to generate a filtered ranging point set, where: The specific steps for generating the set of distance measurement points are as follows: Based on the pixel position corresponding to the back projection record, closure check record, and spatial ranging point set, extract the left and right image back projection positions of the ranging center point, near boundary point, and far boundary point, as well as the closure residual and left and right matching positions; Extract the minimum, maximum, minimum, and maximum x-coordinates of the back projection of the near and far boundary points in the left and right images, respectively, and construct the projection range of the left and right images; Calculate the Euclidean distances between the projection position of the distance measurement center point and the projection positions of the near and far boundary points in the left and right images respectively, and take the maximum value among the four Euclidean distances as the projection tolerance; Retain the ranging center points whose closure residual is no greater than the projection tolerance, whose left matching position is within the projection range of the left image, and whose right matching position is within the projection range of the right image, and generate a set of filtered ranging points; The ranging point set is sorted according to pixel position and associated with the corresponding ranging boundary point pairs to generate binocular vision spatial ranging results.

[0031] Example 1: To verify the feasibility of this invention in practice, it was applied to a continuous ranging task in a closed industrial logistics channel. A binocular camera was installed at the front end of a transport platform. The channel contained periodically perforated material racks, turnover boxes obscuring the background, and low-texture equipment casings. Illuminance varied between 42 and 310 lux, and the ranging range was 1.2–15.0 meters. The binocular baseline was 0.12 meters, the image resolution was 1280×720 pixels, the acquisition frequency was 15 frames per second, and the corrected focal length was 860 pixels.

[0032] 6000 pairs of stereo images were collected, including 1680 pairs of images with repetitive textures, 1350 pairs of images with occluded boundaries, 1210 pairs of images with weak textures, and 1760 pairs of images from distant locations. The training set, validation set, and test set each contained 4500, 750, and 750 pairs, respectively. Each image pair was associated with its acquisition time, image pair order, and calibration data. The time difference between left and right images was less than 1.2 milliseconds, with an average time difference of 0.46 milliseconds. The true depth annotation error did not exceed 0.002 meters. A total of 1.846 million annotation points were set for all images, with a median annotation depth of 6.82 meters.

[0033] The left and right images were cropped to 1216×672 pixels after image pairing and positional matching, with the common effective area occupying 88.7% of the original image area. The mean pixel value of the binocular joint image was 0.407 with a standard deviation of 0.218, and the mean pixel value after standardization was 0.003 with a standard deviation of 0.998. The cropping offset was 32 pixels horizontally and 24 pixels vertically, and the left eye principal point was updated to 608 pixels and 336 pixels. Before epipolar correction, the mean vertical deviation of corresponding points was 1.74 pixels, which was reduced to 0.08 pixels after correction, with 95% of the corresponding points having a vertical deviation of less than 0.16 pixels.

[0034] A set of training images containing a rack, turnover box, and distant panel was selected for simulation. The true depths of the rack, turnover box (foreground), rack behind, and distant panel were 6.440 meters, 3.180 meters, 7.620 meters, and 12.460 meters, respectively. The product of focal length and baseline length was 103.2 meters in pixels, corresponding to true parallaxes of 16.025 pixels, 32.453 pixels, 13.543 pixels, and 8.283 pixels, respectively.

[0035] Candidate disparity sequences are generated within a 1-pixel step size within the range of 1–96 pixels based on calibration data. When the disparity is 8 and 9 pixels, the depths are 12.900 meters and 11.467 meters, with an interval of 1.433 meters; when the disparity is 16 and 17 pixels, the depths are 6.450 meters and 6.071 meters, with an interval of 0.379 meters; and when the disparity is 32 and 33 pixels, the depths are 3.225 meters and 3.127 meters, with an interval of 0.098 meters. Image pairs are associated with the two sequences to form binocular ranging samples.

[0036] Shared weighted feature extraction generates a 304×168×128 left and right matching feature map, which is then divided into 8 groups along the channel dimension. The right eye feature group is translated along the candidate disparity and aligned with the left eye feature group, with the corresponding channel product sum divided by 16. The grouping correlation values ​​at pixels 13, 16, and 19 of the shelf measurement point are 0.81, 0.78, and 0.72, respectively, while the mean grouping correlation value for other candidate disparities is 0.23. The grouping correlation results are concatenated with the broadcast depth interval to form an initial matching representation of 96×168×304×9.

[0037] The median spatial neighborhood peak disparity at the material rack measurement point was 16 pixels. The disambiguation weights for the three local peaks were 0.17, 0.68, and 0.15, respectively, with the main peak corrected from 13 pixels to 16 pixels. A total of 4286 competing peak pixels were detected in the same material rack area, of which 3619 pixels were recovered to the neighborhood disparity range. The traditional BGNet obtained a depth of 7.938 meters at this measurement point with an error of 1.498 meters; after disambiguation, the error was reduced to 0.010 meters.

[0038] The median depth interval is 0.36 meters. The ratio of the 8–9 pixel range (for the far-distance panel) to the median is 3.98. This range is further subdivided into four segments, with candidate disparities of 8.25, 8.50, and 8.75 pixels inserted. The matching value at each insertion point is obtained by interpolating adjacent positions, corresponding to a depth interval adjustment of 0.358 meters. The peak depth after subdivision is 8.29 pixels, with a depth error of 0.011 meters; the fixed step size error is 0.440 meters.

[0039] After BGNet cost aggregation and bilateral mesh transformation, the edge of the turnover box forms a foreground vertex of 32.453 pixels and a background vertex of 13.543 pixels, which are mapped to the same right eye position. Visible side mesh clipping retains the foreground vertices, and a total of 1173 non-visible side vertices and 286 projection out-of-bounds vertices are clipped. The depth before clipping is 4.347 meters, and after clipping it is 3.186 meters, which is 0.006 meters different from the true depth. The average error in the edge region is reduced from 0.412 meters to 0.083 meters.

[0040] The maximum matching probability for distant panel pixels was 0.43, with a depth disparity of 0.48 meters, exceeding the peak depth interval of 0.37 meters, and was therefore identified as an out-of-tolerance location. After re-aggregating the neighborhood cost, the maximum matching probability increased to 0.71, the peak disparity was updated from 8.18 pixels to 8.29 pixels, and the depth disparity decreased to 0.14 meters. Of the 936 out-of-tolerance locations in this image pair, 817 were determined by depth interval after recalculation.

[0041] The training batch size was set to 4 image pairs, with an initial learning rate of 0.001, which decayed to 0.5 every 10 epochs. The initial values ​​for the five training errors were 1.68, 0.62, 0.44, 0.31, and 0.39, with a joint loss of 0.886. After 46 epochs of backpropagation, the five errors decreased to 0.31, 0.09, 0.08, 0.06, and 0.07, and the joint loss decreased to 0.159. The average absolute error of spatial ranging on the validation set reached 0.061 meters and remained unchanged for six consecutive epochs; the network parameters from the 46th epoch were retained. No consecutive epochs during training showed a joint loss rebound exceeding 0.02.

[0042] The peak neighborhood disparities at the material rack measurement points are 15.75 pixels, 16.00 pixels, and 16.25 pixels, with matching probabilities of 0.18, 0.56, and 0.26, corresponding to depths of 6.552 meters, 6.450 meters, and 6.351 meters. The weighted depth is 6.443 meters, the subpixel disparity is 16.017 pixels, the discreteness is 0.165 pixels, and the error boundary is 15.852–16.182 pixels. Compared to directly using the maximum probability disparity, the ranging error is reduced from 0.010 meters to 0.003 meters.

[0043] The left eye measurement points are 742 pixels and 386 pixels, and their spatial coordinates obtained by 3D backprojection are 1.004 meters, 0.375 meters, and 6.443 meters. The parallax error boundaries correspond to a near depth of 6.377 meters and a far depth of 6.510 meters. The left matching positions are 742 pixels and 386 pixels, and the right matching positions are 725.983 pixels and 386 pixels.

[0044] After backprojection, the positional residuals of the left and right images are 0.11 pixels and 0.18 pixels, respectively. The closure residual is less than the projection tolerance of 0.46 pixels, so the ranging center point is retained. Another mismatched point has a closure residual of 2.64 pixels, exceeding the projection tolerance of 0.52 pixels, and the right matching position is outside the projection range, so it is discarded. This image pair generated 204,288 ranging center points, of which 198,736 were retained after closure verification.

[0045] On 750 sets of test image pairs: The average disparity error of the traditional BGNet and the method of this invention is 1.21 pixels and 0.56 pixels, respectively. The average absolute errors of spatial ranging are 0.183 meters and 0.074 meters; The median distance measurement errors were 0.129 meters and 0.046 meters; The 95th percentile errors are 0.611 meters and 0.238 meters; The error rates exceeding 3 pixels were 8.3% and 2.8%; The ranging errors for repeating textures, occluded boundaries, and distances of 10–15 meters decreased from 0.274 meters, 0.326 meters, and 0.692 meters to 0.091 meters, 0.118 meters, and 0.216 meters, respectively. The effective distance measurement point retention rate increased from 84.7%, 79.3%, and 72.6% to 95.2%, 92.4%, and 89.1%, respectively.

[0046] Continuous ranging was performed for 30 minutes in the same industrial logistics channel, processing a total of 27,000 image pairs. For a 6.440-meter material rack, the traditional BGNet output had a mean of 6.592 meters and a standard deviation of 0.214 meters, while the method of this invention had a mean of 6.451 meters and a standard deviation of 0.026 meters. The processing time per image pair for the two methods was 50.8 milliseconds and 57.6 milliseconds, respectively, while the method of this invention achieved 17.4 frames per second.

[0047] Example 1 shows that the method of the present invention reduces the mismatch of repeated textures, long-distance sampling errors and parallax mixing of occlusion boundaries, and improves the accuracy and stability of spatial ranging.

[0048] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A binocular vision spatial ranging method based on deep learning, characterized in that, include: Collect binocular visual ranging data and preprocess it to generate a binocular visual ranging dataset. The binocular visual ranging dataset is rearranged according to the image pair order, and candidate disparity sequences and depth interval sequences are constructed based on the calibration data and packaged into binocular ranging samples. Shared weighted feature extraction is performed on the binocular ranging samples, group correlation results are calculated along the candidate disparity sequence, and concatenated with the broadcast depth interval sequence to generate an initial matching representation; The initial matching representation is input into the improved BGNet network, which includes a repeating texture disambiguation block, a distance adaptation sampling block, a visible side mesh clipping layer, and a range deviation recalculation gate to generate disparity ranging results. Extract the peak neighborhood disparity and matching probability from the disparity ranging results, convert the peak neighborhood disparity into a depth value and weight it according to the matching probability, back-calculate the sub-pixel disparity and determine the disparity error boundary, and generate the corrected disparity result; Three-dimensional back projection is performed on the corrected parallax results to determine the ranging center point, ranging boundary point pairs and left and right matching positions, and to generate a spatial ranging point set. The spatial ranging point set is back-projected onto the left and right images. The closure residual between the back-projected position and the matching position on the left and right is calculated. The ranging center point is selected by combining the projection range of the ranging boundary point pair, and the binocular vision spatial ranging result is generated.

2. The binocular vision spatial ranging method based on deep learning according to claim 1, characterized in that, The binocular visual ranging data includes left eye image data, right eye image data, image acquisition time data, image pair sequence and calibration data.

3. The binocular vision spatial ranging method based on deep learning according to claim 1, characterized in that, The generated binocular vision ranging dataset includes: According to the image pair sequence, the left and right eye image data are matched, and the left and right eye image data with the same sequence and the smallest image acquisition time difference are combined into an initial image pair; Based on the calibration data, construct the left and right image correction mapping, perform lens distortion correction and epipolar correction on the initial image pair, and generate the corrected image pair; The calibration image pairs are synchronously cropped to a common effective area, the image size and channel order are unified, and the images are standardized according to the mean and standard deviation of the binocular joint pixels of the cropped image pairs. The calibration data is updated according to the cropping offset and size scaling ratio to generate standard image pairs. The standard image pairs are associated with image acquisition time data, image pair sequence, and calibration data, and encapsulated into a binocular vision ranging dataset.

4. The binocular vision spatial ranging method based on deep learning according to claim 1, characterized in that, The encapsulated binocular ranging sample includes: The image pairs in the binocular visual ranging dataset are rearranged in ascending order according to their image pair order, and the calibration data is associated with the rearranged image pairs to generate a binocular image pair record. Based on the calibration data, determine the effective disparity lower limit and effective disparity upper limit that are greater than zero. Starting from the effective disparity lower limit, increase the disparity step by one pixel to the effective disparity upper limit to generate a candidate disparity sequence. Multiply the corrected focal length in the calibration data by the binocular baseline length, divide by each candidate disparity in the candidate disparity sequence to generate a candidate depth sequence, take the absolute value of the difference between adjacent candidate depths as the depth interval of the previous candidate disparity, set the depth interval of the last candidate disparity as the previous depth interval, and generate a depth interval sequence according to the order of candidate disparities. The binocular image pair records, candidate disparity sequences, and depth interval sequences are associated according to the image pair order and encapsulated into binocular ranging samples.

5. The binocular vision spatial ranging method based on deep learning according to claim 1, characterized in that, The generation of the initial matching representation includes: Using shared weights, layer-by-layer two-dimensional convolution, batch normalization and linear rectification are performed on the left and right eye image data in the binocular ranging samples to generate left and right eye matching feature maps with the same spatial size and number of channels. Divide the left and right eye matching feature maps into equal number of feature groups along the channel dimension. Translate the right eye feature group along the candidate disparity sequence and align it with the left eye feature group. Fill out the out-of-bounds positions with zeros to generate candidate disparity feature group pairs. The corresponding channel feature values ​​in the candidate disparity feature pairs are multiplied pixel by pixel, the sum of the products is divided by the number of channels in each group, and the calculation results are arranged according to the candidate disparity order and feature group order to generate group correlation results. Align the depth interval sequence with the candidate disparity positions of the group correlation results, broadcast each depth interval along the spatial dimension and splice it with the group correlation results along the feature channel dimension to generate an initial matching representation.

6. The binocular vision spatial ranging method based on deep learning according to claim 1, characterized in that, The generation of disparity ranging results includes: An improved BGNet network is constructed, which includes a repeating texture disambiguation block, a distance-adaptive sampling block, a visible side mesh clipping layer, and a range deviation recalculation gate. The repeating texture disambiguation block receives the initial matching representation, locates local peaks along the candidate disparity sequence, calculates the difference between the matching value of the maximum peak and each local peak and the absolute difference between the disparity of each local peak and the median of the disparity of the peak in the spatial neighborhood, normalizes the two differences, sums them and takes the negative, generates disambiguation weights through Softmax processing, adjusts the initial matching representation according to the disambiguation weights, and generates a disambiguation matching representation. The distance adaptation sampling block receives the disambiguation matching representation, rounds up the ratio of each depth interval to the median of the depth interval to the number of subdivisions, subdivides adjacent candidate disparity intervals according to the number of subdivisions, interpolates matching values ​​along the disparity dimension and equally divides the corresponding depth intervals to generate the distance adaptation representation. The visible side mesh clipping layer receives the distance adaptation representation. After BGNet cost aggregation and bilateral mesh transformation, the right eye projection position is determined based on the left eye pixel horizontal coordinate and candidate disparity. The mesh vertex that maps to the same right eye pixel position and has the largest corresponding candidate disparity is determined as the visible side mesh vertex. Non-visible side mesh vertices and mesh vertices that project out of bounds are clipped. The interpolation weights of the mesh vertices are normalized and retained to generate the visible side cost representation. The ranging error calculation gate receives the visible side cost representation, calculates the matching probability and peak disparity along the disparity dimension, squares the cumulative depth interval between the candidate disparity and the peak disparity and sums them according to the matching probability, and takes the square root to obtain the depth discrepancy. The position where the depth discrepancy is greater than the depth interval corresponding to the peak disparity is determined as the error position. The cost of the error position is re-aggregated in the neighborhood of the peak disparity and the visible side spatial neighborhood, the matching probability and peak disparity are updated, and the disparity ranging result is generated. The improved BGNet network is trained based on the training set. The joint loss is obtained by weighting and summing the disparity regression error, repeating texture peak separation error, depth interval weighted ranging error, visible side projection consistency error, and out-of-tolerance position recalculation error. The trainable parameters of the improved BGNet network are updated using backpropagation. After each training round, the average absolute spatial ranging error of the validation set is calculated. Training stops when the average absolute spatial ranging error does not fall below the historical minimum for six consecutive rounds. The network parameters corresponding to the round with the minimum average absolute spatial ranging error are retained, and the training of the improved BGNet network is completed.

7. The binocular vision spatial ranging method based on deep learning according to claim 1, characterized in that, The step of converting peak neighborhood disparity into depth values ​​and weighting them according to matching probability includes: The product of the corrected focal length and the binocular baseline length in the calibration data is divided by the disparity of each peak neighborhood to generate a peak neighborhood depth sequence. Arrange the corresponding matching probabilities according to the candidate disparity order of the peak neighborhood disparity, and divide each matching probability by the sum of the peak neighborhood matching probabilities to generate a neighborhood probability weight sequence. The peak neighborhood depth sequence and the neighborhood probability weight sequence are multiplied one by one according to the candidate disparity order, and the products are summed to obtain the weighted depth value.

8. The binocular vision spatial ranging method based on deep learning according to claim 1, characterized in that, The generation of the corrected disparity result includes: The peak neighborhood disparity is transformed and weighted according to the matching probability to obtain the weighted depth value. The product of the corrected focal length and the binocular baseline length in the calibration data is divided by the weighted depth value to obtain the subpixel disparity. Calculate the square of the difference between the disparity of each peak neighborhood and the sub-pixel disparity, multiply each squared value by the corresponding matching probability, sum the products, divide by the sum of the peak neighborhood matching probabilities, and take the square root to obtain the disparity discrete quantity. The lower boundary of the disparity error is obtained by subtracting the disparity discrepancy from the subpixel disparity, and the upper boundary of the disparity error is obtained by adding the disparity discrepancy. The lower boundary and the upper boundary of the disparity error are truncated by the minimum and maximum values ​​of the peak neighborhood disparity, respectively. The subpixel disparity and the disparity error boundary are associated according to the pixel position to generate the corrected disparity result.

9. The binocular vision spatial ranging method based on deep learning according to claim 1, characterized in that, The generation of the spatial ranging point set includes: The product of the corrected focal length and the binocular baseline length is divided by the subpixel disparity to obtain the ranging center depth. The difference between the left eye pixel coordinates and the left eye principal point coordinates is multiplied by the ranging center depth and then divided by the corrected focal length to obtain the lateral and longitudinal coordinates, thus generating the ranging center point. The product of the corrected focal length and the binocular baseline length is divided by the upper boundary and the lower boundary of the disparity error, respectively, to obtain the near depth and far depth. Based on the left eye pixel coordinates, the left eye principal point coordinates and the corrected focal length, three-dimensional back projection is performed on the near depth and far depth to generate ranging boundary point pairs. Using the left eye pixel coordinates as the left matching position, the right matching position is obtained by subtracting the subpixel disparity from the left eye pixel's x-coordinate while keeping the y-coordinate unchanged. The spatial ranging point set is generated by associating the ranging center point, ranging boundary point pairs, and left and right matching positions according to the pixel positions.

10. The binocular vision spatial ranging method based on deep learning according to claim 1, characterized in that, The generation of binocular vision spatial ranging results includes: Based on the calibration data, construct the left and right camera projection matrices, convert the distance measurement center point and distance measurement boundary point pair in the spatial distance measurement point set into homogeneous coordinates and multiply them with the left and right camera projection matrices respectively. Take the ratio of the first two components to the third component of each product to obtain the back projection positions of the left and right images and generate back projection records. Based on the left and right image back projection positions and left and right matching positions corresponding to the distance measurement center point of the pixel position, the squares of the difference between the horizontal and vertical coordinates are added together and the square root is taken to obtain the position residuals of the left and right images. The larger position residual is determined as the closure residual, and a closure check record is generated. Based on the back projection record and the closure check record, the range of the left and right image back projection positions of the ranging boundary point pair is determined as the projection range, the maximum back projection distance between the ranging center point and the ranging boundary point pair is determined as the projection tolerance, and the ranging center point whose closure residual is not greater than the projection tolerance and whose left and right matching positions are located within the corresponding projection range is retained to generate a set of filtered ranging points. The ranging point set is sorted according to pixel position and associated with the corresponding ranging boundary point pairs to generate binocular vision spatial ranging results.