Feature detection network training, enhanced real-time registration tracking and occlusion processing methods

Through feature detection network training and the combination of virtual depth map and predicted depth map, the efficiency and accuracy problems of augmented reality registration tracking and virtual and real occlusion processing in the existing technology are solved, efficient and accurate augmented reality processing is achieved, and hardware requirements are reduced.

CN114549927BActive Publication Date: 2024-09-10HUAZHONG UNIV OF SCI & TECH
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202210091712.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-26
Publication Date
2024-09-10
Estimated Expiration
2042-01-26

AI Technical Summary

Technical Problem

In existing augmented reality technology, registration tracking and virtual and real occlusion processing have problems of low efficiency, poor accuracy, and low stability. In particular, the direct regression 6D parameter method based on neural networks is difficult to meet the needs of efficiency and accuracy.

Method used

The feature detection network training method is adopted, and the actual key point heat map and depth map of the monocular image are used to construct training samples. The network is trained through the loss function to obtain the predicted key point heat map and depth map. The camera pose is solved by combining perspective projection. The virtual depth map and the predicted depth map undergo virtual and real fusion processing.

Benefits of technology

It improves the speed and accuracy of augmented reality registration and tracking, ensures the accuracy of virtual and real occlusion processing, reduces the system's hardware requirements, and improves the processing efficiency of the augmented reality system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114549927B
    Figure CN114549927B
Patent Text Reader

Abstract

The present invention relates to a method for feature detection network training, augmented reality registration tracking and occlusion processing, comprising: obtaining a monocular image training sample containing annotation information, wherein the annotation information includes an actual key point heat map and an actual depth map corresponding to each monocular image in the monocular image training sample; determining the value of the loss function of the feature detection network according to the actual key point heat map and the actual depth map; adjusting the parameters of the feature detection network according to the value of the loss function to meet the convergence condition, and determining a fully trained feature detection network. The present invention utilizes a feature detection network, can use a monocular image as input, and simultaneously perform camera pose solution and depth map prediction, thereby improving the efficiency of the augmented reality system processing flow and reducing the system's requirements for hardware.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of augmented reality technology, and in particular to feature detection network training, enhanced reality and virtual reality registration tracking and occlusion processing methods. Background Art

[0002] With the development of augmented reality technology, its application in manufacturing, education, medical care, entertainment and other industries is becoming more and more extensive. At the same time, with the development of hardware devices, such as the popularization of head-mounted glasses and mobile tablets, the application of augmented reality technology has also been promoted. This puts forward the requirements for augmented reality technology to be more adaptable, more timely and more accurate. Existing augmented reality registration tracking and virtual and real occlusion processing often need to be processed separately through different algorithms, and rely on the cooperation of multiple sensors. This method not only results in high hardware cost and poor timeliness, but also has problems of low accuracy and stability. In summary, how to improve the speed, accuracy and stability of augmented reality registration tracking and virtual and real occlusion processing has become a key difficulty in the application of augmented reality.

[0003] With the development of deep learning technology, convolutional neural networks have great advantages in tasks such as image classification and object recognition. In the field of augmented reality, deep learning methods have also begun to be gradually applied to augmented reality registration tracking and virtual and real occlusion processes. At present, the augmented reality registration and tracking method based on deep learning is mainly achieved through neural networks, using fully connected layers to directly regress and calculate the 6D pose of the camera or real object. This method of directly regressing 6D parameters using neural networks has the disadvantages of low accuracy and poor timeliness. Therefore, how to carry out accurate, efficient and practical augmented reality applications is an urgent problem to be solved. Summary of the invention

[0004] In view of this, it is necessary to provide a feature detection network training, enhanced real-virtual-real registration tracking and occlusion processing method to overcome the problem that the augmented reality application method in the prior art is not efficient and accurate enough.

[0005] In order to solve the above technical problems, the present invention provides a feature detection network training, comprising:

[0006] Obtaining a monocular image training sample containing annotation information, wherein the annotation information includes an actual key point heat map and an actual depth map corresponding to each monocular image in the monocular image training sample;

[0007] Determining a value of a loss function of the feature detection network according to the actual key point heat map and the actual depth map;

[0008] According to the value of the loss function, the parameters of the feature detection network are adjusted to meet the convergence conditions, and a fully trained feature detection network is determined.

[0009] Furthermore, the step of obtaining a monocular image training sample containing annotation information further includes:

[0010] For each monocular image, select a number of identical key points;

[0011] Convert the plurality of identical key points into a numerical matrix corresponding to each monocular image, and determine the actual key point heat map according to the numerical matrix;

[0012] Collecting the original depth image of each monocular image and filling it to determine the actual depth map;

[0013] Perform image transformation on each monocular image, perform corresponding transformations according to the transformed monocular image, the actual key point heat map, and the actual depth map, and construct enhanced data of the monocular image training sample.

[0014] Further, determining the value of the loss function of the feature detection network according to the actual key point heat map and the actual depth map includes:

[0015] Inputting the monocular image training samples into the feature detection network to determine the predicted key point heat map and predicted depth map corresponding to each monocular image;

[0016] The loss function is determined according to an error between the predicted key point heat map and the actual key point heat map and an error between the predicted depth map and the actual depth map.

[0017] Furthermore, the network structure of the feature detection network includes an input layer, a backbone feature extraction layer, a deconvolution layer, and a first convolution output layer and a second convolution output layer respectively connected to the deconvolution layer, wherein:

[0018] The input layer is used to obtain each monocular image input;

[0019] The backbone feature extraction layer is used to perform a pooling operation on each monocular image using softpool, and add a self-attention mechanism module to output a backbone feature map;

[0020] The deconvolution layer is used to perform a deconvolution decoding operation on the backbone feature map and output a deconvolution feature map;

[0021] The first convolution output layer is used to perform a convolution operation on the deconvolution feature map, and output the predicted key point heat map as a heat map estimation;

[0022] The second convolution output layer is used to perform a convolution operation on the deconvolution feature map, and output the predicted depth map as a depth map estimate.

[0023] The present invention also provides an augmented reality registration tracking method, comprising:

[0024] Obtain the monocular image to be tested;

[0025] Inputting the monocular image to be tested into a fully trained feature detection network to determine a predicted key point heat map, wherein the fully trained feature detection network is determined according to the feature detection network training method as described above;

[0026] The key point coordinate values ​​in the predicted key point heat map are scaled to determine the spatial coordinate values ​​corresponding to the key point coordinate values.

[0027] Further, the scaling process is performed on the key point coordinate values ​​in the predicted key point heat map to determine the spatial coordinate values ​​corresponding to the key point coordinate values, including:

[0028] The coordinates of the maximum value in the predicted key point heat map are used as the key point coordinate values;

[0029] Scaling the key point coordinate value to obtain the corresponding key point image coordinate value, and determining the space coordinate value corresponding to the key point coordinate value;

[0030] According to the image coordinate values ​​of the key points and the space coordinate values, a perspective projection solution is adopted to determine the rotation matrix and the translation matrix corresponding to the real camera.

[0031] The present invention also provides a method for enhancing virtual reality occlusion processing, comprising:

[0032] Obtain the monocular image to be tested;

[0033] Inputting the monocular image to be tested into a fully trained feature detection network to determine a predicted key point heat map and a predicted depth map, wherein the fully trained feature detection network is determined according to the training method of the feature detection network as described above;

[0034] According to the predicted key point heat map, completing augmented reality registration tracking and determining a virtual depth map of the virtual scene;

[0035] A virtual-real fused image is determined according to the virtual depth map and the predicted depth map.

[0036] Further, determining a virtual depth map according to the predicted key point heat map includes:

[0037] Determine a rotation matrix and a translation matrix corresponding to a real camera according to the predicted key point heat map, wherein the rotation matrix and the translation matrix are determined according to the augmented reality registration and tracking method as described above;

[0038] Assigning the rotation matrix and the translation matrix to a virtual camera, and rendering the virtual model through the virtual camera;

[0039] The distance between each pixel point on the surface of the virtual model and the virtual camera is used as the virtual depth value corresponding to each pixel point, wherein the virtual depth value corresponding to each pixel point constitutes the virtual depth map.

[0040] Furthermore, determining the virtual-real fused image according to the virtual depth map and the predicted depth map includes:

[0041] Determine, according to the virtual depth map, a virtual depth value corresponding to each pixel point corresponding to the virtual scene;

[0042] Determine, according to the predicted depth map, a predicted depth value corresponding to each pixel point corresponding to the real scene;

[0043] Each pixel point is traversed, and pixels to be filled in each pixel point are determined according to the virtual depth value and the predicted depth value, so as to complete virtual and real occlusion processing.

[0044] Furthermore, traversing each pixel point, determining the pixel to be filled in each pixel point according to the virtual depth value and the predicted depth value, and completing the virtual and real occlusion processing, includes:

[0045] Each pixel point is traversed, the virtual depth value is compared with the predicted depth value, and the pixel point corresponding to the minimum value obtained by the comparison is filled in the virtual-real fusion image to complete the virtual-real occlusion processing.

[0046] Compared with the prior art, the beneficial effects of the present invention include: in the feature detection network training method, first, the actual key point heat map and actual depth map corresponding to each monocular image are used to construct monocular image training samples, and the monocular image training samples are effectively acquired; then, the corresponding loss function is constructed through the actual key point heat map and the actual depth map, and the feature detection network is trained to effectively mine the corresponding association between the monocular image and the actual key point heat map and the actual depth map; finally, the feature detection network is trained to convergence using the loss function to obtain a fully trained feature detection network, and the feature detection network is subsequently used to quickly obtain the predicted key point heat map and predicted depth map corresponding to the monocular image. In the augmented reality registration and tracking method, the predicted key point heat map corresponding to the monocular image to be tested is predicted using the fully trained feature detection network, and the key point coordinate values ​​in the predicted key point heat map are scaled to efficiently obtain the spatial coordinate values ​​corresponding to each key point image coordinate value, capture the relative relationship between the image coordinates and the spatial coordinates, and perform effective mapping, thereby achieving the rapidity and accuracy of registration and tracking. In the method for processing virtual-real occlusion in augmented reality, first, the monocular image to be tested is effectively acquired; the monocular image to be tested is predicted using a well-trained feature detection network to obtain a corresponding predicted depth map; finally, the depth information of the virtual depth map and the predicted depth map is combined to determine the pixel value that needs to be filled in each pixel point of the virtual-real fusion image, and the final virtual-real fusion image is obtained comprehensively to ensure the accuracy of virtual-real occlusion processing. In summary, the present invention utilizes a feature detection network, can use a monocular image as input, and simultaneously perform camera tracking registration and virtual-real occlusion processing, thereby improving the efficiency of the augmented reality system processing flow and reducing the system's requirements for hardware. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 A schematic diagram of a flow chart of an embodiment of a feature detection network training method provided by the present invention;

[0048] Figure 2 The present invention provides Figure 1 A schematic diagram of a flow chart of an embodiment of constructing a monocular image training sample before step S101;

[0049] Figure 3 The present invention provides Figure 1 A flow chart of an embodiment of step S102;

[0050] Figure 4 A schematic diagram of the structure of an embodiment of a feature detection network provided by the present invention;

[0051] Figure 5 A schematic diagram of a flow chart of an embodiment of an augmented reality registration and tracking method provided by the present invention;

[0052] Figure 6 The present invention provides Figure 5 A schematic diagram of a flow chart of an embodiment of step S503;

[0053] Figure 7 A schematic diagram of a flow chart of an embodiment of a method for enhancing virtual-real occlusion processing provided by the present invention;

[0054] Figure 8 The present invention provides Figure 7 A flow chart of an embodiment of step S703;

[0055] Fig. 9 The present invention provides Figure 7 A flow chart of an embodiment of step S704;

[0056] Fig.10 A structural schematic diagram of an embodiment of a feature detection network training device provided by the present invention;

[0057] Fig.11 A schematic diagram of the structure of an embodiment of an augmented reality registration and tracking device provided by the present invention;

[0058] Fig.12 A structural schematic diagram of an embodiment of a device for enhancing virtual-real occlusion processing provided by the present invention;

[0059] Fig.13 A schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0060] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.

[0061] In the description of the present invention, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0062] In the description of the present invention, reference to an "embodiment" means that a particular feature, structure, or characteristic described in conjunction with the embodiment may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive of other embodiments. It is explicitly and implicitly understood by those skilled in the art that the described embodiments may be combined with other embodiments.

[0063] The present invention provides a method for feature detection network training, augmented reality registration tracking and occlusion processing, which uses the feature detection network to perform two-way information processing on a monocular image, predicts the corresponding depth information and key point information, and provides a new idea for further improving the accuracy and efficiency of augmented reality.

[0064] Before describing the embodiments, the following definitions are given for the relevant terms:

[0065] Augmented Reality: Augmented Reality (AR) is a technology that calculates the position and angle of camera images in real time and adds corresponding images. It is a new technology that "seamlessly" integrates real-world information and virtual-world information. The goal of this technology is to put the virtual world on the real world on the screen and interact with it.

[0066] Augmented reality registration and tracking: Three-dimensional tracking and registration is the tracking and positioning of images or objects in real scenes. Tracking: The system obtains the sensor pose in real time according to the changes in the target position in the real scene, re-establishes the spatial coordinate system according to the user's current perspective, and renders the virtual scene to the exact position in the real environment. This process is called tracking. Furthermore, registration and tracking technology is the core technology of the augmented reality system, and it is also a key technology that affects the timeliness and functionality of augmented reality. At the same time, the immaturity of this technology also hinders the development and improvement of augmented reality technology to the first extent. Registration and tracking technology is a method that can efficiently and quickly align the virtual world with the displayed world, which can well promote the perfect combination of virtual and real scenes. The virtual world has its three-dimensional coordinate system, and the real world also has its three-dimensional coordinate system. Therefore, to match the two different coordinate systems, it is necessary to find the conversion relationship between them, and the process of finding the conversion relationship is called registration;

[0067] Augmented reality virtual and real occlusion: In virtual reality technology, if the occlusion relationship between real objects and virtual objects in the picture is incorrect, it will not only cause users to misjudge the position, but also cause visual fatigue, and even lead to serious consequences in some important areas. For example, when object A appears in front of object B, the wrong occlusion relationship will make the user feel that object A appears behind object B. Therefore, virtual and real occlusion needs to reflect accurate depth information, which plays a very important role in improving the real feeling of augmented reality.

[0068] Based on the description of the above technical terms, in the prior art, neural networks are often used to directly regress the 6D parameters of real objects, which has the disadvantages of low precision and poor timeliness. Therefore, the present invention aims to propose an efficient and accurate augmented reality registration tracking and virtual-real occlusion integration method.

[0069] The specific embodiments are described in detail below:

[0070] The embodiment of the present invention provides a feature detection network training method, combining Figure 1 Come and see, Figure 1 The flowchart of an embodiment of the feature detection network training method provided by the present invention includes steps S101 to S103, wherein:

[0071] In step S101, a monocular image training sample containing annotation information is obtained, wherein the annotation information includes an actual key point heat map and an actual depth map corresponding to each monocular image in the monocular image training sample;

[0072] In step S102, a value of a loss function of the feature detection network is determined according to the actual key point heat map and the actual depth map;

[0073] In step S103, the parameters of the feature detection network are adjusted according to the value of the loss function to meet the convergence condition, and a fully trained feature detection network is determined.

[0074] In an embodiment of the present invention, in a feature detection network training method, first, the actual key point heat map and the actual depth map corresponding to each monocular image are used to construct monocular image training samples, and the monocular image training samples are effectively acquired; then, the corresponding loss function is constructed through the actual key point heat map and the actual depth map, and the feature detection network is trained to effectively mine the corresponding association between the monocular image and the actual key point heat map and the actual depth map; finally, the feature detection network is trained to convergence using the loss function to obtain a fully trained feature detection network, and the feature detection network is subsequently used to quickly obtain the predicted key point heat map and predicted depth map corresponding to the monocular image.

[0075] Among them, the monocular image is preferably an RGB image. It can be understood that the type of monocular image includes but is not limited to the listed RGB images, as long as it can reflect the corresponding plane information.

[0076] As a preferred embodiment, Figure 2 Come and see, Figure 2 The present invention provides Figure 1 The flowchart of an embodiment of constructing a monocular image training sample before step S101 in the embodiment of the present invention specifically includes steps S201 to S204 before step S101, wherein:

[0077] In step S201, for each monocular image, a number of identical key points are selected;

[0078] In step S202, the plurality of identical key points are converted into a numerical matrix corresponding to each monocular image, and the actual key point heat map is determined according to the numerical matrix;

[0079] In step S203, the original depth image of each monocular image is collected and filled to determine the actual depth map;

[0080] In step S204, image transformation is performed on each monocular image, and corresponding transformations are performed according to the transformed monocular image, the actual key point heat map, and the actual depth map to construct enhanced data of the monocular image training sample.

[0081] In the embodiment of the present invention, the collection of actual key point heat maps and actual depth maps is utilized to effectively construct monocular image training samples for training.

[0082] It should be noted that the above key point heat map refers to a heat map generated by using a two-dimensional Gaussian distribution with the key point as the center. The heat map branch of key point detection contains 4 layers or more channels, where each channel corresponds to a key point on the real object.

[0083] It should be noted that the above depth map is a prediction of the depth map corresponding to the input monocular image. The depth map is represented by a single-pass image. When performing deep learning training, the depth needs to be normalized to a pixel value range of 0 to 255.

[0084] As a preferred embodiment, Figure 3 Come and see, Figure 3 The present invention provides Figure 1 The flowchart of step S102 in an embodiment of the present invention is shown in FIG. 1 , wherein step S102 includes steps S301 to S302, wherein:

[0085] In step S301, the monocular image training sample is input into the feature detection network to determine the predicted key point heat map and predicted depth map corresponding to each monocular image;

[0086] In step S302, the loss function is determined according to the error between the predicted key point heat map and the actual key point heat map and the error between the predicted depth map and the actual depth map.

[0087] In an embodiment of the present invention, a loss function is determined based on the error between the predicted key point heat map and the actual key point heat map, and the error between the predicted depth map and the actual depth map to ensure the convergence of the network.

[0088] As a preferred embodiment, Figure 4 Come and see, Figure 4This is a schematic diagram of the structure of an embodiment of a feature detection network provided by the present invention. The network structure of the feature detection network includes an input layer, a backbone feature extraction layer, a deconvolution layer, and a first convolution output layer and a second convolution output layer connected to the deconvolution layer in sequence, wherein:

[0089] The input layer is used to obtain each monocular image input;

[0090] The backbone feature extraction layer is used to perform a pooling operation on each monocular image using softpool, and add a self-attention mechanism module to output a backbone feature map;

[0091] The deconvolution layer is used to perform a deconvolution decoding operation on the backbone feature map and output a deconvolution feature map;

[0092] The first convolution output layer is used to perform a convolution operation on the deconvolution feature map, and output the predicted key point heat map as a heat map estimation;

[0093] The second convolution output layer is used to perform a convolution operation on the deconvolution feature map, and output the predicted depth map as a depth map estimate.

[0094] In an embodiment of the present invention, a feature detection network is set to include a backbone network and an output branch, wherein the backbone network adopts an encoding and decoding network design, and the output branch includes two parts: a heat map branch for key point detection and a depth map branch for depth prediction.

[0095] It should be noted that the method provided by the present invention includes two parts, namely a neural network prediction part and a virtual-real processing part. In the neural network prediction part, a deep learning training data set for virtual-real registration tracking and virtual-real occlusion processing of an augmented reality system is first established, and the data set contains both the key point position information of real objects and the depth information of the scene; then, a new encoding and decoding convolutional neural network, namely a feature detection network (also known as AR-Centernet), is designed. The feature detection network can use a monocular RGB image as output, and predict the key points and corresponding depth images in the RGB image through full convolution layer regression operations. In the virtual-real processing part, the key points output by the feature detection network are used as the basis, and the rotation matrix and translation matrix of the camera are solved by the perspective projection method to complete the augmented reality registration and tracking. On the other hand, the depth image output by the feature detection network is used as the real scene depth, and the depth is compared with the virtual scene to determine the pixel type that needs to be displayed when the virtual and real are fused, and complete the virtual-real occlusion processing.

[0096] It should be noted that after obtaining the above-mentioned predicted key point heat map and predicted depth map, the predicted data needs to be further calculated and processed. The perspective projection solution method is adopted, and the image coordinates of 4 or more key points detected by AR-Centernet and their corresponding spatial coordinates are used as the input of the perspective projection solution to solve the camera's external parameter matrix and complete the augmented reality registration and tracking. On the other hand, through the pixel traversal method, the predicted depth of each pixel is compared with the depth of the virtual scene to determine whether the current pixel is a real pixel or a virtual pixel, and the augmented reality virtual and real occlusion processing is completed.

[0097] The embodiment of the present invention also provides an augmented reality registration tracking method, combining Figure 5 Come and see, Figure 5 The flowchart of an embodiment of the augmented reality registration and tracking method provided by the present invention includes steps S501 to S503, wherein:

[0098] In step S501, a monocular image to be tested is obtained;

[0099] In step S502, the monocular image to be tested is input into a well-trained feature detection network to determine a predicted key point heat map, wherein the well-trained feature detection network is determined according to the feature detection network training method as described above;

[0100] In step S503, the key point coordinate values ​​in the predicted key point heat map are scaled to determine the corresponding image coordinates, and the space coordinate values ​​corresponding to the key point coordinate values ​​are determined.

[0101] In an embodiment of the present invention, in an augmented reality registration and tracking method, a well-trained feature detection network is used to predict the corresponding predicted key point heat map of the monocular image to be tested, and scaling processing is performed according to the key point coordinate values ​​in the predicted key point heat map, so as to efficiently obtain the spatial coordinate values ​​corresponding to the image coordinate values ​​of each key point, capture the relative relationship between the image coordinates and the spatial coordinates, and perform effective mapping, thereby achieving the speed and accuracy of registration and tracking.

[0102] As a preferred embodiment, Figure 6 Come and see, Figure 6 The present invention provides Figure 5 The flowchart of an embodiment of step S503 includes steps S601 to S603, wherein:

[0103] In step S601, the coordinates of the maximum value in the predicted key point heat map are used as the key point coordinate values;

[0104] In step S602, scaling is performed on the key point coordinate values ​​to obtain corresponding key point image coordinates, and the space coordinate values ​​corresponding to the key point coordinate values ​​are determined;

[0105] In step S603, according to the image coordinate values ​​of the key points and the space coordinate values, a perspective projection solution is adopted to determine the rotation matrix and the translation matrix corresponding to the real camera.

[0106] In an embodiment of the present invention, first, the coordinate values ​​of the key points in the predicted key point heat map are determined, and then the corresponding spatial coordinate values ​​are determined. The relationship between the two is used to solve the perspective projection to obtain the corresponding rotation matrix and translation matrix.

[0107] The embodiment of the present invention also provides a method for enhancing virtual reality occlusion processing, combining Figure 7 Come and see, Figure 7 The flowchart of an embodiment of the method for enhancing virtual reality occlusion processing provided by the present invention includes steps S701 to S704, wherein:

[0108] In step S701, a monocular image to be tested is obtained;

[0109] In step S702, the monocular image to be tested is input into a well-trained feature detection network to determine a predicted key point heat map and a predicted depth map, wherein the well-trained feature detection network is determined according to the feature detection network training method as described above;

[0110] In step S703, according to the predicted key point heat map, the tracking registration result is completed to determine the virtual depth map corresponding to the virtual scene;

[0111] In step S704, a virtual-real fused image is determined according to the virtual depth map and the predicted depth map.

[0112] In an embodiment of the present invention, in an enhanced virtual-real occlusion processing method, first, the monocular image to be tested is effectively acquired; a well-trained feature detection network is used to predict the monocular image to obtain a corresponding predicted key point heat map and a predicted depth map; then, the predicted key point heat map is used to complete registration and tracking, and a virtual depth map composed of each pixel is determined; finally, the depth information of the virtual depth map and the predicted depth map is combined to obtain a virtual-real fusion image to ensure the accuracy of virtual-real occlusion processing.

[0113] As a preferred embodiment, Figure 8 Come and see, Figure 8 The present invention provides Figure 7 The flowchart of an embodiment of step S703 in the embodiment includes steps S801 to S803, wherein:

[0114] In step S801, a rotation matrix and a translation matrix corresponding to a real camera are determined according to the predicted key point heat map;

[0115] In step S802, the rotation matrix and the translation matrix are assigned to a virtual camera, and the virtual model is rendered by the virtual camera;

[0116] In step S803, the distance between each pixel point in the virtual scene on the surface of the virtual model and the virtual camera is used as a virtual depth value corresponding to each pixel point, wherein the virtual depth value corresponding to each pixel point constitutes the virtual depth map.

[0117] In an embodiment of the present invention, the predicted key heat map is used to determine the virtual depth value, effectively forming a corresponding virtual depth map for subsequent comparison with the predicted depth map.

[0118] As a preferred embodiment, Fig. 9 Come and see, Fig. 9 The present invention provides Figure 7 The flowchart of an embodiment of step S704 in FIG. 1 includes steps S901 to S903, wherein:

[0119] In step S901, a virtual depth value corresponding to each pixel in the virtual scene is determined according to the virtual depth map;

[0120] In step S902, a predicted depth value corresponding to each pixel in the real scene is determined according to the predicted depth map;

[0121] In step S903, each pixel point is traversed, and the depth relationship of each pixel point is determined according to the virtual depth value and the predicted depth value, so as to complete the virtual and real occlusion processing.

[0122] In the embodiment of the present invention, the final depth value of each pixel is determined by comparing the virtual depth map with the predicted depth map, thereby completing effective virtual and real occlusion processing.

[0123] As a preferred embodiment, the above step S903 specifically includes:

[0124] Traversing each pixel point, comparing the virtual depth value with the predicted depth value, taking the minimum value obtained by the comparison as the final depth value of each pixel point, obtaining the virtual-real fusion image, and completing the virtual-real occlusion processing.

[0125] In the embodiment of the present invention, the minimum value of the virtual depth value and the predicted depth value corresponding to each pixel value is compared and used as the final depth value to ensure the effectiveness and accuracy of virtual-real fusion.

[0126] The following is a more detailed description of the technical solution of the present invention in conjunction with a specific application scenario, wherein the feature detection network is named AR-Centernet, and the specific process is as follows:

[0127] First, create the AR-Centernet training dataset:

[0128] For augmented reality registration, according to the perspective projection principle, 4 or more key point pairs in the same plane that are not collinear can be used to calculate the camera's pose information. Therefore, when the data set is established, for each image in the training data set, 4 or more feature points in the image are selected as key points for AR-Centernet detection. In order to more reliably calculate the key point position, a heat map is used to represent the key point position features;

[0129] For 4 or more key point information in the image, it is further converted into a numerical matrix of 4 or more channels. Each channel in the matrix represents a certain key point. The value of each element in the numerical matrix is ​​generated using a multidimensional Gaussian distribution according to the coordinates corresponding to the key point and the area radius. The numerical value at the feature coordinate in the numerical matrix is ​​the largest, and the corresponding Gaussian probability is also the largest. Within the radius range, the closer the position is to the center coordinate, the closer its corresponding probability is to the maximum probability value, and the closer the real value is to the maximum real value. Outside the radius range, the Gaussian probability and real value of all positions are 0. The mathematical form of regional digitization can be expressed as:

[0130]

[0131] Another task of AR-Centernet is to estimate the depth map of the input monocular RGB image. Microsoft Azure Kinect is used as the depth image acquisition device to collect the depth map corresponding to the RGB image as the standard data for AR-Centernet depth map estimation for network training. Due to the existence of smooth surfaces, infrared light absorbing materials and uneven lighting in the real environment, when the depth camera is used to obtain the depth image, there will be noise and unmeasured hollow areas at the boundary of the object. After obtaining the original depth image, the original depth map needs to be filled because some pixels lack depth information.

[0132] Second, design the AR-Centernet network structure:

[0133] The present invention proposes a convolutional neural network AR-Centernet for registration tracking and virtual-reality occlusion processing of an augmented reality system. AR-Centernet takes a live monocular RGB image as input, detects key points of real objects in the image, and predicts the depth map of the RGB image for augmented reality virtual-reality fusion processing.

[0134] AR-Centernet network structure combination Figure 4 From the above, we can see that the input layer of AR-Centernet is a 512×512×3 RGB image. Resnet-50 is used as the backbone feature extraction network, and softpool is used to perform pooling on Resnet-50, and a self-attention mechanism module is added. The improved Resnet-50 outputs a 16×16×2048 feature map. The feature map is then deconvolved and decoded three times to obtain a higher resolution output, resulting in a 128×128×64 feature map. Finally, this feature map is used for two convolutions, one of which is used for heat map prediction of key point positions. The output of this convolution layer is 128×128×4, where each layer represents a key point position on the assembly object. Another convolution is used to estimate the depth map of the assembly scene. The output of this convolution is 128×128×1, and this layer outputs the depth map corresponding to the input image.

[0135] Third, train AR-Centernet:

[0136] When training AR-Centernet, in order to reduce the risk of overfitting, the AR-Centernet training dataset is enhanced. Five methods are used to enhance the dataset, namely, image rotation, left-right flipping, up-down flipping, adding motion blur, and color space change. When the image is rotated or flipped, the corresponding key point annotation coordinate values ​​also need to be transformed with the image transformation. A deep learning network training framework, such as pytorch, is used to train AR-Centernet until the output value of the loss function remains relatively stable, completing the training of AR-Centernet.

[0137] Fourth, augmented reality registration tracking and virtual and real occlusion processing:

[0138] 1. Augmented reality registration tracking;

[0139] The heatmap output of AR-Centernet represents different keypoint predictions through different convolutional layers. The heatmap generated by the 128×128×4 convolutional layer of the output part is converted into keypoint image coordinate values. The image coordinates of the maximum value in the heatmap are used as the keypoint position. The extracted keypoint coordinate values ​​are then scaled and converted into the image coordinate values ​​of the keypoints of the corresponding assembly object when the original input image is the size of the augmented reality system.

[0140] The augmented reality registration and tracking process is shown above. The augmented reality system is registered and tracked by the key points detected by AR-Centernet. After AR-Centernet calculates the image coordinates corresponding to the key points, it is also necessary to determine the corresponding spatial coordinates. Since each layer of the heat map generated by the AR-Centernet convolutional layer corresponds to a certain key point, it is only necessary to determine the spatial coordinates of the key points corresponding to each layer, that is, the image coordinates of the key points predicted by AR-Centernet can be matched with the spatial point coordinates to solve the camera pose. Before performing the augmented reality presentation, the center of the real object plane where the key point is located is used as the origin of the spatial coordinates. The spatial coordinate value (x w ,y w , z w ).

[0141] After obtaining the spatial coordinates and pixel coordinates of the key points on the image, the following formula can be used to solve and calculate the rotation matrix and translation matrix of the camera.

[0142]

[0143] 2. Enhance the processing of virtual and real occlusion;

[0144] The 128×128×1 convolution output layer of the convolutional neural network AR-Centernet designed by the present invention is used for depth map prediction. After the depth map of the input RGB image is evaluated, the size of the depth map obtained is 128×128. The evaluation result of AR-Centernet needs to be scaled according to the actual input image size as the actual scene depth.

[0145] Among them, in order to accurately perform virtual and real occlusion processing, it is necessary to obtain the depth map of the virtual model in the virtual scene. In the augmented reality system, the origin of the virtual space coordinate system is set to be the same as the origin of the real space coordinate system. At this time, the assembly object in the real space and the virtual model mapped in the virtual space have the same coordinate values. Using the key points detected by AR-Centernet, the camera pose solution method in augmented reality registration and tracking is used to obtain the real camera pose coordinates. The rotation and translation matrix of the real camera is assigned to the virtual camera so that the virtual camera and the real camera have the same pose parameters. After the virtual scene and the real scene, the coordinate values ​​of the virtual camera and the real camera are unified, when the virtual model is rendered and drawn by the virtual camera, the distance from the surface of the virtual model to the virtual camera corresponding to each pixel point is used as the depth value of the pixel to generate the corresponding virtual scene depth map.

[0146] Among them, the process of virtual-real occlusion processing is as shown above. The depth value corresponding to each pixel of the real scene depth image obtained by AR-Centernet is compared with the virtual scene depth image obtained by virtual model rendering after AR-Centernet tracking registration. For pixels at the same position, if the real scene depth is less than the depth value of the virtual scene, the position displays the pixel of the real image. If the real scene depth is greater than the depth value of the virtual scene, the position displays the pixel of the virtual scene rendering image. Traverse each coordinate point position in the image to obtain a virtual-real fusion image with correct virtual-real occlusion processing as the virtual-real fusion image output of the augmented reality system.

[0147] The embodiment of the present invention also provides a feature detection network training device, combined with Fig.10 Come and see, Fig.10 This is a structural diagram of an embodiment of a feature detection network training device provided by the present invention. The feature detection network training device 1000 includes:

[0148] A first acquisition unit 1001 is used to acquire a monocular image training sample containing annotation information, wherein the annotation information includes an actual key point heat map and an actual depth map corresponding to each monocular image in the monocular image training sample;

[0149] A first processing unit 1002 is used to determine a value of a loss function of the feature detection network according to the actual key point heat map and the actual depth map;

[0150] The training unit 1003 is used to adjust the parameters of the feature detection network according to the value of the loss function to meet the convergence condition, and determine a fully trained feature detection network.

[0151] The more specific implementation methods of each unit of the feature detection network training device can be found in the description of the above-mentioned feature detection network training method, and have similar beneficial effects, so they will not be repeated here.

[0152] The embodiment of the present invention also provides an augmented reality registration tracking device, combined with Fig.11 Come and see, Fig.11 This is a schematic diagram of the structure of an embodiment of an augmented reality registration and tracking device provided by the present invention. The augmented reality registration and tracking device 1100 includes:

[0153] The second acquisition unit 1101 is used to acquire a monocular image to be tested;

[0154] A second processing unit 1102 is used to input the monocular image to be tested into a fully trained feature detection network to determine a predicted key point heat map, wherein the fully trained feature detection network is determined according to the feature detection network training method as described above;

[0155] The registration unit 1103 is used to perform scaling processing on the key point coordinate values ​​in the predicted key point heat map to determine the space coordinate values ​​corresponding to the key point image coordinate values.

[0156] The more specific implementation methods of each unit of the augmented reality registration and tracking device can refer to the description of the above-mentioned augmented reality registration and tracking method, and have similar beneficial effects, which will not be repeated here.

[0157] The embodiment of the present invention also provides a device for enhancing virtual reality occlusion processing, combining Fig.12 Come and see, Fig.12 The structure diagram of an embodiment of the device for enhancing virtual reality occlusion processing provided by the present invention is as follows. The device for enhancing virtual reality occlusion processing 1200 comprises:

[0158] The third acquisition unit 1201 is used to acquire a monocular image to be tested;

[0159] The third processing unit 1202 is used to input the monocular image to be tested into a fully trained feature detection network to determine a predicted depth map, wherein the fully trained feature detection network is determined according to the training method of the feature detection network as described above; and is also used to complete tracking registration according to the predicted key point heat map to determine a virtual depth map of the virtual scene;

[0160] The virtual-real fusion unit 1203 is configured to determine a virtual-real fused image according to the virtual depth map and the predicted depth map.

[0161] The more specific implementation of each unit of the enhanced real-virtual-real occlusion processing device can refer to the description of the enhanced real-virtual-real occlusion processing method, and has similar beneficial effects, which will not be repeated here.

[0162] An embodiment of the present invention also provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the program implements the feature detection network training method described above, and / or the augmented reality registration and tracking method described above, and / or the augmented reality virtual-real occlusion processing method described above.

[0163] Generally speaking, the computer instructions for implementing the method of the present invention can be carried by any combination of one or more computer-readable storage media. Non-transitory computer-readable storage media can include any computer-readable media except for the signal itself that is temporarily propagating.

[0164] Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or device.

[0165] Computer program code for performing the operation of the present invention can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages, in particular, Python language suitable for neural network computing and platform frameworks based on TensorFlow, PyTorch, etc. can be used. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0166] The embodiment of the present invention further provides an electronic device, Fig.13 Come and see, Fig.13This is a structural diagram of an embodiment of an electronic device provided by the present invention. The electronic device 1300 includes a processor 1301, a memory 1302, and a computer program stored in the memory 1302 and executable on the processor 1301. When the processor 1301 executes the program, the feature detection network training method as described above, and / or the augmented reality registration and tracking method as described above, and / or the augmented reality virtual-real occlusion processing method as described above are implemented.

[0167] As a preferred embodiment, the above-mentioned electronic device 1300 also includes a display 1303, which is used to display the data processing results after the processor 1301 executes the feature detection network training method as described above, and / or the augmented reality registration and tracking method as described above, and / or the augmented reality virtual-real occlusion processing method as described above.

[0168] Exemplarily, the computer program may be divided into one or more modules / units, one or more modules / units are stored in the memory 1302, and executed by the processor 1301 to complete the present invention. One or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device 1300. For example, the computer program may be divided into the first acquisition unit 1001, the first processing unit 1002, the training unit 1003, the second acquisition unit 1101, the second processing unit 1102, the registration unit 1103, the third acquisition unit 1201, the third processing unit 1202, and the virtual-real fusion unit 1203 in the above-mentioned embodiment. The specific functions of each unit are as described above, and are not repeated here one by one.

[0169] The electronic device 1300 may be a desktop computer, a notebook, a PDA or a smart phone with an adjustable camera module.

[0170] Among them, the processor 1301 may be an integrated circuit chip with signal processing capabilities. The above-mentioned processor 1301 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present invention can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0171] The memory 1302 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electric erasable programmable read-only memory (EEPROM), etc. The memory 1302 is used to store programs, and the processor 1301 executes the program after receiving the execution instruction. The process definition method disclosed in any of the embodiments of the present invention may be applied to the processor 1301 or implemented by the processor 1301.

[0172] The display 1303 may be an LCD display screen or an LED display screen, for example, a display screen on a mobile phone.

[0173] Understandably, Fig.13 The structure shown is only a schematic diagram of the structure of the electronic device 1300. The electronic device 1300 may also include Fig.13 More or fewer components as shown. Fig.13 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0174] The computer-readable storage medium and electronic device provided according to the above embodiments of the present invention can be implemented with reference to the specific description of the feature detection network training method as described above, and / or the augmented reality registration and tracking method as described above, and / or the enhanced reality and virtual reality occlusion processing method as described above according to the present invention, and have similar beneficial effects as the feature detection network training method as described above, and / or the augmented reality registration and tracking method as described above, and / or the enhanced reality and virtual reality occlusion processing method as described above, which will not be repeated here.

[0175] The present invention discloses a method for training a feature detection network, enhancing real-time registration and tracking, and occlusion processing. In the feature detection network training method, first, the actual key point heat map and actual depth map corresponding to each monocular image are used to construct a monocular image training sample, and the monocular image training sample is effectively acquired; then, the corresponding loss function is constructed through the actual key point heat map and the actual depth map, and the feature detection network is trained to effectively mine the corresponding association between the monocular image and the actual key point heat map and the actual depth map; finally, the feature detection network is trained to converge using the loss function to obtain a fully trained feature detection network, and the feature detection network is subsequently used to quickly obtain the predicted key point heat map and predicted depth map corresponding to the monocular image. In the augmented reality registration and tracking method, the predicted key point heat map corresponding to the monocular image to be tested is predicted using a trained feature detection network, and the key point coordinate values ​​in the predicted key point heat map are scaled to efficiently obtain the control coordinate value corresponding to each key point coordinate value, capture the relative relationship between the image coordinates and the space coordinates, and perform effective mapping, thereby achieving the rapidity and accuracy of registration and tracking. In the enhanced virtual-real occlusion processing method, first, the monocular image to be tested is effectively acquired; the monocular image to be tested is predicted using a well-trained feature detection network to obtain the corresponding predicted key point heat map and predicted depth map; then, the predicted key point heat map is used to determine the virtual depth map composed of each pixel; finally, the depth information of the virtual depth map and the predicted depth map is combined to ensure the accuracy and reliability of the depth information, and the virtual-real fusion image is obtained comprehensively to ensure the accuracy of the virtual-real occlusion processing.

[0176] The technical solution of the present invention utilizes a feature detection network and can use a monocular image as input to simultaneously solve the camera pose and predict the depth map, thereby improving the efficiency of the processing flow of the augmented reality system and reducing the system's requirements for hardware.

[0177] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.

Claims

1. A feature detection network training method, characterized in that: include: Obtaining a monocular image training sample containing annotation information, wherein the annotation information includes an actual key point heat map and an actual depth map corresponding to each monocular image in the monocular image training sample; Determining a value of a loss function of the feature detection network according to the actual key point heat map and the actual depth map; Adjusting the parameters of the feature detection network according to the value of the loss function until a convergence condition is satisfied, and determining a fully trained feature detection network; The step of obtaining a monocular image training sample containing annotation information further includes: For each monocular image, select a number of identical key points; Convert the plurality of identical key points into a numerical matrix corresponding to each monocular image, and determine the actual key point heat map according to the numerical matrix; Collecting the original depth image of each monocular image and filling it to determine the actual depth map; Performing image transformation on each monocular image, performing corresponding transformations according to the transformed monocular image, the actual key point heat map, and the actual depth map, to construct enhanced data of the monocular image training sample; The determining the value of the loss function of the feature detection network according to the actual key point heat map and the actual depth map includes: Inputting the monocular image training samples into the feature detection network to determine the predicted key point heat map and predicted depth map corresponding to each monocular image; Determining the loss function according to an error between the predicted key point heat map and the actual key point heat map and an error between the predicted depth map and the actual depth map; The network structure of the feature detection network includes an input layer, a backbone feature extraction layer, a deconvolution layer, and a first convolution output layer and a second convolution output layer respectively connected to the deconvolution layer, wherein: The input layer is used to obtain each monocular image input; The backbone feature extraction layer is used to perform a pooling operation on each monocular image using softpool, and add a self-attention mechanism module to output a backbone feature map; The deconvolution layer is used to perform a deconvolution decoding operation on the backbone feature map and output a deconvolution feature map; The first convolution output layer is used to perform a convolution operation on the deconvolution feature map, and output the predicted key point heat map as a heat map estimation; The second convolution output layer is used to perform a convolution operation on the deconvolution feature map, and output the predicted depth map as a depth map estimate.

2. An augmented reality registration and tracking method, characterized in that: include: Obtain the monocular image to be tested; Inputting the monocular image to be tested into a fully trained feature detection network to determine a predicted key point heat map, wherein the fully trained feature detection network is determined according to the feature detection network training method according to claim 1; The key point coordinate values ​​in the predicted key point heat map are scaled to determine the spatial coordinate values ​​corresponding to the key point coordinate values.

3. The augmented reality registration and tracking method according to claim 2, characterized in that: The scaling process of the key point coordinate values ​​in the predicted key point heat map to determine the spatial coordinate values ​​corresponding to the key point coordinate values ​​includes: The coordinates of the maximum value in the predicted key point heat map are used as the key point coordinate values; Scaling the key point coordinate value to obtain the corresponding key point image coordinate value, and determining the space coordinate value corresponding to the key point coordinate value; According to the image coordinate values ​​of the key points and the space coordinate values, a perspective projection solution is adopted to determine the rotation matrix and the translation matrix corresponding to the real camera.

4. A method for enhancing virtual reality occlusion processing, characterized in that: include: Obtain the monocular image to be tested; Inputting the monocular image to be tested into a fully trained feature detection network to determine a predicted key point heat map and a predicted depth map, wherein the fully trained feature detection network is determined according to the training method of the feature detection network according to claim 1; According to the predicted key point heat map, completing augmented reality registration tracking and determining a virtual depth map of the virtual scene; A virtual-real fused image is determined according to the virtual depth map and the predicted depth map.

5. The method for enhancing virtual reality occlusion processing according to claim 4, characterized in that: Determining a virtual depth map according to the predicted key point heat map includes: Determine a rotation matrix and a translation matrix corresponding to a real camera according to the predicted key point heat map, wherein the rotation matrix and the translation matrix are determined according to the augmented reality registration and tracking method according to claim 3; Assigning the rotation matrix and the translation matrix to a virtual camera, and rendering the virtual model through the virtual camera; The distance between each pixel point on the surface of the virtual model and the virtual camera is used as the virtual depth value corresponding to each pixel point, wherein the virtual depth value corresponding to each pixel point constitutes the virtual depth map.

6. The method for enhancing virtual reality occlusion processing according to claim 4, characterized in that: The step of determining a virtual-real fused image according to the virtual depth map and the predicted depth map comprises: Determine, according to the virtual depth map, a virtual depth value corresponding to each pixel point corresponding to the virtual scene; Determine, according to the predicted depth map, a predicted depth value corresponding to each pixel point corresponding to the real scene; Each pixel point is traversed, and pixels to be filled in each pixel point are determined according to the virtual depth value and the predicted depth value, so as to complete virtual and real occlusion processing.

7. The method for enhancing virtual reality occlusion processing according to claim 6, characterized in that: The traversing each pixel point, determining the pixel to be filled for each pixel point according to the virtual depth value and the predicted depth value, and completing the virtual and real occlusion processing, includes: Each pixel point is traversed, the virtual depth value is compared with the predicted depth value, and the pixel point corresponding to the minimum value obtained by the comparison is filled in the virtual-real fusion image to complete the virtual-real occlusion processing.

Citation Information

Patent Citations

  • Multi-person human body posture estimation method

    CN111339903A

  • Multi-person three-dimensional attitude estimation method based on RGBD cameras

    CN111597976A

  • Hand key point detection method and device and terminal equipment

    CN112336342A

  • Target detection method and device for general articles in electric power scene and storage medium

    CN113344852A

  • Pseudo RGB-d for self-improving monocular slam and depth prediction

    US20210065391A1