Depth image output model training method, depth image acquisition method and device
Through the combination of the depth feature extraction network layer and the epipolar Transformer network layer, the problem of depth image accuracy and speed in the multi-eye stereo geometry method is solved, efficient depth image output is achieved, and the overall performance of the model is improved.
Patent Information
- Application Number
- CN202210381423.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-12
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2042-04-12
AI Technical Summary
Existing multi-eye stereo geometry methods based on network learning have shortcomings in the accuracy and speed of depth images. The variance-based fusion method does not consider 2D neighborhood and 3D spatial information, resulting in low accuracy. The method based on weighted summation is due to the introduction of Additional network module, resulting in slow speed.
The deep feature extraction network layer and the epipolar Transformer network layer are used to obtain the features of the reference image and the source image, perform depth feature extraction and three-dimensional cost volume feature fusion, and generate high-precision depth images, and only use depth feature extraction in the training phase. Network layer to avoid additional network layers and improve model speed.
It improves the accuracy and speed of the depth image output model, avoids the introduction of additional network layers, and improves the operating efficiency of the model.
Smart Images

Figure CN114821228B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a depth image output model training method, a depth image acquisition method, a device, an electronic device and a storage medium. Background Art
[0002] MVS (Multi-view Stereo) takes multiple images (shooting the same scene or object) and the internal and external parameters of the camera as input, where one of the multiple images is a reference image and multiple source images, and finally obtains the depth image of the reference image and the 3D (Three Dimensions) reconstructed point cloud of the scene.
[0003] In order to achieve the above effects, the existing network learning-based method mainly includes the following steps:
[0004] 1. Feature extraction: Input the reference image and multiple source images into the neural network (2DCNNblock, 2D neural network layer) in the model to obtain 2D image features;
[0005] 2. Differentiable homography transformation: Use the camera's intrinsic and extrinsic parameters to project the features of multiple source images to the reference camera's perspective. After the projection operation, the 2D features of the source image can be converted into 3D features (i.e., cost volume features) from the reference image's perspective.
[0006] 3. Cost volume feature extraction: The cost volume features obtained from different source images are fused together to obtain a total 3D cost volume feature. After the fused cost volume features, we use 3DCNN to further extract features. At this time, the size of the cost volume feature is H, W, D.
[0007] 4. Extraction of depth map: From the cost volume features extracted in the above step, take the position with the largest value of the third dimension (depth dimension) as the depth value of the pixel.
[0008] In the above-mentioned step 3, the method for cost body feature fusion is usually to adopt a variance-based fusion method or a weighted summation-based fusion method, wherein the variance-based fusion method is to take the variance of each feature point position as the value after fusion, and the weighted summation-based fusion method is to use an additional 2DCNN (2D convolution) or DCN (variable convolution) to learn the weight value, and then perform weighted summation on different cost body features.
[0009] However, the variance-based fusion method takes the variance values of multiple cost volume features as the fused features without considering the 2D neighborhood and 3D spatial information, resulting in low accuracy of the depth image output by the model. The weighted summation-based fusion method introduces additional network modules, resulting in a slow speed in outputting the depth image. Summary of the invention
[0010] The embodiments of the present application provide a depth image output model training method, a depth image acquisition method, an apparatus, an electronic device and a storage medium to solve the problem that the cost volume feature fusion method in the related art causes the accuracy of the depth image output by the model to be low, or the speed at which the model outputs the depth image to be slow.
[0011] In order to solve the above technical problems, the embodiments of the present application are implemented as follows:
[0012] In a first aspect, an embodiment of the present application provides a method for training a deep image output model, wherein the deep image output model includes: a deep feature extraction network layer and an epipolar Transformer network layer, and the method includes:
[0013] Acquire the two-dimensional image features of the sample reference image and the three-dimensional cost volume features of N sample source images; N is a positive integer greater than or equal to 2, and the N sample source images are images corresponding to the sample reference image;
[0014] Calling the depth feature extraction network layer to perform feature extraction on the two-dimensional image features to obtain two-dimensional predicted depth features associated with depth estimation of the sample reference image;
[0015] Calling the epipolar Transformer network layer to fuse the three-dimensional cost volume features according to the two-dimensional predicted depth features to generate a three-dimensional fused cost volume feature corresponding to the sample source image;
[0016] Based on the two-dimensional predicted depth features and the three-dimensional fused cost volume features, a loss value of the depth image output model is calculated;
[0017] When the loss value is within a preset range, the trained deep image output model that does not include the deep feature extraction network layer is used as the final target deep image output model.
[0018] Optionally, the depth image output model includes: a feature extraction layer and a feature conversion layer,
[0019] The step of acquiring the two-dimensional image features of the sample reference image and the three-dimensional cost volume features of the N sample source images includes:
[0020] Inputting the sample reference image and N sample source images into the depth image output model;
[0021] Calling the feature extraction layer to extract the two-dimensional image features of the sample reference image and the two-dimensional sample image features of the N sample source images;
[0022] The feature conversion layer is called to convert the two-dimensional sample image features into three-dimensional cost volume features under the perspective of the sample reference image based on the differentiable homography transformation matrix and the two-dimensional image features.
[0023] Optionally, calling the feature conversion layer to convert the two-dimensional sample image features into three-dimensional cost volume features under the perspective of the sample reference image based on the differentiable homography transformation matrix and the two-dimensional image features includes:
[0024] The feature conversion layer is called, and the camera parameters corresponding to the sample reference image and the camera parameters corresponding to the sample source image are used to project the two-dimensional sample image features to the perspective of the sample reference image to obtain the three-dimensional cost volume features of the sample source image at the perspective of the sample reference image.
[0025] Optionally, calling the epipolar Transformer network layer to perform fusion processing on the three-dimensional cost volume feature according to the two-dimensional predicted depth feature to generate a three-dimensional fused cost volume feature corresponding to the sample source image includes:
[0026] Inputting the three-dimensional cost volume features and the two-dimensional predicted depth features into the epipolar Transformer network layer;
[0027] According to the position of the two-dimensional predicted depth feature on the sample reference image, projecting the two-dimensional predicted depth feature onto the sample source image to obtain a feature weight of the three-dimensional cost volume feature in the depth direction;
[0028] Based on the inter-group relationship construction method, cost volume feature association parameters between the three-dimensional cost volume features of different sample source images are constructed;
[0029] Based on the two-dimensional predicted depth feature, the feature weight and the cost volume feature associated parameter, the three-dimensional cost volume feature is fused to obtain the three-dimensional fused cost volume feature.
[0030] Optionally, the sample reference image corresponds to a real depth feature, the sample source image is annotated with a real position and a real probability value of a fused cost volume feature, and the three-dimensional fused cost volume feature includes: a predicted probability value and a predicted position,
[0031] The calculating the loss value of the depth image output model based on the two-dimensional predicted depth feature and the three-dimensional fusion cost volume feature includes:
[0032] Based on the two-dimensional predicted depth feature and the true depth feature, a first loss value of the depth feature extraction network layer is calculated;
[0033] Based on the predicted probability value, the predicted position, the true probability value and the true position, a second loss value of the epipolar Transformer network layer is calculated;
[0034] The loss value of the depth image output model is calculated based on the first loss value, the weight corresponding to the first loss value, the second loss value and the weight corresponding to the second loss value.
[0035] In a second aspect, an embodiment of the present application provides a depth image acquisition method, comprising:
[0036] Acquire a reference image and M source images, where M is a positive integer greater than or equal to 2, and the M source images are images corresponding to the reference image;
[0037] Input the reference image and the M source images into a target depth image output model; the target depth image output model includes: an epipolar Transformer network layer and a depth map prediction network layer;
[0038] Calling the epipolar Transformer network layer to fuse the three-dimensional cost volume features of the M source images according to the two-dimensional image features of the reference image, so as to obtain the three-dimensional fused cost volume features corresponding to the M source images;
[0039] The depth map prediction network layer is called to process the three-dimensional fusion cost volume features to obtain a depth image of the reference image.
[0040] In a third aspect, an embodiment of the present application provides a deep image output model training device, wherein the deep image output model includes: a deep feature extraction network layer and an epipolar Transformer network layer, and the device includes:
[0041] A cost volume feature acquisition module is used to acquire two-dimensional image features of a sample reference image and three-dimensional cost volume features of N sample source images; N is a positive integer greater than or equal to 2, and the N sample source images are images corresponding to the sample reference image;
[0042] A predicted depth feature acquisition module, used for calling the depth feature extraction network layer to extract the features of the two-dimensional image, and obtaining a two-dimensional predicted depth feature associated with the depth estimation of the sample reference image;
[0043] A fused cost volume feature generation module, used for calling the epipolar Transformer network layer to fuse the three-dimensional cost volume feature according to the two-dimensional predicted depth feature, and generating a three-dimensional fused cost volume feature corresponding to the sample source image;
[0044] A loss value calculation module, used to calculate the loss value of the depth image output model based on the two-dimensional predicted depth feature and the three-dimensional fusion cost volume feature;
[0045] The deep image output model acquisition module is used to use the trained deep image output model that does not include the deep feature extraction network layer as the final target deep image output model when the loss value is within a preset range.
[0046] Optionally, the depth image output model includes: a feature extraction layer and a feature conversion layer,
[0047] The cost volume feature acquisition module includes:
[0048] A sample image input unit, used for inputting the sample reference image and N sample source images into the depth image output model;
[0049] A two-dimensional feature extraction unit, used to call the feature extraction layer to extract the two-dimensional image features of the sample reference image and the two-dimensional sample image features of the N sample source images;
[0050] The cost volume feature conversion unit is used to call the feature conversion layer to convert the two-dimensional sample image features into three-dimensional cost volume features under the perspective of the sample reference image based on the differentiable homography transformation matrix and the two-dimensional image features.
[0051] Optionally, the cost volume feature conversion unit includes:
[0052] The cost volume feature acquisition subunit is used to call the feature conversion layer, and use the camera parameters corresponding to the sample reference image and the camera parameters corresponding to the sample source image to project the two-dimensional sample image features to the perspective of the sample reference image, so as to obtain the three-dimensional cost volume features of the sample source image under the perspective of the sample reference image.
[0053] Optionally, the fusion cost volume feature generation module includes:
[0054] A cost volume feature input unit, used to input the three-dimensional cost volume feature and the two-dimensional predicted depth feature into the epipolar Transformer network layer;
[0055] A feature weight acquisition unit, configured to project the two-dimensional predicted depth feature onto the sample source image according to the position of the two-dimensional predicted depth feature on the sample reference image, so as to obtain a feature weight of the three-dimensional cost volume feature in the depth direction;
[0056] A feature association parameter construction unit, used to construct cost volume feature association parameters between three-dimensional cost volume features of different sample source images based on an inter-group relationship construction method;
[0057] The fused cost volume feature acquisition unit is used to fuse the three-dimensional cost volume feature based on the two-dimensional predicted depth feature, the feature weight and the cost volume feature associated parameter to obtain the three-dimensional fused cost volume feature.
[0058] Optionally, the sample reference image corresponds to a real depth feature, the sample source image is annotated with a real position and a real probability value of a fused cost volume feature, and the three-dimensional fused cost volume feature includes: a predicted probability value and a predicted position,
[0059] The loss value calculation module includes:
[0060] A first loss value calculation unit, configured to calculate a first loss value of the depth feature extraction network layer based on the two-dimensional predicted depth feature and the true depth feature;
[0061] A second loss value calculation unit, configured to calculate a second loss value of the epipolar Transformer network layer based on the predicted probability value, the predicted position, the true probability value, and the true position;
[0062] A loss value calculation unit is used to calculate the loss value of the depth image output model according to the first loss value, the weight corresponding to the first loss value, the second loss value and the weight corresponding to the second loss value.
[0063] In a fourth aspect, an embodiment of the present application provides a depth image prediction device, including:
[0064] A reference image acquisition module, used to acquire a reference image and M source images; M is a positive integer greater than or equal to 2, and the M source images are images corresponding to the reference image;
[0065] A reference image input module, used to input the reference image and the M source images into a target depth image output model; the target depth image output model includes: an epipolar Transformer network layer and a depth map prediction network layer;
[0066] A fusion feature acquisition module, used to call the epipolar Transformer network layer to fuse the three-dimensional cost volume features of the M source images according to the two-dimensional image features of the reference image, so as to obtain the three-dimensional fused cost volume features corresponding to the M source images;
[0067] The depth image acquisition module is used to call the depth image prediction network layer to process the three-dimensional fusion cost volume features to obtain the depth image of the reference image.
[0068] In a fifth aspect, an embodiment of the present application provides an electronic device, including:
[0069] A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the depth image output model training method or the depth image acquisition method described above is implemented.
[0070] In a sixth aspect, an embodiment of the present application provides a readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute any of the depth image output model training methods described above, or the depth image acquisition methods described above.
[0071] In an embodiment of the present application, by obtaining the two-dimensional image features of the sample reference image and the three-dimensional cost volume features of N sample source images, N is a positive integer greater than or equal to 2, and the N sample source images are images corresponding to the sample reference image. The deep feature extraction network layer is called to extract the two-dimensional image features to obtain the two-dimensional predicted depth features associated with the depth estimation of the sample reference image. The epipolar line transformer network layer is called to fuse the three-dimensional cost volume features according to the two-dimensional predicted depth features to generate the three-dimensional fused cost volume features corresponding to the sample source image. Based on the two-dimensional predicted depth features and the three-dimensional fused cost volume features, the loss value of the deep image output model is calculated. When the loss value is within a preset range, the trained deep image output model that does not contain the deep feature extraction network layer is used as the final target deep image output model. In the embodiment of the present application, the deep feature extraction network layer is used to extract the image features for depth estimation, and the epipolar line transformer network layer fuses the three-dimensional cost volume features according to the image features for depth estimation, so as to improve the accuracy of the depth image output by the trained model. At the same time, the deep feature extraction network layer is only used in the training phase, and no additional network layer for fusing cost body features is introduced. Compared with the method of introducing DCN (variable convolution) or 2D CNN for cost body feature fusion, the speed of the model outputting deep images can be improved.
[0072] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application 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.
[0074] Figure 1 A flowchart of the steps of a deep image output model training method provided in an embodiment of the present application;
[0075] Figure 2 A flowchart of a method for acquiring three-dimensional cost volume features provided in an embodiment of the present application;
[0076] Figure 3 A flowchart of a method for generating fusion cost volume features provided in an embodiment of the present application;
[0077] Figure 4 A flowchart of a method for calculating a loss value provided in an embodiment of the present application;
[0078] Figure 5 A schematic diagram of a depth image output model provided in an embodiment of the present application;
[0079] Figure 6 A flowchart of a method for acquiring a depth image provided by an embodiment of the present application;
[0080] Figure 7 A schematic diagram of the structure of a depth image output model training device provided in an embodiment of the present application;
[0081] Figure 8 A schematic diagram of the structure of a depth image acquisition device provided in an embodiment of the present application;
[0082] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0083] 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 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.
[0084] Reference Figure 1 , showing a flowchart of the steps of a deep image output model training method provided in an embodiment of the present application, wherein the deep image output model includes: a deep feature extraction network layer and an epipolar Transformer network layer, such as Figure 1 As shown, the deep image output model training method may include the following steps:
[0085] Step 101: Obtain two-dimensional image features of a sample reference image and three-dimensional cost volume features of N sample source images.
[0086] The embodiments of the present application can be applied to scenarios where three-dimensional cost volume features are fused with two-dimensional image features to train a deep image output model.
[0087] The sample reference image and N (N is a positive integer greater than or equal to 2) sample source images correspond to each other. Specifically, the sample reference image and the N sample source images are captured for the same object, such as the sample reference image and the N sample source images are captured for the same building on the same street.
[0088] In this example, when training the deep image output model, multiple sample reference images can be obtained, and each sample reference image corresponds to N sample source images. Of course, the number of sample source images corresponding to each sample reference image can be the same or different. For example, the number of sample reference images is 3, namely: reference image 1, reference image 2 and reference image 3, among which the sample source images corresponding to reference image 1 are: source image 1 and source image 2, the sample source images corresponding to reference image 2 are: source image 4, source image 5, source image 6 and source image 7, the sample source images corresponding to reference image 3 are: source image 8 and source image 9, etc.
[0089] It can be understood that the above examples are merely examples listed for a better understanding of the technical solutions of the embodiments of the present application, and are not intended to be the sole limitation to the embodiments.
[0090] Two-dimensional image features refer to image features extracted from sample reference images.
[0091] The three-dimensional cost volume feature refers to the conversion of the extracted two-dimensional features of the sample source image into three-dimensional features from the perspective of the sample reference image.
[0092] When training a deep image output model, a sample reference image and N sample source images corresponding to the sample reference image can be obtained, and the sample reference image and the N sample source images can be input into the deep image output model to extract the two-dimensional image features of the sample reference image and the two-dimensional features of the sample source image through the feature extraction layer of the deep image output model, and then the two-dimensional features of the sample source image are converted to obtain the three-dimensional cost volume features of the sample source image.
[0093] The above process of obtaining two-dimensional image features and three-dimensional cost volume features can be combined Figure 2 This is described in detail as follows.
[0094] Reference Figure 2 , which shows a flow chart of the steps of a method for acquiring three-dimensional cost volume features provided by an embodiment of the present application, such as Figure 2 As shown, the three-dimensional cost volume feature acquisition method may include: step 201, step 202 and step 203.
[0095] Step 201: Input the sample reference image and N sample source images into the depth image output model.
[0096] In this embodiment, the deep image output model may include: a feature extraction layer and a feature conversion layer, wherein the feature extraction layer can be used to extract image features in the input image, and the feature conversion layer can be used to convert the extracted two-dimensional image features into three-dimensional cost volume features.
[0097] After obtaining the sample reference image and N sample source images, the sample reference image and N sample source images can be input into the depth image output model, such as Figure 5 As shown, after obtaining the sample reference image and the sample source image, the sample reference image and the sample source image can be input into the model, that is, Figure 5 Input Images (i.e. input images) shown.
[0098] After the sample reference image and N sample source images are input into the depth image output model, step 202 is performed.
[0099] Step 202: calling the feature extraction layer to extract the two-dimensional image features of the sample reference image and the two-dimensional sample image features of the N sample source images.
[0100] After the sample reference image and N sample source images are input into the depth image output model, the feature extraction layer can be called to extract the two-dimensional image features of the sample reference image, and the feature extraction layer can be called to extract the two-dimensional sample image features of the N sample source images, such as Figure 5As shown, the feature extraction layer is FPN (Feature Pyramid Network), which can extract multi-scale two-dimensional image features of the sample reference image and the sample source image.
[0101] In a specific implementation, the extracted two-dimensional image features and two-dimensional sample image features are both multi-scale image features. For example, the original size of the sample reference image and the sample source image is 800*800. In this example, image features of multiple sizes such as 500*500, 800*800, and 1000*1000 of the sample reference image and the sample source image can be extracted as two-dimensional image features and two-dimensional sample image features, respectively.
[0102] It can be understood that the above examples are merely examples listed for a better understanding of the technical solutions of the embodiments of the present application, and are not intended to be the sole limitation to the embodiments.
[0103] After the feature extraction layer is called to extract the two-dimensional image features of the sample reference image and the two-dimensional sample image features of the N sample source images, step 203 is executed.
[0104] Step 203: calling the feature conversion layer to convert the two-dimensional sample image features into three-dimensional cost volume features under the perspective of the sample reference image based on the differentiable homography transformation matrix and the two-dimensional image features.
[0105] After extracting the two-dimensional image features of the sample reference image and the two-dimensional sample image features of N sample source images, the feature conversion layer can be called to convert the two-dimensional sample image features of the sample source image into three-dimensional image features under the perspective of the sample reference image based on the differentiable homography transformation matrix and the two-dimensional image features of the sample reference image. The three-dimensional image features are the three-dimensional cost volume features corresponding to the sample source image. In this process, the two-dimensional sample image features can be projected to the perspective of the sample reference image using the camera parameters corresponding to the sample reference image and the camera parameters corresponding to the sample source image to obtain the three-dimensional cost volume features of the sample source image under the perspective of the sample reference image, and the image features of the N sample source images can be projected to the perspective of the reference camera using the intrinsic and extrinsic parameters of the camera. The projection formula is shown in the following formula (1):
[0106] P si,j =Ki*(R 0,i *(K0 -1 *Pr*d j )+t 0,i ) (1)
[0107] In the above formula (1), P si,j K and Pr are the two-dimensional sample image features of the i-th source image (sample source image) and the two-dimensional image features of the reference image (sample reference image), respectively. iis the internal parameter corresponding to the i-th source image, and K0 is the internal parameter corresponding to the reference image. 0,i is the extrinsic rotation matrix from the reference image to the i-th source image, t 0,i is the extrinsic translation matrix from the reference image to the i-th source image. j is the assumed j-th depth value.
[0108] After the projection operation, the two-dimensional sample image features of the sample source image can be converted into 3D features under the reference image perspective (where the third dimension is the assumed depth), and this 3D feature is the three-dimensional cost volume feature.
[0109] After the two-dimensional image features of the sample reference image and the three-dimensional cost volume features of the N sample source images are acquired, step 102 is performed.
[0110] Step 102: Call the depth feature extraction network layer to extract features of the two-dimensional image to obtain two-dimensional predicted depth features associated with depth estimation of the sample reference image.
[0111] In this example, the deep image output model may also include: a deep feature extraction network layer, such as Figure 5 As shown, the deep feature extraction network layer is Figure 5 Monocular Depth Estimator shown.
[0112] After acquiring the two-dimensional image features of the sample reference image, the depth feature extraction network layer may be called to perform feature extraction on the two-dimensional image features of the sample reference image to extract the two-dimensional predicted depth features of the sample reference image associated with the depth estimation.
[0113] This deep feature extraction network layer is only effective during the training phase and can be regarded as an auxiliary task. This auxiliary task can guide the deep image output model to extract image features related to depth estimation to obtain more robust two-dimensional image features. When the model makes predictions, the deep feature extraction network layer can be removed and will not increase the running speed of the deep image output model.
[0114] It can be understood that the deep feature extraction network layer is an existing network (such as a monocular depth estimation network layer, etc.), and this embodiment will not describe the feature extraction process of the deep feature extraction network layer in detail.
[0115] After calling the depth feature extraction network layer to extract the two-dimensional image features and obtaining the two-dimensional predicted depth features associated with the depth estimation of the sample reference image, step 103 is executed.
[0116] Step 103: Call the epipolar Transformer network layer to fuse the three-dimensional cost volume features according to the two-dimensional predicted depth features to generate three-dimensional fused cost volume features corresponding to the sample source image.
[0117] In this example, the deep image output model can also include an epipolar Transformer network layer (i.e. Figure 5 The Epipolar Transformer shown in the figure can learn the two-dimensional feature information and three-dimensional feature information of the image and fuse the cost volume features of multiple perspectives.
[0118] After obtaining the two-dimensional predicted depth features associated with the depth estimation of the sample reference image, the epipolar Transformer network layer can be called to fuse the three-dimensional cost volume features according to the two-dimensional predicted depth features to generate the three-dimensional fused cost volume features corresponding to the sample source image.
[0119] In this process, the fusion of two-dimensional features and three-dimensional cost volume features can be achieved without introducing additional 2DCNN (2D convolution) or DCN (variable convolution), which can obtain a more accurate fusion effect, thereby improving the accuracy of the depth image output by the model.
[0120] For the fusion process, it can be combined Figure 3 This is described in detail as follows.
[0121] Reference Figure 3 , which shows a flowchart of the steps of a method for acquiring features of a three-dimensional fusion cost volume provided in an embodiment of the present application, such as Figure 3 As shown, the method for acquiring three-dimensional fusion cost volume features may include: step 301, step 302, step 303 and step 304.
[0122] Step 301: Input the three-dimensional cost volume features and the two-dimensional predicted depth features into the epipolar Transformer network layer.
[0123] In this embodiment, after obtaining the three-dimensional cost volume features corresponding to N sample source images and the two-dimensional predicted depth features of the sample reference image, the three-dimensional cost volume features and the two-dimensional predicted depth features can be input into the epipolar Transformer network layer, and then, steps 302, 303 and 304 are executed.
[0124] Step 302: According to the position of the two-dimensional predicted depth feature on the sample reference image, the two-dimensional predicted depth feature is projected onto the sample source image to obtain the feature weight of the three-dimensional cost volume feature in the depth direction.
[0125] After the three-dimensional cost volume feature and the two-dimensional predicted depth feature are input into the epipolar Transformer network layer, the two-dimensional predicted depth feature can be projected onto the sample source image through the epipolar Transformer network layer according to the position of the two-dimensional predicted depth feature on the sample reference image to obtain the feature weight of the three-dimensional cost volume feature in the depth direction, that is, the two-dimensional predicted depth feature is projected onto different sample source images. Then the projected two-dimensional predicted depth feature is matched with the position of the three-dimensional cost volume feature on the sample source image, and the feature weight of different three-dimensional cost volume features on each sample source image can be obtained according to the matching result. This feature weight can be used to represent the distance relationship between the two-dimensional predicted depth feature and the three-dimensional cost volume feature.
[0126] Step 303: Based on the inter-group relationship construction method, cost volume feature association parameters between the three-dimensional cost volume features of different sample source images are constructed.
[0127] The cost volume feature association parameter can be used to represent the association relationship between the three-dimensional cost volume features of N sample source images.
[0128] After the three-dimensional cost volume features of the sample source image are input into the epipolar Transformer network layer, the epipolar Transformer network layer can construct the correlation relationship between the three-dimensional cost volume features of different sample source images according to the inter-group relationship construction method, and use the correlation relationship for an index representation, that is, obtain the cost volume feature correlation parameter.
[0129] In practical applications, the inter-group relationship construction method can adopt existing inter-group construction methods such as group-correlation (i.e., the construction of inter-group relationships). The process of constructing cost volume feature correlation parameters between three-dimensional cost volume features of different sample source images will not be described in detail in this embodiment.
[0130] Step 304: Based on the two-dimensional predicted depth feature, the feature weight and the cost volume feature associated parameter, the three-dimensional cost volume feature is fused to obtain the three-dimensional fused cost volume feature.
[0131] The three-dimensional fused cost volume feature refers to a fused feature obtained by fusing the three-dimensional cost volume features of N sample source images.
[0132] After obtaining the feature weights and cost volume feature association parameters of the three-dimensional cost volume features through the above steps, the three-dimensional cost volume features can be fused based on the two-dimensional predicted depth features, feature weights and cost volume feature association parameters to obtain the fused three-dimensional fused cost volume features.
[0133] It can be understood that the epipolar Transformer network layer is particularly suitable for constructing feature relationships in three-dimensional space. When using the epipolar Transformer network layer to construct feature relationships between three-dimensional cost volume features, the QKV parameter is required, where QKV stands for query, key, and value. In this example, the two-dimensional predicted depth feature of the sample reference image can be used as the query, the feature weight as the key, and the cost volume feature association parameter as the value. After obtaining the query, key, and value, the Transformer technique can be used to perform feature fusion to obtain a fused three-dimensional fused cost volume feature.
[0134] The embodiments of the present application efficiently learn two-dimensional image features and three-dimensional image features and fuse three-dimensional cost volume features during the model training process without introducing additional network layers. This can improve the accuracy of acquiring depth images while increasing the model running speed.
[0135] After the epipolar Transformer network layer is called to fuse the three-dimensional cost volume features according to the two-dimensional predicted depth features to generate the three-dimensional fused cost volume features corresponding to the sample source image, step 104 is executed.
[0136] Step 104: Based on the two-dimensional predicted depth features and the three-dimensional fusion cost volume features, a loss value of the depth image output model is calculated.
[0137] After fusing the three-dimensional fused cost volume features, the loss value of the depth image output model can be calculated based on the two-dimensional predicted depth features and the three-dimensional fused cost volume features. Specifically, the loss value of the depth feature extraction network layer can be calculated according to the two-dimensional preset depth features, and the loss value of the polar line Transformer network layer can be calculated according to the three-dimensional fused cost volume features. The loss value of the depth model of the depth image can be calculated through these two loss values.
[0138] The calculation process of the loss value can be combined with Figure 4 This is described in detail as follows.
[0139] Reference Figure 4 , shows a flowchart of a method for calculating a loss value provided by an embodiment of the present application, such as Figure 4 As shown, the loss value calculation method may include: step 401, step 402 and step 403.
[0140] Step 401: Based on the two-dimensional predicted depth feature and the true depth feature, a first loss value of the depth feature extraction network layer is calculated.
[0141] In this embodiment, the real depth feature of each pixel is marked on the sample reference image, and the real position and real probability value of the fused cost volume feature are marked on the sample source image.
[0142] After the two-dimensional predicted depth features of the sample reference image are extracted through the deep feature extraction network layer, the first loss value of the depth feature extraction network layer can be calculated by combining the two-dimensional predicted depth features and the true depth features. Specifically, the difference between the two-dimensional predicted depth features and the true depth features can be calculated, and the absolute value of the difference is used as the first loss value.
[0143] Step 402: Based on the predicted probability value, the predicted position, the true probability value and the true position, a second loss value of the epipolar Transformer network layer is calculated.
[0144] In this example, after the three-dimensional fused cost volume features of N sample source images are output through the epipolar Transformer network layer, the three-dimensional fused cost volume features include the predicted position and the predicted probability value.
[0145] Furthermore, the second loss value of the polar Transformer network layer can be calculated by combining the predicted probability value, the predicted position, the true probability value and the true position.
[0146] Step 403: Calculate the loss value of the depth image output model according to the first loss value, the weight corresponding to the first loss value, the second loss value and the weight corresponding to the second loss value.
[0147] After obtaining the loss values of the deep feature extraction network layer and the epipolar Transformer network layer, the two loss values can be weighted and summed to obtain the loss value of the deep image output model, that is, the loss value of the deep image output model is calculated jointly according to the first loss value, the weight corresponding to the first loss value, the second loss value, and the weight corresponding to the second loss value.
[0148] After the loss value of the depth image output model is calculated based on the two-dimensional predicted depth features and the three-dimensional fused cost volume features, step 105 is performed.
[0149] Step 105: When the loss value is within a preset range, the trained deep image output model that does not include the deep feature extraction network layer is used as the final target deep image output model.
[0150] After the loss value of the depth image output model is calculated based on the two-dimensional predicted depth features and the three-dimensional fused cost volume features, it can be determined whether the loss value is within a preset range.
[0151] If the loss value is not within the preset range, the model parameters of the depth image output model can be adjusted according to the size of the loss value, and the model training process as described above can be continued until the model converges.
[0152] If the loss value is within the preset range, it means that the model has converged. At this time, the deep feature extraction network layer introduced during the training process can be removed, and the trained deep image output model that does not contain the deep feature extraction network layer can be used as the final target deep image output model.
[0153] The training method of the deep image output model provided in the embodiment of the present application obtains the two-dimensional image features of the sample reference image and the three-dimensional cost volume features of N sample source images, where N is a positive integer greater than or equal to 2, and the N sample source images are images corresponding to the sample reference image, and calls the deep feature extraction network layer to extract the two-dimensional image features to obtain the two-dimensional predicted depth features associated with the depth estimation of the sample reference image. The epipolar line transformer network layer is called to fuse the three-dimensional cost volume features according to the two-dimensional predicted depth features to generate the three-dimensional fused cost volume features corresponding to the sample source image. Based on the two-dimensional predicted depth features and the three-dimensional fused cost volume features, the loss value of the deep image output model is calculated. When the loss value is within a preset range, the trained deep image output model that does not include the deep feature extraction network layer is used as the final target deep image output model. The embodiment of the present application uses the deep feature extraction network layer to extract the image features for depth estimation, and the epipolar line transformer network layer fuses the three-dimensional cost volume features according to the image features for depth estimation, so as to improve the accuracy of the deep image output by the trained model. At the same time, the deep feature extraction network layer is only used in the training phase, and no additional network layer for fusing cost body features is introduced. Compared with the method of introducing DCN (variable convolution) or 2D CNN for cost body feature fusion, the speed of the model outputting deep images can be improved.
[0154] Reference Figure 6 , which shows a flowchart of the steps of a depth image acquisition method provided by an embodiment of the present application, such as Figure 6 As shown, the depth image acquisition method may include the following steps:
[0155] Step 601: Acquire a reference image and M source images; M is a positive integer greater than or equal to 2, and the M source images are images corresponding to the reference image.
[0156] The embodiments of the present application can be applied to a scenario in which a depth image of a reference image is predicted in combination with a target depth image output model.
[0157] The reference image and M (M is a positive integer greater than or equal to 2) source images correspond to each other. Specifically, the reference image and the M source images are captured for the same object, such as the reference image and the M source images are captured for the same building on the same street.
[0158] When performing depth image prediction, a reference image may be obtained, and M source images corresponding to the reference image may be obtained. The reference image and the M source images are used together as inputs of a target depth image output model.
[0159] After the reference image and M source images are acquired, step 602 is performed.
[0160] Step 602: Input the reference image and the M source images into a target depth image output model; the target depth image output model includes: an epipolar Transformer network layer and a depth map prediction network layer.
[0161] The target depth image output model is a model for depth image prediction obtained by training according to the solution of the first embodiment above.
[0162] After obtaining the reference image and the M source images, the reference image and the M source images can be input into the target depth image output model, which can include: an epipolar transformer network layer and a depth map prediction network layer, the epipolar transformer network layer can learn the two-dimensional feature information and three-dimensional feature information of the image, and fuse the cost volume features of multiple perspectives. The depth map prediction network layer can process the fused cost volume features output by the epipolar transformer network layer to generate a depth image corresponding to the reference image.
[0163] After the reference image and the M source images are input into the target depth image output model, step 603 is performed.
[0164] Step 603: Call the epipolar Transformer network layer to fuse the three-dimensional cost volume features of the M source images according to the two-dimensional image features of the reference image to obtain the three-dimensional fused cost volume features corresponding to the M source images.
[0165] After the reference image and the M source images are input into the target depth image output model, the epipolar transformer network layer can be called to fuse the three-dimensional cost volume features of the M source images according to the two-dimensional image features of the reference image to obtain the three-dimensional fused cost volume features corresponding to the M source images. Specifically, before calling the epipolar transformer network layer to fuse the three-dimensional cost volume features, it is also necessary to extract the two-dimensional image features of the reference image and the source image through the feature extraction layer, and convert the two-dimensional image features of the source image into three-dimensional cost volume features by the feature conversion layer, and then call the epipolar transformer network layer to fuse the three-dimensional cost volume features of the M source images to generate the three-dimensional fused cost volume features corresponding to the M source images. For this process, the description of the above-mentioned embodiment 1 can be referred to, and this embodiment will not be repeated here.
[0166] In this embodiment, the three-dimensional cost volume features are fused according to the two-dimensional image features through the polar line Transformer network layer, so that the accuracy of the depth image output by the trained model can be improved, and there is no need to introduce an additional fusion network. Compared with the method of introducing an additional fusion network in the prior art, the running speed of the model can be improved.
[0167] After the 3D fusion cost volume features corresponding to the M source images are obtained, step 604 is executed.
[0168] Step 604: calling the depth map prediction network layer to process the three-dimensional fusion cost volume features to obtain a depth image of the reference image.
[0169] After obtaining the 3D fused cost volume features corresponding to the M source images, the 3D fused cost volume features can be transmitted to the depth map prediction network layer by the epipolar Transformer network layer. The depth map prediction network layer can process the 3D fused cost volume features to predict the depth image corresponding to the reference image.
[0170] The depth image acquisition method provided in the embodiment of the present application obtains a reference image and M source images, where M is a positive integer greater than or equal to 2, and the M source images are images corresponding to the reference image, and the reference image and the M source images are input into the target depth image output model, and the target depth image output model includes: an epipolar transformer network layer and a depth map prediction network layer. The epipolar transformer network layer is called to fuse the three-dimensional cost volume features of the M source images and the two-dimensional image features of the reference image to obtain the three-dimensional fused cost volume features corresponding to the M source images, and the depth map prediction network layer is called to process the three-dimensional fused cost volume features to obtain the depth image of the reference image. The embodiment of the present application can improve the accuracy of the depth image output by the trained model by fusing the three-dimensional cost volume features according to the two-dimensional image features through the epipolar transformer network layer in the depth image output model. At the same time, there is no need to introduce an additional fusion network, which can improve the running speed of the model compared to the method of introducing an additional fusion network in the prior art.
[0171] Reference Figure 7 , shows a schematic diagram of the structure of a deep image output model training device provided in an embodiment of the present application, wherein the deep image output model includes: a deep feature extraction network layer and an epipolar Transformer network layer, such as Figure 7 As shown, the depth image output model 700 may include the following modules:
[0172] The cost volume feature acquisition module 710 is used to acquire the two-dimensional image features of the sample reference image and the three-dimensional cost volume features of N sample source images; N is a positive integer greater than or equal to 2, and the N sample source images are images corresponding to the sample reference image;
[0173] A predicted depth feature acquisition module 720 is used to call the depth feature extraction network layer to extract the two-dimensional image features to obtain a two-dimensional predicted depth feature associated with the depth estimation of the sample reference image;
[0174] A fused cost volume feature generating module 730 is used to call the epipolar Transformer network layer to perform fusion processing on the 3D cost volume feature according to the 2D predicted depth feature, so as to generate a 3D fused cost volume feature corresponding to the sample source image;
[0175] A loss value calculation module 740, configured to calculate a loss value of the depth image output model based on the two-dimensional predicted depth feature and the three-dimensional fused cost volume feature;
[0176] The depth image output model acquisition module 750 is used to use the trained depth image output model that does not include the deep feature extraction network layer as the final target depth image output model when the loss value is within a preset range.
[0177] Optionally, the depth image output model includes: a feature extraction layer and a feature conversion layer,
[0178] The cost volume feature acquisition module includes:
[0179] A sample image input unit, used for inputting the sample reference image and N sample source images into the depth image output model;
[0180] A two-dimensional feature extraction unit, used to call the feature extraction layer to extract the two-dimensional image features of the sample reference image and the two-dimensional sample image features of the N sample source images;
[0181] The cost volume feature conversion unit is used to call the feature conversion layer to convert the two-dimensional sample image features into three-dimensional cost volume features under the perspective of the sample reference image based on the differentiable homography transformation matrix and the two-dimensional image features.
[0182] Optionally, the cost volume feature conversion unit includes:
[0183] The cost volume feature acquisition subunit is used to call the feature conversion layer, and use the camera parameters corresponding to the sample reference image and the camera parameters corresponding to the sample source image to project the two-dimensional sample image features to the perspective of the sample reference image, so as to obtain the three-dimensional cost volume features of the sample source image under the perspective of the sample reference image.
[0184] Optionally, the fusion cost volume feature generation module includes:
[0185] A cost volume feature input unit, used to input the three-dimensional cost volume feature and the two-dimensional predicted depth feature into the epipolar Transformer network layer;
[0186] A feature weight acquisition unit, configured to project the two-dimensional predicted depth feature onto the sample source image according to the position of the two-dimensional predicted depth feature on the sample reference image, so as to obtain a feature weight of the three-dimensional cost volume feature in the depth direction;
[0187] A feature association parameter construction unit, used to construct cost volume feature association parameters between three-dimensional cost volume features of different sample source images based on an inter-group relationship construction method;
[0188] The fused cost volume feature acquisition unit is used to fuse the three-dimensional cost volume feature based on the two-dimensional predicted depth feature, the feature weight and the cost volume feature associated parameter to obtain the three-dimensional fused cost volume feature.
[0189] Optionally, the sample reference image corresponds to a real depth feature, the sample source image is annotated with a real position and a real probability value of a fused cost volume feature, and the three-dimensional fused cost volume feature includes: a predicted probability value and a predicted position,
[0190] The loss value calculation module includes:
[0191] A first loss value calculation unit, configured to calculate a first loss value of the depth feature extraction network layer based on the two-dimensional predicted depth feature and the true depth feature;
[0192] A second loss value calculation unit, configured to calculate a second loss value of the epipolar Transformer network layer based on the predicted probability value, the predicted position, the true probability value, and the true position;
[0193] A loss value calculation unit is used to calculate the loss value of the depth image output model according to the first loss value, the weight corresponding to the first loss value, the second loss value and the weight corresponding to the second loss value.
[0194] The depth image output model training device provided in the embodiment of the present application obtains the two-dimensional image features of the sample reference image and the three-dimensional cost volume features of N sample source images, where N is a positive integer greater than or equal to 2, and the N sample source images are images corresponding to the sample reference image. The deep feature extraction network layer is called to extract the two-dimensional image features to obtain the two-dimensional predicted depth features associated with the depth estimation of the sample reference image. The epipolar line transformer network layer is called to fuse the three-dimensional cost volume features according to the two-dimensional predicted depth features to generate the three-dimensional fused cost volume features corresponding to the sample source image. Based on the two-dimensional predicted depth features and the three-dimensional fused cost volume features, the loss value of the depth image output model is calculated. When the loss value is within a preset range, the trained depth image output model that does not include the depth feature extraction network layer is used as the final target depth image output model. The embodiment of the present application uses the deep feature extraction network layer to extract the image features for depth estimation, and the epipolar line transformer network layer fuses the three-dimensional cost volume features according to the image features for depth estimation, so as to improve the accuracy of the depth image output by the trained model. At the same time, the deep feature extraction network layer is only used in the training phase, and no additional network layer for fusing cost body features is introduced. Compared with the method of introducing DCN (variable convolution) or 2D CNN for cost body feature fusion, the speed of the model outputting deep images can be improved.
[0195] Reference Figure 8 , which shows a schematic diagram of the structure of a depth image acquisition device provided in an embodiment of the present application, such as Figure 8 As shown, the depth image acquisition device 800 may include the following modules:
[0196] The reference image acquisition module 810 is used to acquire a reference image and M source images, where M is a positive integer greater than or equal to 2, and the M source images are images corresponding to the reference image;
[0197] A reference image input module 820 is used to input the reference image and the M source images into a target depth image output model; the target depth image output model includes: an epipolar Transformer network layer and a depth map prediction network layer;
[0198] A fusion feature acquisition module 830 is used to call the epipolar Transformer network layer to fuse the three-dimensional cost volume features of the M source images according to the two-dimensional image features of the reference image, so as to obtain the three-dimensional fused cost volume features corresponding to the M source images;
[0199] The depth image acquisition module 840 is used to call the depth image prediction network layer to process the three-dimensional fusion cost volume features to obtain the depth image of the reference image.
[0200] The depth image acquisition device provided in the embodiment of the present application acquires a reference image and M source images, where M is a positive integer greater than or equal to 2, and the M source images are images corresponding to the reference image, and the reference image and the M source images are input into the target depth image output model, and the target depth image output model includes: an epipolar transformer network layer and a depth map prediction network layer. The epipolar transformer network layer is called to fuse the three-dimensional cost volume features of the M source images and the two-dimensional image features of the reference image to obtain the three-dimensional fused cost volume features corresponding to the M source images. The depth map prediction network layer is called to process the three-dimensional fused cost volume features to obtain the depth image of the reference image. The embodiment of the present application fuses the three-dimensional cost volume features according to the two-dimensional image features through the epipolar transformer network layer in the depth image output model, so as to improve the accuracy of the depth image output by the trained model. At the same time, there is no need to introduce an additional fusion network, which can improve the running speed of the model compared with the method of introducing an additional fusion network in the prior art.
[0201] An embodiment of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the above-mentioned depth image output model training method or depth image acquisition method when executed by the processor.
[0202] Fig. 9 FIG. 1 is a schematic diagram showing the structure of an electronic device 900 according to an embodiment of the present invention. Fig. 9 As shown, the electronic device 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 902 or computer program instructions loaded from a storage unit 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the electronic device 900 can also be stored. The CPU 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0203] Multiple components in the electronic device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, a microphone, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the electronic device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0204] The various processes and processing described above may be performed by the processing unit 901. For example, the method of any of the above embodiments may be implemented as a computer software program, which is tangibly contained in a computer-readable medium, such as the storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the CPU 901, one or more actions in the method described above may be performed.
[0205] The embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the above-mentioned depth image output model training method or depth image acquisition method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0206] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0207] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0208] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
[0209] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0210] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0211] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or groups can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0212] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0213] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0214] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0215] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for training a deep image output model, characterized in that: The deep image output model includes: a deep feature extraction network layer and an epipolar Transformer network layer, and the method includes: Acquire the two-dimensional image features of the sample reference image and the three-dimensional cost volume features of N sample source images; N is a positive integer greater than or equal to 2, and the N sample source images are images corresponding to the sample reference image; Calling the depth feature extraction network layer to perform feature extraction on the two-dimensional image features to obtain two-dimensional predicted depth features associated with depth estimation of the sample reference image; Calling the epipolar Transformer network layer to fuse the three-dimensional cost volume features according to the two-dimensional predicted depth features to generate a three-dimensional fused cost volume feature corresponding to the sample source image; Based on the two-dimensional predicted depth features and the three-dimensional fused cost volume features, a loss value of the depth image output model is calculated; When the loss value is within a preset range, the trained deep image output model that does not include the deep feature extraction network layer is used as the final target deep image output model; Acquire a reference image and M source images, where M is a positive integer greater than or equal to 2, and the M source images are images corresponding to the reference image; Input the reference image and the M source images into a target depth image output model; the target depth image output model includes: an epipolar Transformer network layer and a depth map prediction network layer; Calling the epipolar Transformer network layer to fuse the three-dimensional cost volume features of the M source images according to the two-dimensional image features of the reference image, so as to obtain the three-dimensional fused cost volume features corresponding to the M source images; The depth map prediction network layer is called to process the three-dimensional fusion cost volume features to obtain a depth image of the reference image.
2. The method according to claim 1, characterized in that: The depth image output model includes: a feature extraction layer and a feature conversion layer, The step of acquiring the two-dimensional image features of the sample reference image and the three-dimensional cost volume features of the N sample source images includes: Inputting the sample reference image and N sample source images into the depth image output model; Calling the feature extraction layer to extract the two-dimensional image features of the sample reference image and the two-dimensional sample image features of the N sample source images; The feature conversion layer is called to convert the two-dimensional sample image features into three-dimensional cost volume features under the perspective of the sample reference image based on the differentiable homography transformation matrix and the two-dimensional image features.
3. The method according to claim 2, characterized in that The calling of the feature conversion layer to convert the two-dimensional sample image features into three-dimensional cost volume features under the perspective of the sample reference image based on the differentiable homography transformation matrix and the two-dimensional image features includes: The feature conversion layer is called, and the camera parameters corresponding to the sample reference image and the camera parameters corresponding to the sample source image are used to project the two-dimensional sample image features to the perspective of the sample reference image to obtain the three-dimensional cost volume features of the sample source image at the perspective of the sample reference image.
4. The method according to claim 1, characterized in that: The calling of the epipolar Transformer network layer to fuse the three-dimensional cost volume features according to the two-dimensional predicted depth features to generate the three-dimensional fused cost volume features corresponding to the sample source image includes: Inputting the three-dimensional cost volume features and the two-dimensional predicted depth features into the epipolar Transformer network layer; According to the position of the two-dimensional predicted depth feature on the sample reference image, projecting the two-dimensional predicted depth feature onto the sample source image to obtain a feature weight of the three-dimensional cost volume feature in the depth direction; Based on the inter-group relationship construction method, cost volume feature association parameters between the three-dimensional cost volume features of different sample source images are constructed; Based on the two-dimensional predicted depth feature, the feature weight and the cost volume feature associated parameter, the three-dimensional cost volume feature is fused to obtain the three-dimensional fused cost volume feature.
5. The method according to claim 1, characterized in that The sample reference image corresponds to the real depth feature, the sample source image is annotated with the real position and real probability value of the fused cost volume feature, and the three-dimensional fused cost volume feature includes: a predicted probability value and a predicted position, The calculating the loss value of the depth image output model based on the two-dimensional predicted depth feature and the three-dimensional fusion cost volume feature includes: Based on the two-dimensional predicted depth feature and the true depth feature, a first loss value of the depth feature extraction network layer is calculated; Based on the predicted probability value, the predicted position, the true probability value and the true position, a second loss value of the epipolar Transformer network layer is calculated; The loss value of the depth image output model is calculated based on the first loss value, the weight corresponding to the first loss value, the second loss value and the weight corresponding to the second loss value.
6. A deep image output model training device, characterized in that: The deep image output model includes: a deep feature extraction network layer and an epipolar Transformer network layer, and the device includes: A cost volume feature acquisition module is used to acquire two-dimensional image features of a sample reference image and three-dimensional cost volume features of N sample source images; N is a positive integer greater than or equal to 2, and the N sample source images are images corresponding to the sample reference image; A predicted depth feature acquisition module, used for calling the depth feature extraction network layer to extract the features of the two-dimensional image, and obtaining a two-dimensional predicted depth feature associated with the depth estimation of the sample reference image; A fused cost volume feature generation module, used for calling the epipolar Transformer network layer to perform fusion processing on the three-dimensional cost volume feature according to the two-dimensional predicted depth feature, so as to generate a three-dimensional fused cost volume feature corresponding to the sample source image; A loss value calculation module, used to calculate the loss value of the depth image output model based on the two-dimensional predicted depth feature and the three-dimensional fusion cost volume feature; A deep image output model acquisition module, used to use the trained deep image output model that does not include the deep feature extraction network layer as the final target deep image output model when the loss value is within a preset range; A reference image acquisition module, used to acquire a reference image and M source images; M is a positive integer greater than or equal to 2, and the M source images are images corresponding to the reference image; A reference image input module, used to input the reference image and the M source images into a target depth image output model; the target depth image output model includes: an epipolar Transformer network layer and a depth map prediction network layer; A fusion feature acquisition module, used to call the epipolar Transformer network layer to fuse the three-dimensional cost volume features of the M source images according to the two-dimensional image features of the reference image, so as to obtain the three-dimensional fused cost volume features corresponding to the M source images; The depth image acquisition module is used to call the depth image prediction network layer to process the three-dimensional fusion cost volume features to obtain the depth image of the reference image.
7. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the deep image output model training method described in any one of claims 1 to 5.
8. A readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the depth image output model training method described in any one of claims 1 to 5.
