A real-time grid map generation system for XR devices

Real-time grid map generation in XR devices is carried out through depth sensors and Gaussian processes, which solves the problem of high time consumption of grid map generation in the existing technology and realizes the real-time grid map generation capability on XR devices.

CN118628680BActive Publication Date: 2024-10-29HANGZHOU HUIJIAN ZHILIAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing grid map generation is time-consuming and cannot be effectively run in real-time application scenarios, especially when meeting the requirements of virtual and real occlusion, collision, and light field estimation in XR devices.

Method used

The depth sensor is used to obtain point cloud data, and the position and attitude estimation unit and Gaussian process are combined to perform voxel unit segmentation and surface reconstruction. The voxel library is used to store the latest information. The map generation module quickly generates triangular patches based on the voxel library information.

Benefits of technology

It improves calculation efficiency and simplifies processing, meets the real-time requirements of XR equipment, and realizes the ability to quickly generate grid maps.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628680B_ABST
    Figure CN118628680B_ABST
Patent Text Reader

Abstract

The present invention relates to a real-time grid map generation system for XR devices, which belongs to the field of grid map technology and solves the problem of high time consumption in grid map generation in the prior art. The system includes: a depth sensor for real-time acquisition of point cloud data; a position and posture estimation unit for real-time detection of the posture data of the XR device; a voxel library for storing the latest voxel unit information; a reconstruction module for determining the voxel unit at the current moment according to the point cloud data at the current moment and the posture data of the XR device, and performing surface reconstruction based on Gaussian process estimation for the voxel unit judged as a surface type; updating the voxel unit information in the voxel library based on the voxel unit at the current moment; and a map generation module for generating triangular facets of a grid map based on the voxel unit information in the voxel library at the current moment. Real-time grid map generation of XR devices is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of grid map technology, and in particular to a real-time grid map generation system for XR devices. Background Art

[0002] Commonly used 3D model representation methods include point cloud maps, occupancy grid maps, TSDF (Truncated Signed Distance Function) maps, Surfel patch maps and grid maps. Among them, mesh maps have the advantages of being able to approximate most complex 3D model structures, avoiding discontinuities, low storage costs and high scalability compared to other maps.

[0003] The time consumption of existing mesh map generation is exponentially related to the number of 3D points, which is very time-consuming. Therefore, it is mainly suitable for offline processing scenarios, which limits its popularity in real-time application scenarios and is not suitable for application scenarios with high real-time requirements. In the application scenarios of XR (Extended Reality) devices, the Mesh map needs to be updated in real time to meet spatial computing requirements such as virtual-real occlusion, virtual-real collision, and light field estimation. Therefore, existing technologies cannot run in real time on XR devices. Summary of the invention

[0004] In view of the above analysis, an embodiment of the present invention aims to provide a real-time grid map generation system for an XR device, so as to solve the problem of high time consumption of existing grid map generation.

[0005] On the one hand, an embodiment of the present invention provides a real-time grid map generation system for an XR device, including:

[0006] Depth sensor for collecting point cloud data in real time;

[0007] A position and posture estimation unit, used for detecting the position and posture data of the XR device in real time;

[0008] Voxel library, used to store the latest voxel unit information;

[0009] A reconstruction module, used to determine the voxel unit at the current moment according to the point cloud data at the current moment and the posture data of the XR device, and perform surface reconstruction based on Gaussian process estimation on the voxel unit determined to be a surface type; and update the voxel unit information in the voxel library based on the voxel unit at the current moment;

[0010] The map generation module is used to generate triangular facets of the grid map based on the voxel unit information in the voxel library at the current moment.

[0011] Based on the further improvement of the above system, the map generation module generates triangular facets based on the voxel unit information in the voxel library at the current moment in the following manner:

[0012] Each voxel unit marked as having undergone surface reconstruction in the voxel library is traversed in turn as the current voxel unit;

[0013] For the current voxel unit, traverse each 3D reconstruction point in each surface reconstruction direction in turn. If the current reconstruction point has a diagonal grid point on the grid corresponding to the zero plane in the surface reconstruction direction, construct a triangular face based on the grid point corresponding to the current reconstruction point on the zero plane in the surface reconstruction direction.

[0014] The uncertainty of the triangular facet is calculated, and if the uncertainty of the triangular facet is less than a sixth threshold, the triangular facet is output.

[0015] Based on the further improvement of the above system, the uncertainty of the triangle patch is calculated using the following formula:

[0016] ;

[0017] in, represents the uncertainty of the triangle patch, , and They respectively represent the uncertainty of the three reconstruction points constituting the triangular patch.

[0018] Based on the further improvement of the above system, a triangular patch is constructed based on the grid points corresponding to the current reconstruction point on the zero plane of the surface reconstruction direction, including:

[0019] Taking the grid point corresponding to the current reconstruction point on the zero plane in the surface reconstruction direction as the current grid point, determining the adjacent grid points and diagonal grid points of the current grid point;

[0020] The current reconstruction point, the reconstruction point corresponding to the adjacent grid point of the current grid point, and the reconstruction point corresponding to the diagonal grid point of the current grid point are used as the three vertices of the triangular face to construct a triangular face.

[0021] Based on the further improvement of the above system, the reconstruction module uses the following method to perform surface reconstruction on the voxel units judged as surface type based on Gaussian process estimation:

[0022] Determining the surface reconstruction direction of the voxel unit based on principal component analysis;

[0023] For each surface reconstruction direction, a Gaussian process is used to estimate the three-dimensional points of the voxel unit to obtain the reconstruction points and the uncertainty of each reconstruction point.

[0024] Based on the further improvement of the above system, the surface reconstruction direction of the voxel unit is determined in the following manner based on principal component analysis:

[0025] Performing principal component analysis on all three-dimensional points in the voxel unit to obtain corresponding eigenvalues ​​and eigenvectors;

[0026] Calculate the angles between the eigenvector corresponding to the minimum eigenvalue and the three coordinate axes and sort them from small to large to obtain the first angle, the second angle and the third angle;

[0027] If the difference between the second angle and the first angle is greater than or equal to the second threshold, the coordinate axis direction corresponding to the first angle is the surface reconstruction direction;

[0028] If the difference between the second angle and the first angle is less than the second threshold, and the difference between the third angle and the second angle is greater than or equal to the third threshold, the coordinate axis directions corresponding to the first angle and the second angle are both surface reconstruction directions;

[0029] If the difference between the second angle and the first angle is smaller than the second threshold, and the difference between the third angle and the second angle is smaller than the third threshold, the directions of the three coordinate axes are all surface reconstruction directions.

[0030] Based on the further improvement of the above system, for each surface reconstruction direction, the reconstruction point and the uncertainty of each reconstruction point are estimated by using Gaussian process based on the three-dimensional points of the voxel unit, including:

[0031] Meshing the zero plane in the surface reconstruction direction to obtain grid points;

[0032] Projecting the three-dimensional point onto the zero plane of the surface reconstruction direction to obtain a projection point;

[0033] For each grid point, find the nearest projection point, and add the three-dimensional point corresponding to the nearest projection point to the observation point set;

[0034] Taking the three-dimensional points in the observation point set as observation points, the numerical values ​​and uncertainties of the grid points in the surface reconstruction direction are obtained by using Gaussian process estimation based on the values ​​of the observation points in the surface reconstruction direction, and the reconstruction points and the uncertainty of each reconstruction point are obtained.

[0035] Based on the further improvement of the above system, the value and uncertainty of the grid point in the surface reconstruction direction are obtained by using the following formula based on the value of the observation point in the surface reconstruction direction:

[0036] ; ;

[0037] in, is a numerical vector representing the grid point in the direction of surface reconstruction, represents the uncertainty vector of the value of the grid point in the surface reconstruction direction, m represents the number of grid points, n represents the number of observation points, represents the numerical vector of the observation point in the direction of surface reconstruction, noise represents the noise of the observation point, K represents the kernel function matrix of Gaussian process estimation, I represents the identity matrix, and diag(·) represents taking the diagonal elements of the matrix.

[0038] Based on the further improvement of the above system, the voxel unit information in the voxel library is updated based on the voxel unit at the current moment, including:

[0039] For each voxel unit at the current moment, if the voxel unit in the voxel library has not been reconstructed, the three-dimensional point of the voxel unit in the voxel library and the three-dimensional point of the voxel unit at the current moment are merged, and based on the merged three-dimensional point, it is determined whether the voxel unit is a surface type, and if so, the voxel unit is reconstructed by using Gaussian process estimation to obtain the reconstruction result of the voxel unit, and the voxel unit in the voxel library is updated;

[0040] If the voxel unit in the voxel library has undergone surface reconstruction, updating the voxel unit in the voxel library according to the uncertainty of the reconstruction result at the current moment;

[0041] The reconstruction result includes a surface reconstruction direction, a reconstruction point in each surface reconstruction direction, and an uncertainty of each reconstruction point.

[0042] Based on the further improvement of the above system, the voxel unit in the voxel library is updated according to the uncertainty of the reconstruction result at the current moment, including:

[0043] Each reconstruction point in each surface reconstruction direction in the reconstruction result of the voxel unit at the current moment is traversed in turn. If the uncertainty of the reconstruction point and the uncertainty of the reconstruction point corresponding to the voxel unit in the voxel library are both less than the fourth threshold, the reconstruction point and uncertainty corresponding to the voxel unit in the voxel library are updated using the following formula:

[0044] ;

[0045] ;

[0046] Otherwise, if the uncertainty of the reconstruction point is less than the uncertainty of the reconstruction point corresponding to the voxel unit in the voxel library, the reconstruction point and uncertainty corresponding to the voxel unit in the voxel library are updated using the following formula:

[0047] mGpP = cGpP;

[0048] mGpVar = cGpVar;

[0049] Among them, cGpP represents the reconstruction point of the voxel unit at the current moment; cGpVar represents the uncertainty of the reconstruction point of the voxel unit at the current moment, mGpP represents the reconstruction point corresponding to the voxel unit in the voxel library, and mGpVar represents the uncertainty of the reconstruction point corresponding to the voxel unit in the voxel library.

[0050] Compared with the prior art, the present invention obtains the point cloud data of the current moment at each moment through a depth sensor, obtains the posture data of the XR device at each moment through a position and posture estimation device, determines the voxel unit of the current moment according to the point cloud data of the current moment and the posture data of the XR device through a reconstruction module, thereby performing voxel unit segmentation on the point cloud data of the current moment. These voxel units are independent of each other and can be processed in parallel, thereby improving the calculation efficiency; for the voxel units whose type is judged to be surface type, surface reconstruction is performed based on Gaussian process estimation, while for the voxel units of non-surface type, reconstruction is not performed, thereby further simplifying the processing process and improving efficiency; then, based on the voxel units of the current moment, the voxel unit information in the voxel library is updated, so that the voxel library stores the latest voxel unit information; the map generation module can quickly generate the triangular facets of the grid map based on the voxel unit information in the voxel library at the current moment, thereby quickly generating the grid map to meet the real-time requirements of the XR device.

[0051] In the present invention, the above-mentioned technical solutions can also be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can become obvious from the description, or can be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The accompanying drawings are only used for the purpose of illustrating specific embodiments and are not to be considered as limiting the present invention. In the entire drawings, the same reference symbols represent the same components;

[0053] Figure 1 A block diagram of a real-time grid map generation system for an XR device according to an embodiment of the present invention;

[0054] Figure 2 A schematic diagram of zero plane mesh division according to an embodiment of the present invention;

[0055] Figure 3 It is a schematic diagram of projection of a three-dimensional point on the zero plane according to an embodiment of the present invention;

[0056] Figure 4 A triangulated schematic diagram of an embodiment of the present invention;

[0057] Figure 5 Schematic diagram of triangulated connections between adjacent voxels according to an embodiment of the present invention. DETAILED DESCRIPTION

[0058] 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.

[0059] A specific embodiment of the present invention discloses a real-time grid map generation system for XR devices, such as Figure 1 As shown, including:

[0060] Depth sensor for collecting point cloud data in real time;

[0061] A position and posture estimation unit, used for detecting the position and posture data of the XR device in real time;

[0062] Voxel library, used to store the latest voxel unit information;

[0063] A reconstruction module is used to determine the voxel unit at the current moment according to the point cloud data at the current moment, and to perform surface reconstruction on the voxel unit determined to be a surface type based on Gaussian process estimation; and to update the voxel unit information in the voxel library based on the voxel unit at the current moment;

[0064] The map generation module is used to generate a triangular patch mesh of a grid map based on the voxel unit information in the voxel library at the current moment.

[0065] The depth sensor may be, for example, a depth camera.

[0066] In implementation, the voxel library stores voxel unit information through a dictionary Map. The key of the dictionary Map is Cid, which is the number of the voxel unit, and the value is a CellMap structure. The CellMap structure is defined as follows:

[0067] struct CellMap {

[0068] std::uint64_t timestamp;

[0069] std::vector <eigen::vector3d>P;

[0070] std::vector <eigen::vector3d>GpP[3];

[0071] std::vector <double>GpVar[3];

[0072] bool b_surface;

[0073] bool reconstruct_dir[3];

[0074] bool b_reconstruct;

[0075] }

[0076] Where timestamp is the timestamp corresponding to the current depth data; P is an array used to store the 3D points belonging to the cell; GpP is a 3D array used to store the 3D point list predicted by Gaussian process estimation in the three surface reconstruction directions of X, Y, and Z; GpVar is a 3D array used to store the variance value, i.e., uncertainty, of the 3D points predicted by Gaussian process estimation in the three surface reconstruction directions of X, Y, and Z. The variance value is used to describe the uncertainty of the 3D points estimated by Gaussian process. The smaller the value, the lower the uncertainty of the 3D points estimated by Gaussian process; b_surface represents whether the cell is a surface, and the default value is false; reconstruct_dir[0], reconstruct_dir[1], reconstruct_dir[2] represent whether the surface is reconstructed in the X-axis direction, Y-axis direction, and Z-axis direction, and the default value is false; b_reconstruct represents whether the cell has been reconstructed, and the default value is false. Initially, the voxel library is empty. During implementation, the latest information of the voxel units of the grid map is stored in the voxel library, and the grid map is updated by updating the voxel library. The map generation module generates triangular faces of the grid map according to the information of the voxel units in the voxel library at the current moment, so as to provide map rendering, collision detection, lighting estimation and other subsequent spatial calculation modules for corresponding calculation tasks.

[0077] It should be noted that the voxel unit at the current moment is the voxel unit to which the point cloud data at the current moment belongs.

[0078] Compared with the prior art, the real-time grid map generation system for XR devices provided in this embodiment obtains the point cloud data of the current moment at each moment through a depth sensor, obtains the posture data of the XR device at each moment through a position and posture estimation device, and determines the voxel unit of the current moment according to the point cloud data of the current moment and the posture data of the XR device through a reconstruction module, thereby performing voxel unit segmentation on the point cloud data of the current moment. These voxel units are independent of each other and can be processed in parallel, thereby improving computational efficiency; surface reconstruction is performed based on Gaussian process estimation on voxel units that are judged to be surface types, while reconstruction is not performed on non-surface voxel units, thereby further simplifying the processing process and improving efficiency; then, the voxel unit information in the voxel library is updated based on the voxel unit at the current moment, so that the voxel library stores the latest voxel unit information; the map generation module can quickly generate triangular facets of the grid map based on the voxel unit information in the voxel library at the current moment, thereby quickly generating a grid map to meet the real-time requirements of the XR device.

[0079] The application scenarios of the present invention are not limited to XR devices. Devices with a posture position estimation unit that can perform posture position estimation and a depth sensor for collecting depth data can all apply the method of the present invention to perform real-time grid map updates.

[0080] During implementation, the point cloud data obtained at each moment corresponds to the timestamp t.

[0081] During implementation, in order to reduce the influence of noise, a voxel filtering algorithm may be used to filter the point cloud data at time t. For example, the pclVoxelFilter method of the PCL library may be used for filtering.

[0082] Specifically, the reconstruction module determines the voxel unit at the current moment according to the point cloud data at the current moment and the pose data of the XR device in the following manner:

[0083] S11. Converting the point cloud data at the current moment into a world coordinate system according to the posture data of the XR device to obtain the point cloud data at the current moment in the world coordinate system;

[0084] S12, calculating the number of the voxel unit to which each three-dimensional point belongs according to the coordinates of each three-dimensional point of the point cloud data at the current moment in the world coordinate system and the side length of the voxel unit, and obtaining the voxel unit at the current moment.

[0085] Specifically, the point cloud data at the current moment is converted to the world coordinate system using the following formula to obtain the point cloud data at the current moment in the world coordinate system:

[0086] ;

[0087] Among them, WDt represents the point cloud data at the current moment in the world coordinate system, Represents the position and posture data of the position and posture estimation unit in the world coordinate system at the current moment, It represents the pose parameters from the position and attitude estimation unit to the depth sensor, and Dt represents the point cloud data of the depth sensor at the current moment.

[0088] The point cloud data WDt at the current time t converted to the world coordinate system is divided into voxel cells Cell with corresponding numbers Cid. Each Cell is independent of each other, so that surface reconstruction can be performed in parallel.

[0089] It should be noted that the voxel unit is a cube and its number is globally unique. For any three-dimensional point, its voxel unit can be uniquely determined based on its coordinates.

[0090] Specifically, the number of the voxel unit to which each 3D point belongs is calculated using the following formula:

[0091] ; ; ;

[0092] in, Indicates the minimum coordinate value of the point cloud data at the current moment.

[0093] Indicates the maximum coordinate value of the point cloud data at the current moment, Gs indicates the side length of the voxel unit, Indicates the starting coordinate point of the starting voxel unit of the point cloud data at the current moment, Indicates the number of voxel units in the X-axis direction of the point cloud data at the current moment. Indicates the number of voxel units in the Y-axis direction of the point cloud data at the current moment. Indicates the number of voxel units in the Z-axis direction of the point cloud data at the current moment, Cid indicates the number of the voxel unit, floor(·) indicates rounding down, ceil(·) indicates rounding up, and (x, y, z) indicates the coordinates of the three-dimensional point.

[0094] It should be noted that Represents the minimum value of all 3D points on the X-axis, Y-axis, and Z-axis of the point cloud data (in the world coordinate system) at the current moment. Represents the maximum value of all 3D points in the Z axis, Y axis, and Z axis of the point cloud data at the current moment.

[0095] During implementation, the side length of the voxel unit may be 1.2 m.

[0096] For each voxel unit corresponding to the point cloud data at the current moment, its type is first determined, and the types are divided into two types: surface and non-surface. Since the point cloud data at the current moment is the points obtained by scanning the depth sensor at the current moment, these points are usually surface points; however, due to the existence of slender objects or noise in the depth sensor measurement, there will be non-surface voxel units, usually straight lines. After principal component analysis, for the straight line type, its first eigenvalue will be much larger than the other two eigenvalues. Therefore, the type of voxel unit can be determined by the eigenvalue, and only the three-dimensional points in the voxel unit of the surface type need to be reconstructed, thereby simplifying the processing and improving efficiency. For non-surfaces, surface reconstruction is not required at the current moment, and the depth sensor will rescan and measure at subsequent moments until the voxel unit meets the surface judgment condition, that is, it is judged to be a surface type before reconstruction is performed, thereby improving the accuracy of reconstruction.

[0097] Specifically, the type of voxel unit is determined in the following manner:

[0098] S21, performing principal component analysis on all three-dimensional points in the voxel unit to obtain corresponding eigenvalues;

[0099] S22. If the ratio of the maximum eigenvalue to the second largest eigenvalue is greater than or equal to a first threshold, determine that the type of the voxel unit is non-surface; otherwise, the type of the voxel unit is surface.

[0100] During implementation, principal component analysis is performed on all three-dimensional points in the extracted voxel unit. Since each data point has three dimensions, the eigenvalues ​​l1, l2, l3 and eigenvectors vec1, vec2, vec3 corresponding to the first, second, and third principal components are obtained through principal component analysis. From the characteristics of the PCA analysis algorithm, it can be seen that l1>l2>l3.

[0101] If the ratio of the maximum eigenvalue l1 to the second largest eigenvalue l2 is greater than or equal to the first threshold, the voxel unit is a non-surface type, otherwise, the voxel unit is a surface type. In implementation, the first threshold can be set to 50.

[0102] According to the characteristics of principal component analysis, the variance of the three-dimensional point cloud in the direction of the first eigenvector vec1 is the largest, representing the main trend of the data, the variance in the direction of the second eigenvector vec1 is the second largest, and the variance in the direction of the third eigenvector vec1 is the smallest. Therefore, the angle between the eigenvector vec3 corresponding to the minimum eigenvalue and the X, Y, and Z axes is calculated. The smaller the angle, the larger the projection area perpendicular to the axis, so that the surface reconstruction direction can be accurately determined.

[0103] For a voxel unit of surface type, the reconstruction module performs surface reconstruction on the voxel unit based on Gaussian process estimation, specifically including:

[0104] S23, determining the surface reconstruction direction of the voxel unit based on principal component analysis;

[0105] S24. For each surface reconstruction direction, a Gaussian process is used to estimate the three-dimensional points of the voxel unit to obtain a reconstruction point and the uncertainty of each reconstruction point.

[0106] Before performing surface reconstruction, it is necessary to determine the surface reconstruction direction. Specifically, the surface reconstruction direction of the voxel unit is determined in the following manner:

[0107] S231, performing principal component analysis on all three-dimensional points in the voxel unit to obtain corresponding eigenvalues ​​and eigenvectors;

[0108] S232, calculating the angles between the eigenvector corresponding to the minimum eigenvalue and the three coordinate axes and sorting them from small to large to obtain a first angle, a second angle, and a third angle;

[0109] S233: If the difference between the second angle and the first angle is greater than or equal to a second threshold, the coordinate axis direction corresponding to the first angle is the surface reconstruction direction;

[0110] If the difference between the second angle and the first angle is less than the second threshold, and the difference between the third angle and the second angle is greater than or equal to the third threshold, the coordinate axis directions corresponding to the first angle and the second angle are both surface reconstruction directions;

[0111] If the difference between the second angle and the first angle is smaller than the second threshold, and the difference between the third angle and the second angle is smaller than the third threshold, the directions of the three coordinate axes are all surface reconstruction directions.

[0112] During implementation, the process of performing principal component analysis in step S231 may refer to step S21.

[0113] Calculate the angles between the third principal component (i.e., the smallest eigenvalue) eigenvector vec3 and the X, Y, and Z coordinate axes and sort the angles in ascending order to obtain the first angle angle_1, the second angle angle_2, and the third angle angle_3.

[0114] If angle_2-angle_1 is greater than or equal to the second threshold, the coordinate axis direction corresponding to angle_1 is the surface reconstruction direction. During implementation, the second threshold may be set to 0.75.

[0115] If angle_2- angle_1 is less than the second threshold, and angle_3- angle_2 is greater than or equal to the third threshold, the coordinate axis directions corresponding to angle_1 and angle_2 are both surface reconstruction directions. During implementation, the third threshold may be set to 0.25.

[0116] If angle_2-angle_1 is less than the second threshold, and angle_3-angle_2 is less than the third threshold, the coordinate axis directions corresponding to angle_1, angle_2 and angle_3 are all surface reconstruction directions, that is, the three coordinate axis directions are all surface reconstruction directions.

[0117] For a surface type, not every direction needs to be reconstructed. By determining the direction in which the surface reconstruction is required, the processing is further simplified to improve efficiency.

[0118] After the surface reconstruction direction is determined, for each surface reconstruction direction, the reconstruction point and the uncertainty of each reconstruction point are estimated using a Gaussian process based on the three-dimensional points of the voxel unit. Specifically, it includes:

[0119] S2411, meshing the zero plane in the surface reconstruction direction to obtain grid points;

[0120] S2412. Taking the three-dimensional point as the observation point, and using Gaussian process estimation based on the value of the observation point in the surface reconstruction direction to obtain the numerical value and uncertainty of the grid point in the surface reconstruction direction, and obtain the reconstruction point and the uncertainty of each reconstruction point.

[0121] During implementation, Gaussian process estimation is performed on each reconstruction direction of the voxel unit in turn to obtain reconstruction points, thereby performing surface reconstruction.

[0122] For example, if the surface reconstruction direction is the X-axis direction, the corresponding zero plane is the YOZ plane; if the surface reconstruction direction is the Y-axis direction, the corresponding zero plane is the XOZ plane; if the surface reconstruction direction is the Z-axis direction, the corresponding zero plane is the XOY plane.

[0123] During implementation, the zero plane in the surface reconstruction direction is first meshed to obtain grid points. For example, if the surface reconstruction direction is the X-axis direction, only the YOZ plane is meshed to obtain grid points, such as Figure 2 As shown, the Y axis and Z axis of the area corresponding to the voxel unit in the YOZ plane are divided into num_test parts, then a 2D grid points. For example, if num_test is 6, there are 36 2D grid points in the YOZ plane. Then, the 3D points in the voxel unit are used as observation points. Based on the values ​​of the observation points in the X-axis direction, the Gaussian process is used to estimate the values ​​of the 2D grid points in the X-axis direction and the uncertainty. The 2D grid points and their estimated values ​​in the X-axis constitute the reconstruction points, that is, reconstruction points and the corresponding uncertainties.

[0124] During implementation, in order to further improve the computational efficiency, for each surface reconstruction direction, when the reconstruction points are obtained by using Gaussian process estimation based on the three-dimensional points of the voxel unit, the three-dimensional grid points can be downsampled, thereby reducing the computational scale. Specifically, it includes:

[0125] S2421, meshing the zero plane in the surface reconstruction direction to obtain grid points;

[0126] S2422, projecting the three-dimensional point onto the zero plane in the surface reconstruction direction to obtain a projection point;

[0127] S2423. For each grid point, find the nearest projection point, and add the three-dimensional point corresponding to the nearest projection point to the observation point set;

[0128] S2424. Take the three-dimensional points in the observation point set as observation points, and use Gaussian process estimation based on the values ​​of the observation points in the surface reconstruction direction to obtain the numerical values ​​and uncertainties of the grid points in the surface reconstruction direction, and obtain the reconstruction points and the uncertainties of each reconstruction point.

[0129] Step S2421 is the same as step S2411 and will not be repeated here.

[0130] Project all the 3D points in the voxel unit onto the zero plane in the surface reconstruction direction. For example, if the surface reconstruction direction is the X-axis direction, the projection points obtained after the 3D points are projected onto the YOZ plane are as follows: Figure 3 As shown, Figure 3 The solid and hollow points in are projection points.

[0131] Search for the nearest projection point for each grid point in turn. If a projection point is the nearest point to a grid point, add the 3D point corresponding to the projection point to the observation point set. Figure 3 As shown in the figure, the solid points are the nearest points of a grid point, and the hollow points are not the nearest points of any grid point. Only the 3D points in the observation point set are used as observation points to estimate the reconstruction points, thereby downsampling the 3D points and improving the computational efficiency.

[0132] Based on the observation points, Gaussian process estimation is used to predict the value of the grid points in the direction of surface reconstruction.

[0133] Specifically, based on the value of the observation point in the surface reconstruction direction, the following formula is used to obtain the value and uncertainty of the grid point in the surface reconstruction direction:

[0134] ; ;

[0135] in, represents the numerical vector of the grid points in the direction of surface reconstruction, represents the uncertainty vector of the value of the grid point in the surface reconstruction direction, m represents the number of grid points, n represents the number of observation points, represents the numerical vector of the observation point in the direction of surface reconstruction, noise represents the noise of the observation point, K represents the kernel function matrix of Gaussian process estimation, I represents the identity matrix, and diag(·) represents taking the diagonal elements of the matrix.

[0136] When implementing, the noise can be set to 0.02. The kernel function used can be , m1 is the kernel function parameter, and k(i,j) represents the value of the i-th row and j-th column of the kernel function matrix. and The matrices are of different sizes.

[0137] After predicting the value of each grid point in the surface reconstruction direction, the two-dimensional grid point and its surface reconstruction direction value are combined to form a three-dimensional reconstruction point. The uncertainty of the value of the grid point in the surface reconstruction direction is the uncertainty of the corresponding three-dimensional reconstruction point.

[0138] For each surface reconstruction direction, the Gaussian process is used to estimate the three-dimensional points based on the voxel unit to obtain the reconstruction points, and then triangulation is performed based on the reconstruction points to quickly obtain the triangulated connection relationship without a lot of calculations, saving triangulation time.

[0139] Since the value of the zero plane is known, only the value of the surface reconstruction direction is predicted, thus saving calculation time and improving reconstruction efficiency.

[0140] After the reconstruction module performs surface reconstruction on the voxel unit of the current surface type, the voxel unit information in the voxel library is updated based on the voxel unit of the current moment. Specifically, it includes:

[0141] For each voxel unit at the current moment, if the voxel unit in the voxel library has not been reconstructed, the three-dimensional point of the voxel unit in the voxel library and the three-dimensional point of the voxel unit at the current moment are merged, and based on the merged three-dimensional point, it is determined whether the voxel unit is a surface type, and if so, the voxel unit is reconstructed by using Gaussian process estimation to obtain the reconstruction result of the voxel unit, and the voxel unit in the voxel library is updated;

[0142] If the voxel unit in the voxel library has undergone surface reconstruction, updating the voxel unit in the voxel library according to the uncertainty of the reconstruction result at the current moment;

[0143] The reconstruction result includes a surface reconstruction direction, a reconstruction point in each surface reconstruction direction, and an uncertainty of each reconstruction point.

[0144] During implementation, each voxel unit corresponding to the point cloud data at the current moment is traversed in turn. If the voxel unit does not exist in the voxel library, it means that the voxel unit is a newly scanned voxel unit. Therefore, it is directly added to the voxel library, and the CellMap structure corresponding to the voxel unit is constructed. The number Cid of the voxel unit is used as the key, and CellMap is added to the dictionary Map as the Value. If the voxel unit is the number of the voxel unit in the library, the information in the voxel library needs to be updated based on the 3D point or reconstruction result of the voxel unit at the current moment.

[0145] Specifically, the reconstruction result of the voxel unit includes a surface reconstruction direction, a reconstruction point in each surface reconstruction direction, and an uncertainty of each reconstruction point.

[0146] Specifically, if a voxel unit is recorded in the voxel library as not having undergone surface reconstruction, it means that the voxel unit was judged as a non-surface type at a historical moment and did not meet the surface conditions, so no surface reconstruction was performed. The three-dimensional point of the voxel unit in the voxel library and the three-dimensional point of the voxel unit at the current moment are merged, that is, the three-dimensional point of the voxel unit at the current moment is added to the three-dimensional point array of the CellMap structure of the voxel unit in the voxel library. The merged three-dimensional point is used as the three-dimensional point of the voxel unit. According to steps S21~S22, it is judged again whether the voxel unit is a surface type. If it is not a surface type, the timestamp is updated to the current moment, and the update of the voxel unit is completed. If it is a surface type, the surface reconstruction direction is determined according to steps S23~S24 and reconstruction is performed in the surface reconstruction direction. The CellMap structure of the voxel unit in the voxel library is updated according to the reconstruction result, that is, the timestamp is updated to the current moment, the reconstruction point and the corresponding uncertainty are put into GpP and GpVar, b_surface is set to true, the corresponding surface reconstruction direction in reconstruct_dir is set to true, b_reconstruct is set to true, and the update of the voxel unit is completed.

[0147] If the voxel unit in the voxel library has undergone surface reconstruction, that is, the surface has been reconstructed at a historical moment, the information in the voxel library is updated according to the uncertainty of the reconstruction result at the current moment.

[0148] Specifically, updating the voxel unit in the voxel library according to the uncertainty of the reconstruction result at the current moment includes:

[0149] Each reconstruction point in each surface reconstruction direction in the reconstruction result of the voxel unit at the current moment is traversed in turn. If the uncertainty of the reconstruction point and the uncertainty of the reconstruction point corresponding to the voxel unit in the voxel library are both less than the fourth threshold, the reconstruction point and uncertainty corresponding to the voxel unit in the voxel library are updated using the following formula:

[0150] ;

[0151] ;

[0152] If the uncertainty of the reconstruction point and / or the uncertainty of the reconstruction point corresponding to the voxel unit in the voxel library is greater than or equal to the fourth threshold, the reconstruction point and uncertainty corresponding to the voxel unit in the voxel library are updated using the following formula:

[0153] mGpP = cGpP;

[0154] mGpVar = cGpVar;

[0155] Among them, cGpP represents the reconstruction point of the voxel unit at the current moment; cGpVar represents the uncertainty of the reconstruction point of the voxel unit at the current moment, mGpP represents the reconstruction point corresponding to the voxel unit in the voxel library, and mGpVar represents the uncertainty of the reconstruction point corresponding to the voxel unit in the voxel library.

[0156] During implementation, the fourth threshold may be set to 0.5.

[0157] It should be noted that, according to the reconstruction process in steps S23 to S24, for a voxel unit, the reconstruction points at each moment in each reconstruction direction are one-to-one corresponding, so each reconstruction point in the reconstruction result at the current moment is traversed in turn, if the uncertainty of the reconstruction point at the current moment is less than the fourth threshold, and the uncertainty of the corresponding reconstruction point in the voxel library is also less than the fourth threshold, the smaller the uncertainty, the higher the credibility, therefore, the reconstruction point in the historical library and the reconstruction point at the current moment are merged to update the reconstruction point. If one of the uncertainty of the reconstruction point at the current moment and the uncertainty of the corresponding reconstruction point in the voxel library is greater than or equal to the fourth threshold, then if the uncertainty of the reconstruction point at the current moment is less than the uncertainty of the corresponding reconstruction point in the voxel library, the reconstruction point at the current moment is assigned to the corresponding reconstruction point in the voxel library, thereby updating the voxel library, and if the uncertainty of the reconstruction point at the current moment is greater than or equal to the uncertainty of the corresponding reconstruction point in the voxel library, the corresponding reconstruction point in the voxel library is not updated.

[0158] Since the voxel units are independent of each other, the update of the voxel units in the voxel library is also performed in parallel, thereby improving the processing efficiency. After traversing the reconstruction points of all current voxel units, the update of the voxel library is completed.

[0159] The map generation module can quickly generate a grid map based on the voxel unit information in the voxel library at the current moment, that is, generate triangular facets of the grid map.

[0160] Specifically, the map generation module generates triangular facets based on the voxel unit information in the voxel library at the current moment in the following manner:

[0161] Each voxel unit marked as having undergone surface reconstruction in the voxel library is traversed in turn as the current voxel unit;

[0162] For the current voxel unit, traverse each 3D reconstruction point in each surface reconstruction direction in turn. If the current reconstruction point has a diagonal grid point on the grid corresponding to the zero plane in the surface reconstruction direction, construct a triangular face based on the grid point corresponding to the current reconstruction point on the zero plane in the surface reconstruction direction.

[0163] The uncertainty of the triangular facet is calculated, and if the uncertainty of the triangular facet is less than a sixth threshold, the triangular facet is output.

[0164] Specifically, constructing a triangular patch based on the grid points corresponding to the current reconstruction point on the zero plane in the surface reconstruction direction includes:

[0165] Taking the grid point corresponding to the current reconstruction point on the zero plane in the surface reconstruction direction as the current grid point, determining the adjacent grid points and diagonal grid points of the current grid point;

[0166] The current reconstruction point, the reconstruction point corresponding to the adjacent grid point of the current grid point, and the reconstruction point corresponding to the diagonal grid point of the current grid point are used as the three vertices of the triangular face to construct a triangular face.

[0167] For each surface reconstruction direction of the current voxel unit, the grid points of the zero plane are used to determine the reconstruction points that need to be connected. Figure 4 As shown, traverse each grid point from left to right and from top to bottom. For example, the grid point corresponding to a certain reconstruction point on the zero plane of the surface reconstruction direction is the first grid point A in the upper left corner, and there is a diagonal grid point D (there is a grid point in the lower right), then take grid point A as the current grid point, and determine its adjacent grid points B and C, and diagonal grid point D. The triple formed by the reconstruction points corresponding to grid point A, adjacent grid point B, and diagonal grid point D is a triangular face, and the triple formed by the reconstruction points corresponding to grid point A, adjacent grid point C, and diagonal grid point D is another triangular face. If the traversal order is from right to left and from top to bottom, the diagonal grid is the grid point to the lower left of the current grid point, and so on for other traversal orders.

[0168] It should be noted that according to the zero plane grid division process of the surface reconstruction direction of the present invention, adjacent voxel units in the same surface reconstruction direction will share grid points, and the reconstruction points corresponding to the shared grid points of the two voxel units may have slight differences in the surface reconstruction direction. Therefore, they need to be modified to a unified value, for example, the value of one of the voxel units is taken as the final value, or the average value is taken as the final value. Figure 5 As shown, the grid point E of the left voxel unit and the grid point F of the right voxel unit are actually one grid point, and the corresponding reconstruction point should also be the same point. However, since the reconstruction is performed in different voxel units, the values ​​in the surface reconstruction direction may be slightly different, so they need to be unified into one point. During implementation, the coordinate value of the reconstruction point corresponding to point F can be modified to the value of the reconstruction point corresponding to point E, and the coordinate value of the reconstruction point corresponding to point H can be modified to the value of the reconstruction point corresponding to point G, so as to unify; the coordinate value of the reconstruction point corresponding to point E can also be modified to the value of the reconstruction point corresponding to point F, and the coordinate value of the reconstruction point corresponding to point G can be modified to the value of the reconstruction point corresponding to point H, so as to unify; the mean value of the reconstruction point corresponding to point E and the reconstruction point corresponding to point F can also be taken as the value of the reconstruction point corresponding to point E and the reconstruction point corresponding to point F, and the mean value of the reconstruction point corresponding to point G and the reconstruction point corresponding to point H can be taken as the value of the reconstruction point corresponding to point G and the reconstruction point corresponding to point H, so as to unify.

[0169] Compared with the existing triangulation methods that are time-consuming, the triangulation strategy of the present invention can directly determine the connection relationship of the three-dimensional reconstruction points in the triangulation process through the zero-plane grid relationship without any calculation conditions, thus saving the triangulation time. Moreover, the zero-plane two-dimensional grid is evenly distributed, thereby completely avoiding the problem of narrow and long triangular faces appearing in the triangulation process, which affects the spatial calculation of the application scene.

[0170] Specifically, the uncertainty of the triangular patch is calculated using the following formula:

[0171] ;

[0172] in, represents the uncertainty of the triangle patch, , and They respectively represent the uncertainty of the three reconstruction points constituting the triangular patch.

[0173] If the uncertainty of the triangle is less than the sixth threshold, it means that the accuracy of the triangle is high, and the triangle is output, otherwise the triangle is not output until the threshold requirement is met, thereby improving the accuracy of mesh generation. In implementation, the sixth threshold can be set to 0.2.

[0174] During implementation, the voxel unit in the current voxel library is detected at each moment. If the number of three-dimensional points of the voxel unit is less than the set fifth threshold value P_num_thresh, and the storage time delta_t of the voxel unit is greater than the set seventh threshold value exist_t, the voxel unit is deleted from the dictionary Map, so as to facilitate the management of the voxel unit. Exemplarily, the fifth threshold value P_num_thresh is equal to 5, and the seventh threshold value exist_t is equal to 60s.

[0175] The real-time grid map generation system for XR devices of the present invention can quickly and efficiently generate grid maps to meet the real-time requirements of XR devices.

[0176] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[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.< / double>

Claims

1. A real-time grid map generation system for an XR device, characterized in that: include: Depth sensor for collecting point cloud data in real time; A position and posture estimation unit, used for detecting the position and posture data of the XR device in real time; Voxel library, used to store the latest voxel unit information; A reconstruction module, used to determine the voxel unit at the current moment according to the point cloud data at the current moment and the posture data of the XR device, and perform surface reconstruction based on Gaussian process estimation on the voxel unit determined to be a surface type; and update the voxel unit information in the voxel library based on the voxel unit at the current moment; A map generation module, used to generate triangular facets of a grid map based on voxel unit information in a voxel library at a current moment; The map generation module generates triangular facets based on the voxel unit information in the voxel library at the current moment in the following manner: Each voxel unit marked as having undergone surface reconstruction in the voxel library is traversed in turn as the current voxel unit; For the current voxel unit, traverse each 3D reconstruction point in each surface reconstruction direction in turn. If the current reconstruction point has a diagonal grid point on the grid corresponding to the zero plane in the surface reconstruction direction, construct a triangular face based on the grid point corresponding to the current reconstruction point on the zero plane in the surface reconstruction direction. The uncertainty of the triangular patch is calculated, and if the uncertainty of the triangular patch is less than a sixth threshold, the triangular patch is output.

2. The real-time grid map generation system for XR devices according to claim 1, characterized in that: The uncertainty of the triangle patch is calculated using the following formula: ; in, represents the uncertainty of the triangle patch, , and They respectively represent the uncertainty of the three reconstruction points constituting the triangular patch.

3. The real-time grid map generation system for XR devices according to claim 1, characterized in that: Construct a triangular patch based on the grid points corresponding to the current reconstruction point on the zero plane of the surface reconstruction direction, including: Taking the grid point corresponding to the current reconstruction point on the zero plane in the surface reconstruction direction as the current grid point, determining the adjacent grid points and diagonal grid points of the current grid point; The current reconstruction point, the reconstruction point corresponding to the adjacent grid point of the current grid point, and the reconstruction point corresponding to the diagonal grid point of the current grid point are used as the three vertices of the triangular facet to construct the triangular facet.

4. The real-time grid map generation system for XR devices according to claim 1, characterized in that: The reconstruction module performs surface reconstruction on the voxel units determined to be surface type based on Gaussian process estimation in the following manner: Determining the surface reconstruction direction of the voxel unit based on principal component analysis; For each surface reconstruction direction, a Gaussian process is used to estimate the three-dimensional points of the voxel unit to obtain the reconstruction points and the uncertainty of each reconstruction point.

5. The real-time grid map generation system for XR devices according to claim 4, characterized in that: The surface reconstruction direction of the voxel unit is determined based on principal component analysis in the following manner: Performing principal component analysis on all three-dimensional points in the voxel unit to obtain corresponding eigenvalues ​​and eigenvectors; Calculate the angles between the eigenvector corresponding to the minimum eigenvalue and the three coordinate axes and sort them from small to large to obtain the first angle, the second angle and the third angle; If the difference between the second angle and the first angle is greater than or equal to the second threshold, the coordinate axis direction corresponding to the first angle is the surface reconstruction direction; If the difference between the second angle and the first angle is less than the second threshold, and the difference between the third angle and the second angle is greater than or equal to the third threshold, the coordinate axis directions corresponding to the first angle and the second angle are both surface reconstruction directions; If the difference between the second angle and the first angle is smaller than the second threshold, and the difference between the third angle and the second angle is smaller than the third threshold, the directions of the three coordinate axes are all surface reconstruction directions.

6. The real-time grid map generation system for XR devices according to claim 4, characterized in that: For each surface reconstruction direction, the reconstruction points and the uncertainty of each reconstruction point are estimated using a Gaussian process based on the three-dimensional points of the voxel unit, including: Meshing the zero plane in the surface reconstruction direction to obtain grid points; Projecting the three-dimensional point onto the zero plane of the surface reconstruction direction to obtain a projection point; For each grid point, find the nearest projection point, and add the three-dimensional point corresponding to the nearest projection point to the observation point set; Taking the three-dimensional points in the observation point set as observation points, the numerical values ​​and uncertainties of the grid points in the surface reconstruction direction are obtained by using Gaussian process estimation based on the values ​​of the observation points in the surface reconstruction direction, and the reconstruction points and the uncertainty of each reconstruction point are obtained.

7. The real-time grid map generation system for XR devices according to claim 6, characterized in that: Based on the value of the observation point in the surface reconstruction direction, the following formula is used to obtain the value and uncertainty of the grid point in the surface reconstruction direction: ; ; in, is a numerical vector representing the grid point in the direction of surface reconstruction, represents the uncertainty vector of the value of the grid point in the surface reconstruction direction, m represents the number of grid points, n represents the number of observation points, represents the numerical vector of the observation point in the direction of surface reconstruction, noise represents the noise of the observation point, K represents the kernel function matrix of Gaussian process estimation, I represents the identity matrix, and diag(·) represents taking the diagonal elements of the matrix.

8. The real-time grid map generation system for XR devices according to claim 1, characterized in that: The voxel unit information in the voxel library is updated based on the voxel unit at the current moment, including: For each voxel unit at the current moment, if the voxel unit in the voxel library has not been reconstructed, the three-dimensional point of the voxel unit in the voxel library and the three-dimensional point of the voxel unit at the current moment are merged, and based on the merged three-dimensional point, it is determined whether the voxel unit is a surface type, and if so, the voxel unit is reconstructed by using Gaussian process estimation to obtain the reconstruction result of the voxel unit, and the voxel unit in the voxel library is updated; If the voxel unit in the voxel library has undergone surface reconstruction, updating the voxel unit in the voxel library according to the uncertainty of the reconstruction result at the current moment; The reconstruction result includes a surface reconstruction direction, a reconstruction point in each surface reconstruction direction, and an uncertainty of each reconstruction point.

9. The real-time grid map generation system for XR devices according to claim 8, characterized in that: The voxel unit in the voxel library is updated according to the uncertainty of the reconstruction result at the current moment, including: Each reconstruction point in each surface reconstruction direction in the reconstruction result of the voxel unit at the current moment is traversed in turn. If the uncertainty of the reconstruction point and the uncertainty of the reconstruction point corresponding to the voxel unit in the voxel library are both less than the fourth threshold, the reconstruction point and uncertainty corresponding to the voxel unit in the voxel library are updated using the following formula: ; ; Otherwise, if the uncertainty of the reconstruction point is less than the uncertainty of the reconstruction point corresponding to the voxel unit in the voxel library, the reconstruction point and uncertainty corresponding to the voxel unit in the voxel library are updated using the following formula: mGpP=cGpP; mGpVar=cGpVar; Among them, cGpP represents the reconstruction point of the voxel unit at the current moment; cGpVar represents the uncertainty of the reconstruction point of the voxel unit at the current moment, mGpP represents the reconstruction point corresponding to the voxel unit in the voxel library, and mGpVar represents the uncertainty of the reconstruction point corresponding to the voxel unit in the voxel library.

Citation Information

Patent Citations

  • Three-dimensional face grid generation method and device, equipment and storage medium

    CN111243093A

  • Local grid map construction method and device, readable medium and electronic equipment

    CN112270754A