A method, device, and medium for scene filling in digital twins.
By dividing the geometric region into sub-regions and employing vertex composition rules and uniform sampling algorithms, the problem of wasted human and time resources in traditional methods is solved, achieving efficient digital twin scene filling and uniform target distribution.
Patent Information
- Application Number
- CN202411114991.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2044-08-14
AI Technical Summary
In the construction of digital twin scenarios, traditional methods involve locating and processing the location of each vegetation entity individually, which leads to a waste of human and time resources and increases the complexity and cost of production.
The geometric region is divided into multiple sub-regions. Vertex composition rules are used to select suitable vertices to form sub-regions. Then, a uniform sampling algorithm is used to fill the targets in the sub-regions until the scene filling of the entire geometric region is completed.
It reduces labor and time costs, improves production efficiency, and achieves a uniform distribution of the filling target in the area to be filled.
Smart Images

Figure CN119131316B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of computers, in particular to a scene filling method for digital twinning, a device and a medium. BACKGROUND
[0002] In the construction process of a digital twinning scene, although the production of some objects (such as vegetation, water area, animals, small buildings, etc.) has low technical requirements, the challenge faced is the large-scale quantity of construction.
[0003] In the traditional scheme, position positioning and processing are usually carried out separately for each vegetation entity, however, this will consume a large amount of human and time resources, increasing the complexity and cost of the production process. SUMMARY
[0004] To solve the above problems, the present application provides a scene filling method for digital twinning, comprising:
[0005] determining a to-be-filled region in a digital twinning scene, and generating a geometric region based on the to-be-filled region;
[0006] dividing the geometric region to obtain a plurality of sub-regions;
[0007] for each sub-region of the plurality of sub-regions, filling a filling target in the sub-region until all sub-regions in the geometric region complete scene filling.
[0008] In one example, the geometric region is divided to obtain a plurality of sub-regions, specifically comprising:
[0009] determining a plurality of vertices contained in the geometric region;
[0010] based on a pre-set vertex composition rule of the sub-region, sequentially selecting a part of vertices that fit in the plurality of vertices to form a single sub-region;
[0011] after deleting the formed sub-region in the geometric region, repeating the formation of the sub-region until the remaining geometric region can only form a single sub-region, completing the division of the sub-region.
[0012] In one example, based on a pre-set vertex composition rule of the sub-region, sequentially selecting a part of vertices that fit in the plurality of vertices to form a single sub-region, specifically comprising:
[0013] determining that the pre-set sub-region is a triangular region;
[0014] selecting an initial vertex from the plurality of vertices, and selecting two vertices near the initial vertex along a preset direction; wherein the preset direction includes any one of: selecting two vertices in a clockwise direction in succession, selecting two vertices in an anticlockwise direction in succession, selecting one vertex in the clockwise direction and selecting one vertex in the anticlockwise direction;
[0015] forming a single triangular region as a sub-region according to the initial vertex and the two selected vertices.
[0016] In one example, for each sub-region in the plurality of sub-regions, the method further includes:
[0017] determining that the sub-region is the triangular region;
[0018] completing the triangular region to obtain a parallelogram region;
[0019] generating a plurality of sampling points in the parallelogram region based on a uniform sampling algorithm, and adding the sampling points in the completed region to the triangular region;
[0020] filling the sub-region with the filling target according to the sampling points in the triangular region.
[0021] In one example, completing the triangular region to obtain a parallelogram region includes:
[0022] selecting a midpoint of any side of the triangular region as a center point of center symmetry, and copying the triangular region to complete the triangular region in the form of center symmetry to obtain a parallelogram region;
[0023] adding the sampling points in the completed region to the triangular region includes:
[0024] rotating the completed region of the parallelogram region about the selected center point of the triangular region until the completed region overlaps the triangular region, and then adding the sampling points of the completed region to the triangular region.
[0025] In one example, before filling the sub-region with the filling target according to the sampling points in the triangular region, the method further includes:
[0026] obtaining an area of each triangular region based on vector cross product;
[0027] assigning a weight to each triangular region according to the area;
[0028] Based on the weight, a triangular region is extracted by random sampling, and a sampling point is generated in the extracted triangular region.
[0029] In one example, the filling target is filled in the sub-region according to the sampling point in the triangular region, specifically including:
[0030] Determining the target type of the filling target; the target type includes: an overlap-allowed type and an overlap-forbidden type;
[0031] If the target type of the filling target is the overlap-forbidden type, the density of the sampling point in the triangular region is adjusted according to the radius length of the filling target, and the filling target is added in the adjusted sampling point;
[0032] If the target type of the filling target is the overlap-allowed type, the filling target is directly added in the sampling point.
[0033] In one example, the method further includes:
[0034] Based on the user operation, an existing vertex is selected on the boundary of the geometric region, or a new vertex is generated on the boundary of the geometric region and the new vertex is selected;
[0035] The selected vertex is dragged to adjust the geometric region;
[0036] The adjusted geometric region is re-divided into sub-regions.
[0037] On the other hand, the present application also proposes a scene filling device for digital twinning, including:
[0038] At least one processor; and,
[0039] The memory is in communication connection with the at least one processor; wherein,
[0040] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the scene filling method for digital twinning as described in the above examples.
[0041] On the other hand, the present application also proposes a non-volatile computer storage medium, which stores computer executable instructions, and the computer executable instructions are configured as the scene filling method for digital twinning as described in the above examples.
[0042] The scene filling method for digital twinning proposed by the present application can bring the following beneficial effects:
[0043] Since geometric regions are usually irregular in shape, it is difficult to directly fill the entire geometric region. Therefore, it is divided into multiple sub-regions. The shapes of the sub-regions are relatively simple, so filling them is easier. By filling each sub-region, the scene filling of the geometric region can be completed, thereby reducing labor and time costs and improving production efficiency. Attached Figure Description
[0044] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0045] Figure 1 This is a flowchart illustrating the scene filling method for digital twins in the embodiments of this application;
[0046] Figure 2 This is a schematic diagram of the geometric region in one scenario of an embodiment of this application;
[0047] Figure 3 This is a schematic diagram illustrating the division of sub-regions under one scenario in an embodiment of this application;
[0048] Figure 4 This is a schematic diagram illustrating the generation of sampling points in one scenario of an embodiment of this application;
[0049] Figure 5 This is a schematic diagram illustrating the adjustment of the geometric region in one scenario of this application embodiment;
[0050] Figure 6 This is a schematic diagram of a scene filling device for digital twins in an embodiment of this application. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0052] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0053] like Figure 1 As shown, this application embodiment provides a scene filling method for digital twins, including:
[0054] S101: Determine the region to be filled in the digital twin scene, and generate a geometric region based on the region to be filled.
[0055] Digital twins use digital or virtual models to simulate and monitor physical objects, processes, or systems in real time. Through continuous data exchange between the physical object and its virtual model, digital twins enable dynamic monitoring, analysis, and optimization of physical entities.
[0056] In digital twins, it is necessary to build a corresponding virtual model. The virtual model usually includes a simulation process of the actual scene. At this time, the area to be filled is determined based on the actual scene or the user.
[0057] Typically, the area to be filled is a 3D area. In this case, a projection is made from the top to obtain the horizontal area, which serves as the geometric area of the area to be filled.
[0058] S102: Divide the geometric region into multiple sub-regions.
[0059] The shape of the sub-region is fixed; for example, it can be a triangle, quadrilateral, pentagon, etc. Dividing the geometric region into multiple sub-regions facilitates scene filling of the area to be filled.
[0060] Specifically, for a geometric region, determine the multiple vertices it contains. For example... Figure 2 As shown, a corresponding planar coordinate system is set for the geometric region to determine the coordinate values of each vertex in the geometric region, and vertex information is declared based on these coordinate values.
[0061] Different vertex formation rules are set for different types of sub-regions. For example, for a triangular region, the vertex formation rule is any three non-collinear vertices. For a quadrilateral region, the vertex formation rule is any four vertices, and any three of them are non-collinear. Of course, if the sub-region is a parallelogram, then the line connecting any two vertices must be parallel to the line connecting the other two vertices.
[0062] At this point, based on the pre-set rules for the formation of sub-regions, appropriate vertices are selected sequentially from multiple vertices to form a single sub-region.
[0063] like Figure 3 As shown, taking a pre-defined sub-region as a triangular region as an example, the process involves selecting an initial vertex from multiple vertices (for example, randomly selecting one vertex from all vertices as the initial vertex) and selecting two vertices near the initial vertex along a preset direction.
[0064] The preset directions include any one of the following: selecting two vertices consecutively in a clockwise direction, selecting two vertices consecutively in a counterclockwise direction, or selecting one vertex each in a clockwise and counterclockwise direction.
[0065] Thus, either method can be used to obtain a single triangular region as a sub-region, that is, a single triangular region can be formed based on the initial vertex and the two selected vertices, and thus serve as a sub-region.
[0066] like Figure 3 As shown, after obtaining a single sub-region, the already formed sub-regions are deleted from the geometric region. Then, for the remaining region, the process of forming sub-regions is repeated, and the newly formed sub-regions are deleted again, until the remaining geometric regions can only form a single sub-region, thus completing the sub-region partitioning. When the sub-region is a triangular region, the last three vertices naturally form the final single triangular region. At this point, the complexity of this sub-region partitioning algorithm is O(N), and its complexity increases linearly with the input size (N).
[0067] S103: For each of the multiple sub-regions, fill the sub-region with the filling target until all sub-regions in the geometric region have completed scene filling.
[0068] Since geometric regions are usually irregular in shape, it is difficult to directly fill the entire geometric region. Therefore, it is divided into multiple sub-regions. The shapes of the sub-regions are relatively simple, so filling them is easier. By filling each sub-region, the scene filling of the geometric region can be completed, thereby reducing labor and time costs and improving production efficiency.
[0069] Generally, when filling a scene, less important objects (such as vegetation and water features) should be distributed as evenly as possible within the area to be filled. When the sub-region is triangular, directly using a uniform sampling algorithm based on the horizontal and vertical coordinates may result in uneven density, making it difficult to achieve uniform distribution. Therefore, the triangular region is completed to obtain a parallelogram region.
[0070] For example, in a triangular region, choose any side, take the midpoint of that side as the center point of central symmetry, copy the triangular region, and complete the triangular region in a centrally symmetrical manner to obtain a parallelogram region.
[0071] At this point, based on the uniform sampling algorithm, several sampling points are generated in the parallelogram region, and the sampling points in the completed region are added to the triangular region. Of course, in each triangular region, the uniform sampling algorithm can be performed once or multiple times as needed to generate multiple sampling points.
[0072] Among them, such as Figure 4 As shown, for a parallelogram, the uniform sampling algorithm can achieve a roughly uniform distribution of sampling points. At this time, based on the center point selected in the triangular region, the complete region of the parallelogram region is rotated around the center point until the complete region overlaps with the triangular region. Then, the sampling points of the complete region are added to the triangular region accordingly, thereby completing the uniform sampling of the triangular region.
[0073] In one embodiment, before selecting the triangular regions, the area of each triangular region can be obtained based on the vector cross product, and a weight can be assigned to each triangular region according to its area. Generally speaking, the larger the region area, the higher the assigned weight, and the two can be proportional.
[0074] Based on weights, triangular regions are randomly sampled to generate sampling points within these regions. The larger the triangular region, the higher its weight, resulting in a higher probability of selection and a greater number of selections in multiple rounds. Consequently, more sampling points are generated within these regions using a uniform sampling algorithm, thus better meeting the required number of filling targets for each triangular region.
[0075] Of course, if a triangular region is sampled multiple times, then multiple sampling points can be generated.
[0076] In one embodiment, when filling a sub-region after obtaining sampling points, the filling targets need to be filled into the sub-region according to the distribution of the sampling points. At this time, the target type of the filling targets is determined, where the target type includes: types that allow overlap (e.g., vegetation, water area) and types that prohibit overlap (e.g., animals, small buildings). Whether overlap is allowed refers to whether overlap is allowed in terms of height.
[0077] If the target type of the filling target is a non-overlapping type, sometimes multiple sampling points may be generated, resulting in some sampling points having too small an interval, causing the filling targets to overlap in the sub-region. Therefore, the density of sampling points in the triangular region is adjusted according to the radius of the filling target to ensure that the distance between each sampling point is at least twice the radius of the filling target, and the filling target is added to the adjusted sampling points.
[0078] If the target type of the filling target is an overlap-allowing type, the filling target can be added directly to the sampling point, or the density can be adjusted according to the requirements before filling.
[0079] During the filling process, one or more sampling points can be used to correspond to a filling target, depending on the requirements.
[0080] In one embodiment, after generating the geometric region, it may happen that the geometric region does not meet the user's requirements. In this case, such as... Figure 5 As shown, based on user operations, existing vertices can be selected on the boundary of the geometric region, or new vertices can be generated on the boundary of the geometric region and selected, thereby allowing the selected vertices to be dragged to adjust the geometric region.
[0081] Of course, if the geometric region has already been subdivided, then after the adjustment, the adjusted geometric region needs to be subdivided again.
[0082] like Figure 6 As shown in the illustration, this application also provides a scene filling device for digital twins, including:
[0083] At least one processor; and,
[0084] A memory communicatively connected to the at least one processor; wherein,
[0085] The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform a scene filling method for digital twins as described in any of the above embodiments.
[0086] This application also provides a non-volatile computer storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured as: the scene filling method for digital twins described in any of the above embodiments.
[0087] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and medium embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the description of the method embodiments.
[0088] The devices and media provided in this application are one-to-one with the methods. Therefore, the devices and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0089] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0090] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0091] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0092] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0093] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0094] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0095] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0096] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0097] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for scene population for digital twinning, the method comprising: receiving a digital twin model; receiving a scene model; and generating a populated scene model by populating the scene model with data from the digital twin model. The method comprises the following steps: determining a to-be-filled region in a digital twin scene, and generating a geometric region based on the to-be-filled region; dividing the geometric region to obtain a plurality of sub-regions; filling a filling target in each of the plurality of sub-regions until all sub-regions in the geometric region are completed; dividing the geometric region to obtain a plurality of sub-regions, specifically comprising: determining a plurality of vertices contained in the geometric region; based on a pre-set vertex composition rule of the sub-region, sequentially selecting a part of the vertices in the plurality of vertices to form a single sub-region; after deleting the formed sub-region in the geometric region, repeating the formation of the sub-region until the remaining geometric region can only form a single sub-region, completing the division of the sub-region.
2. The method of claim 1, wherein, based on a pre-set vertex composition rule of the sub-region, sequentially selecting a part of the vertices in the plurality of vertices to form a single sub-region, specifically comprising: determining that the pre-set sub-region is a triangular region; selecting an initial vertex in the plurality of vertices and selecting two vertices near the initial vertex in a preset direction; wherein the preset direction includes any one of the following: selecting two vertices in a clockwise direction, selecting two vertices in a counterclockwise direction, selecting one vertex in a clockwise direction and selecting one vertex in a counterclockwise direction; forming a single triangular region as a sub-region according to the initial vertex and the two selected vertices.
3. The method of claim 2, wherein, for each of the plurality of sub-regions, filling a filling target in the sub-region, specifically comprising: determining that the sub-region is the triangular region; completing the triangular region to obtain a parallelogram region; based on a uniform sampling algorithm, generating a plurality of sampling points in the parallelogram region, and adding the sampling points in the completed region to the triangular region; filling a filling target in the sub-region according to the sampling points in the triangular region.
4. The method of claim 3, wherein, completing the triangular region to obtain a parallelogram region, specifically comprising: in the triangular region, selecting a side, taking the midpoint of the side as the center of symmetry, and copying the triangular region to complete the triangular region in the form of center symmetry to obtain a parallelogram region; adding the sampling points in the completed region to the triangular region, specifically comprising: rotating the completed region of the parallelogram region about the selected center point of the triangular region until the completed region overlaps with the triangular region, and then adding the sampling points of the completed region to the triangular region.
5. The method of claim 2, wherein, before filling a filling target in the sub-region according to the sampling points in the triangular region, the method further comprises: based on vector cross product, obtaining the area of each triangular region; according to the area, assigning a weight to each triangular region; based on the weight, extracting a triangular region by random sampling to generate a sampling point in the extracted triangular region.
6. The method of claim 3, wherein, According to the sampling points in the triangular region, the filling target is filled in the sub-region, specifically comprising: determining the target type of the filling target; the target type comprises: an overlap-allowed type and an overlap-forbidden type; if the target type of the filling target is the overlap-forbidden type, adjusting the density of the sampling points in the triangular region according to the radius length of the filling target, and adding the filling target in the adjusted sampling points; if the target type of the filling target is the overlap-allowed type, directly adding the filling target in the sampling points.
7. The method of claim 1, wherein, The method further comprises: based on user operation, selecting an existing vertex on the boundary of the geometric region, or generating a new vertex on the boundary of the geometric region and selecting the new vertex; dragging the selected vertex to adjust the geometric region; re-dividing the sub-regions for the adjusted geometric region.
8. A scene filling device for digital twins, characterized in that, comprise: at least one processor; and a memory in communication connection with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the scene filling method for digital twinning as claimed in any one of claims 1-7.
9. A non-transitory computer storage medium storing computer-executable instructions that, when executed, cause a computer to perform: The computer executable instructions are set as the scene filling method for digital twinning as claimed in any one of claims 1-7.
Citation Information
Patent Citations
Method and device for filling image in graph, equipment and medium
CN111192192A