A method, device and equipment for constructing a visual space index of a three-dimensional building model

CN115482366BActive Publication Date: 2026-07-21GUANGZHOU URBAN PLANNING & DESIGN SURVEY RES INST
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU URBAN PLANNING & DESIGN SURVEY RES INST
Filing Date
2022-09-20
Publication Date
2026-07-21

Smart Images

  • Figure CN115482366B_ABST
    Figure CN115482366B_ABST
Patent Text Reader

Abstract

The application discloses a three-dimensional building model visible space index construction method, device and equipment, which comprises the following steps: establishing a model block set according to model material, polygon connectivity and a triangle patch quantity threshold; performing grid division on the visible space of the three-dimensional building model based on the minimum bounding box of each model block and a preset division interval; collecting a visible model block set in each visible space grid based on a camera detection tool to construct an initial visible space index; and supplementing the initial visible space index by performing supplementary visualization detection on imperfect grids in the initial visible space index to obtain a target visible space index. The application can ensure that the model block in the visible space index is visible to the human eye by simulating the line of sight of the human eye by using the camera detection tool to perform visualization detection on the model block in each visible space grid of the model, thereby significantly improving the visualization effect of the three-dimensional building model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of three-dimensional data visualization technology, and in particular to a method, apparatus and equipment for constructing a visual spatial index of a three-dimensional building model. Background Technology

[0002] Three-dimensional building models are one of the basic elements of digital twin cities or GIS+BIM scenarios. In these scenarios, there are various types of 3D building models that can be loaded. Among them, high-precision building models with indoor and outdoor information constructed manually and BIM models have both indoor and outdoor building data and structural data. Therefore, these two types of 3D building models have a large data volume, which makes data loading difficult during visualization.

[0003] To load these two types of 3D building models, existing technologies typically use spatial indexing methods based on spatial distance, loading all model data within a certain spatial range. This method cannot effectively load distant models visible to the human eye, but instead loads nearby models invisible to the human eye, resulting in poor visualization of the 3D building models. Summary of the Invention

[0004] This invention provides a method, apparatus, and device for constructing a visual space index for a 3D building model, to solve the technical problem of poor visualization effect of loading 3D building models in the prior art. By using a camera detection tool to simulate the human eye's line of sight, the model blocks in each visual space grid of the 3D building model are visually detected, thereby constructing a visual space index for the 3D building model. This ensures that the model blocks in the visual space index are visible to the human eye, thus significantly improving the visualization effect of the 3D building model.

[0005] To address the aforementioned technical problems, the first aspect of this invention provides a method for constructing a visual space index for a three-dimensional architectural model, comprising the following steps:

[0006] Based on the model material and polygon connectivity of the 3D building model to be loaded, the 3D building model to be loaded is divided into several fragmented sub-models;

[0007] The fragmented sub-models are spatially divided according to a preset threshold for the number of triangular facets, and the fragmented sub-models contained in each space are aggregated to obtain a set of model blocks.

[0008] Obtain the minimum bounding box of each model block in the model block set, and obtain the minimum bounding box of the three-dimensional building model to be loaded based on the minimum bounding box of each model block.

[0009] Expand the minimum bounding box of the three-dimensional building model to be loaded according to the preset building exterior space range value to obtain the expanded bounding box;

[0010] Based on the difference between the expanded bounding box and the minimum bounding box, the inner space and outer space of the three-dimensional building model to be loaded are obtained, and the inner space and the outer space are divided into meshes with a preset dividing interval to obtain several visible space meshes.

[0011] Using a preset camera detection tool, the model blocks in each visible space grid are visually detected according to the preset camera round-shot rules to obtain the initial visible space index;

[0012] Compare all model blocks in the initial visual space index with all model blocks in the model block set to identify several imperfect meshes that do not meet the preset comparison requirements.

[0013] The camera detection tool is used to perform supplementary visual detection on the model blocks in the incomplete mesh to obtain a supplementary visual detection set. The initial visual space index is then filled in according to the supplementary visual detection set to obtain the target visual space index.

[0014] As a preferred embodiment, the step of spatially dividing the fragmented sub-models according to a preset threshold for the number of triangular facets, and aggregating the fragmented sub-models contained in each space to obtain a set of model blocks, specifically includes the following steps:

[0015] Based on the fragmented sub-model set composed of the aforementioned fragmented sub-models, the octree algorithm is used to partition the space from the center point of the fragmented sub-model set;

[0016] When the number of triangular faces of the fragmented sub-models contained in the smallest space obtained by spatial partitioning is less than the threshold number of triangular faces, the spatial partitioning is stopped, and the number of fragmented sub-models contained in each space is recorded.

[0017] Aggregate the fragmented sub-models contained in each space to obtain the model blocks corresponding to each space, and combine all the model blocks into the model block set.

[0018] As a preferred embodiment, obtaining the minimum bounding box of each model block in the model block set, and obtaining the minimum bounding box of the 3D building model to be loaded based on the minimum bounding box of each model block, specifically includes the following steps:

[0019] The seed point diffusion algorithm is used to obtain the minimum bounding box of each model block in the model block set;

[0020] The minimum bounding box of the three-dimensional building model to be loaded is obtained by taking the union of the minimum bounding boxes of each model block in the model block set.

[0021] As a preferred embodiment, the partition spacing includes partition spacing in the x-direction, partition spacing in the y-direction, and partition spacing in the z-direction;

[0022] The step of dividing the inner space and the outer space into grids with a preset interval to obtain several visible space grids specifically includes the following steps:

[0023] The inner space and the outer space are divided into grids using preset intervals in the x, y, and z directions;

[0024] When the last grid in the inner space and the outer space is divided, and each grid in the inner space has the same size, and each grid in the outer space has the same size, the grids in the inner space and the outer space are taken as the visible space grid.

[0025] When the last grid in the inner space and the outer space is divided, if there are grids of different sizes in the inner space or the outer space, a new grid is added in the building space with different grid sizes, and all grids in the building space are shifted in the opposite direction of the added grid by half a supplementary unit. The shifted grid is used as the visible space grid.

[0026] As a preferred embodiment, the step of using a preset camera detection tool to perform visual detection on the model blocks in each visible space grid according to a preset camera round-capture rule to obtain an initial visible space index specifically includes the following steps:

[0027] When visually probing the model blocks in each visible space grid in the outer space, the camera detection tool is used to visually probing the model blocks in each visible space grid in the direction facing the inner space, based on a preset threshold for the number of visible pixels, to obtain the visible space index of the outer space.

[0028] When visually probing the model blocks in each visible space grid in the inner space, the camera detection tool is used to visually probing the model blocks in each visible space grid in several preset shooting directions according to the visible pixel number threshold, so as to obtain the visible space index of the inner space.

[0029] The initial visible space index is obtained based on the visible space index of the outer space and the visible space index of the inner space.

[0030] As a preferred embodiment, the visual space index of the outer space includes the position of each visual space grid in the outer space and the visual set of model blocks contained in each visual space grid; the visual space index of the inner space includes the position of each visual space grid in the inner space and the visual set of model blocks contained in each visual space grid.

[0031] Therefore, obtaining the initial visible space index based on the visible space index of the outer space and the visible space index of the inner space specifically includes the following steps:

[0032] Calculate the similarity of the visual sets of model blocks contained in several adjacent visual space grids in the outer space and the inner space respectively;

[0033] When the similarity is greater than a preset similarity threshold, the adjacent visual space grids are merged.

[0034] The initial visual space index is obtained based on the merged visual space index of the outer space and the merged visual space index of the inner space.

[0035] As a preferred embodiment, the step of comparing all model blocks in the initial visual space index with all model blocks in the model block set to identify several imperfect meshes that do not meet the preset comparison requirements specifically includes the following steps:

[0036] The model blocks contained in each visual space grid in the initial visual space index are compared with the model blocks at the corresponding positions of each visual space grid in the model block set;

[0037] When the difference between a model block in any visible space grid and the model block at the corresponding position of any visible space grid in the set of model blocks is greater than a preset difference threshold, the any visible space grid is regarded as the imperfect grid.

[0038] As a preferred embodiment, the step of using the camera detection tool to perform supplementary visual detection on the model blocks in the incomplete mesh to obtain a supplementary visual detection set specifically includes the following steps:

[0039] Based on a number of pre-set supplementary detection locations in the imperfect grid, the camera detection tool is used to perform supplementary visual detection at each supplementary detection location to obtain the supplementary visual detection set.

[0040] A second aspect of the present invention provides a visual space indexing device for a three-dimensional building model, comprising:

[0041] The model partitioning module is used to divide the three-dimensional building model to be loaded into several fragmented sub-models based on the model material and polygon connectivity of the three-dimensional building model to be loaded.

[0042] The spatial partitioning module is used to partition the fragmented sub-models according to a preset threshold for the number of triangular facets, and aggregate the fragmented sub-models contained in each space to obtain a set of model blocks.

[0043] The minimum bounding box acquisition module is used to acquire the minimum bounding box of each model block in the model block set, and to acquire the minimum bounding box of the three-dimensional building model to be loaded based on the minimum bounding box of each model block.

[0044] The expanded bounding box acquisition module is used to expand the minimum bounding box of the three-dimensional building model to be loaded according to the preset building external space range value, so as to obtain the expanded bounding box;

[0045] The mesh generation module is used to obtain the inner space and outer space of the three-dimensional building model to be loaded based on the difference between the expanded bounding box and the minimum bounding box, and to divide the inner space and the outer space into meshes with a preset division interval to obtain several visible space meshes.

[0046] The initial visual space index construction module is used to use a preset camera detection tool to perform visual detection on the model blocks in each visual space grid according to a preset camera round-taking rule, and obtain the initial visual space index.

[0047] The imperfect mesh identification module is used to compare all model blocks in the initial visual space index with all model blocks in the model block set to identify several imperfect meshes that do not meet the preset comparison requirements.

[0048] The target visual space index construction module is used to use the camera detection tool to perform supplementary visual detection on the model blocks in the incomplete mesh, obtain a supplementary visual detection set, and fill in the initial visual space index according to the supplementary visual detection set to obtain the target visual space index.

[0049] A third aspect of the present invention provides a visual space indexing device for a three-dimensional building model, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the visual space indexing method for a three-dimensional building model as described in any of the first aspects.

[0050] Compared with the prior art, the beneficial effect of the embodiments of the present invention is that by using a camera detection tool to simulate the human eye's line of sight, the model blocks in each visible space grid of the three-dimensional building model are visually detected, and then a visible space index of the three-dimensional building model is constructed. This ensures that the model blocks in the visible space index are model blocks visible to the human eye, thereby significantly improving the visualization effect of the three-dimensional building model. Attached Figure Description

[0051] Figure 1 This is a flowchart illustrating the method for constructing a visual space index for a three-dimensional building model according to an embodiment of the present invention.

[0052] Figure 2 This is a schematic diagram of the structure of the visual space index construction method for a three-dimensional building model in an embodiment of the present invention. Detailed Implementation

[0053] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0054] See Figure 1 The first aspect of this invention provides a method for constructing a visual space index for a three-dimensional building model, comprising the following steps S1 to S8:

[0055] Step S1: Based on the model material and polygon connectivity of the three-dimensional building model to be loaded, divide the three-dimensional building model to be loaded into several fragmented sub-models.

[0056] Step S2: Divide the fragmented sub-models into spaces according to a preset threshold for the number of triangular facets, and aggregate the fragmented sub-models contained in each space to obtain a set of model blocks.

[0057] Step S3: Obtain the minimum bounding box of each model block in the model block set, and obtain the minimum bounding box of the three-dimensional building model to be loaded based on the minimum bounding box of each model block.

[0058] Step S4: Expand the minimum bounding box of the three-dimensional building model to be loaded according to the preset building external space range value to obtain the expanded bounding box;

[0059] Step S5: Based on the difference between the expanded bounding box and the minimum bounding box, obtain the inner space and outer space of the three-dimensional building model to be loaded, and divide the inner space and the outer space into meshes with a preset dividing interval to obtain several visible space meshes.

[0060] Step S6: Using a preset camera detection tool, perform visual detection on the model blocks in each visible space grid according to the preset camera round-taking rules to obtain the initial visible space index;

[0061] Step S7: Compare all model blocks in the initial visual space index with all model blocks in the model block set to identify several imperfect meshes that do not meet the preset comparison requirements.

[0062] Step S8: Use the camera detection tool to perform supplementary visual detection on the model blocks in the incomplete mesh to obtain a supplementary visual detection set, and fill in the initial visual space index according to the supplementary visual detection set to obtain the target visual space index.

[0063] In this embodiment, the 3D building model to be loaded is divided into blocks according to the model material used for each model component, resulting in a set of material block sub-models. For each sub-model in the material block sub-model set, its vertices, edges, triangles, and polygons are extracted. The adjacency relationship of triangles is determined by the shared edges, thereby determining the adjacency relationship of polygons. Non-adjacent polygons are divided into different polygon groups, and the vertices, edges, and triangles are recombined to form several fragmented sub-models.

[0064] As one preferred method for determining adjacent polygons, any vertex in the material block sub-model is selected as a seed point. The edges using the seed point are queried, the triangles using the edges are queried, and the polygons using the triangles are queried. The above query process of points, edges, triangles, and polygons is recursively repeated. The result set obtained when the recursive query terminates is the adjacent polygon.

[0065] It is worth noting that the camera detection tool in this embodiment is a tool that simulates the human eye in a graphics software system, such as the game engine UE. This embodiment requires pre-setting the parameters of the camera detection tool, specifically: setting the camera's view frustum range, setting the camera viewport aspect ratio to 1:1, setting the near clipping plane to the default nearest value, and setting the far clipping plane to infinity.<Location,Rotation> Set the camera position and orientation, and obtain round-shot templates for six directions: up, down, left, right, front, and back. Within each round-shot template, establish a method for extracting the visible set of camera images. Specifically: before the camera takes a picture, enable the Hitproxy mechanism of the graphics software system; after taking a picture, extract the Hitproxy map, traverse the objects in the map, extract objects with a visible pixel count greater than a fixed value t, and record them. After obtaining all visible objects in each round of shooting, delete duplicate object records.

[0066] It is worth noting that the external space range of a building is set based on the actual structural characteristics, volume, design specifications, and the visual characteristics of objects as observed by the human eye.

[0067] The spacing between the sections in a 3D architectural model is based on the actual size of the building.

[0068] As a preferred embodiment, the step of spatially dividing the fragmented sub-models according to a preset threshold for the number of triangular facets, and aggregating the fragmented sub-models contained in each space to obtain a set of model blocks, specifically includes the following steps:

[0069] Based on the fragmented sub-model set composed of the aforementioned fragmented sub-models, the octree algorithm is used to partition the space from the center point of the fragmented sub-model set;

[0070] When the number of triangular faces of the fragmented sub-models contained in the smallest space obtained by spatial partitioning is less than the threshold number of triangular faces, the spatial partitioning is stopped, and the number of fragmented sub-models contained in each space is recorded.

[0071] Aggregate the fragmented sub-models contained in each space to obtain the model blocks corresponding to each space, and combine all the model blocks into the model block set.

[0072] As a preferred embodiment, obtaining the minimum bounding box of each model block in the model block set, and obtaining the minimum bounding box of the 3D building model to be loaded based on the minimum bounding box of each model block, specifically includes the following steps:

[0073] The seed point diffusion algorithm is used to obtain the minimum bounding box of each model block in the model block set;

[0074] The minimum bounding box of the three-dimensional building model to be loaded is obtained by taking the union of the minimum bounding boxes of each model block in the model block set.

[0075] Specifically, in this embodiment, the minimum bounding box of each model block is an axial bounding box. The method used is the seed point diffusion algorithm, which is as follows: Eight seed points are arbitrarily selected from the block point set. The X, Y, and Z values ​​of these eight points are compared to obtain three sets of range values ​​for the X, Y, and Z axes: [minX, maxX], [minY, maxY], and [minZ, maxZ]. The remaining points in the block point set are traversed. If the X, Y, and Z values ​​of the remaining points exceed the range values, the range values ​​are updated; otherwise, no processing is performed. The latest range values ​​obtained after the traversal are used as the range values ​​of the minimum bounding box, denoted as [UminX, UmaxX], [UminY, UmaxY], and [UminZ, UmaxZ]. The cube formed by these ranges is the minimum bounding box of the block.

[0076] As a preferred embodiment, the partition spacing includes partition spacing in the x-direction, partition spacing in the y-direction, and partition spacing in the z-direction;

[0077] The step of dividing the inner space and the outer space into grids with a preset interval to obtain several visible space grids specifically includes the following steps:

[0078] The inner space and the outer space are divided into grids using preset intervals in the x, y, and z directions;

[0079] When the last grid in the inner space and the outer space is divided, and each grid in the inner space has the same size, and each grid in the outer space has the same size, the grids in the inner space and the outer space are taken as the visible space grid.

[0080] When the last grid in the inner space and the outer space is divided, if there are grids of different sizes in the inner space or the outer space, a new grid is added in the building space with different grid sizes, and all grids in the building space are shifted in the opposite direction of the added grid by half a supplementary unit. The shifted grid is used as the visible space grid.

[0081] It is understood that in this embodiment, if the preset division spacing in the x, y and z directions cannot achieve integer division of the inner space and the outer space, then when dividing to the last grid of the building space, a layer of grid is added, and all grids are shifted by half a supplementary unit in the opposite direction of the supplementary grid. The final grid is the visible space grid.

[0082] As a preferred embodiment, the step of using a preset camera detection tool to perform visual detection on the model blocks in each visible space grid according to a preset camera round-capture rule to obtain an initial visible space index specifically includes the following steps:

[0083] When visually probing the model blocks in each visible space grid in the outer space, the camera detection tool is used to visually probing the model blocks in each visible space grid in the direction facing the inner space, based on a preset threshold for the number of visible pixels, to obtain the visible space index of the outer space.

[0084] When visually probing the model blocks in each visible space grid in the inner space, the camera detection tool is used to visually probing the model blocks in each visible space grid in several preset shooting directions according to the visible pixel number threshold, so as to obtain the visible space index of the inner space.

[0085] The initial visible space index is obtained based on the visible space index of the outer space and the visible space index of the inner space.

[0086] Specifically, in this embodiment, when performing visual detection, the camera detection tool is placed in each visible space grid, where Location is set as the grid center point, Rotation uses the default value, the visible set of that point is obtained, and this set is used as the representative of the visible set of the grid.

[0087] Specifically, when visually probing the model blocks in each visible space grid in the outer space, only the set of photos facing the inner space is obtained. However, when visually probing the model blocks in each visible space grid in the inner space, a set of photos from all directions is obtained while probing the visible space grid in the inner space, such as a set of photos from the camera in six directions: up, down, left, right, front, and back.

[0088] As a preferred embodiment, the visual space index of the outer space includes the position of each visual space grid in the outer space and the visual set of model blocks contained in each visual space grid; the visual space index of the inner space includes the position of each visual space grid in the inner space and the visual set of model blocks contained in each visual space grid.

[0089] Therefore, obtaining the initial visible space index based on the visible space index of the outer space and the visible space index of the inner space specifically includes the following steps:

[0090] Calculate the similarity of the visual sets of model blocks contained in several adjacent visual space grids in the outer space and the inner space respectively;

[0091] When the similarity is greater than a preset similarity threshold, the adjacent visual space grids are merged.

[0092] The initial visual space index is obtained based on the merged visual space index of the outer space and the merged visual space index of the inner space.

[0093] It is worth noting that, let the visible set of grid A be {a}, the number of elements be Ua, the visible set of the neighboring grid B of grid A be {b}, the number of elements be Ub, and let the number of identical elements in {a} and {b} be r. Then the similarity between grid A and its neighboring grid B is equal to r / (Ua+Ub).

[0094] As a preferred embodiment, the step of comparing all model blocks in the initial visual space index with all model blocks in the model block set to identify several imperfect meshes that do not meet the preset comparison requirements specifically includes the following steps:

[0095] The model blocks contained in each visual space grid in the initial visual space index are compared with the model blocks at the corresponding positions of each visual space grid in the model block set;

[0096] When the difference between a model block in any visible space grid and the model block at the corresponding position of any visible space grid in the set of model blocks is greater than a preset difference threshold, the any visible space grid is regarded as the imperfect grid.

[0097] It is worth noting that the model block set in the initial visual space index may be incomplete. For example, the visual space grid may be too large, causing the visual set obtained by the camera detection tool at the center point to be incomplete and not representative of the visual set of that visual space grid. Alternatively, there may be obvious occlusions within the visual space where the actual camera capture point is located, or other abnormalities in the acquisition of visual sets may occur. Therefore, it is necessary to identify and supplement incomplete grids in the model block set. Specifically, the model blocks contained in each visual space grid in the initial visual space index are read and compared with the corresponding model blocks in the model block set. The difference set in the initial visual space index is identified. When the difference between any model block in the visual space grid and the corresponding model block in the model block set is greater than a preset difference threshold, i.e., the difference set is greater than a specific threshold, the visual space grid is considered an incomplete grid.

[0098] As another optional embodiment, this embodiment can also identify imperfect grids by manually browsing and comparing them in a visualized scene.

[0099] As a preferred embodiment, the step of using the camera detection tool to perform supplementary visual detection on the model blocks in the incomplete mesh to obtain a supplementary visual detection set specifically includes the following steps:

[0100] Based on a number of pre-set supplementary detection locations in the imperfect grid, the camera detection tool is used to perform supplementary visual detection at each supplementary detection location to obtain the supplementary visual detection set.

[0101] Preferably, in this embodiment, a number of supplementary detection points need to be set in advance in the imperfect grid. The number of supplementary detection points n is determined according to the following expression: n = (grid size / number of model blocks in the grid) + 5.

[0102] Furthermore, based on several pre-set supplementary detection location points in the imperfect grid, the camera detection tool's Location is set to the location of the supplementary detection location points, and supplementary visual detection and deduplication are performed at each supplementary detection location point to obtain a supplementary visual detection set.

[0103] This invention provides a method for constructing a visual space index for a 3D building model. By using a camera detection tool to simulate the human eye's line of sight, the method performs visual detection on the model blocks in each visual space grid of the 3D building model, thereby constructing a visual space index for the 3D building model. This ensures that the model blocks in the visual space index are visible to the human eye, thus significantly improving the visualization effect of the 3D building model.

[0104] See Figure 2 The second aspect of this invention provides a visual space indexing device for a three-dimensional building model, comprising:

[0105] The model partitioning module 201 is used to divide the three-dimensional building model to be loaded into several fragmented sub-models based on the model material and polygon connectivity of the three-dimensional building model to be loaded.

[0106] The space partitioning module 202 is used to partition the fragmented sub-models according to a preset threshold for the number of triangular facets, and aggregate the fragmented sub-models contained in each space to obtain a set of model blocks.

[0107] Minimum bounding box acquisition module 203 is used to acquire the minimum bounding box of each model block in the model block set, and acquire the minimum bounding box of the three-dimensional building model to be loaded based on the minimum bounding box of each model block.

[0108] The expanding bounding box acquisition module 204 is used to expand the minimum bounding box of the three-dimensional building model to be loaded according to the preset building external space range value, so as to obtain the expanded bounding box;

[0109] The meshing module 205 is used to obtain the inner space and outer space of the three-dimensional building model to be loaded based on the difference between the expanded bounding box and the minimum bounding box, and to mesh the inner space and the outer space with a preset meshing interval to obtain several visible space meshes.

[0110] The initial visual space index construction module 206 is used to use a preset camera detection tool to perform visual detection on the model blocks in each visual space grid according to a preset camera round-taking rule, and obtain the initial visual space index.

[0111] The imperfect mesh identification module 207 is used to compare all model blocks in the initial visual space index with all model blocks in the model block set to identify several imperfect meshes that do not meet the preset comparison requirements.

[0112] The target visual space index construction module 208 is used to supplement the model blocks in the incomplete mesh with the camera detection tool to obtain a supplementary visual detection set, and fill the initial visual space index according to the supplementary visual detection set to obtain the target visual space index.

[0113] As a preferred embodiment, the space partitioning module 202 is used to partition the plurality of fragmented sub-models according to a preset threshold for the number of triangular facets, and aggregate the fragmented sub-models contained in each space to obtain a set of model blocks, specifically including the following steps:

[0114] Based on the fragmented sub-model set composed of the aforementioned fragmented sub-models, the octree algorithm is used to partition the space from the center point of the fragmented sub-model set;

[0115] When the number of triangular faces of the fragmented sub-models contained in the smallest space obtained by spatial partitioning is less than the threshold number of triangular faces, the spatial partitioning is stopped, and the number of fragmented sub-models contained in each space is recorded.

[0116] Aggregate the fragmented sub-models contained in each space to obtain the model blocks corresponding to each space, and combine all the model blocks into the model block set.

[0117] As a preferred embodiment, the minimum bounding box acquisition module 203 is used to acquire the minimum bounding box of each model block in the model block set, and to acquire the minimum bounding box of the three-dimensional building model to be loaded based on the minimum bounding box of each model block, specifically including the following steps:

[0118] The seed point diffusion algorithm is used to obtain the minimum bounding box of each model block in the model block set;

[0119] The minimum bounding box of the three-dimensional building model to be loaded is obtained by taking the union of the minimum bounding boxes of each model block in the model block set.

[0120] As a preferred embodiment, the partition spacing includes partition spacing in the x-direction, partition spacing in the y-direction, and partition spacing in the z-direction;

[0121] Then, the mesh division module 205 is used to divide the inner space and the outer space into meshes with a preset division interval to obtain a plurality of visible space meshes, specifically including the following steps:

[0122] The inner space and the outer space are divided into grids using preset intervals in the x, y, and z directions;

[0123] When the last grid in the inner space and the outer space is divided, and each grid in the inner space has the same size, and each grid in the outer space has the same size, the grids in the inner space and the outer space are taken as the visible space grid.

[0124] When the last grid in the inner space and the outer space is divided, if there are grids of different sizes in the inner space or the outer space, a new grid is added in the building space with different grid sizes, and all grids in the building space are shifted in the opposite direction of the added grid by half a supplementary unit. The shifted grid is used as the visible space grid.

[0125] As a preferred embodiment, the initial visual space index construction module 206 is used to perform visual detection on the model blocks in each visual space grid according to a preset camera detection tool and a preset camera round-capture rule to obtain the initial visual space index. Specifically, it includes the following steps:

[0126] When visually probing the model blocks in each visible space grid in the outer space, the camera detection tool is used to visually probing the model blocks in each visible space grid in the direction facing the inner space, based on a preset threshold for the number of visible pixels, to obtain the visible space index of the outer space.

[0127] When visually probing the model blocks in each visible space grid in the inner space, the camera detection tool is used to visually probing the model blocks in each visible space grid in several preset shooting directions according to the visible pixel number threshold, so as to obtain the visible space index of the inner space.

[0128] The initial visible space index is obtained based on the visible space index of the outer space and the visible space index of the inner space.

[0129] As a preferred embodiment, the visual space index of the outer space includes the position of each visual space grid in the outer space and the visual set of model blocks contained in each visual space grid; the visual space index of the inner space includes the position of each visual space grid in the inner space and the visual set of model blocks contained in each visual space grid.

[0130] Then, the initial visual space index construction module 206 is used to obtain the initial visual space index based on the visual space index of the outer space and the visual space index of the inner space, specifically including the following steps:

[0131] Calculate the similarity of the visual sets of model blocks contained in several adjacent visual space grids in the outer space and the inner space respectively;

[0132] When the similarity is greater than a preset similarity threshold, the adjacent visual space grids are merged.

[0133] The initial visual space index is obtained based on the merged visual space index of the outer space and the merged visual space index of the inner space.

[0134] As a preferred embodiment, the imperfect mesh identification module 207 is used to compare all model blocks in the initial visual space index with all model blocks in the model block set to identify several imperfect meshes that do not meet the preset comparison requirements, specifically including the following steps:

[0135] The model blocks contained in each visual space grid in the initial visual space index are compared with the model blocks at the corresponding positions of each visual space grid in the model block set;

[0136] When the difference between a model block in any visible space grid and the model block at the corresponding position of any visible space grid in the set of model blocks is greater than a preset difference threshold, the any visible space grid is regarded as the imperfect grid.

[0137] As a preferred embodiment, the target visual space index construction module 208 is used to perform supplementary visual detection on the model blocks in the incomplete mesh using the camera detection tool to obtain a supplementary visual detection set, specifically including the following steps:

[0138] Based on a number of pre-set supplementary detection locations in the imperfect grid, the camera detection tool is used to perform supplementary visual detection at each supplementary detection location to obtain the supplementary visual detection set.

[0139] It should be noted that the visual space index construction device for a three-dimensional building model provided in this embodiment of the invention can realize all the processes of the visual space index construction method for a three-dimensional building model described in any of the above embodiments. The functions and technical effects of each module in the device are the same as those of the visual space index construction method for a three-dimensional building model described in the above embodiments, and will not be repeated here.

[0140] A third aspect of the present invention provides a visual space indexing device for a three-dimensional building model, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the visual space indexing method for a three-dimensional building model as described in any of the first aspects.

[0141] The terminal device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and memory. The terminal device may also include input / output devices, network access devices, buses, etc.

[0142] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.

[0143] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the terminal device by running or executing the computer programs and / or modules stored in the memory and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0144] The above description represents the preferred embodiments 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 are also considered to be within the scope of protection of the present invention.

Claims

1. A method for constructing a visual spatial index for a three-dimensional architectural model, characterized in that, Includes the following steps: Based on the model material and polygon connectivity of the 3D building model to be loaded, the 3D building model to be loaded is divided into several fragmented sub-models; The fragmented sub-models are spatially divided according to a preset threshold for the number of triangular facets, and the fragmented sub-models contained in each space are aggregated to obtain a set of model blocks. Obtain the minimum bounding box of each model block in the model block set, and obtain the minimum bounding box of the three-dimensional building model to be loaded based on the minimum bounding box of each model block. Expand the minimum bounding box of the three-dimensional building model to be loaded according to the preset building exterior space range value to obtain the expanded bounding box; Based on the difference between the expanded bounding box and the minimum bounding box, the inner space and outer space of the three-dimensional building model to be loaded are obtained, and the inner space and the outer space are divided into meshes with a preset dividing interval to obtain several visible space meshes. Using a preset camera detection tool, the model blocks in each visible space grid are visually detected according to the preset camera round-shot rules to obtain the initial visible space index; Compare all model blocks in the initial visual space index with all model blocks in the model block set to identify several imperfect meshes that do not meet the preset comparison requirements; The camera detection tool is used to perform supplementary visual detection on the model blocks in the incomplete mesh to obtain a supplementary visual detection set. The initial visual space index is then filled in according to the supplementary visual detection set to obtain the target visual space index.

2. The method for constructing a visual space index for a three-dimensional architectural model as described in claim 1, characterized in that, The step of spatially dividing the fragmented sub-models according to a preset threshold for the number of triangular facets, and aggregating the fragmented sub-models contained in each space to obtain a set of model blocks, specifically includes the following steps: Based on the fragmented sub-model set composed of the aforementioned fragmented sub-models, the octree algorithm is used to partition the space from the center point of the fragmented sub-model set; When the number of triangular faces of the fragmented sub-models contained in the smallest space obtained by spatial partitioning is less than the threshold number of triangular faces, the spatial partitioning is stopped, and the number of fragmented sub-models contained in each space is recorded. Aggregate the fragmented sub-models contained in each space to obtain the model blocks corresponding to each space, and combine all the model blocks into the model block set.

3. The method for constructing a visual space index for a three-dimensional architectural model as described in claim 1, characterized in that, The step of obtaining the minimum bounding box of each model block in the model block set, and obtaining the minimum bounding box of the 3D building model to be loaded based on the minimum bounding box of each model block, specifically includes the following steps: The seed point diffusion algorithm is used to obtain the minimum bounding box of each model block in the model block set; The minimum bounding box of the three-dimensional building model to be loaded is obtained by taking the union of the minimum bounding boxes of each model block in the model block set.

4. The method for constructing a visual space index for a three-dimensional architectural model as described in claim 1, characterized in that, The division spacing includes the division spacing in the x-direction, the division spacing in the y-direction, and the division spacing in the z-direction; The step of dividing the inner space and the outer space into grids with a preset interval to obtain several visible space grids specifically includes the following steps: The inner space and the outer space are divided into grids using preset intervals in the x, y, and z directions; When the last grid in the inner space and the outer space is divided, and each grid in the inner space has the same size, and each grid in the outer space has the same size, the grids in the inner space and the outer space are taken as the visible space grid. When the last grid in the inner space and the outer space is divided, if there are grids of different sizes in the inner space or the outer space, a new grid is added in the building space with different grid sizes, and all grids in the building space are shifted in the opposite direction of the added grid by half a supplementary unit. The shifted grid is used as the visible space grid.

5. The method for constructing a visual space index for a three-dimensional architectural model as described in claim 1, characterized in that, The step of using a preset camera detection tool to visually detect the model blocks in each visible space grid according to a preset camera round-capture rule, and obtaining the initial visible space index, specifically includes the following steps: When visually probing the model blocks in each visible space grid in the outer space, the camera detection tool is used to visually probing the model blocks in each visible space grid in the direction facing the inner space, based on a preset threshold for the number of visible pixels, to obtain the visible space index of the outer space. When visually probing the model blocks in each visible space grid in the inner space, the camera detection tool is used to visually probing the model blocks in each visible space grid in several preset shooting directions according to the visible pixel number threshold, so as to obtain the visible space index of the inner space. The initial visible space index is obtained based on the visible space index of the outer space and the visible space index of the inner space.

6. The method for constructing a visual space index for a three-dimensional architectural model as described in claim 5, characterized in that, The visible space index of the outer space includes the position of each visible space grid in the outer space and the visible set of model blocks contained in each visible space grid; the visible space index of the inner space includes the position of each visible space grid in the inner space and the visible set of model blocks contained in each visible space grid. Therefore, obtaining the initial visible space index based on the visible space index of the outer space and the visible space index of the inner space specifically includes the following steps: Calculate the similarity of the visual sets of model blocks contained in several adjacent visual space grids in the outer space and the inner space respectively; When the similarity is greater than a preset similarity threshold, the adjacent visual space grids are merged. The initial visual space index is obtained based on the merged visual space index of the outer space and the merged visual space index of the inner space.

7. The method for constructing a visual space index for a three-dimensional architectural model as described in claim 1, characterized in that, The step of comparing all model blocks in the initial visual space index with all model blocks in the model block set to identify several imperfect meshes that do not meet the preset comparison requirements specifically includes the following steps: The model blocks contained in each visual space grid in the initial visual space index are compared with the model blocks at the corresponding positions of each visual space grid in the model block set; When the difference between a model block in any visible space grid and the model block at the corresponding position of any visible space grid in the set of model blocks is greater than a preset difference threshold, the any visible space grid is regarded as the imperfect grid.

8. The method for constructing a visual space index for a three-dimensional architectural model as described in claim 1, characterized in that, The step of using the camera detection tool to perform supplementary visual detection on the model blocks in the incomplete mesh to obtain a supplementary visual detection set specifically includes the following steps: Based on a number of pre-set supplementary detection locations in the imperfect grid, the camera detection tool is used to perform supplementary visual detection at each supplementary detection location to obtain the supplementary visual detection set.

9. A visual space indexing construction device for a three-dimensional architectural model, characterized in that, include: The model partitioning module is used to divide the three-dimensional building model to be loaded into several fragmented sub-models based on the model material and polygon connectivity of the three-dimensional building model to be loaded. The spatial partitioning module is used to partition the fragmented sub-models according to a preset threshold for the number of triangular facets, and aggregate the fragmented sub-models contained in each space to obtain a set of model blocks. The minimum bounding box acquisition module is used to acquire the minimum bounding box of each model block in the model block set, and to acquire the minimum bounding box of the three-dimensional building model to be loaded based on the minimum bounding box of each model block. The expanded bounding box acquisition module is used to expand the minimum bounding box of the three-dimensional building model to be loaded according to the preset building external space range value, so as to obtain the expanded bounding box; The mesh generation module is used to obtain the inner space and outer space of the three-dimensional building model to be loaded based on the difference between the expanded bounding box and the minimum bounding box, and to divide the inner space and the outer space into meshes with a preset division interval to obtain several visible space meshes. The initial visual space index construction module is used to use a preset camera detection tool to perform visual detection on the model blocks in each visual space grid according to a preset camera round-taking rule, and obtain the initial visual space index. The imperfect mesh identification module is used to compare all model blocks in the initial visual space index with all model blocks in the model block set to identify several imperfect meshes that do not meet the preset comparison requirements. The target visual space index construction module is used to use the camera detection tool to perform supplementary visual detection on the model blocks in the incomplete mesh, obtain a supplementary visual detection set, and fill in the initial visual space index according to the supplementary visual detection set to obtain the target visual space index.

10. A visual spatial indexing construction device for a three-dimensional architectural model, characterized in that, The system includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the visual space indexing construction method for a three-dimensional building model as described in any one of claims 1 to 8.