A real scene three-dimensional model space index construction method

CN117971837BActive Publication Date: 2026-10-27COMMUNICATION UNIVERSITY OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410235969.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-01
Publication Date
2026-10-27
Estimated Expiration
2044-03-01

Smart Images

  • Figure CN117971837B_ABST
    Figure CN117971837B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of digital twinning, and particularly relates to a real scene three-dimensional model space index construction method, which comprises the following steps: step 1: analyzing tile data of a real scene three-dimensional model and analyzing a LOD hierarchical structure; step 2: establishing a unified LOD hierarchical structure, creating a unified root tile and LOD parameters, and the number of layers is a multiple of 3, and the reorganization of the LOD hierarchical structure is completed; step 3: calculating a space bounding box of the real scene three-dimensional model, re-dividing the entire space into a uniform quadtree structure from top to bottom, numbering the grids, then filling tile data of each layer into the new grid, and generating a new tile file. The application optimizes the index structure, splits the index tree of a large model into local small indexes with basically consistent sizes, facilitates fast loading, is conducive to the optimization of memory allocation, can reduce the pressure on the network when transmitting the index file, and does not need to query from the root node of the entire model, so that the random reading performance of the model is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of digital twin technology, specifically relating to a method for constructing a spatial index for a real-world 3D model. Background Technology

[0002] In recent years, digital twin technology has been widely used in tourism, education, real estate, emergency rescue, smart cities, security and other fields. This technology is mostly based on B / S architecture, which organically integrates the three-dimensional model of the real world with various big data information to bring users a rich immersive experience.

[0003] To meet the needs of immersive experiences and ensure the efficiency of content production, it is necessary to provide realistic large-scale 3D scene models with detailed structures. Large-scale 3D scene modeling based on oblique photogrammetry is one of the commonly used technical means.

[0004] Large-scale 3D reality model data can place a huge loading burden on B / S architecture applications. To address this issue, the industry standard is to segment the model data according to 3D space, with each unit space called a tile. The space corresponding to a tile can be further subdivided, thus constructing a hierarchical tree structure. The leaf nodes of the tree correspond to the most basic 3D model, while the intermediate nodes contain simplified 3D model structures for the next level, resulting in a Level-of-Detail (LOD) hierarchical structure. When a user accesses the application, it can first load the coarsest 3D model, loading only the more detailed data for the areas of interest to the user. This LOD structure can significantly reduce the pressure on network transmission and model rendering.

[0005] However, as the sophistication of models increases, the spatial index structure also becomes deeper, leading to performance issues with this indexing method.

[0006] 1. Existing indexing technologies such as 3DTiles are based on osgb files and perform certain model optimizations and separate index data from model data. However, they do not optimize the index structure itself. The system needs to load and maintain a huge index structure in memory at the beginning. When processing large-scale real-world 3D models, the transmission of these index files will put a lot of pressure on the network.

[0007] 2. Due to the tree structure, accessing nodes on different branches requires traversing down from the root node. When users frequently switch, zoom in, or zoom out on the model, the application needs to find and load the appropriate model data again from the root node, causing serious performance issues.

[0008] 3. Currently, the tree structure output by oblique photogrammetry technology (usually in OSGB format) is uneven in spatial division. Some spatial divisions are too dense, while others are too sparse. This inconsistency makes it impossible to achieve a unified data structure, which is very detrimental to optimizing model loading. Summary of the Invention

[0009] The purpose of this invention is to provide a method for constructing a spatial index for a real-world 3D model. By optimizing the index structure, the index tree of a large model is split into smaller local indexes of roughly the same size, which facilitates fast loading, optimizes memory allocation, reduces network pressure when transmitting index files, and eliminates the need to query from the root node of the entire model, thereby greatly improving the random access performance of the model.

[0010] The specific technical solution adopted by this invention is as follows:

[0011] A method for constructing a spatial index for a real-world 3D model includes the following steps:

[0012] Step 1: Analyze the tile data of the real-world 3D model and analyze the LOD hierarchy;

[0013] Step 2: Establish a unified LOD hierarchy, create unified root tiles and LOD parameters, and ensure that the number of layers is a multiple of 3, thus completing the reorganization of the LOD hierarchy;

[0014] Step 3: Calculate the bounding box of the real-world 3D model, re-divide the entire space from top to bottom into a uniform quadtree structure, number the meshes, and then fill the tile data of each layer into the new mesh to generate a new tile file, thus completing the tile remodeling.

[0015] Step 4: First, build a root index tree in the first three levels of the LOD hierarchy. Each grid is a node in the tree, and the number of grids in each level is 1, 4, and 16 respectively. The 16 grids in the third level of the root index tree are further divided into 64 grids. Using these 64 grids as root nodes, continue to build three-level index trees, with the number of grids in each level also being 1, 4, and 16. Continue in this manner until the last level of the LOD hierarchy. Each index tree is saved as a JSON file.

[0016] Each index tree contains three aspects of accessibility information, including node content accessibility, node accessibility, and secondary index accessibility. Accessibility data is stored in a binary array, and the coordinates of the spatial grid are encoded into Morton codes using Z-space filling curves as position numbers in the binary array.

[0017] Further, step 1 includes the following steps:

[0018] Step 101: Use the OSG open-source library to read all osgb files in the root directory and subdirectories of the large-scale real-world 3D model;

[0019] Step 102: Parse the LOD hierarchy from all the osgb files of the large-scale real-scene 3D model.

[0020] Furthermore, the osgb file includes LOD level of detail metadata, bounding box information, 3D model vertex and texture information.

[0021] Furthermore, the LOD data includes the calculation mode for whether to load the next level of detail OSGB file and the associated next-level OSGB file.

[0022] Furthermore, step 2 includes the following steps:

[0023] Step 201: Merge the vertex data contained in the root tiles of each subdirectory, and then simplify and construct a new LOD layer upwards. The top layer is used as the root node of the entire LOD hierarchy and saved as an osgb file as the starting point for the initial loading of the model.

[0024] Step 202: Calculate the geometric error of the 0th level LOD as the threshold for loading the next level LOD hierarchy.

[0025] Furthermore, the simplification method for the LOD layer in step 201 can be any one of the following algorithms: vertex clustering, region merging, or geometric element deletion.

[0026] Furthermore, step 3 includes the following steps:

[0027] Step 301: When calculating the spatial bounding box of the real-world 3D model, altitude is not considered; only the latitude and longitude range of the model is taken into account. The final range of the real-world 3D model is represented as follows:

[0028] [long min ,lat min Width, Length

[0029] Among them, the first long min lat min This indicates the coordinates of the bottom left corner of the bounding box, while Width and Length represent the dimensions of the bounding box.

[0030] Step 302: Divide the bounding box into a uniform quadtree structure from top to bottom, with a level of N. new The grid is numbered according to a coordinate system, with the numbering format (l, x, y), where l represents the LOD layer number, and x and y represent the grid number along the X and Y coordinate axes, respectively. The spatial extent of the bounding box can be directly calculated.

[0031] Thus, for the vertices (v) contained in layer l tiles x v y v z And the grid numbered (l, x, y), if the following conditions are met:

[0032]

[0033]

[0034] Then the vertex (v) x v y v z ) belongs to this grid;

[0035] Step 303: Generate a new tile file by combining all vertices that satisfy the formula conditions in Step 2 with other associated information.

[0036] Furthermore, the LOD level number starts counting from 0 and ranges from [0, L-1], where x, y ∈ [0, 2]. l -1].

[0037] The technical effects achieved by this invention are as follows:

[0038] (1) The present invention provides a method for constructing a spatial index of a real-world 3D model by optimizing the index structure, splitting the index tree of a large model into local small indexes of roughly the same size, which facilitates fast loading, optimizes memory allocation, reduces network pressure when transmitting index files, and does not require querying from the root node of the entire model, thereby greatly improving the random reading performance of the model. Attached Figure Description

[0039] Figure 1 This is a partial structural diagram of a typical oblique photogrammetry data output;

[0040] Figure 2 This is a uniform spatial partitioning diagram of a quadtree according to the present invention;

[0041] Figure 3 This is a schematic diagram of the index structure of the present invention;

[0042] Figure 4 This is a schematic diagram of the index tree of the present invention. Detailed Implementation

[0043] To make the objectives and advantages of this invention clearer, the invention will be specifically described below with reference to embodiments. It should be understood that the following text is merely used to describe one or more specific embodiments of the invention and does not strictly limit the scope of protection specifically claimed by the invention.

[0044] like Figure 1-4 As shown, a method for constructing a spatial index for a real-world 3D model includes the following steps:

[0045] Step 1: Analyze the tile data of the real-world 3D model and analyze the LOD hierarchy;

[0046] Large-scale real-world 3D models reconstructed using oblique photogrammetry are saved as several osgb files. A typical portion of oblique photogrammetry data is as follows: Figure 1 As shown in the diagram, the contents of the root directory and two subdirectories are listed. The root directory contains 12 subdirectories, which is equivalent to dividing the entire model into 12 parts. Each osgb file in a subdirectory represents a tile. All osgb files in each subdirectory form a subtree, an independent LOD hierarchy. The first osgb file named after the subdirectory, such as Tile_+000_+001_+000.osgb, represents the root node of this LOD hierarchy.

[0047] The osgb file contains LOD (Level of Detail) metadata, bounding volume information, 3D model vertex and texture information, etc.; LOD data includes whether to load the next level of detail osgb file, the calculation mode (distance mode or pixel mode), and the associated next-level osgb file; in this way, multiple osgb files are linked together to represent a large-scale real-world 3D model.

[0048] Among them, such as Figure 1 As shown, step 1 will be described in detail here. Specifically, step 1 includes the following steps:

[0049] Step 101: Use the OSG open-source library to read all osgb files in the root directory and subdirectories of the large-scale real-world 3D model;

[0050] Step 102: Parse the LOD hierarchy from all the osgb files of the large-scale real-scene 3D model.

[0051] Step 2: Establish a unified LOD hierarchy, create unified root tiles and LOD parameters, and ensure that the number of layers is a multiple of 3, thus completing the reorganization of the LOD hierarchy.

[0052] Specifically, the number of layers in the restructured LOD hierarchy is the closest to the number of layers in the original LOD hierarchy and is a multiple of 3. For example, if the number of layers in the original LOD hierarchy was 8, then the number of layers in the restructured LOD hierarchy will be 9, which is exactly 3 times 3.

[0053] from Figure 1 The data structure reveals that oblique photogrammetry data lacks a unified LOD root tile. Initial model loading requires at least a one-time transfer and loading of the root osgb file from all subdirectories. With many subdirectories, this inevitably puts significant performance pressure on the system. Step 2 aims to establish a unified LOD hierarchy, which specifically includes the following steps:

[0054] Step 201: Merge the vertex data contained in the root tiles of each subdirectory, and then simplify upwards to construct a new LOD layer. Assuming that the LOD hierarchy before refactoring has L layers, then the number of layers in the refactored LOD hierarchy will be L. new Then we need to simplify the construction upwards sequentially (L) new -L) layers, simplified methods can use algorithms such as vertex clustering, region merging, and geometric element deletion. Finally, the topmost layer is used as the root node of the LOD hierarchy and saved as an osgb file, which is equivalent to the starting point of the initial loading of the model, which can greatly improve performance.

[0055] Step 202: Calculate the geometric error (geometricError0) of the 0th level LOD as the threshold for loading the next level LOD hierarchy. For the 1st level LOD, its geometric error can be directly calculated.

[0056] .

[0057] Step 3: Calculate the bounding box of the real-world 3D model, re-divide the entire space from top to bottom into a uniform quadtree structure, number the meshes, and then fill the tile data of each layer into the new meshes to generate new tile files, thus completing the tile reorganization. The new tile files are the mesh numbers. For example, the tile file name corresponding to the mesh numbered (l, x, y) is l_x_y.b3dm.

[0058] Specifically, step 3 includes the following steps:

[0059] Step 301: Considering that the real-world 3D models obtained by oblique photogrammetry are all ground-hugging models, altitude can be disregarded. Therefore, when calculating the spatial bounding box range of the real-world 3D model, only the latitude and longitude range of the model is considered. Finally, the range of the real-world 3D model can be expressed as:

[0060] [long min ,latmin Width, Length

[0061] Among them, the first long min lat min This represents the coordinates of the bottom left corner of the bounding box, while Width and Length represent the dimensions of the bounding box.

[0062] Step 302: Following the above principles, this method divides the bounding box into a uniform quadtree structure from top to bottom, with N levels. new ,like Figure 2 As shown in the figure, an example of a 3-level quadtree partitioning is illustrated. The grids are numbered according to the coordinate system, with the numbering format (l, x, y). l represents the level number of the Level of Detail (LOD) (starting from 0 and ranging from [0, L-1]), and x and y represent the grid numbers along the X and Y coordinate axes, respectively (where x, y ∈ [0, 2). l -1]), the spatial extent of the bounding box can be directly calculated as

[0063] Thus, for the vertices (v) contained in layer l tiles x v y v z And the grid numbered (l, x, y), if the following conditions are met:

[0064]

[0065]

[0066] Then the vertex (v) x v y v z (Note that altitude is not considered.)

[0067] Step 303: Using the formula in Step 2, generate a new tile file by combining all vertices that satisfy the conditions in Step 2 with other associated information, such as textures and normals. This method uses the b3dm format, which is currently the mainstream format for tile models. To ensure the integrity of certain building models, the spatial range of the mesh can be appropriately expanded so that there is some overlap at the edges. Finally, the tile file corresponding to the mesh numbered (l, x, y) is named l_x_y.b3dm. All model files (*.b3dm) are saved in the tiles subdirectory under the final output directory.

[0068] Considering that some meshes may not contain any vertices, this step also creates a temporary lookup table to record which meshes have corresponding tile files. If a tile file exists, it is saved as 1; otherwise, it is saved as 0.

[0069] Step 4: First, build a root index tree in the first three levels of the LOD hierarchy. Each grid is a node in the tree, and the number of grids in each level is 1, 4, and 16 respectively. The 16 grids in the third level of the root index tree are further divided into 64 grids. Using these 64 grids as root nodes, continue to build three-level index trees, with the number of grids in each level also being 1, 4, and 16. Continue in this manner until the last level of the LOD hierarchy. Each index tree is saved as a JSON file.

[0070] Each index tree contains three aspects of accessibility information, including node content accessibility, node accessibility, and secondary index accessibility. Accessibility data is stored in a binary array, and the coordinates of the spatial grid are encoded into Morton codes using Z-space filling curves as position numbers in the binary array.

[0071] Specifically, for large-scale scenarios, the temporary lookup table established in step 3 can become extremely large, making it wasteful to load all at once and inconvenient to search. This method addresses this issue by establishing a novel indexing system, as detailed below:

[0072] Step 401: Build the root index tree for the first three levels of the LOD hierarchy. Each grid corresponds to a node in the tree (since it's a one-to-one correspondence, we won't distinguish between grids and nodes later in this article). Therefore, the number of nodes in each level is 1, 4, and 16 respectively, as follows: Figure 3 As shown in b. The root index tree is saved as a separate JSON file named 0_0_0.json.

[0073] Step 402: Following the principles of quadtrees, the 16 grids of the third level of the root index tree will be further divided into 64 grids. Then, new three-level index trees will be built using these 64 grids as root nodes. The structure of the trees is the same as in step 1), and these are called secondary index trees. Each secondary index tree is saved as a separate JSON file. Assuming that the grid number corresponding to the root node of a certain secondary index tree is (l, x, y), then the corresponding index tree file name is l_x_y.json.

[0074] Step 403: Continue in this manner until the last level of LOD is reached, ultimately allowing the establishment of a system like... Figure 3 The index structure is shown in diagram 'a'. All index files are stored in the subdirectory 'indics' under the final output directory.

[0075] Step 404: Generate the entry index file tilesset.json for the entire model in the final output directory. The fields include geometricError0, model bounding box, and total number of LOD levels.

[0076] The node content accessibility indicates whether there are accessible model files for all spatial grids (21 in total) corresponding to all nodes in the current index tree. It contains two fields: the total number of accessible nodes (count) and a binary array (data) representing the accessibility of each node (0 indicates accessible, 1 indicates inaccessible, length 21), stored as a hexadecimal encoded string. Furthermore, if the total number of accessible nodes is 0, then data is empty.

[0077] Node accessibility indicates whether all nodes in the current index tree need to be accessed. If a node's accessibility is 1, there are two possibilities:

[0078] The first scenario is that the accessibility of the current node's content is 1.

[0079] The second type is when the accessibility of the current node's lower-level nodes is 1, or when the lower-level node is the root node of the secondary index tree.

[0080] Node accessibility contains two fields: the total number of accessible nodes (count) and a binary array (data) representing the accessibility of each node (0 indicates existence, 1 indicates non-existence, length is 21), in hexadecimal encoded string format; in addition, if the total number of accessible nodes is 0, then data is empty.

[0081] Secondary index accessibility indicates whether the 64 grids at the bottom level of the index tree are the root nodes of the new secondary index tree. It contains two fields: the total number of secondary indexes (count) and a binary array (data) representing the accessibility of secondary indexes (0 indicates accessible, 1 indicates inaccessible, and the length is 64). It is stored in a hexadecimal encoded string format. In addition, if the total number of secondary indexes is 0, then data is empty.

[0082] Figure 4 An example of an index tree is shown, representing node accessibility, node content accessibility, and secondary index accessibility. Figure 4 The upper part is arranged in a quadtree space, and the lower part is arranged in a one-dimensional binary array. Node accessibility and node content accessibility store information about the nodes of the three levels of the index tree, so the length is 1+4+16=21, while the secondary index existence stores information about the nodes of the next level (the 3rd level) of the index tree, so the length is 64.

[0083] This method uses a one-dimensional binary array to store the accessibility information mentioned above. In order to store the two-dimensional grid information into the one-dimensional array, this method uses a Z-fill curve to arrange the order of the grid (nodes), which is called Morton code. It is formed by interleaving the binary format of the two-dimensional grid number. For example, for the grid numbered (1,3), the binary format is (01,11), so its Morton code is 1011, and the value is 11. That is, the grid with coordinates (1,3) has an index number of 11 in the array (not considering the case of multiple layers).

[0084] Figure 4 The upper part shows the order in which the Z-fill curve is traversed in the two-dimensional grid and the value of the Morton code. Since the information of the three layers of nodes is stored, the Morton codes of each layer are connected end to end.

[0085] The spatial index constructed using the above method has the following advantages:

[0086] 1. Uniformly divided space facilitates quick location of the required LOD layer without needing to access each layer one by one. Furthermore, using grid coordinates and hierarchy allows for rapid location of the required tile and index files.

[0087] 2. The index tree of the entire large model is split into smaller local indexes of roughly the same size, which facilitates fast loading and optimizes memory allocation.

[0088] 3. The three accessibility features in the index tree can help applications eliminate grids that do not need to be accessed, reduce unnecessary network requests, and improve the random read performance of tiles, thereby greatly improving the speed of traversing and querying the entire model.

[0089] 4. The accessibility of binary arrays can reduce space usage, and from... Figure 4 It can be observed that adjacent grids in the Morton code are also adjacent in space, which is beneficial for applications to quickly query grid accessibility information for a region.

[0090] 5. If the grid to be accessed is not the root node of the index tree, its Morton code can be used to deduce the coordinates of the root node of the index tree to which it belongs, thus finding the index file, without needing to start the query from the root node of the entire model.

[0091] In summary, this technical solution optimizes the index structure by splitting the index tree of a large model into smaller local indexes of roughly the same size. This facilitates fast loading, optimizes memory allocation, reduces network pressure when transmitting index files, and eliminates the need to query from the root node of the entire model, thereby significantly improving the random access performance of the model.

[0092] The above description is merely a preferred embodiment of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention. Structures, devices, and operating methods not specifically described or explained in this invention are implemented according to conventional methods in the art unless otherwise specified or limited.

Claims

1. A method for constructing a spatial index for a real-world 3D model, characterized in that: Includes the following steps: Step 1: Analyze the tile data of the real-world 3D model and analyze the LOD hierarchy; Step 2: Establish a unified LOD hierarchy, create unified root tiles and LOD parameters, complete the reorganization of the LOD hierarchy, and ensure that the number of layers in the reorganized LOD hierarchy is a multiple of 3. Step 3: Calculate the bounding box of the real-world 3D model, re-divide the entire space from top to bottom into a uniform quadtree structure, number the meshes, and then fill the tile data of each layer into the new mesh to generate a new tile file, thus completing the tile remodeling. Step 3 includes the following steps: Step 301: When calculating the spatial bounding box of the real-world 3D model, altitude is not considered; only the latitude and longitude range of the model is taken into account. The final range of the real-world 3D model is represented as follows: [ , ,Width,Length] in, , This indicates the coordinates of the bottom left corner of the bounding box, while Width and Length represent the dimensions of the bounding box. Step 302: Divide the bounding box into a uniform quadtree structure from top to bottom, with Nnew layers. Number the grids according to the coordinate system in the format (l, x, y), where l represents the LOD layer number, and x and y represent the grid numbers along the XY coordinate axes, respectively. The spatial extent of the bounding box can be directly calculated. ; Thus, for the vertices contained in layer l ( , , And the grid numbered (l, x, y), if the following conditions are met: ; Then the vertex (v) x v y v z ) belongs to this grid; Step 303: Generate a new tile file by combining all vertices that satisfy the formula conditions in Step 2 with other associated information; Step 4: First, build a root index tree in the first three levels of the LOD hierarchy. Each grid is a node in the tree, and the number of grids in each level is 1, 4, and 16 respectively. The 16 grids in the third level of the root index tree are further divided into 64 grids. Using these 64 grids as root nodes, continue to build three-level index trees, with the number of grids in each level also being 1, 4, and 16. Continue in this manner until the last level of the LOD hierarchy. Each index tree is saved as a JSON file. Each index tree contains three aspects of accessibility information, including node content accessibility, node accessibility, and secondary index accessibility. Accessibility data is stored in a binary array, and the coordinates of the spatial grid are encoded into Morton codes using Z-space filling curves as position numbers in the binary array.

2. The method for constructing a spatial index for a real-scene 3D model according to claim 1, characterized in that: Step 1 includes the following steps: Step 101: Use the OSG open-source library to read all osgb files in the root directory and subdirectories of the large-scale real-world 3D model; Step 102: Parse the LOD hierarchy from all the osgb files of the large-scale real-scene 3D model.

3. The method for constructing a spatial index for a real-scene 3D model according to claim 2, characterized in that: The osgb file contains LOD (Level of Detail) metadata, bounding box information, 3D model vertices, and texture information.

4. The method for constructing a spatial index for a real-scene 3D model according to claim 3, characterized in that: The LOD detail level metadata includes the computation mode for whether to load the next detail level osgb file and the associated next-level osgb file.

5. The method for constructing a spatial index for a real-scene 3D model according to claim 2, characterized in that: Step 2 includes the following steps: Step 201: Merge the vertex data contained in the root tiles of each subdirectory, and then simplify and construct a new LOD layer upwards. The top layer is used as the root node of the entire LOD hierarchy and saved as an osgb file as the starting point for the initial loading of the model. Step 202: Calculate the geometric error of the 0th level LOD as the threshold for loading the next level LOD hierarchy.

6. The method for constructing a spatial index for a real-scene 3D model according to claim 5, characterized in that: The simplified method for the LOD layer in step 201 adopts any one of the following algorithms: vertex clustering, region merging, and geometric element deletion.

7. The method for constructing a spatial index for a real-scene 3D model according to claim 1, characterized in that: The level number of the LOD is counted starting from 0, and the range is... , .

Citation Information

Patent Citations

  • Oblique model organization construction method

    CN106600684A

  • Multi-level tile joint large-scale digital twinning scene construction method

    CN116842121A