An indoor scene layout method, device, electronic device and storage medium
By converting two-dimensional data into one-dimensional data, using polygonal data structures and comprehensive constraint evaluation value evaluation, the problems of long calculation time and limited effects of interior design layout in the existing technology are solved, and an interior scene layout that is more realistic is generated.
Patent Information
- Application Number
- CN202111505856.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-10
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2041-12-10
AI Technical Summary
The existing interior design layout method has a long calculation time and limited effect when dealing with complex constraints, and cannot effectively meet advanced constraints such as room adjacent relationships, room size constraints and spatial rationality.
Two-dimensional data is converted into one-dimensional data, the object node characteristics are gathered through the polygonal data structure, and the indoor scene layout is generated based on wall information, and the layout is evaluated and adjusted using comprehensive constraint evaluation value, including space utilization, relationship constraints, movable space and escape evaluation value.
The calculation time is reduced, the generated indoor scene layout is more realistic, meets complex constraints, improves generation efficiency and layout rationality, and avoids safety hazards.
Smart Images

Figure CN114241129B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of interior design. Specifically, it relates to an indoor scene layout method, device, electronic device and computer-readable storage medium. Background Art
[0002] Currently, indoor design layout methods generally use optimization-based methods or deep learning-based methods to implement. However, both of these methods have certain limitations.
[0003] Optimization-based methods generally do not consider constraints, randomly generate an initial solution, and then use an optimization algorithm to adjust the scene layout to make it as much as possible meet basic layout constraints such as adjacency relationships. This makes the process of iterative solution using the optimization algorithm extremely time-consuming and the optimization ability is limited, and it cannot truly meet the given constraints.
[0004] Deep learning-based methods generally first construct a dataset with a layout structure, and then train on this dataset to encode the layout features in the dataset into the deep learning model, so as to generate the layout. This makes it impossible to obtain reasonable results when the data in the dataset varies greatly, and it cannot handle high-level constraints such as room adjacency relationships, room size constraints, and spatial rationality. Summary of the Invention
[0005] The purpose of the embodiments of the present application is to provide an indoor scene layout method, device, electronic device and computer-readable storage medium, which can convert two-dimensional data into one-dimensional data, solve the complex constraint problem of the entire indoor scene layout, and is not affected by data differences, and at the same time can reduce the calculation time.
[0006] In a first aspect, the embodiments of the present application provide an indoor scene layout method, and the method includes:
[0007] Obtain object nodes, and construct a polygon data structure according to the object nodes;
[0008] Obtain wall information, and perform planning processing on the polygon data structure according to the wall information to obtain a two-dimensional scene layout;
[0009] Reduce the two-dimensional scene layout to a one-dimensional scene layout;
[0010] Obtain a comprehensive constraint evaluation value according to the one-dimensional scene layout. If the comprehensive constraint evaluation value is greater than a threshold, generate an indoor scene layout according to the one-dimensional scene layout. If the comprehensive constraint evaluation value is less than or equal to the threshold, obtain a new one-dimensional scene layout again.
[0011] In the above implementation process, the characteristics of object nodes are aggregated using a polygon data structure, not limited to the common picture form. The object nodes are combined with wall information to obtain a two-dimensional scene layout, and then the indoor scene layout is obtained through the one-dimensional scene layout, saving calculation time and making the obtained indoor scene layout more in line with reality.
[0012] Further, the steps of obtaining the object nodes and constructing a polygon data structure according to the object nodes include:
[0013] Obtain the boundary sub-nodes and the remaining object sub-nodes in the object nodes;
[0014] Insert the remaining object sub-nodes into the boundary sub-nodes to obtain the polygon data structure.
[0015] In the above implementation process, the polygon data structure can adapt to scenes of different scales, and the generation efficiency on scenes of different scales will not vary due to different scene scales. At the same time, by using the polygon data structure, the layout of special-shaped indoor scenes can also be generated.
[0016] Further, the steps of obtaining the wall information and performing planning processing on the polygon data structure according to the wall information to obtain a two-dimensional scene layout include:
[0017] Obtain the attachment relationship between the wall and the object nodes according to the wall information;
[0018] Perform planning processing on the polygon data structure according to the attachment relationship to obtain the two-dimensional scene layout.
[0019] In the above implementation process, the attachment relationship contains the connection data between the wall information and the object nodes, which can ensure that the object nodes are attached to the correct wall and will not cause confusion between the wall and the object nodes.
[0020] Further, the steps of reducing the two-dimensional scene layout to a one-dimensional scene layout include:
[0021] Obtain the two-dimensional coordinates in the wall information of the two-dimensional scene layout;
[0022] Perform boundary topological isomorphism processing on the two-dimensional coordinates to obtain one-dimensional coordinates;
[0023] Obtain the one-dimensional scene layout according to the one-dimensional coordinates.
[0024] In the above implementation process, converting the two-dimensional coordinates to one-dimensional coordinates reduces the dimension, making it possible to have a complex scene layout, and the generation of the indoor scene layout will not be affected by multi-dimensional data, ensuring the rationality of the indoor scene layout.
[0025] Further, the step of obtaining the comprehensive constraint evaluation value according to the one-dimensional scene layout includes:
[0026] Obtaining a space utilization evaluation value, a relationship constraint evaluation value, a movable space evaluation value, and an escapability evaluation value according to the one-dimensional scene layout;
[0027] Obtaining the comprehensive constraint evaluation value according to the space utilization evaluation value, the relationship constraint evaluation value, the movable space evaluation value, and the escapability evaluation value.
[0028] In the above implementation process, performing a comprehensive constraint evaluation on the one-dimensional scene layout can ensure the rationality of the scene layout, and can eliminate potential safety hazards existing in the generation process of the indoor scene layout, ensuring the safety and usability of the indoor scene layout.
[0029] Further, according to the following formula, obtain a space utilization evaluation value, a relationship constraint evaluation value, a movable space evaluation value, and an escapability evaluation value according to the one-dimensional scene layout:
[0030] The utilization evaluation value is:
[0031] where R space is the space utilization evaluation value, S total is the total area of the scene, and RN is the wall-adjacent room node and free room node in the remaining object sub-nodes;
[0032] The relationship constraint evaluation value is:
[0033] where R neighboor is the relationship constraint evaluation value, RCNS is the room container node in the remaining object sub-nodes, RNS is the room node in the remaining object sub-nodes, RN k is the room node k in the remaining object sub-nodes, and Pair(*,*) is the adjacent relationship indicator function;
[0034] The movable space evaluation value:
[0035] where R move is the movable space evaluation value, and CA is the enclosed area in the scene;
[0036] The escapability evaluation value:
[0037] where R escape is the escapability evaluation value, ECA is the escapable area in the enclosed area, and S totalis the total area of the scene.
[0038] In the above implementation process, the space utilization evaluation value, the relationship constraint evaluation value, the movable space evaluation value, and the escapability evaluation value can evaluate the one-dimensional scene layout from multiple aspects and angles, ensuring the rationality of the one-dimensional scene layout, so that the one-dimensional scene layout can generate an indoor scene layout.
[0039] Further, the step of obtaining the comprehensive constraint evaluation value according to the space utilization evaluation value, the relationship constraint evaluation value, the movable space evaluation value, and the escapability evaluation value includes:
[0040] Obtain the evaluation index R other ;
[0041] Obtain the comprehensive constraint evaluation value according to the evaluation index, the space utilization evaluation value, the relationship constraint evaluation value, the movable space evaluation value, and the escapability evaluation value:
[0042] R total = λ space ·R space + λ neighboor ·R neighboor + λ move ·R move + λ escape ·R escape + λ other ·R other ;
[0043] where λ space is the utilization evaluation weight value, λ neighboor is the relationship constraint evaluation weight value, λ move is the movable space evaluation weight value, λ escape is the escapability evaluation weight value.
[0044] In the above implementation process, the comprehensive constraint evaluation value can reflect the space utilization, relationship constraint, escapability, and movability of the indoor scene layout, making the indoor scene layout meet the actual use.
[0045] In a second aspect, an embodiment of the present application further provides an indoor scene layout device, and the device includes:
[0046] A construction module, configured to obtain object nodes and construct a polygon data structure according to the object nodes;
[0047] A planning module, configured to obtain wall information and perform planning processing on the polygon data structure according to the wall information to obtain a two-dimensional scene layout;
[0048] A conversion module, configured to reduce the two-dimensional scene layout to a one-dimensional scene layout;
[0049] A generation module, configured to obtain a comprehensive constraint evaluation value according to the one-dimensional scene layout. If the comprehensive constraint evaluation value is greater than a threshold, an indoor scene layout is generated according to the one-dimensional scene layout. If the comprehensive constraint evaluation value is less than or equal to the threshold, a new one-dimensional scene layout is obtained again.
[0050] In the above implementation process, the characteristics of object nodes are aggregated using a polygon data structure, not limited to the common picture form. The two-dimensional scene layout is obtained by combining object nodes with wall information, and then the indoor scene layout is obtained through the one-dimensional scene layout, saving calculation time and making the obtained indoor scene layout more in line with reality.
[0051] In a third aspect, an electronic device provided by an embodiment of the present application includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method described in any item of the first aspect are implemented.
[0052] In a fourth aspect, a computer-readable storage medium provided by an embodiment of the present application has instructions stored thereon. When the instructions are run on a computer, the computer is made to execute the method described in any item of the first aspect.
[0053] In a fifth aspect, a computer program product provided by an embodiment of the present application, when run on a computer, causes the computer to execute the method described in any item of the first aspect.
[0054] Other features and advantages of the present disclosure will be described in the subsequent specification, or some features and advantages can be inferred from the specification or determined without doubt, or can be known by implementing the above technologies of the present disclosure.
[0055] And it can be implemented according to the content of the specification. The following will be described in detail with reference to the preferred embodiments of the present application and the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] To more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation of the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.
[0057] Figure 1 It is a schematic flowchart of the indoor scene layout method provided by an embodiment of the present application;
[0058] Figure 2 Schematic diagram of the polygon data structure provided by the embodiment of the present application;
[0059] Figure 3 Schematic diagram of the dependency relationship provided by the embodiment of the present application;
[0060] Figure 4 Schematic diagram of the coordinate transformation provided by the embodiment of the present application;
[0061] Figure 5 Schematic diagram of the indoor scene layout provided by the embodiment of the present application;
[0062] Figure 6 Schematic diagram of the structural composition of the indoor scene layout device provided by the embodiment of the present application;
[0063] Figure 7 Schematic diagram of the structural composition of the electronic device provided by the embodiment of the present application. Detailed implementation manners
[0064] Next, the technical solutions in the embodiments of the present application will be described with reference to the accompanying drawings in the embodiments of the present application.
[0065] It should be noted that: Similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of the present application, the terms "first", "second", etc. are only used for descriptive distinction and cannot be understood as indicating or implying relative importance.
[0066] Next, with reference to the accompanying drawings and embodiments, the detailed implementation manners of the present application will be further described in detail. The following embodiments are used to illustrate the present application, but are not used to limit the scope of the present application.
[0067] Embodiment 1
[0068] Figure 1 It is a flowchart of the indoor scene layout method provided by the embodiment of the present application. As Figure 1 shown, the method includes:
[0069] S1. Obtain object nodes and construct a polygon data structure according to the object nodes;
[0070] S2. Obtain wall information and perform planning processing on the polygon data structure according to the wall information to obtain a two-dimensional scene layout;
[0071] S3. Dimensionally reduce the two-dimensional scene layout to a one-dimensional scene layout;
[0072] S4. Obtain the comprehensive constraint evaluation value according to the one-dimensional scene layout. If the comprehensive constraint evaluation value is greater than the threshold, generate the indoor scene layout according to the one-dimensional scene layout. If the comprehensive constraint evaluation value is less than or equal to the threshold, obtain a new one-dimensional scene layout again.
[0073] Taking this embodiment as an example, the feature of aggregating object nodes is utilized with the polygon data structure, not limited to the common picture form. The object nodes are combined with the wall information to obtain the two-dimensional scene layout, and then the indoor scene layout is obtained through the one-dimensional scene layout, saving calculation time and making the obtained indoor scene layout more in line with reality.
[0074] Exemplarily, S1 further includes:
[0075] Obtain the boundary sub-nodes and the remaining object sub-nodes in the object nodes;
[0076] Insert the remaining object sub-nodes into the boundary sub-nodes to obtain the polygon data structure.
[0077] Taking this embodiment as an example, the polygon data structure can adapt to scenes of different scales, and the generation efficiency on scenes of different scales will not vary due to different scene scales. At the same time, by using the polygon data structure, the layout of special-shaped indoor scenes can also be generated.
[0078] The basic data unit used to describe a single object in the indoor scene is called an object node (Object Node, ON). Optionally, the object node includes:
[0079] 1. World sub-node: The initial root node used to create the object node and build the attachment relationship;
[0080] 2. Outer wall sub-node: The node used to save the initial outer wall contour of the indoor scene;
[0081] 3. Inner wall sub-node: The node used to save the inner wall contour of the indoor scene. The inner walls include load-bearing walls, elevator shafts, fire channels, and other fixed walls, etc.;
[0082] 4. Room container sub-node: The node used to save the room group with adjacent relationships, which contains one or more adjacent wall-mounted room sub-nodes or free room sub-nodes;
[0083] 5. Wall-mounted room sub-node: The node used to save the wall-mounted room contour with attachment relationships to the inner and outer walls;
[0084] 6. Free room sub-node: The node used to save the free room contour without attachment relationships to the inner and outer walls. The free room may be semi-open areas such as open meeting rooms, open negotiation rooms, and bars;
[0085] 7. Team sub - node: A node used to save the smallest outer contour that has an attachment relationship with a wall - adjacent room sub - node or a free - room sub - node and contains one or more regular workspace sub - nodes;
[0086] 8. Workspace sub - node: A node used to save the smallest outer contour that has an attachment relationship with a team sub - node and contains one or more furniture sub - nodes;
[0087] 9. Furniture sub - node: A node used to save the position and simplified outer contour of a single piece of furniture that has an attachment relationship with a workspace node;
[0088] 10. Space sub - node: A node used to save the position information of the polygon corresponding to the contour of an object node;
[0089] 11. Boundary sub - node: A node used to save the position information of a certain edge in the contour of an object node.
[0090] The remaining object sub - nodes include sub - nodes in other object nodes except boundary sub - nodes. As Figure 2 shown, it is a polygon data structure composed of multiple sub - nodes in an object node.
[0091] S2 further includes:
[0092] Obtain the attachment relationship between the wall and the object node according to the wall information;
[0093] Perform planning processing on the polygon data structure according to the attachment relationship to obtain a two - dimensional scene layout.
[0094] Taking this embodiment as an example, the attachment relationship includes the connection data between the wall information and the object node, which can ensure that the object node attaches to the correct wall and will not cause chaos between the wall and the object node.
[0095] Walls are divided into two different types: One is the wall that changes with the change of the room position, which is called the room wall. The room wall is the wall that must be generated together with the room when a room is added to the scene, and when the room position changes, the positions of these walls also change together; The other is the wall that has nothing to do with the room position, which is called the fixed wall. No matter how the room position changes in the scene, the fixed wall always exists. For example, the initial outer contour of the scene, elevator shaft, load - bearing wall, etc.
[0096] For a reasonable indoor scene layout, it always satisfies that all rooms are attached to at least one fixed wall.
[0097] Exemplarily, the relationship between the wall and the object node becomes an attachment relationship. As Figure 3As shown in the figure, for the World Axis on the left side of the figure, first add the boundary of an Outer Wall to it. The coordinate system it is in is ON1 AIW. After adding the Outer Wall, create four boundary sub-nodes BN1, BN2, BN3, BN4, and a space sub-node SN1. For the boundary sub-node BN1 of the boundary of this Outer Wall (denoted as ON1-BN1 in the figure for convenience according to the parent-child node relationship), the coordinate system it is in is ON1-BN1 AIW. Add a wall-adjacent room ON2 to the boundary sub-node BN1 (denoted as ON1-BN1-ON2 in the figure for convenience according to the parent-child node relationship). The coordinate system of this wall-adjacent room will be attached to the X-axis of the boundary sub-node BN1, and the coordinate system directions of the two are the same. Further, this wall-adjacent room ON2 can only slide on the boundary of the Outer Wall and always maintains the same coordinate system direction as that of the boundary sub-node. As shown on the right side of the figure, the relationship between this wall-adjacent room and the boundary sub-node it depends on is called the attachment relationship.
[0098] Further, through the attachment relationship, a two-dimensional scene layout is obtained. A dot matrix set is constructed to cover the entire scene and sniff the position coordinates of the unused areas. The shortest distance between any two points in the dot matrix becomes the free room generation error (this error value can be adjusted adaptively according to the scene size). According to the state of each point in the dot matrix, it is divided to obtain a largest unused regular rectangular area, and a free room sub-node and multiple team sub-nodes are generated on it. Then, this process is repeated until a suitable-sized unused area cannot be found in the entire scene, and thus the two-dimensional scene layout is obtained.
[0099] Through this generation process, the unused areas in the entire scene can be minimized as much as possible, thereby greatly improving the space utilization rate of the entire scene.
[0100] S3 further includes:
[0101] Obtain the two-dimensional coordinates in the wall information in the two-dimensional scene layout;
[0102] Perform boundary topological isomorphism processing on the two-dimensional coordinates to obtain one-dimensional coordinates;
[0103] Obtain a one-dimensional scene layout according to the one-dimensional coordinates.
[0104] As Figure 4As shown in the figure, it is a schematic diagram of converting two-dimensional coordinates into one-dimensional coordinates. The outer wall and the inner wall on the left side of the figure are respectively converted into two one-dimensional line segments, and the length of the line segment is equal to the total length of the contour of the corresponding wall. The boundary line of the room container is generated on this line segment, and each boundary line corresponds to the attachment position of a room container sub-node. Boundary topology isomorphism is a data processing method that can reduce the two-dimensional coordinates to generate one-dimensional coordinates.
[0105] Obtain the one-dimensional scene layout according to the one-dimensional coordinates. Search for the shortest distance between the position corresponding to this boundary line and all other room container contours on the left side of the figure, so as to obtain the maximum height value of the non-conflicting room container, to ensure that this room container does not overlap with any other room container. Finally, compare the maximum height value with the specified height of this room container, and take the smaller value as the actual height of this room container, and convert it into the actual room container on the left side of the figure and add it to the boundary sub-node of the corresponding wall.
[0106] Taking this embodiment as an example, converting two-dimensional coordinates into one-dimensional coordinates reduces the dimension, which makes it possible to have a complex scene layout, and the generation of the indoor scene layout will not be affected by multi-dimensional data, ensuring the rationality of the indoor scene layout.
[0107] S4 further includes:
[0108] Further, the steps of obtaining the comprehensive constraint evaluation value according to the one-dimensional scene layout include:
[0109] Obtain the space utilization evaluation value, relationship constraint evaluation value, movable space evaluation value and escapability evaluation value according to the one-dimensional scene layout;
[0110] Obtain the comprehensive constraint evaluation value according to the space utilization evaluation value, relationship constraint evaluation value, movable space evaluation value and escapability evaluation value.
[0111] Taking this embodiment as an example, conducting a comprehensive constraint evaluation on the one-dimensional scene layout can ensure the rationality of the scene layout, and can eliminate potential safety hazards existing in the process of generating the indoor scene layout, ensuring the safety and usability of the indoor scene layout.
[0112] Further, according to the following formula, obtain the space utilization evaluation value, relationship constraint evaluation value, movable space evaluation value and escapability evaluation value according to the one-dimensional scene layout:
[0113] The utilization evaluation value is:
[0114] Where R space is the space utilization evaluation value, S totalLet \(S\) be the total area of the scene, and \(RN\) be the wall - adjacent room nodes and free - room nodes among the remaining object sub - nodes;
[0115] The relationship - constraint evaluation value is:
[0116] Among them, \(R\) neighboor is the relationship - constraint evaluation value, \(RCNS\) is the room - container nodes among the remaining object sub - nodes, \(RNS\) is the room nodes among the remaining object sub - nodes, \(RN\) k is the room node \(k\) among the remaining object sub - nodes, \(Pair(*, *)\) is the adjacent - relationship indicator function. Due to the existence of room - container nodes, it is necessary to judge whether the adjacent relationship of rooms satisfies the constraint rules of the adjacent relationship by judging whether the rooms are in the same room container. When two room nodes are defined as adjacent rooms, the return value of the \(R\) neighboor function is 1, otherwise the return value is 0.
[0117] The movable - space evaluation value:
[0118] Among them, \(R\) move is the movable - space evaluation value, and \(CA\) is the enclosed area in the scene;
[0119] Since all non - passable areas in the scene are exactly covered by furniture sub - nodes, it is necessary to judge the connectivity of all areas except furniture sub - nodes, that is, to evaluate the mobility in the scene.
[0120] Exemplarily, as Figure 5 shown, for the example layout on the left side of the figure, first, cluster all furniture sub - nodes according to connectivity to obtain a set of non - overlapping obstacle polygons (Obstacle Polygon Set) composed of several non - crossable furniture, as shown in the middle part of the figure. Judge whether each obstacle polygon (Obstacle Polygon) intersects at least two different walls. If so, record the intersection - point information of the intersecting walls. By recording this information, all internal walls are converted into nodes, and the intersection information is transmitted, so as to obtain the segmentation of the external walls, as shown in the right - hand part of the figure. Through this intersection result, it can be quickly found that the entire scene is isolated into several enclosed areas (Closed Area).
[0121] The escapability evaluation value:
[0122] Among them, \(R\) escape is the escapability evaluation value, \(ECA\) is the escapable area in the enclosed area, and \(S\) total is the total area of the scene.
[0123] Taking this embodiment as an example, the spatial utilization evaluation value, the relationship constraint evaluation value, the movable space evaluation value, and the escapability evaluation value can evaluate the one-dimensional scene layout from multiple aspects and angles, ensuring the rationality of the one-dimensional scene layout and enabling the one-dimensional scene layout to generate an indoor scene layout.
[0124] Further, the steps of obtaining the comprehensive constraint evaluation value according to the spatial utilization evaluation value, the relationship constraint evaluation value, the movable space evaluation value, and the escapability evaluation value include:
[0125] Obtain the evaluation index R other ;
[0126] Obtain the comprehensive constraint evaluation value according to the evaluation index, the spatial utilization evaluation value, the relationship constraint evaluation value, the movable space evaluation value, and the escapability evaluation value:
[0127] R total = λ space ·R space + λ neighboor ·R neighboor + λ move ·R move + λ escape ·R escape + λ other ·R other ;
[0128] Wherein, λ space is the utilization evaluation weight value, that is, the weight of the utilization evaluation value, λ neighboor is the relationship constraint evaluation weight value, that is, the weight of the relationship constraint evaluation value, λ move is the movable space evaluation weight value, that is, the weight of the movable space evaluation weight value, λ escape is the escapability evaluation weight value, that is, the weight of the escapability evaluation value, and satisfies λ space + λ neighboor + λ move + λ escape = 1.
[0129] Taking this embodiment as an example, the comprehensive constraint evaluation value can reflect the spatial utilization, relationship constraint, escapability, and mobility of the indoor scene layout, making the indoor scene layout conform to actual use.
[0130] Optionally, the process of generating an indoor scene layout based on a one-dimensional scene layout can be completed according to reinforcement learning, that is, a process in which an agent interacts with the surrounding environment. When a given environment is provided, it is necessary to set how the agent interacts with the environment, that is, to create an action space. The agent selects and executes an action in the action space, thereby changing the state of the environment. Next, the action selected by the agent is evaluated in response to the change in the environment, and the agent is informed of this evaluation and the new state of the current environment (observations). The agent then selects the next action based on these two pieces of data until the end of this round. By repeating this process continuously, we can enable the agent to learn how to select actions through the rewards we tell it so that this reward reaches the maximum value as much as possible.
[0131] The system for generating based on the room container boundary line defines the single-step actions of reinforcement learning, that is, inserting a boundary line into the line segments corresponding to all walls each time and setting a target height. After inserting the boundary lines multiple times, a complete scene layout can be obtained.
[0132] After each single-step action is executed, a comprehensive constraint evaluation of the current scene layout is obtained to get a comprehensive constraint evaluation value, and the comprehensive constraint evaluation is used as the score of the reward function of reinforcement learning, prompting it to gradually generate an indoor scene layout that meets the requirements.
[0133] After a large amount of training, the agent can generate a reasonable indoor scene layout based on the object nodes and wall information and that can meet the comprehensive constraint evaluation as much as possible. Even if there are strong conflicts between the provided object nodes and wall information, a relatively reasonable result can be obtained, and there will be no phenomenon of solution failure.
[0134] Embodiment 2
[0135] To execute the method corresponding to the above Embodiment 1 to achieve the corresponding functions and technical effects, the following provides an indoor scene layout device, as Figure 6 shown. The device includes:
[0136] A construction module 1 for obtaining object nodes and constructing a polygon data structure according to the object nodes;
[0137] A planning module 2 for obtaining wall information and performing planning processing on the polygon data structure according to the wall information to obtain a two-dimensional scene layout;
[0138] A conversion module 3 for reducing the two-dimensional scene layout to a one-dimensional scene layout;
[0139] A generation module 4 is used to obtain a comprehensive constraint evaluation value according to a one-dimensional scene layout. If the comprehensive constraint evaluation value is greater than a threshold, an indoor scene layout is generated according to the one-dimensional scene layout. If the comprehensive constraint evaluation value is less than or equal to the threshold, a new one-dimensional scene layout is obtained again.
[0140] Furthermore, the construction module 1 is also used for:
[0141] Obtain the boundary sub-nodes and the remaining object sub-nodes in the object node;
[0142] Insert the remaining object sub-nodes into the boundary sub-nodes to obtain a polygon data structure.
[0143] Furthermore, the planning module 2 is also used for:
[0144] Obtain the attachment relationship between the wall and the object node according to the wall information;
[0145] Perform planning processing on the polygon data structure according to the attachment relationship to obtain a two-dimensional scene layout.
[0146] Furthermore, the conversion module 3 is also used for:
[0147] Obtain the two-dimensional coordinates in the wall information of the two-dimensional scene layout;
[0148] Perform boundary topological isomorphism processing on the two-dimensional coordinates to obtain one-dimensional coordinates;
[0149] Obtain a one-dimensional scene layout according to the one-dimensional coordinates.
[0150] Furthermore, the generation module 4 is also used for:
[0151] Obtain a space utilization evaluation value, a relationship constraint evaluation value, a movable space evaluation value, and an escapability evaluation value according to the one-dimensional scene layout;
[0152] Obtain a comprehensive constraint evaluation value according to the space utilization evaluation value, the relationship constraint evaluation value, the movable space evaluation value, and the escapability evaluation value.
[0153] The utilization evaluation value is:
[0154] Among them, R space is the space utilization evaluation value, S total is the total area of the scene, and RN is the wall-adjacent room nodes and free room nodes in the remaining object sub-nodes;
[0155] The relationship constraint evaluation value is:
[0156] Among them, R neighbooris the relationship constraint evaluation value, RCNS is the room container node in the remaining object sub-nodes, RNS is the room node in the remaining object sub-nodes, RN k is the room node k in the remaining object sub-nodes, Pair(*,*) is the adjacent relationship indicator function;
[0157] Movable space evaluation value:
[0158] where, R move is the movable space evaluation value, CA is the enclosed area in the scene;
[0159] Escapability evaluation value:
[0160] where, R escape is the escapability evaluation value, ECA is the escapable area in the enclosed area, S total is the total area of the scene.
[0161] Obtain the evaluation index R other ;
[0162] Obtain the comprehensive constraint evaluation value according to the evaluation index, space utilization evaluation value, relationship constraint evaluation value, movable space evaluation value and escapability evaluation value:
[0163] R total = λ space ·R space + λ neighboor ·R neighboor + λ move ·R move + λ escape ·R escape + λ other ·R other ;
[0164] where, λ space is the utilization evaluation weight value, λ neighboor is the relationship constraint evaluation weight value, λ move is the movable space evaluation weight value, λ escape is the escapability evaluation weight value.
[0165] The above indoor scene layout device can implement the method of the first embodiment. The optional items in the first embodiment are also applicable to this embodiment and will not be elaborated here.
[0166] The remaining content of the embodiments of this application can refer to the content of the first embodiment and will not be repeated in this embodiment.
[0167] Embodiment Three
[0168] An embodiment of the present application provides an electronic device, including a memory and a processor. The memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the indoor scene layout method of Embodiment 1.
[0169] Optionally, the above-mentioned electronic device may be a server.
[0170] Please refer to Figure 7 , Figure 7 which is a schematic diagram of the structural composition of the electronic device provided by the embodiment of the present application. The electronic device may include a processor 71, a communication interface 72, a memory 73, and at least one communication bus 74. Among them, the communication bus 74 is used to realize the direct connection and communication of these components. Among them, the communication interface 72 of the device in the embodiment of the present application is used to communicate with other node devices for signaling or data. The processor 71 may be an integrated circuit chip with signal processing capabilities.
[0171] The above-mentioned processor 71 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor, or the processor 71 may also be any conventional processor, etc.
[0172] The memory 73 may be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The memory 73 stores computer-readable instructions. When the computer-readable instructions are executed by the processor 71, the device can execute the above Figure 1 steps involved in the method embodiment.
[0173] Optionally, the electronic device may further include a storage controller and an input / output unit. Each component of the memory 73, the storage controller, the processor 71, the peripheral interface, and the input / output unit is electrically connected directly or indirectly to each other to achieve data transmission or interaction. For example, these components may be electrically connected to each other through one or more communication buses 74. The processor 71 is configured to execute an executable module stored in the memory 73, such as a software functional module or a computer program included in the device.
[0174] The input / output unit is used to provide the user with the ability to create tasks and create an optional start period or a preset execution time for the task to achieve interaction between the user and the server. The input / output unit may be, but is not limited to, a mouse, a keyboard, etc.
[0175] It can be understood that Figure 7 The structure shown is only schematic, and the electronic device may further include more or fewer components than those Figure 7 shown, or have a configuration different from that Figure 7 shown. Figure 7 Each component shown may be implemented in hardware, software, or a combination thereof.
[0176] In addition, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which when executed by a processor, implements the indoor scene layout method of Embodiment 1.
[0177] An embodiment of the present application further provides a computer program product, which when running on a computer, causes the computer to execute the method described in the method embodiment.
[0178] In several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of apparatuses, methods, and computer program products according to multiple embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
[0179] In addition, each functional module in various embodiments of the present application may be integrated together to form an independent part, or each module may exist alone, or two or more modules may be integrated to form an independent part.
[0180] If the above functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical discs that can store program codes.
[0181] The above are only the embodiments of the present application and are not used to limit the protection scope of the present application. For those skilled in the art, the present application may have various changes and modifications. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that similar reference numerals and letters indicate similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.
[0182] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present application, and all should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
[0183] It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.
Claims
1. An indoor scene layout method, characterized in that, The method includes: Obtaining object nodes and constructing a polygon data structure according to the object nodes; Obtaining wall information and performing planning processing on the polygon data structure according to the wall information to obtain a two-dimensional scene layout; Reducing the two-dimensional scene layout to a one-dimensional scene layout; Obtaining a comprehensive constraint evaluation value according to the one-dimensional scene layout. If the comprehensive constraint evaluation value is greater than a threshold, generating an indoor scene layout according to the one-dimensional scene layout. If the comprehensive constraint evaluation value is less than or equal to the threshold, obtaining a new one-dimensional scene layout again; The step of obtaining the comprehensive constraint evaluation value according to the one-dimensional scene layout includes: Obtaining a space utilization evaluation value, a relationship constraint evaluation value, a movable space evaluation value, and an escapability evaluation value according to the one-dimensional scene layout; Obtaining the comprehensive constraint evaluation value according to the space utilization evaluation value, the relationship constraint evaluation value, the movable space evaluation value, and the escapability evaluation value; The step of obtaining object nodes and constructing a polygon data structure according to the object nodes includes: Obtaining boundary sub-nodes and remaining object sub-nodes in the object nodes; Inserting the remaining object sub-nodes into the boundary sub-nodes to obtain the polygon data structure; Obtaining a space utilization evaluation value, a relationship constraint evaluation value, a movable space evaluation value, and an escapability evaluation value according to the one-dimensional scene layout according to the following formula: The utilization evaluation value is: Among them, R space is the space utilization evaluation value, S total is the total area of the scene, and RN is the wall-adjacent room node and free room node among the remaining object child nodes; The relationship constraint evaluation value is: wherein, R neighboor is the relationship constraint evaluation value, RCNS is the room container node in the remaining object child nodes, RNS is the room node in the remaining object child nodes, RN k is the room node k in the remaining object child nodes, and Pair(*,*) is the adjacent relationship indicator function; Movable space evaluation value: Among them, R move is the movable space evaluation value, and CA is the enclosed area in the scene; Evaluated value of escapability: wherein, R escape is the escapability evaluation value, ECA is the escapable area in the enclosed area, and S total is the total area of the scenario.
2. The indoor scene layout method according to claim 1, wherein The step of obtaining wall information and performing planning processing on the polygon data structure according to the wall information to obtain a two-dimensional scene layout includes: Obtaining the attachment relationship between the wall and the object nodes according to the wall information; Performing planning processing on the polygon data structure according to the attachment relationship to obtain the two-dimensional scene layout.
3. The indoor scene layout method according to claim 1, wherein The step of reducing the two-dimensional scene layout to a one-dimensional scene layout includes: Obtaining the two-dimensional coordinates in the wall information of the two-dimensional scene layout; Performing boundary topological isomorphism processing on the two-dimensional coordinates to obtain one-dimensional coordinates; Obtaining the one-dimensional scene layout according to the one-dimensional coordinates.
4. An indoor scene layout device, characterized in that, The device includes: A construction module for obtaining object nodes and constructing a polygon data structure according to the object nodes; A planning module for obtaining wall information and performing planning processing on the polygon data structure according to the wall information to obtain a two-dimensional scene layout; A conversion module for reducing the two-dimensional scene layout to a one-dimensional scene layout; A generation module for obtaining a comprehensive constraint evaluation value according to the one-dimensional scene layout. If the comprehensive constraint evaluation value is greater than a threshold, generating an indoor scene layout according to the one-dimensional scene layout. If the comprehensive constraint evaluation value is less than or equal to the threshold, obtaining a new one-dimensional scene layout again; The generation module is further configured to: Obtaining a space utilization evaluation value, a relationship constraint evaluation value, a movable space evaluation value, and an escapability evaluation value according to the one-dimensional scene layout; Obtaining the comprehensive constraint evaluation value according to the space utilization evaluation value, the relationship constraint evaluation value, the movable space evaluation value, and the escapability evaluation value; The construction module is further configured to: Obtain the boundary sub-nodes and the remaining object sub-nodes in the object nodes; Insert the remaining object sub-nodes into the boundary sub-nodes to obtain the polygon data structure; The generating module is further configured to obtain a space utilization evaluation value, a relationship constraint evaluation value, a movable space evaluation value, and an escapability evaluation value according to the following formula based on the one-dimensional scene layout: The utilization evaluation value is: wherein, R space is the space utilization evaluation value, S total is the total area of the scene, and RN are the wall-adjacent room nodes and free room nodes among the remaining object child nodes; The relationship constraint evaluation value is: wherein, R neighboor is the relationship constraint evaluation value, RCNS is the room container node in the remaining object sub-nodes, RNS is the room node in the remaining object sub-nodes, RN k is the room node k in the remaining object sub-nodes, and Pair(*,*) is the adjacent relationship indicator function; Movable space evaluation value: wherein, R move is the movable space evaluation value, and CA is the enclosed area in the scene; Evaluated value of escapability: Among them, R escape is the escapability evaluation value, ECA is the escapable area in the enclosed area, and S total is the total area of the scene.
5. An electronic device, characterized in that, It includes a memory and a processor. The memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the indoor scene layout method according to any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that, It stores a computer program, and when the computer program is executed by the processor, it implements the indoor scene layout method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Kitchen automatic layout method and device based on nonlinear optimization and computer equipment
CN111274627A
Tree structure-based soft installation design method, device, equipment and storage medium
CN113486436A