Binocular stereo matching method, device, medium and product

By constructing a binocular stereo matching model, using geometric prior guidance and parallax fusion to refine the cost volume module, combined with an efficient aggregation network, the problem of mismatching and computational efficiency in the existing technology is difficult to balance, and higher matching accuracy is achieved. and robustness.

CN118657962BActive Publication Date: 2024-10-22NANCHANG HANGKONG UNIVERSITY
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411131881.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2024-10-22
Estimated Expiration
2044-08-19

AI Technical Summary

Technical Problem

Existing binocular stereo matching methods are prone to mismatching in local ambiguous scenes such as object edges, weak textures, and occlusions, and it is difficult to balance model calculation efficiency and accuracy.

Method used

A binocular stereo matching method is adopted, including a feature extraction network, a geometric prior guidance module, a disparity fusion refinement cost volume module and an efficient aggregation module. Global structural information is obtained through the self-attention layer, geometric feature interaction layer and MLP sub-module to construct Cost volume and suppress redundant information, using efficient 3D convolution sub-modules to balance model accuracy and complexity.

Benefits of technology

It improves the reliability and robustness of disparity estimation, improves the matching accuracy in object edges, weak textures and occlusion scenes, and balances the computational efficiency and accuracy of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118657962B_ABST
    Figure CN118657962B_ABST
Patent Text Reader

Abstract

The present application discloses a binocular stereo matching method, device, medium and product, and relates to the field of binocular stereo matching. The method comprises constructing a binocular stereo matching model; and training the binocular stereo matching model using a binocular data set; the binocular stereo matching model comprises: a feature extraction network, a geometric prior guidance module, a disparity fusion refinement cost volume module and an efficient aggregation module; the geometric prior guidance module comprises: a self-attention layer, a geometric feature interaction layer and an MLP submodule; a disparity map of a binocular image pair is predicted using a trained binocular stereo matching model, and binocular stereo matching is performed based on the disparity map; the present application can improve the reliability and robustness of disparity estimation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of binocular stereo matching, and in particular to a binocular stereo matching method, device, medium and product. Background Art

[0002] Binocular stereo matching is a key research topic in the field of computer vision and image processing. It aims to obtain dense disparity values ​​by analyzing the corrected left and right eye view pairs, thereby providing reliable depth information for advanced visual tasks such as 3D reconstruction and 3D object detection. Compared with active detection technologies such as laser sensors and depth cameras, binocular stereo matching has low cost, high efficiency calculation and little environmental restrictions. Its research results are widely used in many industrial production and social life fields such as space exploration, medical diagnosis, virtual reality (AR, VR), autonomous driving, and robot control.

[0003] In recent years, there has been a large-scale application of deep learning theories and methods in the field of computer vision, and stereo matching research based on deep learning has become a hot topic. Although stereo matching methods based on deep learning have achieved remarkable results in terms of computational accuracy and robustness, when images contain local ambiguous scenes such as object edges, weak textures, and occlusions, the existing methods are prone to mismatching due to the ambiguity of pixel matching. In addition, stereo matching methods based on cost filtering require stacking a large number of 3D convolutions in the cost aggregation stage for similarity measurement, which makes the model too bloated and it is difficult to balance the computational efficiency and accuracy of the model.

[0004] Therefore, to address the above problems, there is an urgent need to provide a new stereo matching algorithm that aims to improve the matching accuracy and robustness in local ambiguous scenarios such as object edges, weak textures and occlusions, and to balance the relationship between model accuracy and complexity. Summary of the invention

[0005] The purpose of this application is to provide a binocular stereo matching method, device, medium and product, which can improve the reliability and robustness of disparity estimation.

[0006] To achieve the above objectives, this application provides the following solutions:

[0007] In a first aspect, the present application provides a binocular stereo matching method, the binocular stereo matching method comprising:

[0008] Construct a binocular stereo matching model; and use the binocular data set to train the binocular stereo matching model; the binocular stereo matching model includes: a feature extraction network, a geometric prior guidance module, a disparity fusion refinement cost volume module and an efficient aggregation module; the geometric prior guidance module includes: a self-attention layer, a geometric feature interaction layer and an MLP submodule;

[0009] The trained binocular stereo matching model is used to predict the disparity map of the binocular image pair, and the binocular stereo matching is performed according to the disparity map; the binocular image pair includes: a left image and a right image;

[0010] The process of predicting the disparity map of a binocular image pair using the trained binocular stereo matching model is as follows:

[0011] The features of the left image and the right image are respectively extracted using a feature extraction network to obtain the features of the left image and the features of the right image;

[0012] Preprocessing the left image features and the right image features; the preprocessing includes: adding fixed two-dimensional sine and cosine position codes;

[0013] The self-attention layer is used to determine the self-attention features of the left image and the self-attention features of the right image respectively;

[0014] Determine the affinity feature used to measure the left image and the right image according to the similarity score between each pair of pixels in the self-attention feature of the left image and the self-attention feature of the right image;

[0015] The affinity feature and the cross attention layer are fused together to form a geometric feature interaction layer, and the geometric feature interaction layer is used to integrate the geometric prior information of the left image and the right image to obtain the geometric interaction features of the left image and the geometric interaction features of the right image;

[0016] The MLP submodule is used to concatenate the left image features and the corresponding geometric interaction features to obtain the left image feature representation; at the same time, the MLP submodule is used to concatenate the right image features and the corresponding geometric interaction features to obtain the right image feature representation;

[0017] The feature representation of the left image and the feature representation of the right image at each disparity level are spliced ​​to obtain an initial spliced ​​cost volume;

[0018] Determine a correlation matrix according to the feature similarity between each position in the feature representation of the left image and the feature representation of the right image along the one-dimensional horizontal direction, perform softmax operation, mask operation and weighted average on the correlation matrix to obtain a one-dimensional correspondence, and determine the disparity feature according to the difference between the corresponding coordinates of the one-dimensional correspondence and the one-dimensional correspondence;

[0019] The disparity features are concatenated and fused with the initial concatenated cost volume along the channel dimension to form a disparity fused refined cost volume;

[0020] The 3D convolution submodule in the efficient aggregation module is used to perform convolution operations on the disparity fusion refined cost volume;

[0021] The aggregation submodule in the efficient aggregation module is used to extract the underlying features of the disparity fusion refined cost volume after the convolution operation; the aggregation submodule includes 4 3D convolution submodules;

[0022] Predict disparity map based on low-level features.

[0023] Optionally, the feature extraction network is: a unary feature extraction module of a weight sharing mechanism; the unary feature extraction module is used to extract unary feature information.

[0024] Optionally, the MLP submodule adopts a two-layer feedforward network.

[0025] Optionally, the 3D convolution submodule is connected to the aggregation submodule using a three-dimensional convolution kernel of size 1×1×1 to obtain an efficient aggregation module.

[0026] Optionally, predicting the disparity map according to the underlying features specifically includes:

[0027] Each underlying feature uses two 3D convolutions to output a 4-dimensional tensor with a channel number of 1;

[0028] Each 4D tensor is upsampled to the original resolution along the disparity dimension and converted to a probability tensor through the softmax function;

[0029] According to the probability tensor, the soft-argmin function is used to obtain the disparity map.

[0030] In a second aspect, the present application provides a binocular stereo matching device, the binocular stereo matching device comprising:

[0031] A binocular stereo matching model construction training module is used to construct a binocular stereo matching model; and a binocular stereo matching model is trained using a binocular data set; the binocular stereo matching model includes: a feature extraction network, a geometric prior guidance module, a disparity fusion refinement cost volume module and an efficient aggregation module; the geometric prior guidance module includes: a self-attention layer, a geometric feature interaction layer and an MLP submodule;

[0032] The disparity map prediction module is used to predict the disparity map of the binocular image pair using the trained binocular stereo matching model, and perform binocular stereo matching based on the disparity map; the binocular image pair includes: a left image and a right image;

[0033] The process of predicting the disparity map of a binocular image pair using the trained binocular stereo matching model is as follows:

[0034] The features of the left image and the right image are respectively extracted using a feature extraction network to obtain the features of the left image and the features of the right image;

[0035] Preprocessing the left image features and the right image features; the preprocessing includes: adding fixed two-dimensional sine and cosine position codes;

[0036] The self-attention layer is used to determine the self-attention features of the left image and the self-attention features of the right image respectively;

[0037] Determine the affinity feature used to measure the left image and the right image according to the similarity score between each pair of pixels in the self-attention feature of the left image and the self-attention feature of the right image;

[0038] The affinity feature and the cross attention layer are fused together to form a geometric feature interaction layer, and the geometric feature interaction layer is used to integrate the geometric prior information of the left image and the right image to obtain the geometric interaction features of the left image and the geometric interaction features of the right image;

[0039] The MLP submodule is used to concatenate the left image features and the corresponding geometric interaction features to obtain the left image feature representation; at the same time, the MLP submodule is used to concatenate the right image features and the corresponding geometric interaction features to obtain the right image feature representation;

[0040] The feature representation of the left image and the feature representation of the right image at each disparity level are spliced ​​to obtain an initial spliced ​​cost volume;

[0041] Determine a correlation matrix according to the feature similarity between each position in the feature representation of the left image and the feature representation of the right image along the one-dimensional horizontal direction, perform softmax operation, mask operation and weighted average on the correlation matrix to obtain a one-dimensional correspondence, and determine the disparity feature according to the difference between the corresponding coordinates of the one-dimensional correspondence and the one-dimensional correspondence;

[0042] The disparity features are concatenated and fused with the initial concatenated cost volume along the channel dimension to form a disparity fused refined cost volume;

[0043] The 3D convolution submodule in the efficient aggregation module is used to perform convolution operations on the disparity fusion refined cost volume;

[0044] The aggregation submodule in the efficient aggregation module is used to extract the underlying features of the disparity fusion refined cost volume after the convolution operation; the aggregation submodule includes 4 3D convolution submodules;

[0045] Predict disparity map based on low-level features.

[0046] In a third aspect, the present application provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the binocular stereo matching method.

[0047] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the binocular stereo matching method when executed by a processor.

[0048] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the binocular stereo matching method when executed by a processor.

[0049] According to the specific embodiments provided in this application, this application discloses the following technical effects:

[0050] The present application provides a binocular stereo matching method, device, medium and product. By constructing a binocular stereo matching model, the binocular stereo matching model includes: a feature extraction network, a geometric prior guidance module, a disparity fusion refinement cost volume module and an efficient aggregation module; the global structure information is obtained through the geometric prior guidance module to achieve more sufficient feature information extraction; the cost volume is constructed through the disparity fusion refinement cost volume module, the disparity-related geometric features are introduced into the spliced ​​volume and its redundant information is suppressed to provide a better similarity measurement; the reliability and robustness of the disparity estimation are ensured through the efficient aggregation module. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0052] Figure 1 This is a diagram of an application environment of a binocular stereo matching method in one embodiment of the present application.

[0053] Figure 2 A flowchart of a binocular stereo matching method provided in one embodiment of the present application.

[0054] Figure 3 This is a schematic diagram of the image on the left in the embodiment of the present application.

[0055] Figure 4 This is a schematic diagram of the image on the right in the embodiment of the present application.

[0056] Figure 5 This is a structural diagram of the geometric prior guidance module in an embodiment of the present application.

[0057] Figure 6 This is a schematic diagram of the initial splicing volume construction in the embodiment of the present application.

[0058] Figure 7Schematic diagram of the parallax feature acquisition process in the embodiment of the present application.

[0059] Figure 8 Schematic diagram of the parallax fusion refinement strategy in the embodiment of the present application.

[0060] Fig. 9 This is a diagram of the efficient 3D convolution structure in an embodiment of the present application.

[0061] Fig.10 This is a structural diagram of the efficient aggregation module in the embodiment of the present application. DETAILED DESCRIPTION

[0062] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0063] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0064] The binocular stereo matching method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be set up separately, or it can be integrated on the server 104, or it can be placed on the cloud or other servers. The terminal 102 can send the binocular image pair to the server 104. After the server 104 receives the binocular image pair, for the binocular image pair, the server 104 uses the trained binocular stereo matching model to predict the disparity map of the binocular image pair, and performs binocular stereo matching based on the disparity map. The server 104 can feedback the obtained binocular stereo matching result to the terminal 102. In addition, in some embodiments, the binocular stereo matching method can also be implemented by the server 104 or the terminal 102 alone, such as the binocular image pair can be directly processed by the terminal 102, or the server 104 can obtain the binocular image pair from the data storage system and process the binocular image pair.

[0065] The terminal 102 may be, but is not limited to, various desktop computers, laptop computers, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart vehicle-mounted devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers, or may be a cloud server.

[0066] In an exemplary embodiment, Figure 2 As shown, a binocular stereo matching method is provided. The method is executed by a computer device, and can be executed by a computer device such as a terminal or a server alone, or by a terminal and a server together. In the embodiment of the present application, the method is applied to Figure 1 The server 104 in the example is used for explanation, including the following S201 to S202. Wherein: S201, constructing a binocular stereo matching model; and using a binocular data set to train the binocular stereo matching model; the binocular stereo matching model includes: a feature extraction network, a geometric prior guidance module, a disparity fusion refinement cost volume module and an efficient aggregation module; the geometric prior guidance module includes: a self-attention layer, a geometric feature interaction layer and a multilayer perceptron (MLP) submodule.

[0067] S202, using the trained binocular stereo matching model to predict a disparity map of a binocular image pair, and performing binocular stereo matching according to the disparity map; the binocular image pair includes: a left image and a right image.

[0068] The process of predicting the disparity map of a binocular image pair using the trained binocular stereo matching model is as follows:

[0069] S1, using the feature extraction network to extract the features of the left image and the right image respectively, to obtain the features of the left image and the features of the right image;

[0070] S2, preprocessing the left image features and the right image features; the preprocessing includes: adding fixed two-dimensional sine and cosine position codes;

[0071] S3, using the self-attention layer to determine the self-attention features of the left image and the self-attention features of the right image respectively;

[0072] S4, determining an affinity feature for measuring the left image and the right image according to a similarity score between each pair of pixels in the self-attention feature of the left image and the self-attention feature of the right image;

[0073] S5, the affinity feature and the cross attention layer are fused together to form a geometric feature interaction layer, and the geometric feature interaction layer is used to integrate the geometric prior information of the left image and the right image to obtain the geometric interaction features of the left image and the geometric interaction features of the right image;

[0074] S6, using the MLP submodule to splice the left image features and the corresponding geometric interaction features to obtain the left image feature representation; at the same time, using the MLP submodule to splice the right image features and the corresponding geometric interaction features to obtain the right image feature representation;

[0075] S7, stitching the left image feature representation and the right image feature representation of each disparity level to obtain an initial stitching cost volume;

[0076] S8, determining a correlation matrix according to the feature similarity between each position in the feature representation of the left image and the feature representation of the right image along the one-dimensional horizontal direction, performing a softmax operation, a mask operation and a weighted average on the correlation matrix to obtain a one-dimensional correspondence, and determining a disparity feature according to the difference between the corresponding coordinates of the one-dimensional correspondence and the one-dimensional correspondence;

[0077] S9, concatenating and fusing the disparity feature with the initial concatenated cost volume along the channel dimension to form a disparity fused refined cost volume;

[0078] S10, using the 3D convolution submodule in the efficient aggregation module to perform a convolution operation on the disparity fusion refined cost volume;

[0079] S11, using the aggregation submodule in the efficient aggregation module to extract underlying features from the disparity fusion refined cost volume after the convolution operation; the aggregation submodule includes 4 3D convolution submodules;

[0080] S12, predicting a disparity map based on underlying features.

[0081] It can be seen from the above steps that the binocular stereo matching method of the present application is a stereo matching method based on geometric prior guidance and parallax fusion refinement; the specific steps are:

[0082] Construct a binocular stereo matching model, wherein constructing the binocular stereo matching model requires constructing a feature extraction network, a geometric prior guidance module, a disparity fusion refinement cost volume module, and an efficient aggregation module in sequence.

[0083] First, build a feature extraction network:

[0084] The feature extraction network uses a unary feature extraction module with a weight sharing mechanism. Figure 3 and Figure 4The left and right images shown in the figure are processed to extract the corresponding unary feature information. This unary feature extraction network adopts an architecture similar to ResNet, and its basic building block is the 2D convolution layer. In the initial stage, the network operates through three 3x3 2D convolution layers, which share the same receptive field size in order to achieve multi-level extraction of image features. Going deeper, four larger residual blocks are embedded in the network structure, each of which is composed of several small residual blocks. Specifically, these four large residual blocks contain 3, 16, 3, and 3 small residual blocks respectively. The small residual block consists of two 2D convolution layers, and the Relu activation function and batch normalization function are connected in turn after each convolution layer.

[0085] Second, construct a geometric prior guidance module:

[0086] like Figure 5 As shown in the figure, to supplement the missing spatial information of the left and right image features, fixed two-dimensional sine and cosine position encodings are added to the left and right image features. The introduction of position information allows the matching process to consider not only feature similarity but also their spatial distance, which helps to resolve ambiguity and improve the model prediction performance. The features are input to the self-attention layer, which further improves the feature quality by considering a larger context and receptive field than the convolutional layer. Left image features After feature transformation, we can obtain the query corresponding to the image feature on the left. ,key Sum For the self-attention mechanism, the query, key, and value in the attention mechanism all come from the same feature. Using the self-attention mechanism, the self-attention feature of the image feature on the left can be calculated :

[0087] (1)

[0088] Among them, T represents the transposition operation, and the self-attention feature The dimension is , C is the number of feature channels, H is the height of the feature, and W is the width of the feature. By performing self-attention calculation, we can get the self-attention features of the image features on the right. .

[0089] By calculation and The similarity score between each pair of pixels in is used to obtain the affinity feature P used to measure the left and right views. The size of the affinity feature P is .

[0090] The affinity feature and the cross attention layer are fused together to form a geometric feature interaction layer, which is used to integrate the geometric prior information in the left and right views. For cross attention, according to the self-attention feature Calculate the key vector Sum value vector , according to the self-attention feature Calculate the query vector . According to the query vector and key vector Multiply the corresponding elements one by one to get the cross attention weight matrix E. The dimension of the cross attention weight matrix E is The affinity feature P is fused with the cross attention weight matrix E to obtain the geometric feature interaction weight matrix (GFW), as Figure 5 As shown, Represents fusion, Figure 5 middle, To fuse the affinity feature P with the cross attention weight matrix E, GFW is:

[0091] (2)

[0092] Geometric interaction feature based on the left image feature Depend on With value vector Multiplying together gives:

[0093] (3)

[0094] In order to further improve the expression and modeling capabilities of the network, a two-layer feed-forward network (FFN) is used to form the MLP submodule. It is concatenated with the original left image features to obtain the feature representation of the left image. And in the same way, the feature representation of the right image containing geometric interaction features can be obtained .

[0095] Third, construct the initial stitching volume:

[0096] Figure 6 The cost volume constructed based on the stitching method is shown. Figure 6In , the left and right feature maps are represented in black, the zero padding operation is marked with a solid red line, and the pruning operation is represented by a dotted red line. For zero disparity, the corresponding matching cost can be obtained by directly concatenating the left and right feature maps, and its dimension is 2C×H / 4×W / 4, where the dimensions of the left and right feature maps are both C×H / 4×W / 4. As the disparity value increases to 1, the sub-images from columns 1 to W / 4 are cut from the left image feature map, and the sub-images from columns 0 to W / 4-1 are cut from the right image feature map, and these two sub-images are cascaded to obtain the matching cost for the disparity value of 1. Similarly, for any disparity value i, the sub-images from columns i to W / 4 of the left image feature map and the sub-images from columns 0 to W / 4-i of the right image feature map are selected and cascaded. After traversing all possible disparity values, the matching cost at each disparity value can be obtained, and these costs are connected in series along the disparity direction to form the final cost volume.

[0097] Feature representation of the left image And the feature representation of the image on the right The size of is C×H / 4×W / 4. By representing the feature of the left image at each disparity level And the feature representation of the image on the right Splice them together to get the initial splicing cost volume :

[0098] (4)

[0099] Among them, the initial splicing cost volume The size is , d represents the parallax level, Represents the maximum parallax range.

[0100] Fourth, obtain the disparity features:

[0101] The goal of stereo matching is to find the per-pixel differences (one-dimensional correspondences) along horizontal scan lines between pairs of rectified stereo views, which can be computed by finding one-dimensional pixel-dense correspondences on the image plane. To achieve this, we directly compare the two images by computing their correlation (i.e., global matching). Each position and Along the one-dimensional horizontal direction The similarity of features. Figure 7 As shown, this can be efficiently implemented using simple matrix multiplication:

[0102] (5)

[0103] The correlation matrix The value of each element in is The point with coordinates (i, j) and The correlation calculation results between the points with coordinates (k, l) are: is a normalization factor to avoid too large values ​​after the dot product operation.

[0104] In order to obtain dense correspondences, a softmax matching layer is used. Specifically, the last dimension of the correlation matrix is ​​first normalized using a softmax operation to obtain a matching distribution:

[0105] (6)

[0106] Considering that the correspondence of each pixel in the left image is located to the left of its reference pixel, the matching distribution The upper triangular part of the W × W dimension in the image is masked to avoid unnecessary matching calculations. Then, all possible horizontal positions P = [0, 1, 2, ···, W-1] are calculated. The matching distribution of The weighted average of :

[0107] (7)

[0108] Finally, by computing the one-dimensional horizontal pixel grid (Only store horizontal coordinates) corresponding coordinates and The difference between :

[0109] (8)

[0110] In order to obtain the accurate disparity features of the initial spliced ​​body, a disparity feature refinement network with an encoder-decoder structure is used to optimize its details, and then upsampled to the original resolution to use the real value disparity to supervise the disparity features. .

[0111] Fifth, construct the parallax fusion refinement cost volume:

[0112] In obtaining the disparity feature Then, the disparity feature and the initial splicing volume The splicing and fusion along the channel dimension form a disparity fusion refinement cost volume, which provides disparity prior information for the initial splicing volume, eliminates redundant information, and enhances its representation ability. Figure 8 Schematic diagram of the cost volume refined for parallax fusion. Figure 8 middle, To transform the disparity feature and the initial splicing volume Concatenate and fuse along the channel dimension.

[0113] Sixth, build an efficient aggregation network:

[0114] First, we build a 3D convolution submodule (preprocessing submodule). We use deep convolution to keep some channels unchanged and represent them as the same mapping branch. For the channels that need to be processed, we use 3×3×3 as one of the branches to avoid using large convolution kernels. Decompose into , , Calculate. Specifically, for the input feature X, divide X into five groups along the channel dimension:

[0115] (9)

[0116] Where g represents the number of channels in the convolution branch; setting the ratio Control the number of branch channels g = Next, each convolution branch Send to different parallel branches for calculation and get the calculation results of the branches , , , , :

[0117] (10)

[0118] in, Indicates the size of the small convolution kernel used to calculate the disparity dimension and spatial dimension features. The default setting is 3; Indicates the large-size convolution kernel size used to calculate the corresponding dimension features of the remaining branches, and the default setting is 7. Finally, the calculation results of each branch are concatenated to get the output:

[0119] (11)

[0120] After obtaining the 3D convolution submodule, the aggregation submodule (hourglass architecture encoding stage) is constructed, as Fig. 9 As shown in Figure 1. The cost volume is first processed using a preprocessing submodule, which consists of four 3D convolution submodules with batch normalization and ReLU activation functions. The aggregation submodule is used to extract low-level features and provide detailed information for the final disparity prediction as the geometry of the disparity map.

[0121] In the encoding phase of the hourglass architecture, four rounds of efficient 3D convolution block operations were implemented. Specifically, after the second and fourth rounds of convolution block operations, the average pooling layer and downsampling technology were introduced to not only reduce the spatial dimension of the feature map, but also double the number of feature channels. In view of the implementation of two downsamplings in the encoding process, the decoding phase adopts two upsampling strategies accordingly, that is, the three-dimensional deconvolution technology with a kernel size of 3×3×3 is used to restore the resolution of the image. At the same time, the number of feature channels is also increasing.

[0122] Finally, a 1×1×1 three-dimensional convolution kernel is used to directly connect the preprocessing module with the hourglass network structure to form an efficient aggregation network. This not only effectively reduces the amount of computational parameters of the model, but also enhances the representation ability of the network by supplementing the contextual information of the output features.

[0123] Seventh, disparity prediction:

[0124] Four outputs are obtained in cost aggregation, see Fig.10 For each output, two 3D convolutions are used to calculate the output of a 4-dimensional tensor with a channel number of 1, which is then upsampled to the original resolution along the disparity dimension and converted into a probability tensor through the softmax function. Finally, the prediction value is calculated through the soft-argmin function:

[0125] (12)

[0126] Where k represents the parallax level, Representing the probability size corresponding to different levels of disparity, the four output predicted disparity maps are represented as d0, d1, d2 and d3 respectively.

[0127] This application obtains left and right image features from the input left and right image pairs through a feature extraction network, and uses a geometric prior guidance module to obtain global structural information to achieve more comprehensive feature information extraction; secondly, an initial stitching volume is constructed, and disparity features are obtained through global matching, and a cost volume is constructed using a disparity fusion refinement strategy to suppress redundant information in the initial stitching volume to provide a better similarity measurement; an efficient 3D convolution is designed and used to construct an efficient aggregation network to balance the relationship between model matching accuracy and complexity; finally, the final disparity calculation result is output through a multi-level hourglass structure in the aggregation network.

[0128] Based on the same inventive concept, the embodiment of the present application also provides a binocular stereo matching device for implementing the binocular stereo matching method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more binocular stereo matching device embodiments provided below can refer to the limitations of the binocular stereo matching method above, and will not be repeated here.

[0129] In an exemplary embodiment, a binocular stereo matching device is provided, comprising:

[0130] A binocular stereo matching model construction training module is used to construct a binocular stereo matching model; and a binocular stereo matching model is trained using a binocular data set; the binocular stereo matching model includes: a feature extraction network, a geometric prior guidance module, a disparity fusion refinement cost volume module and an efficient aggregation module; the geometric prior guidance module includes: a self-attention layer, a geometric feature interaction layer and an MLP submodule;

[0131] The disparity map prediction module is used to predict the disparity map of the binocular image pair using the trained binocular stereo matching model, and perform binocular stereo matching based on the disparity map; the binocular image pair includes: a left image and a right image;

[0132] The process of predicting the disparity map of a binocular image pair using the trained binocular stereo matching model is as follows:

[0133] The features of the left image and the right image are respectively extracted using a feature extraction network to obtain the features of the left image and the features of the right image;

[0134] Preprocessing the left image features and the right image features; the preprocessing includes: adding fixed two-dimensional sine and cosine position codes;

[0135] The self-attention layer is used to determine the self-attention features of the left image and the self-attention features of the right image respectively;

[0136] Determine the affinity feature used to measure the left image and the right image according to the similarity score between each pair of pixels in the self-attention feature of the left image and the self-attention feature of the right image;

[0137] The affinity feature and the cross attention layer are fused together to form a geometric feature interaction layer, and the geometric feature interaction layer is used to integrate the geometric prior information of the left image and the right image to obtain the geometric interaction features of the left image and the geometric interaction features of the right image;

[0138] The MLP submodule is used to concatenate the left image features and the corresponding geometric interaction features to obtain the left image feature representation; at the same time, the MLP submodule is used to concatenate the right image features and the corresponding geometric interaction features to obtain the right image feature representation;

[0139] The feature representation of the left image and the feature representation of the right image at each disparity level are spliced ​​to obtain an initial spliced ​​cost volume;

[0140] Determine a correlation matrix according to the feature similarity between each position in the feature representation of the left image and the feature representation of the right image along the one-dimensional horizontal direction, perform softmax operation, mask operation and weighted average on the correlation matrix to obtain a one-dimensional correspondence, and determine the disparity feature according to the difference between the corresponding coordinates of the one-dimensional correspondence and the one-dimensional correspondence;

[0141] The disparity features are concatenated and fused with the initial concatenated cost volume along the channel dimension to form a disparity fused refined cost volume;

[0142] The 3D convolution submodule in the efficient aggregation module is used to perform convolution operations on the disparity fusion refined cost volume;

[0143] The aggregation submodule in the efficient aggregation module is used to extract the underlying features of the disparity fusion refined cost volume after the convolution operation; the aggregation submodule includes 4 3D convolution submodules;

[0144] Predict disparity map based on low-level features.

[0145] In an exemplary embodiment, a computer device is provided, which may be a server or a terminal. The computer device includes a processor, a memory, an input / output interface (I / O for short) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store binocular image pairs. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a binocular stereo matching method is implemented.

[0146] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0147] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0148] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0149] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

[0150] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.

[0151] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0152] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A binocular stereo matching method, It is characterized in that The binocular stereo matching method comprises: Construct a binocular stereo matching model; and use the binocular data set to train the binocular stereo matching model; the binocular stereo matching model includes: a feature extraction network, a geometric prior guidance module, a disparity fusion refinement cost volume module and an efficient aggregation module; the geometric prior guidance module includes: a self-attention layer, a geometric feature interaction layer and an MLP submodule; The trained binocular stereo matching model is used to predict the disparity map of the binocular image pair, and the binocular stereo matching is performed according to the disparity map; the binocular image pair includes: a left image and a right image; The process of predicting the disparity map of a binocular image pair using the trained binocular stereo matching model is as follows: The features of the left image and the right image are respectively extracted using a feature extraction network to obtain the features of the left image and the features of the right image; Preprocessing the left image features and the right image features; the preprocessing includes: adding fixed two-dimensional sine and cosine position codes; The self-attention layer is used to determine the self-attention features of the left image and the self-attention features of the right image respectively; Determine the affinity feature used to measure the left image and the right image according to the similarity score between each pair of pixels in the self-attention feature of the left image and the self-attention feature of the right image; The affinity feature and the cross attention layer are fused together to form a geometric feature interaction layer, and the geometric feature interaction layer is used to integrate the geometric prior information of the left image and the right image to obtain the geometric interaction features of the left image and the geometric interaction features of the right image; The MLP submodule is used to concatenate the left image features and the corresponding geometric interaction features to obtain the left image feature representation; at the same time, the MLP submodule is used to concatenate the right image features and the corresponding geometric interaction features to obtain the right image feature representation; The feature representation of the left image and the feature representation of the right image at each disparity level are spliced ​​to obtain an initial spliced ​​cost volume; Determine a correlation matrix according to the feature similarity between each position in the feature representation of the left image and the feature representation of the right image along the one-dimensional horizontal direction, perform softmax operation, mask operation and weighted average on the correlation matrix to obtain a one-dimensional correspondence, and determine the disparity feature according to the difference between the corresponding coordinates of the one-dimensional correspondence and the one-dimensional correspondence; The disparity features are concatenated and fused with the initial concatenated cost volume along the channel dimension to form a disparity fused refined cost volume; The 3D convolution submodule in the efficient aggregation module is used to perform convolution operations on the disparity fusion refined cost volume; The aggregation submodule in the efficient aggregation module is used to extract the underlying features of the disparity fusion refined cost volume after the convolution operation; the aggregation submodule includes 4 3D convolution submodules; Predict disparity map based on low-level features.

2. The binocular stereo matching method according to claim 1, It is characterized in that The feature extraction network is: a unary feature extraction module with a weight sharing mechanism; the unary feature extraction module is used to extract unary feature information.

3. The binocular stereo matching method according to claim 1, It is characterized in that The MLP submodule adopts a two-layer feed-forward network.

4. The binocular stereo matching method according to claim 1, It is characterized in that The 3D convolution submodule is connected to the aggregation submodule using a three-dimensional convolution kernel of size 1×1×1 to obtain an efficient aggregation module.

5. The binocular stereo matching method according to claim 1, It is characterized in that The predicting of the disparity map according to the underlying features specifically includes: Each underlying feature uses two 3D convolutions to output a 4-dimensional tensor with a channel number of 1; Each 4D tensor is upsampled to the original resolution along the disparity dimension and converted to a probability tensor through the softmax function; According to the probability tensor, the soft-argmin function is used to obtain the disparity map.

6. A binocular stereo matching device, It is characterized in that The binocular stereo matching device comprises: A binocular stereo matching model construction training module is used to construct a binocular stereo matching model; and a binocular stereo matching model is trained using a binocular data set; the binocular stereo matching model includes: a feature extraction network, a geometric prior guidance module, a disparity fusion refinement cost volume module and an efficient aggregation module; the geometric prior guidance module includes: a self-attention layer, a geometric feature interaction layer and an MLP submodule; The disparity map prediction module is used to predict the disparity map of the binocular image pair using the trained binocular stereo matching model, and perform binocular stereo matching based on the disparity map; the binocular image pair includes: a left image and a right image; The process of predicting the disparity map of a binocular image pair using the trained binocular stereo matching model is as follows: The features of the left image and the right image are respectively extracted using a feature extraction network to obtain the features of the left image and the features of the right image; Preprocessing the left image features and the right image features; the preprocessing includes: adding fixed two-dimensional sine and cosine position codes; The self-attention layer is used to determine the self-attention features of the left image and the self-attention features of the right image respectively; Determine the affinity feature used to measure the left image and the right image according to the similarity score between each pair of pixels in the self-attention feature of the left image and the self-attention feature of the right image; The affinity feature and the cross attention layer are fused together to form a geometric feature interaction layer, and the geometric feature interaction layer is used to integrate the geometric prior information of the left image and the right image to obtain the geometric interaction features of the left image and the geometric interaction features of the right image; The MLP submodule is used to concatenate the left image features and the corresponding geometric interaction features to obtain the left image feature representation; at the same time, the MLP submodule is used to concatenate the right image features and the corresponding geometric interaction features to obtain the right image feature representation; The feature representation of the left image and the feature representation of the right image at each disparity level are spliced ​​to obtain an initial spliced ​​cost volume; Determine a correlation matrix according to the feature similarity between each position in the feature representation of the left image and the feature representation of the right image along the one-dimensional horizontal direction, perform softmax operation, mask operation and weighted average on the correlation matrix to obtain a one-dimensional correspondence, and determine the disparity feature according to the difference between the corresponding coordinates of the one-dimensional correspondence and the one-dimensional correspondence; The disparity features are concatenated and fused with the initial concatenated cost volume along the channel dimension to form a disparity fused refined cost volume; The 3D convolution submodule in the efficient aggregation module is used to perform convolution operations on the disparity fusion refined cost volume; The aggregation submodule in the efficient aggregation module is used to extract the underlying features of the disparity fusion refined cost volume after the convolution operation; the aggregation submodule includes 4 3D convolution submodules; Predict disparity map based on low-level features.

7. A computer device, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the binocular stereo matching method according to any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the binocular stereo matching method according to any one of claims 1 to 5 is implemented.

9. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the binocular stereo matching method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Visual saliency prediction method based on binocular parallax offset fusion

    CN113066074A

  • Binocular stereo vision matching network construction method and binocular stereo vision matching method

    CN117152580A

  • Binocular stereo matching model training method and device, equipment and storage medium

    CN118115762A

  • Binocular image super-resolution reconstruction method and system based on parallax guidance

    CN118297808A

  • Stereo matching method and system based on double-feature extractor and gated attention

    CN118314181A