Indoor dynamic environment map construction method and system based on image restoration and completion
Through the background restoration network guided by optical flow and the depth completion network of the visual transformer, the problem of interference of dynamic targets on indoor environment maps and lack of depth information is solved, and a detailed and consistent environment map is constructed, which is suitable for robot navigation in complex indoor scenes. and perception tasks.
Patent Information
- Application Number
- CN202410582935.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-11
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-05-11
AI Technical Summary
When constructing an indoor dynamic environment map using existing technology, "ghosts" and lack of depth information caused by dynamic targets affect the usability and consistency of the map. Moreover, due to the limitations of hardware equipment, the depth measurement noise is large, making it impossible to completely construct an environmental map.
The background repair network based on optical flow guidance and the depth completion network of the visual Transformer are used to perform image repair and depth information completion by acquiring indoor depth images, dynamic object mask images and RGB images, and generate repaired RGB images and completions. Depth images are combined with camera estimated trajectories for map construction.
It effectively solves the interference of dynamic targets on the map, restores the occluded environmental information, improves the accuracy and consistency of the map, and builds a more detailed and complete environmental map, which is suitable for robot navigation and perception tasks in complex indoor scenes.
Smart Images

Figure CN118822906A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of environmental map construction, and in particular to a method and system for constructing an indoor dynamic environmental map based on image restoration and completion. Background Art
[0002] Environmental maps are the basis for mobile robots to interact with the world around them. They help robots understand their surroundings and assist them in completing positioning, path planning, navigation and obstacle avoidance, and even more advanced tasks. The presence of moving objects in the scene poses a great challenge to the construction of environmental maps. This is mainly manifested in the fact that dynamic targets will appear as "ghosts" during the mapping process, that is, the ghost images of targets moving between consecutive frames, which seriously affects the availability and consistency of scene maps. If the map is constructed by simply removing dynamic targets, the static background information covered by them will also be removed. Sufficient environmental information is very necessary for home service robots to perform tasks in indoor scenes. In addition, in the current process of restoring scene maps using camera depth information, due to the limitations of hardware equipment, the camera has a large noise when calculating depth, and cannot accurately measure depths that exceed the ranging range of the depth sensor, making it impossible to fully construct an environmental map.
[0003] With the continuous development of science and technology, robotics has been widely infiltrated into various fields, bringing great convenience to people's lives and work, and the market demand for mobile robots is increasing. Environmental maps help mobile robots complete various intelligent tasks such as positioning, navigation, scene understanding, and interaction in unknown environments. In real complex dynamic environments, mobile robots often encounter many challenges when building environmental maps. Among them, the interference of dynamic targets is one of the main difficulties in building a globally consistent map. In complex dynamic environments indoors, dynamic targets such as pedestrians are constantly moving, leaving tracks or occluded areas in the image. Removing these dynamic targets not only destroys the static background information of the map, but may also cause inconsistent holes or noise in the map, making it difficult for the robot to accurately judge the environmental conditions when navigating and positioning.
[0004] The limitations of depth information acquisition are also a major challenge in building a globally consistent map. In complex dynamic environments, depth information is often missing or erroneous due to the camera's acquisition range and accuracy limitations, as well as occlusion and reflection of dynamic objects in the scene. These missing and errors not only affect the three-dimensional structure and spatial relationship of the map, but may also cause the robot to make mistakes in tasks such as navigation and obstacle avoidance. For example, in areas where dynamic targets are severely occluded, the camera cannot accurately obtain depth information, resulting in missing or distorted depth information in these areas of the map. The RGB image restoration-based method cannot well restore the depth of single-channel images occluded by dynamic targets in the scene, and cannot complete the incomplete depth captured by the camera, which leads to the loss of some environmental information when building the environment map.
[0005] In summary, how to repair the holes caused by dynamic targets in RGB images and depth images and fill in the missing depth information caused by device acquisition limitations is of great significance for building a more accurate and consistent environment map. At present, the holes caused by dynamic targets in environment mapping are often repaired by using information from different perspectives or different frames. This process requires the camera to move back and forth in space or use multiple devices to collect environmental information from multiple angles, which increases the cost and is inconsistent with the movement of mobile robots in actual scenarios. Summary of the invention
[0006] In order to solve the deficiencies of the prior art, the present invention provides a method and system for constructing an indoor dynamic environment map based on image restoration and completion;
[0007] On the one hand, a method for constructing an indoor dynamic environment map based on image restoration and completion is provided, including:
[0008] Obtaining the indoor depth image to be mapped, the mask image of the indoor dynamic object to be mapped, the indoor RGB image to be mapped, and the camera estimated trajectory;
[0009] Input the mask image of the indoor dynamic object to be mapped and the indoor RGB image to be mapped into the trained background restoration network guided by optical flow to obtain the restored RGB image to be mapped;
[0010] Based on the mask image of the indoor dynamic object to be mapped, the indoor depth image to be mapped is mask mapped to obtain the hole depth map to be mapped; the hole depth map to be mapped and the repaired RGB image to be mapped are input into the trained visual Transformer-based depth completion network to obtain the completed depth image to be mapped;
[0011] Based on the repaired RGB image to be mapped, the completed depth image to be mapped and the camera estimated trajectory, a map is constructed to obtain a constructed map.
[0012] On the other hand, a system for building indoor dynamic environment maps based on image restoration and completion is provided, including:
[0013] An acquisition module, which is configured to: acquire an indoor depth image to be mapped, an indoor dynamic object mask image to be mapped, an indoor RGB image to be mapped, and a camera estimated trajectory;
[0014] A restoration module is configured to: input the mask image of the indoor dynamic object to be mapped and the indoor RGB image to be mapped into the trained background restoration network guided by optical flow to obtain the restored RGB image to be mapped;
[0015] The completion module is configured to: perform mask mapping on the indoor depth image to be mapped based on the mask image of the indoor dynamic object to be mapped, so as to obtain a hole depth map to be mapped; input the hole depth map to be mapped and the repaired RGB image to be mapped into the trained visual Transformer-based depth completion network to obtain a completed depth image to be mapped;
[0016] The construction module is configured to: construct a map based on the repaired RGB image to be mapped, the completed depth image to be mapped and the camera estimated trajectory to obtain a constructed map.
[0017] On the other hand, there is also provided an electronic device, comprising:
[0018] a memory for non-transitory storage of computer-readable instructions; and
[0019] a processor for executing the computer readable instructions,
[0020] When the computer-readable instructions are executed by the processor, the method described in the first aspect is executed.
[0021] On the other hand, a storage medium is provided, which non-temporarily stores computer-readable instructions, wherein when the non-temporary computer-readable instructions are executed by a computer, the instructions of the method described in the first aspect are executed.
[0022] On the other hand, a computer program product is provided, comprising a computer program, wherein the computer program is used to implement the method described in the first aspect when running on one or more processors.
[0023] The above technical solution has the following advantages or beneficial effects:
[0024] According to the pose estimation obtained during the sensor positioning process, the information missing problem caused by dynamic targets and hardware devices is solved through the RGB image restoration method guided by optical flow and the depth image completion guided by the restored RGB image. The truncated signed distance field is used to build a dense map of the environment, so that the robot can obtain more detailed environmental information to cope with more complex scenes. It promotes mobile robots to better complete visual tasks such as target classification, detection, positioning, interaction, and scene understanding. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0026] Figure 1 Constructing a framework for the environment map of the first embodiment;
[0027] Figure 2 This is a diagram showing the internal structure of a background restoration network based on optical flow guidance in Embodiment 1;
[0028] Figure 3 Schematic diagram of the internal structure of the depth completion network of Example 1;
[0029] Figure 4 This is a diagram of the internal structure of the joint convolution and transformer module (JCAT) of Example 1;
[0030] Figure 5 This is a diagram showing the internal structure of the convolutional attention mechanism of Example 1;
[0031] FIG6( a ) is an RGB image captured by a camera in a real scene of Example 1;
[0032] FIG6( b ) is a restored RGB image of Example 1;
[0033] FIG6( c ) is a depth image containing a dynamic target hole in a real scene of Example 1;
[0034] FIG6( d ) is a completed depth image of Example 1;
[0035] FIG6( e ) is a display of the original data point cloud map of Example 1;
[0036] FIG6( f ) is a representation of the construction of a static point cloud map of Example 1;
[0037] FIG6( g ) is a global dense map representation of the first embodiment. DETAILED DESCRIPTION
[0038] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used in the present invention have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0039] Embodiment 1
[0040] This embodiment provides a method for constructing an indoor dynamic environment map based on image restoration and completion;
[0041] like Figure 1 As shown, the indoor dynamic environment map construction method based on image restoration and completion includes:
[0042] S101: Acquire an indoor depth image to be mapped, a mask image of an indoor dynamic object to be mapped, an indoor RGB image to be mapped, and a camera estimated trajectory;
[0043] S102: inputting the mask image of the indoor dynamic object to be mapped and the indoor RGB image to be mapped into the trained background restoration network guided by optical flow to obtain the restored RGB image to be mapped;
[0044] S103: Based on the mask image of the indoor dynamic object to be mapped, mask mapping is performed on the indoor depth image to be mapped to obtain a hole depth map to be mapped; the hole depth map to be mapped and the repaired RGB image to be mapped are input into the trained visual Transformer-based depth completion network to obtain a completed depth image to be mapped;
[0045] S104: constructing a map based on the restored RGB image to be mapped, the completed depth image to be mapped, and the camera estimated trajectory to obtain a constructed map.
[0046] Further, the S101: acquiring an indoor depth image to be mapped, a mask image of an indoor dynamic object to be mapped, an indoor RGB image to be mapped, and a camera estimated trajectory;
[0047] Among them, the indoor depth image refers to a grayscale image in which each pixel stores the distance information of the camera and is used to describe the three-dimensional structure of the scene. It is obtained by the Realsense D435i camera sensor;
[0048] Among them, the indoor dynamic object mask image refers to a binary image composed of 0 and 1, in which the value of the identified dynamic object area is 1. The mask image is obtained by inputting the RGB image into the mask generation network, and the mask generation network includes: a CenterTrack network and a CondInst network connected in sequence; the mask of the instance target is generated by combining the CenterTrack based on target tracking with the CondInst instance mask generation network. Instance segmentation is an important task in the field of computer vision. It not only segments the image objects but also assigns an identifier to each object. The network outputs a binary mask image of the dynamic instance after inputting the RGB image through the network (the dynamic target area is white and the rest of the area is black).
[0049] Among them, CenterTrack network comes from Zhou X, Koltun V, P.Trackingobjects as points[C] / / European conference on computer vision.Cham:SpringerInternational Publishing,2020:474-490.
[0050] Among them, the CondInst network comes from Tian Z, Shen C, Chen H. Conditional convolutions for instance segmentation [C] / / Computer Vision–ECCV 2020: 16th European Conference, Glasgow, UK, August 23–28, 2020, Proceedings, Part I 16. Springer International Publishing, 2020: 282-298.
[0051] Among them, indoor RGB image refers to a digital image format, which means that the image contains red, green and blue channel pixel values, which is obtained by Realsense D435i camera sensor;
[0052] Among them, the camera estimated trajectory refers to the rigid body transformation of the camera pose of each frame in the process of camera movement from the camera pose of the first frame. A series of transformation matrices during the movement constitute the estimated trajectory of the camera, which is obtained by the DGM-VINS camera pose estimation algorithm.
[0053] Furthermore, if Figure 2 As shown, the S102: trained background restoration network based on optical flow guidance includes:
[0054] A parallel optical flow prediction module and a first encoder;
[0055] The output end of the optical flow prediction module and the output end of the first encoder are both connected to the input end of the feature propagation module;
[0056] The output end of the feature propagation module and the output end of the first encoder are both connected to the input end of the content generation module;
[0057] The output end of the content generation module is connected to the input end of the first decoder;
[0058] The output end of the first decoder is used to output the restored RGB image.
[0059] Furthermore, the optical flow prediction module is implemented using an optical flow estimation network FlowNet2; the optical flow prediction module is used to predict the forward optical flow and backward optical flow of the video.
[0060] Optical flow estimation network FlowNet2, Ilg E, Mayer N, Saikia T, et al. Flownet 2.0: Evolution of optical flow estimation with deep networks [C] / / Proceedings of the IEEE conference on computer vision and pattern recognition. 2017: 2462-2470.
[0061] The optical flow prediction module uses an optical flow prediction network between adjacent frames. The forward and backward optical flows of the video are predicted. However, the movement of dynamic targets in the scene blocks most of the scene information, which becomes a conflict factor in the optical flow estimation and affects the quality of the estimated optical flow. Therefore, it is necessary to restore the bidirectional optical flow. The bidirectional feature propagation loss of the forward and backward optical flows is calculated through the L1 loss function to restore the bidirectional flow feature L flow :
[0062]
[0063] Among them, F t→t+1 is the forward optical flow in the original video reasoning, F t→t-1 is the reverse optical flow in the original video reasoning, It represents the output result of the optical flow prediction network, and T represents the video running time.
[0064] Furthermore, the first encoder comprises: a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer and a fifth convolutional layer connected in sequence;
[0065] Furthermore, the first encoder is used to extract local adjacent features from local adjacent frame images; and is also used to extract non-local reference features from non-local reference frame images.
[0066] Among them, the locally adjacent frames refer to frames whose distance in time or space is less than a set threshold or whose similarity is higher than a set threshold in the process of acquiring data using a camera sensor or in a video sequence.
[0067] The non-local reference frame means that when performing inter-frame prediction, not only the adjacent frames in time or space are referenced, but also the non-adjacent frames in the entire video sequence are considered.
[0068] The first encoder is used to input the RGB image sequence collected by the camera Dynamic target mask sequence with current image sequence The first encoder downsamples the RGB image sequence and the mask sequence to 1 / 4 resolution. Matches the spatial resolution of the features encoded by the first encoder.
[0069] Furthermore, the feature propagation module includes: an affine transformation warping layer, a convolution layer, a LeakyReLU activation function layer, a convolution layer and a LeakyReLU activation function layer connected in sequence.
[0070] Among them, affine transformation warping is a commonly used linear transformation method in image processing, which can change the shape and position of the image through operations such as translation, rotation, scaling and shearing. In general, the warping layer calculates the affine transformation matrix through the affine transformation parameters and applies this matrix to the input image to achieve the geometric transformation of the image.
[0071] Furthermore, the feature propagation module is used to capture the movement of the dynamic mask area from the t-th frame to the t+1-th frame.
[0072] Extract local temporal neighbor features through the first encoder Where T l Indicates the local adjacent frame length.
[0073] Forward optical flow features Capture the motion trajectory from the tth frame to the t+1th frame. Therefore, when the corresponding area of the pixel at the mask feature at time t is known at time t+1, use the back propagation feature at time t+1 Warped to the forward optical flow feature of the current time, and realized with the current feature through the back propagation function of formula (2) Merge and update:
[0074]
[0075] in, It represents the spatial warping function based on optical flow. The specific expression of the spatial warping function based on optical flow is: I1(x, y) = I2(x+u, y+v), and the back propagation feature and the optical flow image feature are aligned by the pixel values at the corresponding positions of the image; is the backward propagation feature at time t, the propagation feature It is a structure of two convolutional layers with ReLU as the activation function. is the back propagation feature of the step size at the tth time. Represents the back propagation feature of the step at time t+1. Represents the forward optical flow prediction result.
[0076] Introduce Deformable ConvNets (DCN) to correct the optical flow to calculate the model mask W t→t+1 and the offset ΔF of the estimated optical flow t→t+1 :
[0077]
[0078] in, is a number of cascaded convolutional layers. t Indicates the current content characteristics. represents the back propagation characteristics of the step length at time t+1, Represents the forward optical flow prediction result, Represents the warping operation of the forward optical flow and the reverse optical flow to achieve optical flow alignment.
[0079] The calculated offset is added to the completed optical flow estimate to further generate K at each spatial location 2 ×G candidate feature points, where K and G represent the kernel size and the number of variable convolutions, respectively.
[0080] Then, use the weight kernel offset to get the back-propagation feature The estimate is:
[0081]
[0082] in, represents the deformable convolution operation, E t Indicates the current content characteristics.
[0083] Weighted mask Wt→t+1 Normalized by the sigmoid function, it can be applied to each sampled pixel to measure its effectiveness. Similarly, it can be calculated and then a 1×1 convolution is used Adaptive fusion forward propagation features With back propagation features Get new features
[0084]
[0085] It should be understood that deformable convolution actually refers to adding an offset to the sampling position in the standard convolution operation, so that the convolution kernel can be expanded to a large range during training. This concept was proposed in ICCV 2017, the paper name is: Deformable Convolutional Networks. The optical flow space warp function is mainly based on the process of image deformation or correction based on photometric consistency. In the present invention, the warp operation is used to align the forward predicted optical flow results with the back-propagation features to reduce the offset and misalignment problems of the front and back results.
[0086] Furthermore, the content generation module utilizes local features and non-local features to achieve feature fusion through a multi-head attention mechanism. The content generation module includes multiple stacked Focal transformer blocks.
[0087] Furthermore, the content generation module is used to effectively combine local and non-local temporal neighborhood information to perform content generation.
[0088] Multiple temporal focal transformers are introduced in the content generation module to fuse local and non-local temporal neighborhood features.
[0089] In the content generation module, soft segmentation is used to embed local and non-local temporal features, and the multi-temporal Focal transformer realizes the expansion of the focal window from 2D space to 3D space.
[0090] The minimum feature Z of the input n-1 Divide into grid size s t ×s h ×s w The segmented features can be directly used to calculate fine-grained local attention.
[0091] In order to achieve global attention at a coarse granularity, a linear embedding layer f is used p(x) = ωx + b pooled sub-window, and the query, key and value of the attention mechanism are calculated through two linear projection layers of formula (6-1) and formula (6-2).
[0092] The purpose of the linear projection layer is to map the output of the attention mechanism to a new feature space so that subsequent network layers can better process the feature representation.
[0093] Linear projection layer, the specific expression is: LinearProjection(x) = ωx + b. In the embedding layer and projection layer formulas, x is the input vector or matrix, ω is the weight matrix, and b is the bias vector.
[0094]
[0095]
[0096] To compute attention using local-global interactions, for the query value of the i-th sub-window The queries in the i-th local window With the i-th expanded coarse-grained window Get Keys from the merged key and value. Focal self-attention pays more attention to specific elements and information when calculating attention weights, allowing the model to capture important information in the input sequence more effectively.
[0097]
[0098] In the nth focal attention process, the multi-head focal self-attention mechanism (MFSA) and layer normalization (LN) are used, and the fusion feed forward network (F3N) is used to embed the relationship between feature blocks. Then the restored RGB image is obtained.
[0099] Z′ n =MFSA(LN1(Z n-1 ))+Z n-1 ; (8-1)
[0100] Z n =F3N(LN2(Z′ n ))+Z′ n ; (8-2)
[0101] Among them, Zn-1 represents the minimum embedding feature containing local and non-local information in the n-1th focal attention; Z′ n is the minimum feature after the multi-head focal self-attention mechanism; Z n is the embedded feature in the nth Focal attention process.
[0102] It should be understood that Focal Self-Attention combines the concepts of self-attention mechanism and focus. It refers to an attention mechanism that pays more attention to specific elements or information when calculating attention weights, so that the model can more effectively capture important information in the input sequence and improve the performance and generalization ability of the model.
[0103] It should be understood that the purpose of the linear projection layer is to map the output of the attention mechanism to a new feature space so that subsequent network layers can better process the feature representation.
[0104] It should be understood that Focal transformer is an efficient attention model open sourced by Microsoft. It is an important optimization of the transformer architecture, aiming to maintain high performance while reducing resource requirements. The core concept of this project is the Focal mechanism, which reduces invalid calculations and improves model calculation efficiency by dynamically adjusting the attention range. The reference is Yang J, Li C, Zhang P, et al. Focal self-attention for local-global interactions in vision transformers[J].arXiv preprint arXiv:2107.00641,2021.
[0105] It should be understood that multi-head focal self-attention (MFSA), Li Z, Lu CZ, Qin J, et al. Towards an end-to-end framework for flow-guided video inpainting [C] / / Proceedings of the IEEE / CVF conference on computer vision and pattern recognition. 2022: 17562-17571.
[0106] Feedforward network (Fusion feed forward network, F3N), Liu R, Deng H, Huang Y, et al. Fuseformer: Fusing fine-grained information in transformers for videoinpainting[C] / / Proceedings of the IEEE / CVF international conference oncomputer vision.2021:14040-14049.
[0107] Furthermore, the first decoder comprises: a sixth convolutional layer, a seventh convolutional layer, a first upsampling layer, an eighth convolutional layer, a ninth convolutional layer, a second upsampling layer and a tenth convolutional layer connected in sequence.
[0108] Furthermore, the first decoder is used to amplify the filled features and reconstruct them into a final completed image sequence.
[0109] Furthermore, if Figure 2 As shown, the S102: trained background restoration network based on optical flow guidance is used to restore background information blocked by dynamic targets.
[0110] Furthermore, the training process of the trained background restoration network based on optical flow guidance in S102 includes:
[0111] Constructing a background restoration network guided by optical flow, constructing a first training set, wherein the first training set is a known restored RGB image, and its corresponding indoor dynamic object mask image and indoor RGB image; inputting the first training set into the background restoration network guided by optical flow, training the network, and obtaining a trained background restoration network guided by optical flow;
[0112] During training, the indoor dynamic object mask image and the indoor RGB image are used as the input values of the background restoration network guided by optical flow, and the known restored RGB image is used as the output value of the background restoration network guided by optical flow.
[0113] Further, the step S103: performing mask mapping on the indoor depth image to be mapped based on the mask image of the indoor dynamic object to be mapped to obtain the hole depth map to be mapped, includes:
[0114] The original depth image and the mask are operated element by element, and the depth value of the corresponding position in the original depth image is set to infinity according to the pixel value in the mask to indicate the depth area blocked by the dynamic object in the depth image.
[0115] Furthermore, if Figure 3 As shown, the trained visual Transformer-based depth completion network includes:
[0116] a second encoder and a second decoder;
[0117] The second encoder comprises: a downsampling layer, a first patch embedding module, a first convolution and transformer joint module, a second patch embedding module, a second convolution and transformer joint module, a third patch embedding module, a third convolution and transformer joint module, a fourth patch embedding module and a fourth convolution and transformer joint module, which are sequentially connected from top to bottom;
[0118] The second decoder comprises: a first deconvolution layer, a first convolution attention layer, a second deconvolution layer, a second convolution attention layer, a third deconvolution layer, a third convolution attention layer, a fourth deconvolution layer, a fourth convolution attention layer, a fifth deconvolution layer and a fifth convolution attention layer, which are sequentially connected from bottom to top;
[0119] The output end of the fourth convolution and Transformer joint module is connected to the input end of the first deconvolution layer; the output end of the third convolution and Transformer joint module is connected to the input end of the second deconvolution layer; the output end of the second convolution and Transformer joint module is connected to the input end of the third deconvolution layer; the output end of the first convolution and Transformer joint module is connected to the input end of the fourth deconvolution layer; the output end of the downsampling layer is connected to the input end of the fifth deconvolution layer;
[0120] The output end of the downsampling layer and the output end of the fifth convolutional attention layer are both connected to the input end of the prediction head, the output end of the prediction head is connected to the input end of the spatial propagation network (Spatial Propagation Networks, SPN), and the output end of the spatial propagation network SPN outputs the completed depth map.
[0121] Furthermore, the downsampling layer is used to obtain a downsampled half-resolution feature map F1 using a ResNet network, thereby reducing the computational cost and memory overhead of the Transformer layer.
[0122] Furthermore, the internal structures of the first patch embedding module, the second patch embedding module, the third patch embedding module and the fourth patch embedding module are the same; the first patch embedding module is used to convolve the feature map F of the previous stage using a convolution with a stride of 2 and a convolution kernel of 3×3. i-1 Divided into 2×2 blocks.
[0123] The patch embedding module is a deep learning module for processing image data. It is used to cut the image into small blocks (called patches or regions) and then convert each patch into a vector representation for easy input into subsequent networks for processing.
[0124] Furthermore, the internal structures of the first convolution and transformer joint module, the second convolution and transformer joint module, the third convolution and transformer joint module and the fourth convolution and transformer joint module are the same, and the first convolution and transformer joint module (Joint Convolutional Attention and Transformer block, JCAT) includes:
[0125] A first branch and a second branch connected in parallel; the first branch is a Transformer layer; the second branch is a convolutional attention layer;
[0126] The first branch comprises: a first branch input end, a first layer normalization module, a space-dimensionality reduction attention layer, a second layer normalization module, a feedforward neural network and a first branch output end connected in sequence;
[0127] The second branch comprises: a second branch input end, a channel attention module, a first multiplier, a spatial attention module, a second multiplier, a third multiplier and a second branch output end connected in sequence;
[0128] The second branch input end is connected to the input end of the first multiplier; the output end of the first multiplier is connected to the input end of the second multiplier; the input end of the second branch is connected to the input end of the third multiplier;
[0129] The first branch input terminal and the second branch input terminal are both connected to the output terminal of the first patch embedding module;
[0130] The first branch output end and the second branch output end are both connected to the input end of the series connection layer, the output end of the series connection layer is connected to the input end of the 3*3 convolutional layer, and the output end of the 3*3 convolutional layer is the output end of the first convolution and Transformer joint module.
[0131] The spatial-reduction attention layer (SRA) is used to process high-resolution features and reduce resource consumption.
[0132] It should be understood that the spatial-reduction attention layer (Spatial-Reduction Attention, SRA), see Wang W, Xie E, Li X, et al. Pyramid vision transformer: Aversatile backbone for dense prediction without convolutions [C] / / Proceedings of the IEEE / CVF international conference on computer vision. 2021: 568-578.
[0133] It should be understood that the spatial attention module refers to dynamically adjusting the importance of each channel so that the model can more effectively utilize the information of the input data. The spatial attention module is derived from Sanghyun Woo, JongchanPark, Joon-Young Lee, and In So Kweon. Cbam: Convolutional block attention module. In ECCV, pages 3–19, 2018.
[0134] It should be understood that the channel attention module refers to an attention mechanism for processing spatial information, which is mainly used to dynamically adjust the importance of different spatial positions of input data in deep learning models to enhance useful information and suppress useless information. The channel attention module is derived from Sanghyun Woo, Jongchan Park, Joon-Young Lee, and In So Kweon. Cbam: Convolutional block attention module. In ECCV, pages 3–19, 2018.
[0135] Furthermore, the first convolution and Transformer joint module is used to enable the network to have local and global features at the same time, allowing different scale feature representations to effectively communicate with each other. In the present invention, connections are established between local and global pixels to achieve reliable pixel depth propagation.
[0136] The convolutional attention layer is used to enhance the representation ability of the convolutional path, which helps to simulate local accurate attention and reduce noise. In addition, the convolutional attention improves the modeling ability of the model and pays more attention to the features provided by the Transformer layer.
[0137] The feedforward neural network is used to pass the extracted features to the next layer of the model.
[0138] The input features of the patch embedding module or the fourth convolution and Transformer joint module are normalized into feature vectors Where C is the number of image channels and N is the number of all pixels in the image feature. Then, the linear transformation learned by the network is used to project the image feature into the corresponding query Q, key K and value vector V. Finally, self-attention is implemented using equation (7).
[0139]
[0140] Furthermore, the internal structures of the first convolutional attention layer, the second convolutional attention layer, the third convolutional attention layer, the fourth convolutional attention layer and the fifth convolutional attention layer are the same, and the first convolutional attention layer is a convolutional block attention module (CBAM) module.
[0141] Convolutional block attention module (CBAM) module, from Sanghyun Woo, Jongchan Park, Joon-Young Lee, and In So Kweon. CBAM: Convolutional block attention module. In ECCV, pages 3–19, 2018.
[0142] like Figure 5 As shown in the figure, the internal structure diagram of the convolutional block attention module (CBAM) module.
[0143] Furthermore, the first convolutional attention layer uses a convolutional attention mechanism to enhance feature fusion in channel and spatial dimensions.
[0144] It should be understood that each convolutional attention layer in the decoder connects the outputs from the corresponding encoding layer and is processed by the corresponding decoding layer. In order to better adapt to features of different scales, the deconvolution layer is used to first upsample the features of the previous decoding layer to the current scale, and then the convolutional block attention module (CBAM) is used to strengthen the feature fusion of the channel and spatial dimensions. Finally, the fusion result from the decoder is connected with the features of the first stage and fed back to the first convolution layer of the prediction head.
[0145] Furthermore, the prediction head includes a hierarchical structure consisting of a convolutional layer, a pooling layer and a fully connected layer, which is used to fuse the results of the decoder processing and the features of the first stage.
[0146] Furthermore, the spatial propagation network (SPN) refers to a neural network structure for processing spatial data such as images or videos.
[0147] Spatial propagation network (SPN), from Sifei Liu, Shalini De Mello, Jinwei Gu, Guangyu Zhong, Ming-Hsuan Yang, and Jan Kautz. Learning affinity via spatial propagation networks. NeurIPS, 2017.
[0148] Furthermore, the spatial propagation network SPN is used to: change from local propagation to non-local propagation, thereby obtaining a spatial propagation accuracy that is almost the same as that of local and non-local.
[0149] In the spatial propagation network, the pixel coordinate system of point p = (u, v) is in the tth step and the non-local neighborhood feature Defined as:
[0150]
[0151] in, represents the depth value at point p, ω u,v (i, j) represents the affinity weight between the reference pixel and the domain pixel, and λ represents the amount of original depth retention.
[0152] After multiple propagations, a refined depth map is finally obtained. The loss function of the spatial propagation network is:
[0153]
[0154] in, is the final output precision depth map, V is the real depth map D gt The set of effective depths in is used to jointly supervise the training of the model through the minimum absolute deviation loss L1 and the least squares error loss L2.
[0155] Furthermore, the trained visual Transformer-based depth completion network is used to: end-to-end restore large-area holes and depth noise in the depth map.
[0156] Furthermore, the training process of the trained visual Transformer-based depth completion network includes:
[0157] S102: constructing a depth completion network based on visual Transformer, and constructing a second training set, wherein the second training set is a known completed depth image, and its corresponding hole depth map and a repaired RGB image; the hole depth map is obtained by performing mask mapping on the indoor depth image based on the indoor dynamic object mask image; the second training set is input into the depth completion network based on visual Transformer to obtain a trained depth completion network based on visual Transformer;
[0158] During training, the hole depth map and the repaired RGB image are used as the input values of the depth completion network based on the visual Transformer, and the known completed depth image is used as the output value of the depth completion network based on the visual Transformer.
[0159] Exemplarily, the trained visual Transformer-based depth completion network uses 15 sequences of static scenes in the TUMRGB-D dataset and 26,925 images for training, of which 70% are used for model training and 30% are used for testing. A mask-to-depth map mapping preprocessing is added before the depth completion network. During training, a depth map containing large irregular holes is created by mapping masks of random shapes and sizes to the depth map. AdamW is used as the optimizer, with an initial learning rate of 0.001, β1=0.9, β2=0.999, and a weight decay rate of 0.01. A total of 200 epochs are trained, and the learning rate is reduced by half at epochs 80, 100, 130, 150, and 180.
[0160] Furthermore, the S104: constructing a map based on the repaired RGB image to be mapped, the completed depth image to be mapped, and the camera estimated trajectory to obtain a constructed map, specifically includes:
[0161] S104-1: Obtaining environmental point cloud information by constructing a point cloud map using the restored RGB image to be mapped and the completed depth image to be mapped;
[0162] S104-2: Based on the environmental point cloud information and the camera estimated trajectory, map construction based on truncated signed distance fields (TSDFs) is implemented to reconstruct the environmental map in the real scene.
[0163] Furthermore, the S104-1: using the restored RGB image to be mapped and the completed depth image to be mapped to obtain environmental point cloud information by constructing a point cloud map, specifically includes:
[0164] Point cloud map A map consisting of point clouds in a three-dimensional world coordinate system is called a point cloud map. The so-called point cloud is a set of discrete points containing three-dimensional coordinates x, y, z and color information r, g, b. For a point with image pixel coordinates p = (u, v), its corresponding three-dimensional space point coordinates in the camera coordinate system are P c =(X,Y,Z), according to the intrinsic parameter matrix K obtained by camera calibration, the pixel coordinate p and camera coordinate P can be obtained c The conversion relationship between them is:
[0165]
[0166] After obtaining the coordinate representation in the camera coordinate system, the image coordinates are converted to the world coordinate system through the camera external parameters to obtain the spatial point coordinates P w After converting all the pixels of the image, the point cloud corresponding to the single frame image can be obtained. Further stitching the point clouds between consecutive images can obtain a dense point cloud map of the scene.
[0167] Furthermore, the S104-2: based on the environmental point cloud information and the camera estimated trajectory, implementing map construction based on truncated signed distance fields TSDFs to reconstruct the environmental map in the real scene specifically includes:
[0168] After obtaining the image point cloud, the point cloud data is divided into a three-dimensional grid map, the truncated signed distance field (TSDF) in the three-dimensional grid map is calculated, and the TSDFs data is converted into a triangular mesh by extracting the isosurface through the Marching Cubes algorithm. Finally, the mesh is optimized and smoothed to improve the quality and performance of the mesh.
[0169] Marching Cubes is a method for creating polygonal surfaces of three-dimensional scalar field isosurfaces in computer graphics. Lorensen WE, Cline H E. Marching cubes: A high resolution 3D surface construction algorithm [M] / / Seminal graphics: pioneering efforts that shaped the field. 1998: 347-353.
[0170] Furthermore, the S104-2: traversing all voxels updated in the truncated signed distance function TSDF map; the truncated signed distance function TSDF map, the specific acquisition process includes:
[0171] S104-21: Calculate the Truncated Signed Distance Function (TSDF). Note that the voxel at the origin (0,0,0) of the TSDF corresponds to the coordinates (x0,y0,z0) in the actual scene, and the coordinates of the voxel x in the TSDF construction are (v x ,v y ,v z ), then its position in the physical world coordinate system is expressed as:
[0172] P x,world =(x0+v x ·voxel.x,y0+v y ·voxel.y,z0+v z ·voxel.z) (12)
[0173] S104-22: Calculate the position of voxel x in the camera coordinate system: According to the camera poses R and T obtained in the pose estimation, the position of voxel x in the camera coordinate system is obtained as follows:
[0174] P x,cam =RP x,world +T (13)
[0175] S104-23: Calculate the camera depth cam corresponding to voxel x z (x): According to the camera imaging model, we know cam z (x)·I x =KP x,cam , K represents the camera intrinsic parameter matrix, I x Represents the pixel coordinate of voxel x in the camera imaging plane.
[0176] S104-24: Draw a straight line between the camera optical center and voxel x and the intersection of the object cross section is P, the depth of point P is d P =D(I x ). Then the signed distance field SDF is:
[0177] SDF(x)=d P -d x =D(I x )-cam z (x) (14)
[0178] S104-25: Calculate TSDF value: When SDF(x)>0, it means that the voxel x is between the camera and the surface of the object; when SDF(x)<0, it means that the voxel is behind the surface of the object. According to the SDF value of the voxel, the TSDF value is calculated as:
[0179] tsdf(x)=max[-1,min(1,SDF(x) / t)]; (15)
[0180] Wherein, t represents the depth difference threshold between voxel x and the section intersection point P, and SDF(x) / t represents truncation.
[0181] When -t≤SDF(x)≤t, tsdf(x)=SDF(x) / t∈[-1,1];
[0182] When SDF(x)>t or SDF(x)<-t, tsdf(x)=1 or -1, which means: when the voxel is very close to the surface, TSDF is close to zero;
[0183] When voxels are very far from the surface, the TSDF value tends to 1 or -1.
[0184] Initialize all voxel TSDFs to 1, which is equivalent to having no surface in the map.
[0185] S104-26: Calculate the TSDF weight of the current frame; based on the findings of Nguyen et al. that the change in the single ray measurement value is closely related to the square of the camera's measured depth, the simplified RGBD model is combined with the Behind-surface descent model to calculate the weight:
[0186]
[0187] Where, the cutoff distance δ=4v, ε=v, and v is the voxel size. This model reduces the voxels that are not actually directly observed (such as voxels behind the surface), which will have a greater impact on thin surfaces observed from multiple perspectives.
[0188] S104-27: Current frame and global fusion: TSDF(P) is named as the fused TSDF value, W(P) is the fusion weight, and the fused global TSDF is:
[0189]
[0190] First, in order to verify the dynamic target hole repair problem based on background repair technology, the present invention adopts the most common and widely used Peak Signal to Noise Ratio (PSNR) and Structural SIMilarity (SSIM) in the field of background repair to evaluate the image sequence after dynamic target hole repair. The evaluation results are shown in Table 1.
[0191] Table 1 Performance experiments of image restoration methods on dynamic datasets
[0192]
[0193] From Table 1, it can be seen that the average peak signal-to-noise ratio of the end-to-end background restoration network based on optical flow used in the present invention for dynamic target restoration is above 30dB, and the structural similarity is close to 1. Especially for the high-resolution OpenLORIS-Scene dataset, the peak signal-to-noise ratio of the image in the corridor and home scenes is close to 40dB, which is close to the original image quality, and the structural similarity is above 0.95. Comprehensive experimental results show that the RGB image after the dynamic target is removed by this method can meet the needs of depth completion and environment mapping.
[0194] Then, in order to verify the effect of the depth completion method on filling the depth holes in the scene, Table 2 compares the root mean square error (RMSE), mean absolute error (MAE), root mean squared error of the inverse depth (iRMSE), root mean square error of the inverse depth (iMAE) and mean absolute relative error (REL) between the predicted depth and the true depth under dynamic sequences with the NLSPN based on the non-local spatial propagation network.
[0195] Table 2 Comparative experiments of depth completion methods under dynamic sequences
[0196]
[0197] The experimental results show that the depth hole completion method used in dynamic environments has better performance. In dynamic scenes, this method can more accurately complete the hole depth information, making the completed depth image more consistent with the actual scene.
[0198] Experiments have shown that in environmental maps that have not been processed by deep learning, there are shadows of dynamic targets, incomplete environmental information, lack of information in distant spaces, and large noise at the boundaries of objects. The method proposed in this invention not only removes dynamic targets in the scene, but also fills in the occluded parts, effectively solving the "ghosting" problem of dynamic targets in the dense map construction process, while restoring all scene information and constructing a globally consistent dense map.
[0199] The real scene selection experiment includes two types of real indoor scenes, from compact laboratory scenes to corridors with weak textures and low features, and spacious halls with different lighting conditions. Multiple individuals walking back and forth in the scene bring challenges to map construction. Figure 6(a) to Figure 6(g) As shown in the figure, the experiment shows that in the actual scene, image restoration can well restore the content blocked by dynamic targets, and the introduction of depth completion technology can effectively restore the depth information in large-area holes, and also avoid the noise generated by the RGB-D camera in the process of depth information acquisition, ensuring the integrity of the depth information in map construction. In the process of building the environment map, the repaired RGB image and depth image are first used to obtain the environment point cloud information through the point cloud map construction method. Subsequently, these point cloud information and the estimated pose data are synchronously input into the map construction link based on TSDFs (truncated signed distance field) to reconstruct the environment map in the real scene. This method not only improves the accuracy of map construction, but also ensures the global consistency of the map, providing a reliable environment model for subsequent robot navigation, environmental perception and other applications.
[0200] Embodiment 2
[0201] This embodiment provides an indoor dynamic environment map construction system based on image restoration and completion;
[0202] Indoor dynamic environment map construction system based on image restoration and completion, including:
[0203] An acquisition module, which is configured to: acquire an indoor depth image to be mapped, an indoor dynamic object mask image to be mapped, an indoor RGB image to be mapped, and a camera estimated trajectory;
[0204] A restoration module is configured to: input the mask image of the indoor dynamic object to be mapped and the indoor RGB image to be mapped into the trained background restoration network guided by optical flow to obtain the restored RGB image to be mapped;
[0205] The completion module is configured to: perform mask mapping on the indoor depth image to be mapped based on the mask image of the indoor dynamic object to be mapped, so as to obtain a hole depth map to be mapped; input the hole depth map to be mapped and the repaired RGB image to be mapped into the trained visual Transformer-based depth completion network to obtain a completed depth image to be mapped;
[0206] The construction module is configured to: construct a map based on the repaired RGB image to be mapped, the completed depth image to be mapped and the camera estimated trajectory to obtain a constructed map.
[0207] It should be noted that the acquisition module, repair module, completion module and construction module described above correspond to steps S101 to S104 in Embodiment 1, and the examples and application scenarios implemented by the modules and the corresponding steps are the same, but are not limited to the contents disclosed in Embodiment 1. It should be noted that the modules described above as part of the system can be executed in a computer system such as a set of computer executable instructions.
[0208] The description of each embodiment in the above embodiments has different emphases. For parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0209] The proposed system can be implemented in other ways. For example, the system embodiment described above is only illustrative, and the division of the modules is only a logical function division. In actual implementation, there may be other division methods, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed.
[0210] Embodiment 3
[0211] This embodiment also provides an electronic device, including: one or more processors, one or more memories, and one or more computer programs; wherein the processor is connected to the memory, and the one or more computer programs are stored in the memory. When the electronic device is running, the processor executes the one or more computer programs stored in the memory so that the electronic device executes the method described in the above embodiment one.
[0212] Embodiment 4
[0213] This embodiment further provides a computer-readable storage medium for storing computer instructions. When the computer instructions are executed by a processor, the method described in the first embodiment is completed.
[0214] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for constructing an indoor dynamic environment map based on image restoration and completion, characterized in that: include: Obtaining the indoor depth image to be mapped, the mask image of the indoor dynamic object to be mapped, the indoor RGB image to be mapped, and the camera estimated trajectory; Input the mask image of the indoor dynamic object to be mapped and the indoor RGB image to be mapped into the trained background restoration network guided by optical flow to obtain the restored RGB image to be mapped; Based on the mask image of the indoor dynamic object to be mapped, mask mapping is performed on the indoor depth image to be mapped to obtain a hole depth map to be mapped; The hole depth map to be mapped and the repaired RGB image to be mapped are input into the trained visual Transformer-based depth completion network to obtain the completed depth image to be mapped; Based on the repaired RGB image to be mapped, the completed depth image to be mapped and the camera estimated trajectory, a map is constructed to obtain a constructed map.
2. The method for constructing an indoor dynamic environment map based on image restoration and completion as claimed in claim 1, characterized in that: The trained background restoration network based on optical flow guidance includes: A parallel optical flow prediction module and a first encoder; The output end of the optical flow prediction module and the output end of the first encoder are both connected to the input end of the feature propagation module; The output end of the feature propagation module and the output end of the first encoder are both connected to the input end of the content generation module; The output end of the content generation module is connected to the input end of the first decoder; The output end of the first decoder is used to output the restored RGB image.
3. The method for constructing an indoor dynamic environment map based on image restoration and completion as claimed in claim 1, characterized in that: The trained background restoration network based on optical flow guidance. The training process includes: Constructing a background restoration network guided by optical flow, constructing a first training set, wherein the first training set is a known restored RGB image, and its corresponding indoor dynamic object mask image and indoor RGB image; inputting the first training set into the background restoration network guided by optical flow, training the network, and obtaining a trained background restoration network guided by optical flow; During training, the indoor dynamic object mask image and the indoor RGB image are used as the input values of the background restoration network guided by optical flow, and the known restored RGB image is used as the output value of the background restoration network guided by optical flow.
4. The method for constructing an indoor dynamic environment map based on image restoration and completion as claimed in claim 1, characterized in that: The trained visual Transformer-based depth completion network includes: a second encoder and a second decoder; The second encoder comprises: a downsampling layer, a first convolution and Transformer joint module, a second convolution and Transformer joint module, a third convolution and Transformer joint module and a fourth convolution and Transformer joint module connected sequentially from top to bottom; The second decoder comprises: a first deconvolution layer, a first convolution attention layer, a second deconvolution layer, a second convolution attention layer, a third deconvolution layer, a third convolution attention layer, a fourth deconvolution layer, a fourth convolution attention layer, a fifth deconvolution layer and a fifth convolution attention layer, which are sequentially connected from bottom to top; The output end of the fourth convolution and Transformer joint module is connected to the input end of the first deconvolution layer; the output end of the third convolution and Transformer joint module is connected to the input end of the second deconvolution layer; the output end of the second convolution and Transformer joint module is connected to the input end of the third deconvolution layer; the output end of the first convolution and Transformer joint module is connected to the input end of the fourth deconvolution layer; the output end of the downsampling layer is connected to the input end of the fifth deconvolution layer; The output end of the downsampling layer and the output end of the fifth convolutional attention layer are both connected to the input end of the prediction head, the output end of the prediction head is connected to the input end of the spatial propagation network SPN, and the output end of the spatial propagation network SPN outputs the completed depth map.
5. The method for constructing an indoor dynamic environment map based on image restoration and completion as claimed in claim 1, characterized in that: The training process of the trained visual Transformer-based depth completion network includes: Constructing a depth completion network based on visual Transformer, constructing a second training set, wherein the second training set is a known completed depth image, and its corresponding hole depth map and a repaired RGB image; the hole depth map is obtained by performing mask mapping on the indoor depth image based on the indoor dynamic object mask image; the second training set is input into the depth completion network based on visual Transformer to obtain a trained depth completion network based on visual Transformer; During training, the hole depth map and the repaired RGB image are used as the input values of the depth completion network based on the visual Transformer, and the known completed depth image is used as the output value of the depth completion network based on the visual Transformer.
6. The method for constructing an indoor dynamic environment map based on image restoration and completion as claimed in claim 1, characterized in that: The map is constructed based on the repaired RGB image to be constructed, the completed depth image to be constructed and the camera estimated trajectory to obtain the constructed map, specifically including: Using the restored RGB image to be mapped and the completed depth image to be mapped, the point cloud information of the environment is obtained by constructing a point cloud map. Based on the environmental point cloud information and the camera estimated trajectory, map construction based on truncated signed distance fields TSDFs is implemented to reconstruct the environmental map in the real scene.
7. Indoor dynamic environment map construction system based on image restoration and completion, characterized by: include: An acquisition module, which is configured to: acquire an indoor depth image to be mapped, an indoor dynamic object mask image to be mapped, an indoor RGB image to be mapped, and a camera estimated trajectory; A restoration module is configured to: input the mask image of the indoor dynamic object to be mapped and the indoor RGB image to be mapped into the trained background restoration network guided by optical flow to obtain the restored RGB image to be mapped; A completion module is configured to: perform mask mapping on the indoor depth image to be mapped based on the mask image of the indoor dynamic object to be mapped, so as to obtain a hole depth map to be mapped; The hole depth map to be mapped and the repaired RGB image to be mapped are input into the trained visual Transformer-based depth completion network to obtain the completed depth image to be mapped; The construction module is configured to: construct a map based on the repaired RGB image to be mapped, the completed depth image to be mapped and the camera estimated trajectory to obtain a constructed map.
8. An electronic device, comprising: a memory for non-transitory storage of computer readable instructions; as well as a processor for executing the computer readable instructions, Wherein, when the computer-readable instructions are executed by the processor, the method described in any one of claims 1 to 6 is executed.
9. A storage medium characterized by being non-temporary The computer-readable instructions are stored, wherein when the non-transitory computer-readable instructions are executed by a computer, the instructions of the method according to any one of claims 1 to 6 are executed.
10. A computer program product, characterized in that The invention comprises a computer program, which is used to implement the method according to any one of claims 1 to 6 when running on one or more processors.
Citation Information
Patent Citations
Depth completion method and device based on attention panoramic perception guidance
CN116245930A
Three-dimensional reconstruction method and system for indoor scene
CN116797742A
Depth image completion method based on Transform
CN117422644A
Two-stage multi-scale hyperspectral snapshot compression imaging image reconstruction method
CN117974909A
Image processing method and related apparatus
WO2024002211A1
Cited By
Scene object shielding complementing method and device based on spatio-temporal joint priori knowledge
CN119006834A
Arc screen multi-view 3D image generation method and device
CN119671885A
Curved screen multi-view 3D image generation method and device
CN119671885B
Hanging object three-dimensional space accurate positioning method
CN120014057A
Scene reconstruction model training method and device, equipment, medium and product
CN120182500A
