A scene model construction method, intelligent terminal and computer-readable storage medium

Through scene fusion and voxel prediction technology, the problem of holes in 3D reconstruction is solved, the integrity and accuracy of the model are improved, and the correctness of virtual and real rendering in the augmented reality system is ensured.

CN113034675BActive Publication Date: 2024-09-27PENG CHENG LAB +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110325406.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-26
Publication Date
2024-09-27
Estimated Expiration
2041-03-26

AI Technical Summary

Technical Problem

Existing 3D reconstruction technology is prone to holes, causing the model to be unable to accurately reflect the relationship between objects. Especially in augmented reality systems, it is impossible to render the correct virtual and real occlusion relationship.

Method used

By acquiring multiple depth images, perform scene fusion and voxel prediction, extract neighborhood features of voxels, use a structured random forest model to calculate voxel prediction values, update the scene model, fill the hole areas in the model, and improve model integrity. .

Benefits of technology

It effectively reduces the holes in the three-dimensional reconstruction model, improves the integrity and accuracy of the model, and ensures that the occlusion relationship between objects can be correctly rendered in augmented reality applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113034675B
    Figure CN113034675B
Patent Text Reader

Abstract

The present invention discloses a scene model construction method, an intelligent terminal and a computer-readable storage medium, the method comprising: when acquiring the Nth original depth image for the same scene, according to the Nth original depth image, performing scene fusion on the Nth original scene model to obtain the Nth intermediate scene model; according to a preset extraction rule, extracting the neighborhood features of each voxel in the Nth intermediate scene model; according to the neighborhood features, calculating the voxel prediction value corresponding to each voxel; for each voxel, when the voxel value corresponding to the voxel in the Nth original scene model is a non-voxel observation value, according to the voxel prediction value corresponding to the voxel, updating the Nth original scene model to obtain the (N+1)th original scene model. The present invention realizes the prediction of the voxel value of the scene model through the neighborhood features of the voxels, thereby reducing the holes of the subsequent model and improving the integrity of the model.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Technology Neighborhood

[0002] The present invention relates to a scene model construction neighborhood, and in particular to a scene model construction method, an intelligent terminal and a computer-readable storage medium. Background Art

[0003] RGB is a color model. An RGB image represents an image containing three color channels: red, green, and blue. In 3D computer graphics, a depth map is an image or image channel that contains information about the distance from the surface of a scene object at the viewpoint. In a depth map, each pixel value represents the shooting distance from the object. Usually, RGB images and depth maps are matched with each other, so there is a one-to-one relationship between the pixels of the two. Since the depth map can represent the distance from the object, the scene can be reconstructed by combining the RGB image and the depth map.

[0004] The current scene reconstruction method mainly uses a depth camera to surround the scene to collect different depth maps. Then, according to the camera's internal parameters and the pixel values ​​in the depth map, the depth map is converted into a three-dimensional point cloud, and the normal vector corresponding to each point cloud is calculated. For example, the iterative closest point (ICP) algorithm is used to iteratively minimize the distance from the point to the plane, and then the pose transformation between the two frames is calculated to obtain the camera pose of the current frame. According to the camera pose of the current frame, the point cloud is fused into a truncated signed distance function (TSDF) model, and the TSDF model surface, point cloud and normal vector under the current camera perspective are obtained according to the reprojection algorithm, and then the ICP iteration is performed with the next frame data to solve the pose of the next frame.

[0005] However, since the current depth cameras mainly use time of flight (TOF), binocular camera and structured light technology when collecting the distance of objects, the occluded areas often cannot be reconstructed due to the inability to collect depth data. At the same time, there are often objects occluding each other in the shooting scene. Therefore, in practice, it is very difficult to ensure that the depth camera scan can cover all points of indoor objects, and the model reconstructed based on the current three-dimensional reconstruction method will have a large number of holes. Taking the augmented reality system as an example, the three-dimensional model reconstruction based on the augmented reality system usually quickly scans the scene in a local area, obtains the local three-dimensional model of the scene, and then uses the model to achieve the effect of virtual and real rendering. However, since the acquired model is usually not complete, it is inevitable to observe the unreconstructed area during the movement of the camera. At this time, the correct virtual and real occlusion relationship cannot be rendered in the augmented reality application. Summary of the invention

[0006] The main purpose of the present invention is to provide a scene model construction method, an intelligent terminal and a computer-readable storage medium, aiming to solve the problem that current three-dimensional reconstruction technology is prone to holes, resulting in the model being unable to accurately reflect the relationship between objects.

[0007] To achieve the above object, the present invention provides a scene model construction method, which comprises the following steps:

[0008] When acquiring an Nth original depth image for the same scene, performing scene fusion on the Nth original scene model according to the Nth original depth image to obtain an Nth intermediate scene model, wherein N is a natural number less than or equal to the total number of the original depth images, and when N is equal to 1, the first original scene model is a preset blank scene model;

[0009] Extracting neighborhood features of each voxel in the Nth intermediate scene model according to a preset extraction rule;

[0010] Calculating a voxel prediction value corresponding to each voxel according to the neighborhood features;

[0011] For each voxel, when the voxel value corresponding to the voxel in the Nth original scene model is a non-voxel observation value, the Nth original scene model is updated according to the voxel prediction value corresponding to the voxel to obtain the (N+1)th original scene model.

[0012] Optionally, the scene model construction method, wherein when acquiring an Nth original depth image for the same scene, performing scene fusion on the Nth original scene model according to the Nth original depth image to obtain an Nth intermediate scene model, specifically includes:

[0013] When acquiring an Nth original depth image for the same scene, filtering the Nth original depth image to generate an Nth denoised depth image;

[0014] Calculate the point cloud corresponding to each pixel in the Nth denoised depth image according to the camera intrinsic parameters corresponding to the Nth original depth image to obtain a plurality of point clouds;

[0015] For each pixel in the Nth denoised depth image, determine a normal vector of the point cloud corresponding to the pixel according to a neighborhood point cloud corresponding to the pixel, wherein the neighborhood point cloud corresponds to a point cloud of a neighborhood pixel of the pixel;

[0016] According to the normal vectors of each point cloud, scene fusion is performed on each voxel in the Nth scene model to obtain the Nth intermediate scene model.

[0017] Optionally, in the scene model construction method, for each of the voxels, the neighborhood features corresponding to the voxel include scene features of the neighborhood voxels of the voxel, and the neighborhood voxels are voxels corresponding to the neighborhood pixels of the pixel point corresponding to the voxel.

[0018] Optionally, the scene model construction method, wherein, extracting the neighborhood features of each voxel in the Nth intermediate scene model according to a preset extraction rule, specifically includes:

[0019] Extracting scene features of each voxel in the Nth intermediate scene model according to a preset extraction rule;

[0020] For each of the voxels, according to a preset screening rule and the coordinates of the neighboring voxels corresponding to the voxel, the neighboring voxels are screened to obtain a target voxel;

[0021] The scene feature corresponding to the target voxel is used as the neighborhood feature corresponding to the voxel.

[0022] Optionally, the scene model construction method, wherein the step of calculating the voxel prediction value corresponding to each voxel according to the neighborhood feature, specifically includes:

[0023] For each of the voxels, a neighborhood feature corresponding to the voxel is input into a trained structured random forest model, and the structured random forest model is used to predict the voxel value according to the input neighborhood feature to obtain a plurality of initial prediction values ​​corresponding to the voxel;

[0024] Calculate the error value corresponding to each of the initial prediction values ​​according to a preset error loss function;

[0025] Determining a plurality of intermediate prediction values ​​in the initial prediction value according to the error value;

[0026] According to the intermediate prediction value, a voxel prediction value corresponding to the voxel is calculated.

[0027] Optionally, in the scenario model construction method, the training process of the structured random forest model includes:

[0028] Obtain training depth images of different scenes;

[0029] According to a preset sampling rule, the pixel points in the training depth image are screened to obtain training pixel points;

[0030] For each of the training pixels, the voxel value corresponding to the pixel is used as label data, and the neighborhood voxel value corresponding to the pixel is used as training data;

[0031] Inputting the training data into a preset structured random forest model, and calculating corresponding training prediction values ​​according to the training data through the structured random forest model;

[0032] According to the training prediction value and the label data, the parameters of the structured random forest model are adjusted until the structured random forest model converges.

[0033] Optionally, the scenario model construction method, wherein the structured random forest model includes a plurality of decision trees; the inputting of the training data into a preset structured random forest model, and calculating the corresponding training prediction value according to the training data by the structured random forest model, specifically includes:

[0034] Generate a plurality of training subsets according to the label data and the training data, wherein the number of the training subsets is the same as the number of the decision trees;

[0035] For each of the decision trees, the training data in the training subset is input into the decision tree, and each node of the decision tree performs dimension reduction and clustering on the training data to obtain the principal component value corresponding to the training data;

[0036] According to the principal component value, the child node corresponding to the training data is determined until a leaf node is reached to obtain a predicted training value corresponding to the decision number.

[0037] Optionally, in the scene model construction method, the step of calculating the voxel prediction value corresponding to the voxel according to the intermediate prediction value specifically includes:

[0038] For each of the intermediate prediction values, determine a weight value corresponding to the intermediate prediction value according to an error value corresponding to the intermediate prediction value;

[0039] The voxel prediction value corresponding to the voxel is calculated according to the weight values ​​corresponding to the intermediate prediction values.

[0040] In addition, to achieve the above-mentioned purpose, the present invention also provides a smart terminal, wherein the smart terminal includes: a memory, a processor, and a scene model construction program stored in the memory and executable on the processor, and when the scene model construction program is executed by the processor, the steps of the scene model construction method as described above are implemented.

[0041] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a scene model construction program, and when the scene model construction program is executed by a processor, the steps of the scene model construction method as described above are implemented.

[0042] The present invention provides a scene model construction method, an intelligent terminal and a computer-readable storage medium. The Nth original depth image is first obtained, and the Nth original depth image is subjected to scene fusion with the corresponding Nth scene model, and the neighborhood features of each voxel in the fused scene model are extracted. Then, based on the neighborhood features of each voxel, the voxel prediction value corresponding to each voxel is calculated. On the basis of obtaining each voxel prediction value, it is fused with the Nth original scene model to obtain the N+1th original scene model. In the process of continued scanning, the original scene model is continuously updated and optimized, and when the voxel value of the voxel cannot be directly obtained, the corresponding voxel can be predicted through the neighborhood features of the voxel, thereby filling the hole area in the initial model, reducing the number of holes, and improving the completeness of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 It is a flow chart of a preferred embodiment of the scene model construction method provided by the present invention;

[0044] Figure 2 It is a schematic diagram of a TSDF model in a preferred embodiment of the scene model construction method of the present invention;

[0045] Figure 3 It is a scene model display diagram obtained by voxel prediction in a preferred embodiment of the scene model construction method of the present invention;

[0046] Figure 4 Schematic diagram of the operating environment of a preferred embodiment of the intelligent terminal of the present invention. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0048] The scene model construction method described in the preferred embodiment of the present invention can be executed by an intelligent terminal, which includes a smart phone, a virtual reality technology terminal, and the like. This embodiment takes a smart phone as an example to describe the scene model construction process. Figure 1 The scene model construction method comprises the following steps:

[0049] Step S100, when an Nth original depth image for the same scene is obtained, scene fusion is performed on the Nth original scene model according to the Nth original depth image to obtain an Nth intermediate scene model.

[0050] Specifically, the depth image can be obtained by shooting and processing with a depth camera, a binocular camera, etc. Taking a depth camera as an example, the depth camera obtains the distance between objects in the environment and the camera through time-of-flight technology, laser scanning technology, etc., so as to obtain a depth image. When the depth camera is working, it generally continuously shoots multiple angles for the same scene to obtain multiple depth images.

[0051] This embodiment takes a certain indoor scene as an example. When multiple depth images are taken in the indoor scene, these depth images are used as original depth images, and these original depth images are acquired in sequence. When the Nth original depth image is acquired, the Nth original scene model corresponding to the Nth original depth image is subjected to scene fusion to obtain the Nth intermediate scene model.

[0052] In this embodiment, N is a natural number less than or equal to the total number of original depth images. This embodiment is described by taking N equal to 1 as an example. When N is equal to 1, the first original scene model is a preset blank scene model. The scene model used in this embodiment is the TSDF model. Each voxel in the TSDF model corresponds to a pixel point of the original depth image. The scene model corresponding to the original depth image is completed by calculating the voxel value of each voxel. When N=1, the TSDF model corresponding to the first original depth image is a scene model in which the voxel value of each voxel is empty. Figure 2 As shown, when N is greater than one, the Nth original scene model may also be a scene model whose voxel values ​​of some voxels are already known.

[0053] Furthermore, in the process of fusing the first original depth image and the first original scene model, the fusion method adopted can be implemented by KinectFusion algorithm, Kintinuous algorithm, ElasticReconstruction offline scene model construction algorithm, etc. The fusion process includes:

[0054] Filtering the Nth original depth image to generate an Nth denoised depth image;

[0055] Calculate the point cloud corresponding to each pixel in the Nth denoised depth image according to the camera intrinsic parameters corresponding to the Nth original depth image to obtain a plurality of point clouds;

[0056] For each pixel in the Nth denoised depth image, determine a normal vector of the point cloud corresponding to the pixel according to a neighborhood point cloud corresponding to the pixel;

[0057] According to the normal vectors of each point cloud, scene fusion is performed on each voxel in the Nth scene model to obtain the Nth intermediate scene model.

[0058] Specifically, each pixel in the first original depth image is filtered, and the selected filtering method may be bilateral filtering, smoothing filtering, etc. Bilateral filtering is a nonlinear filtering that combines two Gaussian filters. Bilateral filtering includes a pixel space Euclidean distance kernel function and a pixel depth value difference kernel function. When the pixel is located in an internal flat area with a small change in depth value, the change in depth value is close to 0, and the weight of the pixel depth value difference kernel function is close to 1. At this time, the Euclidean distance kernel function plays a major role in bilateral filtering, which is equivalent to Gaussian blurring the original image. When the pixel is located in an edge area with a large change in depth value, the change in depth value is large, resulting in a large weight of the pixel depth value difference kernel function. Even if the weight of the pixel space Euclidean distance kernel function is small, it can be ensured that the geometric edge area of ​​the object in the image will not be blurred. The filtering method used in this embodiment is bilateral fast filtering, which is fast and relatively simple, and can be implemented in an augmented reality terminal with low computing power. Taking the pixel p in the first original depth image as an example, the equation for bilateral fast filtering of the pixel is: d(p)=1 / s∑ q∈N c(||pq||2)s(||d0(q)-d0(p)||2)·d0(p).

[0059] Among them, d(p) represents the depth value of pixel p in the depth map, N represents the set of all pixels in the surrounding area of ​​point p that may affect its value, and these pixels are also called the neighborhood points of point p; s represents the number of pixels in the set N; d0(p) is the depth value of pixel p after filtering. c(||pq||2) represents the geometric proximity between pixel p and its neighborhood points, and s(||d0(q)-d0(p)||2) measures the similarity between the depth values ​​of pixel p and its neighborhood points after filtering.

[0060] Based on the filtering process, the first original depth image can be denoised to obtain a first denoised depth image.

[0061] The depth map provides the z coordinate in the camera coordinate system, that is, the distance between the camera and the object corresponding to each pixel in space. After obtaining the first denoised depth image, the internal parameters of the depth camera are used to calculate the point cloud mapping in the camera local coordinate system according to the first denoised depth image. If the converted pixel coordinates are (u, v), the conversion formula is:

[0062]

[0063] Among them, K d is the camera intrinsic parameter of the depth camera, T is the transposed matrix, D k (u, v) is the depth value of the pixel, That is, the spatial coordinates corresponding to the pixel point, each spatial coordinate corresponds to a point cloud. By transforming the coordinates of each pixel point in the first denoised depth image, a plurality of point clouds are obtained.

[0064] After obtaining the spatial coordinates, for each pixel point, the corresponding normal vector is calculated according to the three-dimensional coordinates of the neighboring pixels of the pixel point. The three-dimensional coordinates of the neighboring pixels include the pixel points of the up, down, left, right, etc., and the coordinates of the pixel points adjacent to the pixel point in the captured image. The pixel points corresponding to the coordinates of several directly adjacent pixels can also be selected as adjacent pixels. Among them, when the coordinates of the pixel point in the first denoised depth image are (u, v), the normal vector formula used in this embodiment is:

[0065]

[0066] Among them, normalfze refers to normalization, is the spatial vector of the point cloud corresponding to the pixel, and is the spatial vector of the point cloud corresponding to the neighborhood pixels of the pixel, is the normal vector of the point cloud corresponding to the pixel with a length of 1. Furthermore, if the three-dimensional coordinates corresponding to the pixel are invalid or the three-dimensional coordinates corresponding to the adjacent pixel are invalid, the normal vector corresponding to the pixel is regarded as an outlier and is removed.

[0067] Then, based on the normal vectors of each point cloud, scene fusion is performed by using the KinectFusion algorithm or the like. This process is a prior art and will not be described in detail here.

[0068] Step S200: extracting neighborhood features of each voxel in the Nth intermediate scene model according to a preset extraction rule.

[0069] Specifically, an extraction rule is pre-set, and the extraction rule is mainly used to extract the neighborhood features of each voxel according to the attributes of the neighborhood voxels of each voxel, including distance features, voxel value features, etc. For each of the voxels, the neighborhood features corresponding to the voxel include the scene features of the neighborhood voxels of the voxel, and the neighborhood voxels are voxels corresponding to the neighborhood pixels of the pixel point corresponding to the voxel.

[0070] In addition, in order to reduce unnecessary calculation amount and improve calculation speed, the neighborhood features extracted according to the extraction rules in this embodiment are features for certain screening of neighborhood voxels. First, according to the preset extraction rules, the scene features of each voxel in the Nth intermediate scene model are extracted. The scene features refer to features related to the scene model such as the voxel value and distance features corresponding to the voxel. Then, for each voxel, according to the preset screening rules and the coordinates of the neighborhood voxels corresponding to the voxel, the neighborhood voxels are screened to obtain the target voxel. The screening rules are mainly used to eliminate voxels in the neighborhood voxels that are not strongly correlated with the voxel value of the voxel. In this embodiment, the target voxel is a cube of a fixed size, whose x-axis is consistent with the direction of the normal vector of the voxel, and whose z-axis is consistent with the z-axis direction of the world coordinate system. Finally, the scene features corresponding to the target voxel are used as the neighborhood features corresponding to the voxel.

[0071] Furthermore, since the most critical voxels whose voxel values ​​are to be updated subsequently are those located on the scene surface, in the present embodiment, it is possible to choose not to calculate the neighborhood features of each voxel, but to select the neighborhood features of the voxels corresponding to each vertex in the vertex graph obtained by reprojecting the virtual camera with the first original scene model. When subsequently calculating the voxel prediction value, only the voxels corresponding to each vertex need to be calculated, so as to reduce the amount of calculation and improve the calculation efficiency.

[0072] Step S300: Calculate the voxel prediction value corresponding to each voxel according to the neighborhood feature.

[0073] Specifically, for each voxel, a voxel prediction value corresponding to the voxel is calculated according to the neighborhood features corresponding to the voxel. The voxel prediction value is a value predicted for the voxel value of the voxel according to the neighborhood features corresponding to the voxel.

[0074] In this embodiment, the prediction method can be implemented by deep learning, machine learning, etc. In this embodiment, a structured random forest model is used to calculate the voxel prediction value. The specific process is as follows:

[0075] A10. For each voxel, the neighborhood features corresponding to the voxel are input into the trained structured random forest model, and the structured random forest model is used to predict the voxel value according to the input neighborhood features to obtain a number of initial prediction values ​​corresponding to the voxel.

[0076] Specifically, for each voxel, or only for the voxel corresponding to the vertex, the neighborhood features of the voxel are input into the trained structured random forest model. Each decision tree in the structured random forest model calculates the initial prediction value corresponding to the decision tree according to the input neighborhood features. Since the structured random forest model generally includes several decision trees, several initial prediction models can be obtained.

[0077] Furthermore, when training the structured random forest model, a large number of training depth images are first obtained, and training pixels therein are screened. Then, for each training pixel, the voxel value corresponding to the pixel is used as label data, and the neighborhood voxel value corresponding to the pixel is used as training data, and the training data is input into a pre-set structured random forest model, and the structured random forest model is used to calculate the corresponding training prediction value according to the training data.

[0078] Among them, since each decision tree predicts the predicted voxel value of a voxel through the scene features of the neighborhood voxels of a voxel, in the vertex graph, two adjacent points usually have similar effects on the prediction, so there is no need to predict the voxel value of each voxel corresponding to each pixel in each training depth image. Therefore, training data that is helpful for prediction can be selected through pre-set sampling rules. In this embodiment, the pixel points whose corresponding normal vectors are far away from the depth camera and the pixel points whose normal vectors are in the same positive direction as the z-axis of the world coordinate system are used as elimination points, and the scene coordinates of the voxels corresponding to the elimination points are eliminated from the neighborhood features corresponding to each voxel to obtain training data.

[0079] When training a decision tree, the label data and its corresponding training data are taken as a data pair. For each decision tree, several data pairs are selectively selected from all the data pairs as the training subsets corresponding to the decision tree, thereby obtaining several training subsets.

[0080] This embodiment takes a training data as an example to describe the process of training a decision tree. For each decision tree, the training data is input into the root node of the decision tree, and the classification starts from the root node layer by layer until the leaf node is reached. Each node is feature classified according to the value in the training data, so that the features assigned to the child nodes are as similar as possible, that is, the neighborhood features are as similar as possible. When classifying, this embodiment first adopts a random sampling method to randomly sample the dimensions of the three dimensions in the training data, thereby achieving dimensionality reduction of the data, and then divides it into two temporary classes by clustering. Dimensionality reduction and clustering can be performed by random sampling to obtain two principal component values. Then, according to the sign of the principal component value with the largest value, the training comfort is assigned to the most appropriate one of the two child nodes. At the last leaf node, a predicted training value is output. Then, according to the predicted training value and the label data corresponding to the training data, the parameters of each node of the decision tree are adjusted until the training of all decision trees is completed, and the structured random forest model completes convergence, that is, the training is completed.

[0081] A20. Calculate the error value corresponding to each of the initial prediction values ​​according to a preset error loss function.

[0082] Specifically, since the calculation results of each decision tree are not the same, and some results are far from the actual geometric structure, the error value corresponding to each initial prediction value is calculated by a preset error loss function, thereby eliminating some initial prediction values ​​with large errors. In this embodiment, the three-dimensional point cloud corresponding to the first original depth image is first calculated by reprojection, and the three-dimensional point cloud falling into the neighborhood voxel is found. The error loss function used is: Where E is the error value, is a 3D point cloud falling into the neighborhood voxel, p is any one of the 3D point clouds falling into the neighborhood voxel, and y(p) is the initial prediction value.

[0083] A30. Determine several intermediate prediction values ​​among the initial prediction values ​​according to the error value.

[0084] Specifically, according to the error value, the intermediate prediction value in the initial prediction value is determined. The determination method can be to first sort the error values ​​corresponding to the initial prediction values ​​according to their sizes to obtain an error sequence, and then select the initial prediction values ​​of the same number as the selected number in the initial prediction value according to a preset selection number, for example, 2, as the intermediate prediction values. It is also possible to preset an error value threshold and use the initial prediction values ​​corresponding to the error values ​​less than the threshold as the intermediate prediction values.

[0085] A40. Calculate the voxel prediction value corresponding to the voxel according to the intermediate prediction value.

[0086] Specifically, after obtaining the intermediate prediction value, the number of the intermediate prediction values ​​may also be greater than one, so it is necessary to calculate the corresponding voxel prediction value based on the intermediate prediction value. The method used may be weighted average. The weight value added to the intermediate prediction value in this embodiment is adjusted based on the error value calculated in the previous text. The weighted average calculation formula used in this embodiment is:

[0087] TSDF globle =∑ i∈M w i TSDF i ;

[0088] Among them, TSDF globle is the voxel prediction value, M is the number of intermediate prediction values, TSDF i is the ith intermediate prediction value, w i TSDF i The corresponding weight value, w i =exp(-αE). Where, is a weight parameter. When α is equal to zero, it is equivalent to a naive average without weighting. When α tends to infinity, the predicted value that is most consistent with the observed geometry is given a higher weight. In this embodiment, α is set to 100.

[0089] Step S400, for each voxel, when the voxel value corresponding to the voxel in the Nth original scene model is a non-voxel observation value, the Nth original scene model is updated according to the voxel prediction value corresponding to the voxel to obtain the (N+1)th original scene model.

[0090] Specifically, after obtaining the voxel prediction value corresponding to each voxel, for each voxel, when the voxel value corresponding to the voxel in the Nth original scene model is a non-voxel observation value, the Nth original scene model is updated according to the voxel prediction value corresponding to the voxel to obtain the (N+1)th original scene model. The non-body side observation value corresponds to the body side observation value, and the voxel observation value refers to the voxel value directly determined by the depth image, rather than an invalid value or voxel prediction value such as null, 1, or -1. That is, when the voxel value of a certain voxel is a voxel observation value, the voxel value of the voxel is not changed; when the voxel value of a certain voxel is a non-voxel observation value, the voxel prediction value corresponding to the voxel currently obtained is used as the voxel value corresponding to the voxel, and the Nth original scene model is updated to obtain the (N+1)th original scene model.

[0091] Each voxel is marked with a label value in advance, and the label value is recorded as P. The label value is used to determine the voxel value type corresponding to the voxel.

[0092] When the voxel value of the voxel is empty, +1 or -1, the label value P corresponding to the voxel is assigned 0.

[0093] When the voxel value of the voxel value is a value determined according to the three-dimensional point cloud, the label value P is assigned a value of 1.

[0094] When the voxel value of the voxel value is a value obtained by the prediction method in the previous text, the label value P is assigned a value of -1.

[0095] During the update process, the label value corresponding to each voxel in the Nth original scene model is obtained. When the label value is 0 or -1, the predicted voxel prediction value is used as the updated voxel value of the voxel, and the label value is updated to -1; when the label value is 1, the voxel value of the voxel is not changed; when the voxel has a voxel observation value and the corresponding label value is -1 or 0, the voxel observation value is used as the voxel value corresponding to the voxel, and the label value is updated to 1. This method can eliminate the predicted area in the scene 3D model and use the real geometric data of the scene to improve the model, so as to achieve accurate estimation of the scene surface. At the same time, the camera posture is estimated according to the normal vector of each pixel point to complete the reconstruction of the scene model.

[0096] Subsequently, the Marching Cube algorithm or the like may be used to extract vertices and triangles from the scene model obtained after the update, thereby obtaining a reconstructed model.

[0097] like Figure 3 As shown, the image on the left is a three-dimensional model obtained without using the scene construction model of this embodiment, and the image on the right is a three-dimensional model obtained by using the scene construction model of this embodiment, wherein the dotted line framed portion is a hollow area. It can be clearly seen that the number and range of hollows can be greatly reduced through the scene model construction method of this embodiment with higher accuracy.

[0098] Furthermore, if Figure 4 Based on the above-mentioned scene model construction method, the present invention also provides a smart terminal, which includes a processor 10, a memory 20 and a display 30. Figure 4 Only some components of the smart terminal are shown, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.

[0099] In some embodiments, the memory 20 may be an internal storage unit of the smart terminal, such as a hard disk or memory of the smart terminal. In other embodiments, the memory 20 may also be an external storage device of the smart terminal, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the smart terminal. Furthermore, the memory 20 may also include both an internal storage unit of the smart terminal and an external storage device. The memory 20 is used to store application software and various types of data installed in the smart terminal, such as the program code of the installed smart terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, a scene model construction program 40 is stored on the memory 20, and the scene model construction program 40 can be executed by the processor 10, thereby realizing the scene model construction method in the present application.

[0100] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 20, such as executing the scene model construction method.

[0101] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 30 is used to display information on the smart terminal and to display a visual user interface. The components 10-30 of the smart terminal communicate with each other via a system bus.

[0102] In one embodiment, when the processor 10 executes the scene model building program 40 in the memory 20, the following steps are implemented:

[0103] When acquiring an Nth original depth image for the same scene, performing scene fusion on the Nth original scene model according to the Nth original depth image to obtain an Nth intermediate scene model, wherein N is a natural number less than or equal to the total number of the original depth images, and when N is equal to 1, the first original scene model is a preset blank scene model;

[0104] Extracting neighborhood features of each voxel in the Nth intermediate scene model according to a preset extraction rule;

[0105] Calculating a voxel prediction value corresponding to each voxel according to the neighborhood features;

[0106] For each voxel, when the voxel value corresponding to the voxel in the Nth original scene model is a non-voxel observation value, the Nth original scene model is updated according to the voxel prediction value corresponding to the voxel to obtain the (N+1)th original scene model.

[0107] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a scene model construction program, and when the scene model construction program is executed by a processor, the steps of the scene model construction method as described above are implemented.

[0108] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the program can be stored in a computer-readable storage medium that can be read by a computer, and the program can include the processes of the above-mentioned method embodiments when executed. The computer-readable storage medium can be a memory, a disk, an optical disk, etc.

[0109] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.

Claims

1. A scene model construction method, characterized in that: The scene model construction method comprises: When acquiring an Nth original depth image for the same scene, performing scene fusion on the Nth original scene model according to the Nth original depth image to obtain an Nth intermediate scene model, wherein N is a natural number less than or equal to the total number of the original depth images, and when N is equal to 1, the first original scene model is a preset blank scene model; Extracting neighborhood features of each voxel in the Nth intermediate scene model according to a preset extraction rule; For each of the voxels, the neighborhood features corresponding to the voxel include scene features of neighborhood voxels of the voxel, and the neighborhood voxels are voxels corresponding to neighborhood pixels of the pixel point corresponding to the voxel; The step of extracting the neighborhood features of each voxel in the Nth intermediate scene model according to a preset extraction rule specifically includes: Extracting scene features of each voxel in the Nth intermediate scene model according to a preset extraction rule; For each of the voxels, according to a preset screening rule and the coordinates of the neighboring voxels corresponding to the voxel, the neighboring voxels are screened, and voxels with weak correlation with the voxel value of the current voxel are eliminated to obtain the target voxel; Using the scene feature corresponding to the target voxel as the neighborhood feature corresponding to the voxel; Calculating a voxel prediction value corresponding to each voxel according to the neighborhood features; For each voxel, when the voxel value corresponding to the voxel in the Nth original scene model is a non-voxel observation value, the Nth original scene model is updated according to the voxel prediction value corresponding to the voxel to obtain the (N+1)th original scene model.

2. The scene model construction method according to claim 1, characterized in that: When acquiring the Nth original depth image for the same scene, performing scene fusion on the Nth original scene model according to the Nth original depth image to obtain the Nth intermediate scene model specifically includes: When acquiring an Nth original depth image for the same scene, filtering the Nth original depth image to generate an Nth denoised depth image; Calculate the point cloud corresponding to each pixel in the Nth denoised depth image according to the camera intrinsic parameters corresponding to the Nth original depth image to obtain a plurality of point clouds; For each pixel in the Nth denoised depth image, determine a normal vector of the point cloud corresponding to the pixel according to a neighborhood point cloud corresponding to the pixel, wherein the neighborhood point cloud corresponds to a point cloud of a neighborhood pixel of the pixel; According to the normal vectors of each point cloud, scene fusion is performed on each voxel in the Nth scene model to obtain the Nth intermediate scene model.

3. The scene model construction method according to claim 1, characterized in that: Calculating the voxel prediction value corresponding to each voxel according to the neighborhood feature specifically includes: For each of the voxels, a neighborhood feature corresponding to the voxel is input into a trained structured random forest model, and the structured random forest model is used to predict the voxel value according to the input neighborhood feature to obtain a plurality of initial prediction values ​​corresponding to the voxel; Calculate the error value corresponding to each of the initial prediction values ​​according to a preset error loss function; Determining a plurality of intermediate prediction values ​​in the initial prediction value according to the error value; According to the intermediate prediction value, a voxel prediction value corresponding to the voxel is calculated.

4. The scene model construction method according to claim 3, characterized in that: The training process of the structured random forest model includes: Obtain training depth images of different scenes; According to a preset sampling rule, the pixel points in the training depth image are screened to obtain training pixel points; For each of the training pixels, the voxel value corresponding to the pixel is used as label data, and the neighborhood voxel value corresponding to the pixel is used as training data; Inputting the training data into a preset structured random forest model, and calculating corresponding training prediction values ​​according to the training data through the structured random forest model; According to the training prediction value and the label data, the parameters of the structured random forest model are adjusted until the structured random forest model converges.

5. The scene model construction method according to claim 4, characterized in that: The structured random forest model includes a plurality of decision trees; the training data is input into a preset structured random forest model, and the structured random forest model is used to calculate the corresponding training prediction value according to the training data, specifically including: Generate a plurality of training subsets according to the label data and the training data, wherein the number of the training subsets is the same as the number of the decision trees; For each of the decision trees, the training data in the training subset is input into the decision tree, and each node of the decision tree performs dimension reduction and clustering on the training data to obtain the principal component value corresponding to the training data; According to the principal component value, the child node corresponding to the training data is determined until a leaf node is reached to obtain the predicted training value corresponding to the decision tree.

6. The scene model construction method according to claim 3, characterized in that: The calculating the voxel prediction value corresponding to the voxel according to the intermediate prediction value specifically includes: For each of the intermediate prediction values, determine a weight value corresponding to the intermediate prediction value according to an error value corresponding to the intermediate prediction value; The voxel prediction value corresponding to the voxel is calculated according to the weight values ​​corresponding to the intermediate prediction values.

7. An intelligent terminal, characterized in that: The intelligent terminal includes: a memory, a processor, and a scene model construction program stored in the memory and capable of running on the processor. When the scene model construction program is executed by the processor, the steps of the scene model construction method according to any one of claims 1 to 6 are implemented.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a scene model construction program, and when the scene model construction program is executed by a processor, the steps of the scene model construction method according to any one of claims 1 to 6 are implemented.