Three-dimensional reconstruction method, device, electronic device and storage medium

By obtaining feature enhancement and depth prediction of perspective images, the initial depth range of 3D reconstruction is provided, solving the problems of low efficiency and low quality of 3D reconstruction, and achieving a more efficient and reliable 3D reconstruction process.

CN118485785BActive Publication Date: 2024-09-24IFLYTEK CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410948625.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-16
Publication Date
2024-09-24
Estimated Expiration
2044-07-16

AI Technical Summary

Technical Problem

Existing 3D reconstruction algorithms are inefficient and prone to falling into local optimal solutions, resulting in low 3D reconstruction quality.

Method used

By acquiring at least two perspective images, feature enhancement and depth prediction are performed based on the correlation of perspective map features, and the predicted depth range is obtained as the initial depth range of the stereo matching algorithm, and then three-dimensional reconstruction is performed.

Benefits of technology

It improves the efficiency and quality of three-dimensional reconstruction, reduces the risk of falling into a local optimal solution during iterative optimization, and ensures the reliability of the predicted depth range.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118485785B
    Figure CN118485785B
Patent Text Reader

Abstract

The present invention relates to the field of image processing technology, and provides a three-dimensional reconstruction method, device, electronic device and storage medium, wherein the method comprises: acquiring at least two perspective images; based on the correlation between the perspective map features of the at least two perspective images, performing feature enhancement on each perspective map feature to obtain the enhanced map features of each perspective image, and performing depth prediction based on the enhanced map features of each perspective image to obtain a predicted depth range; using the predicted depth range as the initial depth range of a stereo matching algorithm, and applying the stereo matching algorithm to perform three-dimensional reconstruction based on at least two perspective images. The method, device, electronic device and storage medium provided by the present invention use the predicted depth range as the initial depth range, which can reduce the error between the initial depth range and the actual depth situation, improve the iterative optimization efficiency of three-dimensional reconstruction, and reduce the risk of falling into a local optimal solution, thereby improving the efficiency of three-dimensional reconstruction and ensuring the quality of three-dimensional reconstruction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a three-dimensional reconstruction method, device, electronic equipment and storage medium. Background Art

[0002] Three-dimensional reconstruction refers to the establishment of a mathematical model suitable for computer representation and processing of three-dimensional objects. It is the basis for processing, operating and analyzing its properties in a computer environment. It is also a key technology for establishing virtual reality in computers to express the objective world.

[0003] In the current 3D reconstruction algorithm, multiple rounds of propagation algorithms, such as spatial propagation and perspective transmission, are required to continuously optimize the quality of iterative point clouds in order to achieve point cloud construction. This algorithm relies too much on the serial optimization process during execution, resulting in low efficiency of the 3D reconstruction process. In addition, during the iterative optimization process, it is easy to fall into a local optimal solution, which affects the quality of 3D reconstruction. Summary of the invention

[0004] The present invention provides a three-dimensional reconstruction method, device, electronic device and storage medium, which are used to solve the defects of low efficiency and low quality of three-dimensional reconstruction in related technologies.

[0005] The present invention provides a three-dimensional reconstruction method, comprising:

[0006] Acquire at least two perspective images;

[0007] Based on the correlation between the perspective image features of the at least two perspective images, feature enhancement is performed on each perspective image feature to obtain an enhanced image feature of each perspective image, and depth prediction is performed based on the enhanced image feature of each perspective image to obtain a predicted depth range;

[0008] The predicted depth range is used as an initial depth range of a stereo matching algorithm, and the stereo matching algorithm is applied to perform three-dimensional reconstruction based on the at least two perspective images.

[0009] According to a 3D reconstruction method provided by the present invention, based on the correlation between the view graph features of the at least two view images, the feature enhancement of each view graph feature is performed to obtain the enhanced graph feature of each view image, including:

[0010] Based on the correlation between the perspective graph features of the at least two perspective images, performing attention interaction on each perspective graph feature to obtain an interaction graph feature of each perspective image;

[0011] Channel filtering is performed on the interaction graph features of each viewing angle image to obtain an enhanced feature map of each viewing angle image.

[0012] A three-dimensional reconstruction method provided by the present invention further includes:

[0013] Based on the enhanced image features of each viewing angle image, image restoration is performed on each viewing angle image to obtain a restored image of each viewing angle image;

[0014] The applying the stereo matching algorithm to perform three-dimensional reconstruction based on the at least two perspective images includes:

[0015] The stereo matching algorithm is applied to perform three-dimensional reconstruction based on the restored images of the at least two perspective images.

[0016] According to a three-dimensional reconstruction method provided by the present invention, the feature enhancement, depth prediction and image restoration are performed based on a restoration prediction model;

[0017] The restoration prediction model is trained based on sample images of at least two viewing angles, sample restoration images of at least two viewing angles, and depth values ​​corresponding to the sample images of at least two viewing angles.

[0018] According to a three-dimensional reconstruction method provided by the present invention, the three-dimensional reconstruction is performed based on the at least two perspective images by applying the stereo matching algorithm, including:

[0019] Perturbing the color attributes of the at least two viewing angle images to obtain color perturbed images of the at least two viewing angle images;

[0020] Applying the stereo matching algorithm to iterate the initial depth range based on the color perturbation images of the at least two perspective images to obtain a first depth map;

[0021] Perform three-dimensional reconstruction based on the first depth map.

[0022] According to a three-dimensional reconstruction method provided by the present invention, the color attribute includes at least one of chroma, brightness and saturation;

[0023] The step of applying the stereo matching algorithm to iterate the initial depth range based on the color perturbation images of the at least two perspective images to obtain a first depth map includes:

[0024] Applying the stereo matching algorithm, based on color perturbation images of at least two perspective images corresponding to at least one color attribute, iterates the initial depth range to obtain a depth map under at least one color attribute;

[0025] The first depth map is determined based on a depth map under at least one color attribute.

[0026] According to a three-dimensional reconstruction method provided by the present invention, performing three-dimensional reconstruction based on the first depth map includes:

[0027] Applying the stereo matching algorithm to iterate the initial depth range based on the feature maps of at least two scales of the at least two perspective images to obtain a second depth map;

[0028] Perform three-dimensional reconstruction based on the first depth map and the second depth map.

[0029] The present invention also provides a three-dimensional reconstruction device, comprising:

[0030] An image acquisition unit, used to acquire at least two perspective images;

[0031] a depth prediction unit, configured to perform feature enhancement on each view image feature based on the correlation between the view image features of the at least two view images to obtain an enhanced image feature of each view image, and perform depth prediction based on the enhanced image feature of each view image to obtain a predicted depth range;

[0032] The three-dimensional reconstruction unit is used to use the predicted depth range as an initial depth range of a stereo matching algorithm, and apply the stereo matching algorithm to perform three-dimensional reconstruction based on the at least two perspective images.

[0033] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any one of the three-dimensional reconstruction methods described above is implemented.

[0034] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the three-dimensional reconstruction method as described above is implemented.

[0035] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the three-dimensional reconstruction method described above is implemented.

[0036] The three-dimensional reconstruction method, device, electronic device and storage medium provided by the present invention perform depth prediction based on at least two view images, and use the predicted depth range obtained by the prediction as the initial depth range of the stereo matching algorithm, thereby performing three-dimensional reconstruction. Compared with the method of performing three-dimensional reconstruction by randomly initializing the depth range, using the predicted depth range as the initial depth range can reduce the error between the initial depth range and the actual depth situation, thereby improving the efficiency of iterative optimization in three-dimensional reconstruction, reducing the risk of falling into a local optimal solution in iterative optimization, thereby improving the efficiency of three-dimensional reconstruction and ensuring the quality of three-dimensional reconstruction. In addition, in the present invention, by performing feature enhancement on the view map features of each view image, the enhanced map features of each view image are obtained, and depth prediction is achieved based on this, so that the reliability of the predicted depth range obtained thereby can be guaranteed, thereby ensuring the reliability of using the predicted depth range as the initial depth range of the stereo matching algorithm to achieve three-dimensional reconstruction. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the present invention or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0038] Figure 1 This is one of the flow charts of the three-dimensional reconstruction method provided by the present invention.

[0039] Figure 2 It is a flowchart of the depth prediction method provided by the present invention.

[0040] Figure 3 It is a structural schematic diagram of the feature extraction module provided by the present invention.

[0041] Figure 4 It is a structural schematic diagram of the residual convolution block provided by the present invention.

[0042] Figure 5 It is a schematic diagram of the structure of the deformable convolution block provided by the present invention.

[0043] Figure 6 It is a schematic diagram of the structure of the hole convolution block provided by the present invention.

[0044] Figure 7 It is a structural schematic diagram of the upsampling convolution block provided by the present invention.

[0045] Figure 8 It is a structural schematic diagram of the hollow space pyramid pooling block provided by the present invention.

[0046] Fig. 9It is a structural schematic diagram of the depth prediction module provided by the present invention.

[0047] Fig.10 It is a structural schematic diagram of the feature enhancement module provided by the present invention.

[0048] Fig.11 It is a structural schematic diagram of the cross-fusion block provided by the present invention.

[0049] Fig.12 It is a structural schematic diagram of the channel filter block provided by the present invention.

[0050] Fig.13 It is a structural schematic diagram of the repair prediction model provided by the present invention.

[0051] Fig.14 It is a schematic diagram of the training process of the repair prediction model provided by the present invention.

[0052] Fig.15 It is a schematic diagram of the process of stereo matching provided by the present invention.

[0053] Fig.16 This is the second flow chart of the three-dimensional reconstruction method provided by the present invention.

[0054] Fig.17 It is a schematic structural diagram of the three-dimensional reconstruction device provided by the present invention.

[0055] Fig.18 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0057] In industrial fields such as aerospace, automobile manufacturing, and metal smelting, due to limitations of factors such as the scene environment, damaged workpieces on industrial equipment often cannot be directly inspected through observation, resulting in hidden dangers during production and operation.

[0058] With the continuous improvement of industrial technology, endoscopes have emerged as a workpiece inspection tool. The workpiece inspection solution based on endoscopes can facilitate workers to inspect workpieces from multiple angles, directions, and levels, and the binocular endoscope can effectively perform three-dimensional reconstruction based on the internal and external parameters of the binocular camera, thereby obtaining a three-dimensional view of the workpiece, thereby achieving the purpose of workpiece measurement, defect distance measurement, etc.

[0059] In the endoscope-based workpiece detection solution, the three-dimensional reconstruction algorithm is one of the key technologies. The three-dimensional reconstruction algorithm can be specifically divided into two categories: traditional methods and deep learning methods. Among them, traditional methods can include PatchMatchStereo, COLMAP, etc., and deep learning methods include Raft-Stereo, MVSNet (DepthInference for Unstructured Multi-view Stereo, multi-view stereo network), etc. The above algorithm can calculate the disparity map of the binocular camera and construct a three-dimensional image of the object in combination with the binocular camera parameters. In addition, based on the coordinate conversion of the internal and external parameters of the camera, the user can accurately calculate the distance, area, defect size and other information of the real workpiece according to the world coordinate system position coordinates on the three-dimensional image.

[0060] Furthermore, the traditional method of 3D reconstruction continues to evolve based on the PatchMatchStereo scheme, while improving the propagation algorithm on this basis. For example, ACMMP (Advanced Combined Multi-View Matching with Prior Information) can construct plane disparity by calculating the point cloud plane parameters, thereby calculating the point cloud depth and constructing a 3D view of the object through the point cloud coordinates.

[0061] In traditional methods of 3D reconstruction, in order to calculate the plane parameters of the point cloud, it is necessary to execute multiple rounds of propagation algorithms, such as spatial propagation and perspective transmission, so as to continuously optimize the iterative point cloud quality and thus realize point cloud construction. This algorithm relies too much on the serial optimization process during execution, resulting in low efficiency of the 3D reconstruction process and difficulty in meeting the real-time requirements of real scenes. In addition, during the iterative optimization process, it is easy to fall into a local optimal solution, resulting in the inability to reconstruct high-quality 3D images.

[0062] Deep learning methods for 3D reconstruction, such as Raft-Stereo and MVSNet methods based on optical flow, as well as GeoMVSNet and RC_MVSNet improved around the MVSNet series, can all perform binocular stereo modeling and directly predict disparity based on binocular vision images to construct point cloud images.

[0063] However, deep learning-based 3D reconstruction algorithms require a large number of training samples for model building and training. In addition, considering that sample data in the industrial field is not easy to collect, there is often a lack of sufficient training samples, resulting in poor model building results. In addition, deep learning-based 3D reconstruction requires powerful computing resources and is often limited in use on portable devices.

[0064] In view of the above problems, an embodiment of the present invention provides a three-dimensional reconstruction method. Figure 1 is one of the flow charts of the three-dimensional reconstruction method provided by the present invention, such as Figure 1 As shown, the method includes:

[0065] Step 110: Acquire at least two viewing angle images.

[0066] Here, at least two perspective images are images obtained by capturing images of the target to be modeled from different perspectives. The target to be modeled contained in at least two perspective images is the same target. For example, when modeling a workpiece, at least two perspective images are rated images captured from different perspectives for the same workpiece. For example, perspective images of left and right perspectives can be captured by a binocular camera.

[0067] Step 120, based on the correlation between the perspective image features of the at least two perspective images, perform feature enhancement on each perspective image feature to obtain an enhanced image feature of each perspective image, and perform depth prediction based on the enhanced image feature of each perspective image to obtain a predicted depth range.

[0068] Specifically, for at least two acquired perspective images, the perspective images can be applied to perform depth prediction on the target to be modeled contained in the perspective images, thereby obtaining a predicted depth range. Here, the predicted depth range is the result of depth prediction, specifically, the range of depth values ​​of the target to be modeled on the point cloud plane obtained based on the prediction of at least two perspective images.

[0069] Here, depth prediction for the perspective image can be achieved through a pre-trained depth prediction model. It can be understood that the depth prediction model here takes perspective images of at least two perspectives as input and outputs a depth prediction result. The depth prediction result here can be the depth value or range of depth values ​​of the target to be modeled on the point cloud plane.

[0070] The depth prediction model can be obtained by training before executing step 120. For example, a large number of multi-perspective sample perspective images can be collected in advance, and the true depth values ​​of the targets corresponding to the standard sample perspective images can be collected in advance, so that the sample perspective images are used as training samples and the true depth values ​​are used as labels, and supervised learning is performed to obtain the depth prediction model.

[0071] Furthermore, in the process of performing depth prediction based on each viewing angle image, it can be achieved by respectively extracting features from each viewing angle image, enhancing features of the extracted viewing angle image features, and performing depth prediction based on the enhanced enhanced feature map.

[0072] That is, each viewing image may be firstly subjected to feature extraction, wherein the feature extraction is used to extract the image features of each viewing image, and the image features of the viewing image are recorded as viewing graph features. After obtaining the viewing graph features of each viewing image, the features of each viewing graph may be enhanced based on the correlation between the viewing graph features of each viewing image, thereby obtaining the enhanced graph features of each viewing image.

[0073] In this process, feature enhancement of the perspective graph features of each perspective image can be achieved based on the attention mechanism. That is, the correlation between the perspective graph features of each perspective image can be calculated based on the attention mechanism, specifically, the correlation between the features representing each pixel in each perspective graph feature can be calculated. Here, the correlation between the perspective graph features can reflect which pixels in different perspective images are related to each other, that is, which pixels in different perspective images match each other. Therefore, based on the correlation between the perspective graph features, the information representation of different perspective images at the same position of the same target can be complemented to achieve the effect of enhancing the perspective graph features under each perspective, thereby obtaining the features after the enhancement of each perspective graph feature, that is, the enhanced graph features of each perspective image.

[0074] Subsequently, after the enhancement image features of each viewing angle image are obtained, depth prediction can be performed based on the enhancement image features of each viewing angle image, thereby obtaining a predicted depth range.

[0075] Step 130: Using the predicted depth range as an initial depth range of a stereo matching algorithm, and applying the stereo matching algorithm to perform three-dimensional reconstruction based on the at least two perspective images.

[0076] Specifically, after depth prediction is performed based on the view images and a predicted depth range is obtained, a stereo matching algorithm may be applied to perform three-dimensional reconstruction based on the at least two view images.

[0077] Here, the stereo matching algorithm can be PatchMatchStereo, or it can be ACMMP, or other algorithms optimized on the basis of PatchMatchStereo. In the process of three-dimensional reconstruction based on the stereo matching algorithm, random plane parameter initialization is usually performed first, and then propagation methods such as spatial propagation, plane optimization, and perspective propagation are performed to achieve iterative optimization. Among them, random plane parameter initialization is used to randomly initialize the parameters of the point cloud plane, where the parameters of the point cloud plane include the depth range of the target to be modeled on the point cloud plane.

[0078] In an embodiment of the present invention, in the process of three-dimensional reconstruction based on the stereo matching algorithm, the depth range of the target to be modeled in the point cloud plane is no longer randomly initialized. Instead, the predicted depth range obtained in step 120 can be directly used as the initial depth range in the stereo matching algorithm, that is, as the depth range of the initialized target in the point cloud plane in the stereo matching algorithm.

[0079] It is understandable that the depth range obtained by randomly initializing the plane parameters in the related technology often has a large error compared to the actual depth situation, and the error in the initial depth range will make the stereo matching algorithm very inefficient in the subsequent iterative optimization process, and may even fail to converge to the correct solution.

[0080] The predicted depth range obtained in step 120 is closer to the actual depth of the target to be modeled on the point cloud plane. Compared with the depth range obtained by randomly initializing the plane parameters in the related technology, it can greatly improve the efficiency of the subsequent iterative optimization process and reduce the probability of falling into the local optimal solution during the iterative optimization process, thereby accelerating the speed of 3D reconstruction and optimizing the quality of 3D reconstruction.

[0081] The method provided by the embodiment of the present invention performs depth prediction based on at least two perspective images, and uses the predicted depth range obtained by prediction as the initial depth range of the stereo matching algorithm, thereby performing three-dimensional reconstruction. Compared with the method of performing three-dimensional reconstruction by randomly initializing the depth range, using the predicted depth range as the initial depth range can reduce the error between the initial depth range and the actual depth situation, thereby improving the efficiency of iterative optimization in three-dimensional reconstruction and reducing the risk of falling into a local optimal solution in iterative optimization, thereby improving the efficiency of three-dimensional reconstruction and ensuring the quality of three-dimensional reconstruction.

[0082] Moreover, in the method provided in the embodiment of the present invention, by performing feature enhancement on the perspective map features of each perspective image, the enhanced map features of each perspective image are obtained, and depth prediction is implemented based on this, thereby ensuring the reliability of the predicted depth range obtained thereby, and further ensuring the reliability of using the predicted depth range as the initial depth range of the stereo matching algorithm to achieve three-dimensional reconstruction.

[0083] Based on the above embodiments, Figure 2 is a flow chart of the depth prediction method provided by the present invention, such as Figure 2 As shown, step 120 includes:

[0084] Step 121 : extracting features from each of the at least two perspective images to obtain perspective image features of each perspective image.

[0085] Step 122: Based on the correlation between the view graph features of each view image, the feature of each view graph is enhanced to obtain the enhanced graph feature of each view image.

[0086] Step 123: perform depth prediction based on the enhanced image features of each viewing angle image to obtain a predicted depth range.

[0087] Specifically, in order to achieve depth prediction based on the above-mentioned at least two perspective images, it can be achieved by extracting features from each perspective image respectively, enhancing the features of the extracted perspective image features, and performing depth prediction based on the enhanced enhanced feature image.

[0088] In step 121, feature extraction may be performed on each viewing angle image respectively. The feature extraction here is used to extract image features of each viewing angle image. The image features of the viewing angle images are recorded as viewing angle image features.

[0089] It is understandable that the feature extraction for each viewing angle image can be achieved through a pre-trained feature extraction module. In addition, for each viewing angle image, the weight of the feature extraction module can be shared, that is, the feature extraction of each viewing angle image is achieved based on the same feature extraction weight. The structure of the feature extraction module can be various types of convolutional networks, such as residual convolutional networks, deformable convolutional networks, etc., or can be a combination of various types of convolutional networks, which is not specifically limited in the embodiments of the present invention.

[0090] For example, Figure 3 Schematic diagram of the structure of the feature extraction module provided by the present invention. Figure 3 As shown in the figure, for any view image, the view image can be first input into the residual convolution block ResConv Block, and the features obtained by the residual convolution block can be used to perform feature extraction of three branches respectively. Taking the view image as the right view as an example, in one branch, the features obtained by the residual convolution block can be obtained by upsampling Upsampling. In the other branch, the features obtained by the residual convolution block are serially input into the deformable convolution block, the dilated convolution block, and the upsampling convolution block DeConv Block to obtain the features. In another branch, the features obtained by the residual convolution block are processed by the atrous spatial pyramid pooling block (ASPP Block) and upsampled to obtain the features Finally, the feature , and Perform the addition operation to obtain the perspective map features of the right view It can be understood that, in the case where the perspective image is a left view, the perspective image feature of the left view can be obtained based on the same method as the above feature extraction method. .

[0091] Further, Figure 4 Schematic diagram of the structure of the residual convolution block provided by the present invention. Figure 4 As shown in the figure, the residual convolution block includes residual convolution ResConv and rectified linear unit ReLu. The view image is input into the residual convolution block, which can be divided into two branches after multiple residual convolutions and rectified linear units. The features of one branch are again subjected to multiple residual convolutions and rectified linear units, and are added to the features of the other branch to obtain the final output of the residual convolution block.

[0092] Figure 5 Schematic diagram of the structure of the deformable convolution block provided by the present invention. Figure 5 As shown in the figure, the deformable convolution block includes a deformable convolution Deformable Conv, a rectified linear unit ReLu and a convolution Conv. The features obtained by the residual convolution block are input into the deformable convolution block, which can be convolved after multiple deformable convolutions and rectified linears, and then divided into two branches. The features of one branch are convolved again after multiple deformable convolutions and rectified linears, and are added with the features of the other branch to obtain the final output of the deformable convolution block.

[0093] Figure 6 Schematic diagram of the structure of the dilated convolution block provided by the present invention. Figure 6 As shown in the figure, the dilated convolution block includes a dilated Conv and a rectified linear unit ReLu. The features passed through the deformable convolution block are input into the dilated convolution block. After multiple dilated convolutions and rectified linear units, the final output of the dilated convolution block can be obtained.

[0094] Figure 7 Schematic diagram of the structure of the upsampling convolution block provided by the present invention. Figure 7 As shown in the figure, the upsampling convolution block includes unpooling and upsampling convolution DeConv. The features passed through the hole convolution block are input into the upsampling convolution block, and the final output of the upsampling convolution block can be obtained through unpooling, upsampling convolution and unpooling.

[0095] Figure 8 Schematic diagram of the structure of the hollow space pyramid pooling block provided by the present invention. Figure 8As shown in the figure, the dilated spatial pyramid pooling block includes convolutions of various sizes and dilation rates, as well as pooling. The features of the residual convolution block are input into the dilated spatial pyramid pooling block, and convolutions and pooling of various sizes and dilation rates can be performed in parallel. The results of various convolutions and pooling are then concatenated as the final output of the dilated spatial pyramid pooling block. Figure 8 middle," "," " is the size of the convolution kernel, and "dilation rate 6", "dilation rate 12", and "dilation rate 18" are the values ​​of the dilation rate of the convolution kernel.

[0096] In step 122, after obtaining the viewing angle graph features of each viewing angle image, the features of each viewing angle graph feature may be enhanced based on the correlation between the viewing angle graph features of each viewing angle image, thereby obtaining the enhanced graph features of each viewing angle image.

[0097] In this process, the feature enhancement of the perspective graph features of each perspective image can be achieved through a pre-trained feature enhancement module, and the feature enhancement module here can be implemented based on the attention mechanism. That is, in the process of enhancing the features of each perspective graph based on the feature enhancement module, the correlation between the perspective graph features of each perspective image can be calculated based on the attention mechanism, and specifically, the correlation between the features representing each pixel in each perspective graph feature can be calculated. Here, the correlation between the perspective graph features can reflect which pixels in different perspective images are related to each other, that is, which pixels in different perspective images match each other. Therefore, based on the correlation between the perspective graph features, the information representation of different perspective images at the same position of the same target can be complemented to achieve the effect of enhancing the perspective graph features under each perspective, thereby obtaining the features after the enhancement of each perspective graph feature, that is, the enhanced graph features of each perspective image.

[0098] In step 123, after the enhancement image features of each viewing angle image are obtained, depth prediction can be performed based on the enhancement image features of each viewing angle image, thereby obtaining a predicted depth range.

[0099] In this process, it can be implemented through a trained depth prediction module. For example, the depth prediction module can be used to fuse the enhanced image features of each perspective image, and then the fused features can be used to perform depth prediction. Here, the structure of the depth prediction module can be implemented through a convolutional network, a multilayer perceptron (MLP), etc., and the embodiment of the present invention does not specifically limit this.

[0100] For example, Fig. 9 Schematic diagram of the structure of the depth prediction module provided by the present invention. Fig. 9As shown in the figure, the enhanced features of each view image can be convolved Conv respectively, and the convolved features can be concatenated to achieve feature fusion of each view image. After the concatenation is completed, the concatenated features can be convolved, reshaped Reshape and multi-layer perceptron can be performed in sequence to output the predicted depth. The predicted depth here can be the predicted depth value of each point on the point cloud plane, and the range can be expanded on this basis to obtain the predicted depth range.

[0101] For example, range expansion can be performed based on the following formula to obtain the predicted depth range:

[0102]

[0103] In the formula, To predict the depth range, is the predicted depth value, Indicates the expansion of the scope, The preset weights.

[0104] The method provided by the embodiment of the present invention obtains the enhanced map features of each perspective image by performing feature extraction and feature enhancement on each perspective image, and implements depth prediction based on the enhanced map features, thereby ensuring the reliability of the predicted depth range obtained thereby, and further ensuring the reliability of using the predicted depth range as the initial depth range of the stereo matching algorithm to achieve three-dimensional reconstruction.

[0105] Based on any of the above embodiments, in step 120, based on the correlation between the view graph features of each view image, the feature enhancement of each view graph feature is performed to obtain the enhanced graph feature of each view image, including:

[0106] Based on the correlation between the view graph features of each view image, attention interaction is performed on the view graph features to obtain the interaction graph features of each view image;

[0107] Channel filtering is performed on the interaction graph features of each viewing angle image to obtain an enhanced feature map of each viewing angle image.

[0108] Specifically, in the process of performing feature enhancement on the view map features of each view image, attention interaction and channel filtering may be performed on each view map feature.

[0109] In the process of attention interaction of each view graph feature, for any view image, after further feature extraction of the view graph feature of the view image, the extracted features are used as the query (Query, Q) vector in the attention mechanism, and the features obtained by further feature extraction of the view graph features of other view images are used as the key (Key, K) vector and value (Vaule, V) vector in the attention mechanism. The attention weight between the view graph feature and other view graph features is obtained through attention calculation between the key vector, the value vector and the query vector. The attention weight here can reflect the correlation between the view graph feature and other view graph features. On this basis, the view graph feature and other view graph features are weightedly fused based on the attention weight to achieve attention interaction, thereby obtaining the interactive graph feature of the view image.

[0110] It can be understood that the interaction graph feature here is the result of attention interaction between the perspective graph feature of the perspective image and the perspective graph features of other perspective images to achieve feature interaction fusion, and the interaction graph feature realizes the information filling of the perspective graph feature.

[0111] After obtaining the interaction graph features of each viewing angle image, channel filtering can also be performed on the interaction graph features of each viewing angle image. Here, channel filtering is used to filter out information in the interaction graph features that is useless for depth prediction, and retain information in the interaction graph features that can be used for depth information prediction. In an embodiment of the present invention, the interaction graph features of each viewing angle image after channel filtering are recorded as enhanced graph features.

[0112] It is understandable that channel filtering can be implemented by a pre-trained channel filtering block, which can be a convolutional neural network or other neural network structures that can be used for filtering.

[0113] In the method provided in the embodiment of the present invention, feature enhancement is achieved for each perspective image through attention interaction and channel filtering, thereby improving the accuracy and reliability of depth prediction.

[0114] Based on any of the above embodiments, Fig.10 Schematic diagram of the structure of the feature enhancement module provided by the present invention. Fig.10 As shown, the feature enhancement for each viewing angle image in step 120 can be implemented by a feature enhancement module.

[0115] Fig.10In , the feature enhancement module includes the residual convolution block ResConv Block, the cross fusion block Cross FusionBlock and the channel filter block Channel Filter Block. Take two perspective images, i.e., the left view and the right view, as an example. Assume that the perspective image feature of the left view is , the viewing angle feature of the right view is , input the two view map features into the feature enhancement module respectively, and then the Q, K, V vectors of the left view and the Q, K, V vectors of the right view can be obtained through their corresponding residual convolution blocks. Subsequently, the K, V vectors of the left view and the Q vector of the right view are input into the cross fusion block, and the K, V vectors of the right view and the Q vector of the left view are input into the cross fusion block, and the features of the left and right views can be cross-fused based on the cross attention mechanism in the cross fusion block, so that the information of the left and right views is complemented, thereby filling the information of the exposure position in the left and right views, thereby obtaining the interactive map features of the right view output by the two cross fusion blocks. , and the interactive graph features of the left view Next, the interactive image features of the left and right views can be input into the channel filter block for filtering, thereby obtaining the enhanced image features of the left and right views respectively.

[0116] Fig.11 Schematic diagram of the structure of the cross-fusion block provided by the present invention. Fig.11 In the cross fusion block, convolution Conv, residual convolution ResConv, reshape Reshape and logistic function Sigmoid can be used to input the Q vector of one view image and the K and V vectors of another view image into the cross fusion block. The Q vector of one view image is sequentially convolved and reshaped to obtain the feature vector. , the K and V vectors of the other perspective image are respectively convolved, residual convolution and reshaped to obtain the feature and , and then the features and Multiply and pass through the logistic function Sigmoid, and then add the feature Multiply them together to obtain the interactive graph features of the perspective image.

[0117] Fig.12 Schematic diagram of the structure of the channel filter block provided by the present invention. Fig.12 In the example, the channel filter block includes convolution Conv, rectified linear unit ReLu, channel separation Split and concatenation concatenate. The interaction graph features of any view can be input into the channel filter block, and the interaction graph features can be convolved once to obtain the feature ; In addition, the interaction graph features can be convolved and corrected linearly to obtain features , and then the features Perform channel separation operation to obtain , and then After convolution and correction linearity, features are obtained , the feature The features obtained by the first channel separation are convolved together, linearly corrected, and then the features are obtained by the second channel separation operation. , and then continue to obtain the features through convolution and modified linear operations , and then through the third channel separation operation to obtain the characteristic , the feature , , and The splicing operation is performed to obtain the features of the final output of the channel filter block, that is, the enhanced image features. In this process, the channel separation operation can specifically be to use the first half of the information of the channel separation features as the separated features, and pass them into the next convolution and correction linear.

[0118] In traditional methods of 3D reconstruction, due to the influence of lighting and occluding objects, the robustness of 3D reconstruction is poor and it is easy to fall into a local optimal solution, resulting in low reliability and poor quality of the reconstructed 3D image. In view of this situation, based on any of the above embodiments, the method further includes:

[0119] Based on the enhanced image features of each viewing angle image, image restoration is performed on each viewing angle image to obtain a restored image of each viewing angle image.

[0120] Specifically, in the process of performing depth prediction based on each viewing angle image, feature extraction can be performed on each viewing angle image first, and then feature enhancement can be performed on the viewing angle map features of each viewing angle image obtained through feature extraction to obtain enhanced map features of each viewing angle image. Finally, depth prediction can be performed based on the enhanced map features of each viewing angle image to obtain a predicted depth range.

[0121] Among them, the enhanced image features of each perspective image are not only intermediate parameters for depth prediction, but can also be used to perform image restoration on each perspective image.

[0122] That is, in the process of depth prediction, after obtaining the enhanced map features of each view image, each view image can also be restored based on the enhanced map features of each view image, thereby obtaining the restoration results of each view image, which are recorded as the restored images of each view image. Further, image restoration based on the enhanced map features of each view image can be specifically performed by upsampling the enhanced map features of each view image respectively, and using the upsampling results as the restored images.

[0123] It can be understood that the enhanced image features of each perspective image obtained through feature enhancement complete the information filling between each other, so that image restoration can supplement and repair the exposure and occlusion objects existing in the original perspective image, thereby alleviating the exposure and occlusion problems of the perspective image.

[0124] Accordingly, in step 130, applying the stereo matching algorithm to perform three-dimensional reconstruction based on the at least two perspective images includes:

[0125] The stereo matching algorithm is applied to perform three-dimensional reconstruction based on the restored images of the at least two perspective images.

[0126] Specifically, after completing the image restoration for each view image, the stereo matching algorithm can be applied to perform three-dimensional reconstruction based on the restoration images of the at least two view images. It can be understood that the restoration image alleviates the exposure and occlusion problems of the view image. Therefore, compared with performing three-dimensional reconstruction directly on the view image, the three-dimensional reconstruction is performed on the basis of the restoration image in the embodiment of the present invention, which reduces the interference of illumination and occluding objects in the three-dimensional reconstruction process, can improve the robustness of the three-dimensional reconstruction, and further improve the reliability and quality of the three-dimensional image obtained by the three-dimensional reconstruction.

[0127] In the method provided in the embodiment of the present invention, the enhanced image features of each perspective image are reused to achieve depth prediction and image restoration, and the restored image is used for three-dimensional reconstruction, which only occupies a small amount of calculation and can alleviate the interference problems of lighting and occluded objects in three-dimensional reconstruction, thereby optimizing the three-dimensional reconstruction effect.

[0128] Based on any of the above embodiments, in step 120, the feature enhancement, depth prediction and image restoration are performed based on a restoration prediction model;

[0129] The restoration prediction model is trained based on sample images of at least two viewing angles, sample restoration images of at least two viewing angles, and depth values ​​corresponding to the sample images of at least two viewing angles.

[0130] Specifically, in step 120, the process of performing depth prediction based on each viewing angle image includes feature enhancement and depth prediction. In addition, after obtaining the enhanced map features of each viewing angle image through feature enhancement, the enhanced map features can also be used to perform image restoration. That is, since the depth prediction and image restoration reuse the enhanced map features obtained by feature enhancement, the above-mentioned feature enhancement, depth prediction and image restoration can be implemented by the same model, which is referred to as the restoration prediction model here. Optionally, in order to obtain the viewing angle map features of each viewing angle image, it is necessary to perform feature extraction for each viewing angle image respectively, that is, the restoration prediction model can realize feature extraction, feature enhancement, depth prediction and image modification.

[0131] It can be understood that the restoration prediction model is a model for performing two tasks, depth prediction and image restoration, based on the input perspective images of at least two perspectives. That is, through the restoration prediction model, the depth corresponding to the perspective images of at least two perspectives can be predicted to obtain a predicted depth range, and the perspective images of at least two perspectives can also be restored to obtain a restored image.

[0132] For example, Fig.13 is a schematic diagram of the structure of the repair prediction model provided by the present invention, such as Fig.13 As shown, the restoration prediction model may include a feature extraction module, a feature enhancement module, a depth prediction module and an image restoration module. Each view image may be input into each feature extraction module for feature extraction, thereby obtaining the view map features of each view image; then, the view map features of each view image are input into the feature enhancement module for feature enhancement, thereby obtaining the enhanced map features of each view image; then, the enhanced map features of each view image are input into the depth prediction module for depth prediction, thereby obtaining the predicted depth range; in addition, the enhanced map features of each view image are respectively input into each image restoration module, thereby obtaining the restored image of each view image. Under this structure, each feature extraction module may share weight parameters; in addition, the image restoration module may specifically be an upsampling operation.

[0133] In order to achieve depth prediction and image restoration, it is necessary to train the restoration prediction model before executing step 120. In an embodiment of the present invention, a large number of image samples can be collected in advance, specifically, a set of multiple groups of sample images including at least two perspectives, and for each group of sample images of at least two perspectives, the corresponding restoration images of each sample image, i.e., sample restoration images, and the real depth values ​​can be marked. On this basis, each group of sample images of at least two perspectives can be used as samples for model training, and the corresponding sample restoration images and real depth values ​​can be used as labels for supervised learning, thereby obtaining a restoration prediction model.

[0134] For example, Fig.14 FIG. 1 is a schematic diagram of the training process of the repair prediction model provided by the present invention. Fig.14 As shown, during the training process, each group of sample images of at least two perspectives can be input into the restoration prediction model, thereby obtaining the output of the restoration prediction model, where the output includes the predicted depth value and the restored image. On this basis, the loss calculation can be performed based on the output of the restoration prediction model, the sample restoration image as a label and the true depth value, and the calculated loss value is fed back to the restoration prediction model to achieve iterative optimization of the restoration prediction model parameters.

[0135] For example, the loss calculation for image restoration can be expressed as follows:

[0136]

[0137] in, is the loss value for the image restoration task, is the weight, is the Root Mean Square Error loss, is the Structural Similarity Index loss.

[0138] For another example, the L1 loss function can be used to calculate the loss for depth prediction.

[0139] Furthermore, in order to obtain sample images, the collected images of at least two viewing angles may be subjected to color dithering and mosaic processing, and the images subjected to color dithering and mosaic processing may be used as sample images, thereby achieving preprocessing of illumination interference and defects of the collected images, and further achieving data augmentation. Furthermore, the original images that have not been subjected to color dithering and mosaic processing may be used as sample repaired images corresponding to the sample images.

[0140] The method provided by the embodiment of the present invention realizes two tasks, depth prediction and image restoration, through the restoration prediction model. In addition, during the training process, the two tasks, depth prediction and image restoration, can assist each other, thereby improving the ability of the restoration prediction model to perform feature extraction and feature enhancement, and further ensuring the reliability of depth prediction and image restoration.

[0141] In traditional methods of 3D reconstruction, ACMH (Adaptive Checkerboard sampling and Multi-Hypothesis) is often used for spatial propagation. ACMH accelerates the propagation path of the adaptive checkerboard algorithm and proposes the concept of spatial multi-scale to improve the robustness of the algorithm to fine-grained textures, so that it can better reconstruct texture areas of different degrees, and ultimately adaptively improve the 3D reconstruction effect. However, the ACMH algorithm lacks adaptability to different light intensities, which often causes different lighting changes to affect the stereo matching effect, reducing the 3D reconstruction effect.

[0142] In view of the above problem, based on any of the above embodiments, in step 130, applying the stereo matching algorithm to perform three-dimensional reconstruction based on the at least two perspective images includes:

[0143] Perturbing the color attributes of the at least two viewing angle images to obtain color perturbed images of the at least two viewing angle images;

[0144] Applying the stereo matching algorithm to iterate the initial depth range based on the color perturbation images of the at least two perspective images to obtain a first depth map;

[0145] Perform three-dimensional reconstruction based on the first depth map.

[0146] Specifically, in order to solve the problem of adaptability of ACMH to illumination changes, a method for stereo matching based on color attributes of perspective images is provided in an embodiment of the present invention.

[0147] Here, the color attribute may include at least one of chroma, brightness, and saturation. Chroma describes the type of color. Brightness describes the lightness or darkness of a color. Saturation describes the purity or vividness of a color.

[0148] After obtaining each viewing angle image, the color attribute perturbation may be performed on each viewing angle image. For example, the chromaticity of each viewing angle image may be changed, or the brightness of each viewing angle image may be changed, or the saturation of each viewing angle image may be changed, thereby obtaining an image after the color attribute perturbation, that is, a color perturbed image of each viewing angle image.

[0149] After completing the color attribute perturbation, the stereo matching algorithm can be applied to iteratively optimize the initial depth range as the initial plane parameter based on the color perturbation image of each view image, thereby obtaining the result of iterative depth optimization based on the color perturbation image of each view image, which is recorded as the first depth map. It can be understood that stereo matching for color perturbation images can weaken the influence of light intensity on stereo matching, thereby optimizing the stereo matching effect and improving the three-dimensional reconstruction effect.

[0150] For example, after obtaining the color perturbation images of each viewing angle, ACMH operation and ACMH with GC (ACMH with Geometric Consistency) operation may be performed on each color perturbation image, thereby achieving iterative optimization of the initial depth range and obtaining the first depth map.

[0151] Moreover, in the process of iterating the initial depth range, the cost function used in conventional spatial propagation needs to calculate the cost from two dimensions: color gradient and color difference. Since the color attribute of the color perturbed image itself is perturbed, in the embodiment of the present invention, the cost function only calculates the cost from the color gradient and removes the color difference. The cost function can be expressed as follows:

[0152]

[0153] In the formula, is the cost function for spatial propagation of color perturbation images, is the weight, and is the color gradient of images at different viewing angles, for The norm of .

[0154] After the first depth map is obtained, a three-dimensional model can be constructed based on the first depth map.

[0155] The method provided by the embodiment of the present invention uses color perturbation images for stereo matching, which can weaken the influence of light intensity on stereo matching, thereby optimizing the stereo matching effect and improving the three-dimensional reconstruction effect.

[0156] Based on any of the above embodiments, the color attribute includes at least one of hue, brightness and saturation;

[0157] In step 130, applying the stereo matching algorithm to iterate the initial depth range based on the color perturbation images of the at least two perspective images to obtain a first depth map includes:

[0158] Applying the stereo matching algorithm, based on color perturbation images of at least two perspective images corresponding to at least one color attribute, iterates the initial depth range to obtain a depth map under at least one color attribute;

[0159] The first depth map is determined based on a depth map under at least one color attribute.

[0160] Specifically, considering that there may be one or more color attributes, in the process of three-dimensional reconstruction, for each viewing angle image, color attribute perturbations may be performed for different color attributes, so that each color attribute may correspond to color perturbation images of at least two viewing angle images. For example, for chromaticity, the color perturbation image corresponding to chromaticity is the image obtained by perturbing the chromaticity of the viewing angle image; for another example, for brightness, the color perturbation image corresponding to brightness is the image obtained by perturbing the brightness of the viewing angle image.

[0161] In the process of stereo matching, the initial depth range iteration can be performed for the color perturbation images corresponding to different color attributes. Thus, each color attribute corresponds to a depth map after optimization iteration. For example, the chromaticity perturbation can be performed on each perspective image, and stereo matching can be performed based on the color perturbation image after the chromaticity perturbation. The depth map thus obtained is the depth map under chromaticity. For another example, the saturation perturbation can be performed on each perspective image, and stereo matching can be performed based on the color perturbation image after the saturation perturbation. The depth map thus obtained is the depth map under saturation.

[0162] Thus, when there are depth maps under multiple color attributes, the depth maps under various color attributes can be integrated to obtain a first depth map. For example, the depth maps under various color attributes can be averaged, and the average result is used as the first depth map.

[0163] Based on any of the above embodiments, in step 130, performing three-dimensional reconstruction based on the first depth map includes:

[0164] Applying the stereo matching algorithm to iterate the initial depth range based on the feature maps of at least two scales of the at least two perspective images to obtain a second depth map;

[0165] Perform three-dimensional reconstruction based on the first depth map and the second depth map.

[0166] Specifically, in addition to iterating the initial depth range based on the color perturbation image, the initial depth range can also be iterated through the feature maps of the view image at at least two scales. For the sake of distinction, in the embodiment of the present invention, the algorithm for stereo matching based on the color perturbation image is recorded as color perturbation stereo matching; the algorithm for stereo matching based on the feature maps of at least two scales is recorded as multi-scale stereo matching, for example, it can be Multi-Scale ACMM.

[0167] Furthermore, in the embodiment of the present invention, different from the color perturbation stereo matching, the cost function of the multi-scale stereo matching can be calculated from the color gradient and the color difference, and the cost function can be expressed as follows:

[0168]

[0169] In the formula, is the cost function for spatial propagation of multi-scale feature maps, is the weight, and is the color of the image at different viewing angles, and is the color gradient of images at different viewing angles.

[0170] The second depth map can be obtained by iterating the initial depth range based on feature maps of at least two scales of at least two perspective images using a stereo matching algorithm.

[0171] It can be understood that the first depth map and the second depth map are depth maps obtained under different spatial propagation paths. The first depth map uses the color perturbation image as the basis for stereo matching, which can weaken the adverse effects of illumination on spatial propagation. The second depth map uses feature maps of multiple scales as the basis for stereo matching, which can better capture image details at different scales, thereby improving the reliability of three-dimensional reconstruction.

[0172] Thus, after obtaining the first depth map and the second depth map, the first depth map and the second depth map may be integrated, and three-dimensional reconstruction may be performed based on the integration result. For example, the first depth map and the second depth map may be averaged or weighted summed to obtain an integrated depth map, and three-dimensional reconstruction may be performed based on the integrated depth map.

[0173] The method provided by the embodiment of the present invention combines color perturbation stereo matching and multi-scale stereo matching to perform three-dimensional reconstruction, which can improve the robustness of stereo matching and further improve the three-dimensional reconstruction effect.

[0174] Based on any of the above embodiments, Fig.15 is a schematic diagram of the process of stereo matching provided by the present invention, such as Fig.15 As shown, stereo matching can be performed from two branches: color perturbation and multi-scale. Fig.15 In the figure, D represents DetailRestorer. In the stereo matching process, the cost function can be the sum of the color perturbation and multi-scale cost functions, or the weighted sum of the color perturbation and multi-scale cost functions.

[0175] Fig.15 In the figure, the upper part is the process of multi-scale stereo matching, specifically Multi-Scale ACMM. In the upper part, Scale=0, 1, and 2 respectively represent the stereo matching process of feature maps of three scales. Among them, downsampling can be performed through each perspective image to obtain feature maps of different scales, and then ACMH operation and ACMH with GC operation can be performed based on the feature maps at each scale to obtain the depth map at that scale. Moreover, before performing ACMHwith GC operation on the feature map of each scale, the depth map at a smaller scale can be upsampled, and the upsampled depth map is fused with the depth map obtained by performing ACMH operation on that scale, and then ACMH with GC operation is performed. In this way, the depth map after ACMH and ACMH with GC operation at the maximum scale can be obtained, that is, the second depth map in the above embodiment.

[0176] Fig.15The lower part is the process of color perturbation stereo matching. For each view image, chroma, brightness, and saturation perturbations may be performed respectively, and ACMH operation and ACMH with GC operation are performed respectively on the color perturbation images obtained by performing chroma, brightness, and saturation perturbations, thereby obtaining depth maps at chroma, brightness, and saturation respectively, and the first depth map in the above embodiment is obtained by averaging the depth maps at chroma, brightness, and saturation.

[0177] Subsequently, the first depth map and the second depth map may be averaged to obtain a depth map for three-dimensional reconstruction.

[0178] Based on any of the above embodiments, Fig.16 FIG. 2 is a flow chart of the three-dimensional reconstruction method provided by the present invention. Fig.16 As shown, the method may include the following steps:

[0179] First, a binocular image is obtained, where the binocular image includes perspective images of left and right perspectives.

[0180] Secondly, the binocular image is input into the restoration prediction model, which extracts and enhances features of the two-view images, and then performs depth prediction based on the enhanced map features of the left and right views, so that the restoration prediction model outputs a predicted depth range; in addition, image restoration is performed based on the enhanced map features of the left and right views, respectively, so that the restoration prediction model also outputs restored images of the left and right views.

[0181] Next, the predicted depth range is used as the initial depth range of the stereo matching algorithm, and stereo matching is performed on the basis of the restored images of the left and right perspectives. In this process, the stereo matching can be a combination of color perturbation stereo matching and multi-scale stereo matching, and the depth map obtained after iterating the initial depth range is obtained.

[0182] Finally, three-dimensional reconstruction is performed based on the depth map obtained by stereo matching.

[0183] The method provided by the embodiment of the present invention can alleviate the overexposure and low light problems caused by the interference of light sources on the binocular camera by applying the restoration prediction model for image restoration, and use the restored image for three-dimensional reconstruction to improve the three-dimensional reconstruction effect. In addition, by predicting the initial depth range by applying the restoration prediction model, the speed of three-dimensional reconstruction can be accelerated. In addition, combining color perturbation stereo matching and multi-scale stereo matching for three-dimensional reconstruction can alleviate the influence of illumination on spatial propagation, improve the robustness of stereo matching, and thus ensure the three-dimensional reconstruction effect.

[0184] Based on any of the above embodiments, Fig.17 Schematic diagram of the structure of the three-dimensional reconstruction device provided by the present invention. Fig.17 As shown, the device comprises:

[0185] An image acquisition unit 1710, configured to acquire at least two perspective images;

[0186] The depth prediction unit 1720 is configured to perform feature enhancement on each view image feature based on the correlation between the view image features of the at least two view images to obtain an enhanced image feature of each view image, and perform depth prediction based on the enhanced image feature of each view image to obtain a predicted depth range;

[0187] The 3D reconstruction unit 1730 is configured to use the predicted depth range as an initial depth range of a stereo matching algorithm, and apply the stereo matching algorithm to perform 3D reconstruction based on the at least two perspective images.

[0188] The device provided by the embodiment of the present invention performs depth prediction based on at least two perspective images, and uses the predicted depth range obtained by prediction as the initial depth range of the stereo matching algorithm, thereby performing three-dimensional reconstruction. Compared with the method of performing three-dimensional reconstruction by randomly initializing the depth range, using the predicted depth range as the initial depth range can reduce the error between the initial depth range and the actual depth situation, thereby improving the efficiency of iterative optimization in three-dimensional reconstruction and reducing the risk of falling into a local optimal solution in iterative optimization, thereby improving the efficiency of three-dimensional reconstruction and ensuring the quality of three-dimensional reconstruction.

[0189] Moreover, in the device provided by the embodiment of the present invention, by performing feature enhancement on the perspective map features of each perspective image, the enhanced map features of each perspective image are obtained, and depth prediction is implemented based on this, thereby ensuring the reliability of the predicted depth range obtained thereby, and further ensuring the reliability of using the predicted depth range as the initial depth range of the stereo matching algorithm to achieve three-dimensional reconstruction.

[0190] Based on any of the foregoing embodiments, the depth prediction unit is specifically used for:

[0191] Based on the correlation between the view graph features of each view image, attention interaction is performed on the view graph features to obtain the interaction graph features of each view image;

[0192] Channel filtering is performed on the interaction graph features of each viewing angle image to obtain an enhanced feature map of each viewing angle image.

[0193] Based on any of the above embodiments, the depth prediction unit further includes:

[0194] An image restoration subunit, used to perform image restoration on each viewing angle image based on the enhanced image features of each viewing angle image, so as to obtain a restored image of each viewing angle image;

[0195] The 3D reconstruction unit is specifically used for:

[0196] The stereo matching algorithm is applied to perform three-dimensional reconstruction based on the restored images of the at least two perspective images.

[0197] Based on any of the above embodiments, the feature enhancement, depth prediction and image restoration are performed based on a restoration prediction model;

[0198] The restoration prediction model is trained based on sample images of at least two viewing angles, sample restoration images of at least two viewing angles, and depth values ​​corresponding to the sample images of at least two viewing angles.

[0199] Based on any of the above embodiments, the 3D reconstruction unit is specifically used for:

[0200] Perturbing the color attributes of the at least two viewing angle images to obtain color perturbed images of the at least two viewing angle images;

[0201] Applying the stereo matching algorithm to iterate the initial depth range based on the color perturbation images of the at least two perspective images to obtain a first depth map;

[0202] Perform three-dimensional reconstruction based on the first depth map.

[0203] Based on any of the above embodiments, the color attribute includes at least one of hue, brightness and saturation;

[0204] The 3D reconstruction unit is specifically used for:

[0205] Applying the stereo matching algorithm, based on color perturbation images of at least two perspective images corresponding to at least one color attribute, iterates the initial depth range to obtain a depth map under at least one color attribute;

[0206] The first depth map is determined based on a depth map under at least one color attribute.

[0207] Based on any of the above embodiments, the 3D reconstruction unit is specifically used for:

[0208] Applying the stereo matching algorithm to iterate the initial depth range based on the feature maps of at least two scales of the at least two perspective images to obtain a second depth map;

[0209] Perform three-dimensional reconstruction based on the first depth map and the second depth map.

[0210] Fig.18 An example of a physical structure diagram of an electronic device is shown in FIG. Fig.18As shown, the electronic device may include: a processor 1810, a communication interface 1820, a memory 1830 and a communication bus 1840, wherein the processor 1810, the communication interface 1820 and the memory 1830 communicate with each other through the communication bus 1840. The processor 1810 may call the logic instructions in the memory 1830 to execute the three-dimensional reconstruction method, which includes:

[0211] Acquire at least two perspective images;

[0212] Based on the correlation between the perspective image features of the at least two perspective images, feature enhancement is performed on each perspective image feature to obtain an enhanced image feature of each perspective image, and depth prediction is performed based on the enhanced image feature of each perspective image to obtain a predicted depth range;

[0213] The predicted depth range is used as an initial depth range of a stereo matching algorithm, and the stereo matching algorithm is applied to perform three-dimensional reconstruction based on the at least two perspective images.

[0214] In addition, the logic instructions in the above-mentioned memory 1830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the relevant technology or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0215] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the three-dimensional reconstruction method provided by the above methods, the method comprising:

[0216] Acquire at least two perspective images;

[0217] Based on the correlation between the perspective image features of the at least two perspective images, feature enhancement is performed on each perspective image feature to obtain an enhanced image feature of each perspective image, and depth prediction is performed based on the enhanced image feature of each perspective image to obtain a predicted depth range;

[0218] The predicted depth range is used as an initial depth range of a stereo matching algorithm, and the stereo matching algorithm is applied to perform three-dimensional reconstruction based on the at least two perspective images.

[0219] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the three-dimensional reconstruction method provided by the above methods is implemented, and the method includes:

[0220] Acquire at least two perspective images;

[0221] Based on the correlation between the perspective image features of the at least two perspective images, feature enhancement is performed on each perspective image feature to obtain an enhanced image feature of each perspective image, and depth prediction is performed based on the enhanced image feature of each perspective image to obtain a predicted depth range;

[0222] The predicted depth range is used as an initial depth range of a stereo matching algorithm, and the stereo matching algorithm is applied to perform three-dimensional reconstruction based on the at least two perspective images.

[0223] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0224] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.

[0225] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A three-dimensional reconstruction method, characterized in that: include: Acquire at least two perspective images; Based on the correlation between the perspective image features of the at least two perspective images, feature enhancement is performed on each perspective image feature to obtain an enhanced image feature of each perspective image, and depth prediction is performed based on the enhanced image feature of each perspective image to obtain a predicted depth range; The predicted depth range is used as an initial depth range of a stereo matching algorithm, and the stereo matching algorithm is applied to perform three-dimensional reconstruction based on the at least two perspective images.

2. The three-dimensional reconstruction method according to claim 1, characterized in that: The step of enhancing the features of each viewing image based on the correlation between the viewing image features of the at least two viewing images to obtain enhanced image features of each viewing image includes: Based on the correlation between the perspective graph features of the at least two perspective images, performing attention interaction on each perspective graph feature to obtain an interaction graph feature of each perspective image; Channel filtering is performed on the interaction graph features of each viewing angle image to obtain an enhanced feature map of each viewing angle image.

3. The three-dimensional reconstruction method according to claim 1, characterized in that: Also includes: Based on the enhanced image features of each viewing angle image, image restoration is performed on each viewing angle image to obtain a restored image of each viewing angle image; The applying the stereo matching algorithm to perform three-dimensional reconstruction based on the at least two perspective images includes: The stereo matching algorithm is applied to perform three-dimensional reconstruction based on the restored images of the at least two perspective images.

4. The three-dimensional reconstruction method according to claim 3, characterized in that: The feature enhancement, depth prediction and image restoration are performed based on the restoration prediction model; The restoration prediction model is trained based on sample images of at least two viewing angles, sample restoration images of at least two viewing angles, and depth values ​​corresponding to the sample images of at least two viewing angles.

5. The three-dimensional reconstruction method according to any one of claims 1 to 4, characterized in that: The applying the stereo matching algorithm to perform three-dimensional reconstruction based on the at least two perspective images includes: Perturbing the color attributes of the at least two viewing angle images to obtain color perturbed images of the at least two viewing angle images; Applying the stereo matching algorithm to iterate the initial depth range based on the color perturbation images of the at least two perspective images to obtain a first depth map; Perform three-dimensional reconstruction based on the first depth map.

6. The three-dimensional reconstruction method according to claim 5, characterized in that: The color attribute includes at least one of hue, brightness and saturation; The step of applying the stereo matching algorithm to iterate the initial depth range based on the color perturbation images of the at least two perspective images to obtain a first depth map includes: Applying the stereo matching algorithm, based on color perturbation images of at least two perspective images corresponding to at least one color attribute, iterates the initial depth range to obtain a depth map under at least one color attribute; The first depth map is determined based on a depth map under at least one color attribute.

7. The three-dimensional reconstruction method according to claim 5, characterized in that: The performing three-dimensional reconstruction based on the first depth map includes: Applying the stereo matching algorithm to iterate the initial depth range based on the feature maps of at least two scales of the at least two perspective images to obtain a second depth map; Perform three-dimensional reconstruction based on the first depth map and the second depth map.

8. A three-dimensional reconstruction device, characterized in that: include: An image acquisition unit, used to acquire at least two perspective images; a depth prediction unit, configured to perform feature enhancement on each view image feature based on the correlation between the view image features of the at least two view images to obtain an enhanced image feature of each view image, and perform depth prediction based on the enhanced image feature of each view image to obtain a predicted depth range; The three-dimensional reconstruction unit is used to use the predicted depth range as an initial depth range of a stereo matching algorithm, and apply the stereo matching algorithm to perform three-dimensional reconstruction based on the at least two perspective images.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the three-dimensional reconstruction method according to any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the three-dimensional reconstruction method according to any one of claims 1 to 7 is implemented.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the three-dimensional reconstruction method according to any one of claims 1 to 7 is implemented.