CN113205601B - Roaming path generation method and device, storage medium and electronic equipment - Google Patents

Roaming path generation method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN113205601B
CN113205601B CN202110587665.7A CN202110587665A CN113205601B CN 113205601 B CN113205601 B CN 113205601B CN 202110587665 A CN202110587665 A CN 202110587665A CN 113205601 B CN113205601 B CN 113205601B
Authority
CN
China
Prior art keywords
point
target
determining
roaming
scene
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110587665.7A
Other languages
Chinese (zh)
Other versions
CN113205601A (en
Inventor
金泽
杨淼
刘明荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Youzhuju Network Technology Co Ltd
Original Assignee
Beijing Youzhuju Network Technology Co Ltd
Filing date
Publication date
Application filed by Beijing Youzhuju Network Technology Co Ltd filed Critical Beijing Youzhuju Network Technology Co Ltd
Priority to CN202110587665.7A priority Critical patent/CN113205601B/en
Publication of CN113205601A publication Critical patent/CN113205601A/en
Application granted granted Critical
Publication of CN113205601B publication Critical patent/CN113205601B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The disclosure relates to a roaming path generation method, a roaming path generation device, a storage medium and electronic equipment, so as to solve the problem of discontinuous camera point positions, enable a scene roaming path to be continuous, and improve browsing experience of a user on scene design effects. The method comprises the following steps: determining a target scene top view corresponding to the indoor scene; in the top view of the target scene, determining reachable pixels without article shielding in the indoor scene, and determining a roaming path in each room in the indoor scene according to the reachable pixels; determining a tree structure corresponding to the indoor scene, and determining a roaming path among rooms in the indoor scene according to the tree structure; and selecting a target camera point in the roaming path in each room and the roaming paths among the rooms, and generating a user roaming path according to the target camera point.

Description

Roaming path generation method and device, storage medium and electronic equipment
Technical Field
The disclosure relates to the field of computer technology, and in particular, to a roaming path generation method, a roaming path generation device, a storage medium and electronic equipment.
Background
Along with the rapid development of virtual reality technology, the field of scene design also starts to apply the technology to the task of scene roaming, such as scene roaming in the field of indoor scene design through virtual reality technology. Specifically, after a user designs a scene in a virtual space through an electronic device, a camera point location may be selected, the scene rendered, and the design effect of the current scene quickly browsed.
However, in the related art, the camera point is usually manually selected, and the problem that the camera point is discontinuous exists, so that a continuous user roaming path cannot be formed, and the browsing experience of the user on the scene design effect is affected.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
In a first aspect, the present disclosure provides a roaming path generating method, the method including:
determining a target scene top view corresponding to the indoor scene;
In the top view of the target scene, determining reachable pixels without article shielding in the indoor scene, and determining a roaming path in each room in the indoor scene according to the reachable pixels;
Determining a tree structure corresponding to the indoor scene, and determining a roaming path among all rooms in the indoor scene according to the tree structure, wherein nodes in the tree structure represent the rooms in the indoor scene, and the relation among the nodes is used for representing the communication relation among all rooms in the indoor scene;
And selecting a target camera point in the roaming path in each room and the roaming paths among the rooms, and generating a user roaming path according to the target camera point.
In a second aspect, the present disclosure provides a roaming path generating apparatus, the apparatus including:
the first determining module is used for determining a target scene top view corresponding to the indoor scene;
The second determining module is used for determining the reachable pixels without article shielding in the indoor scene in the top view of the target scene, and determining the roaming path in each room in the indoor scene according to the reachable pixels;
the third determining module is used for determining a tree structure corresponding to the indoor scene and determining a roaming path among all rooms in the indoor scene according to the tree structure, wherein nodes in the tree structure represent the rooms in the indoor scene, and the relation among the nodes is used for representing the communication relation among all rooms in the indoor scene;
And the generation module is used for selecting a target camera point in the roaming path in each room and the roaming paths among the rooms, and generating a user roaming path according to the target camera point.
In a third aspect, the present disclosure provides a computer readable medium having stored thereon a computer program which when executed by a processing device implements the steps of the method described in the first aspect.
In a fourth aspect, the present disclosure provides an electronic device comprising:
a storage device having a computer program stored thereon;
Processing means for executing said computer program in said storage means to carry out the steps of the method described in the first aspect.
Through the technical scheme, the roaming path of each room and the roaming paths among the rooms in the indoor scene can be determined, and then the target camera point position is selected from the roaming path of each room and the roaming paths among the rooms. Because the target camera point is selected from the continuous room roaming path, the problem of discontinuous camera point can be avoided, so that the user roaming path generated according to the target camera point is continuous, and the browsing experience of the user on the scene design effect is improved.
Additional features and advantages of the present disclosure will be set forth in the detailed description which follows.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale. In the drawings:
FIG. 1 is a flow chart illustrating a roaming path generation method according to an exemplary embodiment of the present disclosure;
FIG. 2 is a block diagram of a roaming path generating apparatus according to an exemplary embodiment of the present disclosure;
fig. 3 is a block diagram of an electronic device, according to an exemplary embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units. It is further noted that references to "one" or "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
As to the background art, in the related art, camera points are usually selected manually, and there is a problem that the camera points are discontinuous, so that a continuous user roaming path cannot be formed, and browsing of the scene design effect by the user is affected. In view of this, the embodiments of the present disclosure provide a roaming path generating method to solve the problem of discontinuous camera points, so that the roaming path of the user is continuous, and the browsing experience of the user on the scene design effect is improved.
Fig. 1 is a flowchart illustrating a roaming path generation method according to an exemplary embodiment of the present disclosure. Referring to fig. 1, the roaming path generating method includes:
Step 101, determining a target scene top view corresponding to an indoor scene;
Step 102, in the top view of the target scene, determining the reachable pixels without article shielding in the indoor scene, and determining the roaming path in each room in the indoor scene according to the reachable pixels.
Step 103, determining a tree structure corresponding to the indoor scene, and determining a roaming path among rooms in the indoor scene according to the tree structure. The nodes in the tree structure represent rooms in the indoor scene, and the relation among the nodes is used for representing the communication relation of all rooms in the indoor scene;
step 104, selecting a target camera point in the roaming path in each room and the roaming paths among the rooms, and generating a user roaming path according to the target camera point.
By the method, the roaming path of each room and the roaming paths among the rooms in the indoor scene can be determined, and then the target camera point is selected from the roaming path of each room and the roaming paths among the rooms. Because the target camera point is selected from the continuous room roaming path, the problem of discontinuous camera point can be avoided, so that the user roaming path generated according to the target camera point is continuous, and the browsing experience of the user on the scene design effect is improved.
In order to make those skilled in the art more understand the roaming path generation method provided in the present disclosure, the following details of the above steps are illustrated.
For example, room structure information of an indoor scene and layout information of each article in the indoor scene may be read from the three-dimensional scene graph, for example, room structure information such as walls, windows, etc. in the indoor scene may be read, and orientation, size, and position information of the articles in the indoor scene may be read. Meanwhile, a blank two-dimensional image can be created, then a corresponding line segment is added in the two-dimensional image according to room structure information, and the pixel value of the line segment can be set to be 1, so that the line segment is distinguished from a pixel point with a pixel value of 0 in a blank region in the two-dimensional image. Of course, other non-0 pixel values may be set for the line segment as well, which is not limited by the disclosed embodiments. It should further be appreciated that for the generation of a subsequent roaming path, the position of the gate in the indoor scene may be left empty, i.e. the pixel value of the pixel point at the position of the gate may be 0.
Meanwhile, corresponding shielding pixel points can be added in the two-dimensional image according to layout information, so that a scene top view corresponding to the indoor scene is obtained. The occlusion pixel point may be, for example, a pixel point with a pixel value of 1, so as to distinguish the occlusion pixel point from a pixel point with a pixel value of 0 in a blank area. Of course, in the implementation of the present disclosure, other non-0 pixel values may be set for the occlusion pixel point, which is not limited in the embodiment of the present disclosure.
After the top view of the target scene is obtained in the mode, vector expression (namely three-dimensional expression) of the indoor scene can be converted into two-dimensional pixel expression, and through setting of pixel values, areas with and without article shielding in the indoor scene can be distinguished, so that a passable area in the indoor scene is determined, and generation of a subsequent roaming path is facilitated.
It should be appreciated that the higher the resolution of the target scene top view, the more camera points that can be placed on behalf of, the higher the computational time complexity. Resolution needs to be reduced in order to reduce the time complexity. That is, in a possible manner, determining the target scene top view corresponding to the indoor scene may be: and determining an initial scene top view corresponding to the target scene, and then reducing the resolution of the initial scene top view to obtain the target scene top view corresponding to the indoor scene.
In the embodiment of the disclosure, the roaming path needs to be determined later, so that the walking path of the user needs to be considered in the process of determining the camera point location. In the initial scene top view, the user's travel path width may correspond to more pixels due to higher resolution. In the embodiment of the present disclosure, in order to reduce resolution, the number of pixels corresponding to a walking path of a user in an initial scene top view may be reduced. For example, the resolution ratio may be determined according to the actual walking path width of the user and the preset walking path pixel width, and then the resolution of the initial scene top view may be reduced according to the length, width, and resolution ratio of the initial scene top view.
For example, the preset travel path pixel width may characterize the degree of resolution reduction, the greater the travel path pixel width, the smaller the degree of resolution reduction, and conversely the smaller the travel path pixel width, the greater the degree of resolution reduction. For example, the actual walking path width of the user is 30 cm, and the preset walking path pixel width is 1 pixel point, so that a specific resolution ratio can be obtained. Then, when the length of the initial scene top view is X (in meters) and the width is Y (in meters), a pixel length and a pixel width, which are resolutions of the target scene top view after the resolution is reduced, can be determined according to the resolution ratio. Therefore, the resolution of the initial scene top view can be reduced, and the purpose of obtaining the target scene top view can be achieved.
In a possible manner, the initial scene top view may also be divided into a plurality of grids, the width of each grid being obtained by the resolution ratio and the pixel length and pixel width of the initial scene top view. The maximum pixel value in each grid may then be taken as the pixel value for all pixels in the grid. Therefore, the aim of reducing the resolution of the top view of the initial scene can be fulfilled, the time complexity of subsequent calculation is reduced, and the generation efficiency of the roaming path is improved.
After determining the top view of the target scene corresponding to the indoor scene, in the top view of the target scene, the reachable pixels without article shielding in the indoor scene can be determined, and then the roaming path in each room in the indoor scene is determined according to the reachable pixels.
For example, as described above, the pixel value of the pixel point of the blank area in the top view of the target scene is 0, and thus, the pixel point with the pixel value of 0 in the top view of the target scene may be determined as the reachable pixel point where no article shielding exists in the indoor scene.
In a possible manner, determining a roaming path in each room in the indoor scene may be, based on the reachable pixels: and taking all the reachable pixels in each room in the indoor scene as nodes, and establishing edges between the nodes represented by the adjacent reachable pixels to obtain a graph structure corresponding to each room. And then selecting a target pixel point from pixel points covered by an entrance of each room, taking a node represented by the target pixel point as a starting point, taking all nodes represented by all reachable pixel points in the room as end points, determining shortest paths from the starting point to all the end points according to a graph structure, and selecting the longest path from all the shortest paths as a roaming path of the room.
For example, the pixel covered by the entrance of the room may be the pixel covered by the entrance door of the room, and the target pixel may be the pixel where the center point of the entrance door of the room is located. That is, the pixel point where the center point of the room entrance gate is located may be taken as the path start point, and all the reachable pixels in the room are taken as the path end point. The shortest path algorithm can then be used to find the shortest path of the path start point and all path end points. Since the number of reachable pixels in the room is multiple, multiple shortest paths can be correspondingly obtained. Finally, the longest path from the plurality of shortest paths may be selected as the roaming path for the room to ensure the coverage of the room by the roaming path.
In addition, in implementation, it is desirable that the roaming path is shortest and has as few inflection points as possible, so that the cost of the path change direction can be increased in the cost function in determining the shortest path through the shortest path algorithm. For example, the cost function may be calculated as follows:
C=Cpath+Cdir
Wherein, Position coordinates x,/>, representing the ith pixel point in the rover pathRepresenting the position coordinates y,/>, of the ith pixel point in the roaming pathPosition coordinates x,/>, representing the (i+1) th pixel point in the roaming pathPosition coordinates y,/>, representing the (i+1) th pixel point in the roaming pathRepresentation/>Subtracting/>Absolute value of difference of/>Representation/>Subtracting/>Inf represents an infinite number, d i represents the direction of the i-th pixel in the roaming path, and d i+1 represents the direction of the i+1-th pixel in the roaming path. Therefore, according to the roaming path with the minimum cost function result, the shortest roaming path can be obtained, and the inflection point in the shortest roaming path can be reduced.
By the method, all reachable pixel points in each room in the indoor scene can be used as nodes, and the corresponding graph structure of each room is built, so that the roaming path of each room in the indoor scene is determined according to the graph structure and the shortest path algorithm, further, camera points can be selected on the roaming path of each room, and continuity of the camera points is guaranteed.
After determining the roaming path of each room in the indoor scene, a tree structure corresponding to the indoor scene can be determined, and the roaming path among the rooms in the indoor scene can be determined according to the tree structure.
In a possible manner, hierarchical traversal may be performed from a node at the lowest layer of the tree structure, in each traversal process, a target pixel point is selected from pixel points covered by a room entry corresponding to a node, the target pixel point is taken as a starting point, a parent node of the node is determined, a pixel point occupied by a roaming path of a room corresponding to the parent node is taken as an end point, shortest paths between the starting point and all the end points are determined, and then the shortest paths are determined in all the shortest paths to be taken as roaming paths between the room corresponding to the node and the room corresponding to the parent node.
For example, each room in the indoor scene may be taken as a node, and an edge is established between nodes corresponding to two rooms with connections, such as an edge is established between nodes corresponding to two rooms with doors connected, so as to obtain a graph structure corresponding to the indoor scene. And then, taking the node corresponding to the room where the entrance door is positioned in the indoor scene as a starting point, and performing breadth-first traversal until all the nodes are traversed, so as to obtain a tree structure corresponding to the indoor scene. It should be appreciated that in the tree structure, the door that each child node communicates with its parent node serves as the access door for the room characterized by that child node, and the access door for the room characterized by the root node is the access door.
After the tree structure corresponding to the indoor scene is obtained, hierarchical traversal can be performed from the bottommost node of the tree structure. In each traversal process, the pixel where the center point of the room entrance gate represented by each node is located is taken as a path starting point, and the pixel point occupied by the roaming path already determined in the parent node room is taken as a path ending point. Since the roaming path has a certain length and width, a plurality of path end points can be obtained. Then, the shortest paths of the path start point and the plurality of path end points can be calculated to obtain a plurality of shortest paths. And finally, selecting the shortest roaming path between the room represented by the node and the room represented by the father node from the plurality of shortest paths, so that the roaming path between rooms in the indoor scene is shortest, the roaming switching time between rooms is shortened, and the scene roaming efficiency is improved.
After the roaming paths in each room and the roaming paths among the rooms are determined, the target camera point positions can be selected from the roaming paths, so that the problem of discontinuous camera point positions is avoided, the roaming paths generated according to the target camera point positions are continuous, and the browsing experience of a user on the scene design effect is improved.
In a possible manner, at least one of the following types of location points may be selected as target camera points on the roaming path in each room and between rooms: inflection points on the roaming paths, start points, end points, and intersections between the roaming paths. The inflection point represents a position point where the direction on the roaming path changes.
It should be appreciated that if all types of location points described above are selected on the roaming path in each room and between rooms, it may be ensured that all target camera points in the indoor scene are reachable, so that the roaming path generated from the target camera point is continuous. However, the more the number of camera points is, the rendering time in the scene browsing process is increased, so that the above-mentioned position points of each type can be screened.
In a possible manner, for each room in the indoor scene, it is also possible to cluster all reachable pixels in the room, and determine the central point of the cluster as a key location point. Accordingly, selecting a target camera point in the roaming path in each room and the roaming path between rooms may be: selecting at least one type of candidate location point on the roaming path within each room and between rooms: the inflection point, the start point, the end point, and the intersection point between the roaming paths on the roaming path, and then a target location point enabling communication between the key location points is determined among the candidate location points, and the target location point and the key location point are determined as target camera points.
For better scene design, it is desirable to select camera points in an area that is as clear as possible, which is often where the reachable pixels are gathered. Therefore, in the embodiment of the disclosure, all reachable pixels in each room may be clustered, then the center of the cluster is determined as a key position point, and then the camera point location may be determined according to the key position point. Therefore, the density of the camera points is moderate, and the problem that a large amount of resources are consumed for scene rendering in the scene browsing process due to too dense camera points can be solved.
For example, a point set may be formed according to the coordinate positions of all reachable pixels in each room, and then the point set is clustered by a clustering algorithm such as a K-Means algorithm, and a central point of the cluster is found. Wherein 2 cluster center points may be selected for rooms with larger areas, and 1 cluster center point may be selected for rooms with smaller areas, which is not limited by the embodiments of the present disclosure. Then, the cluster center point of each room can be taken as a key location point.
After determining the keypoint, candidate location points may be determined. It should be understood that the key location points are camera points that can better demonstrate the design effect, and the candidate location points are camera points selected to satisfy the accessibility between cameras. In addition, in order to reduce the scene rendering time, the smaller the number of camera points is, the better. Thus, after obtaining the keypoint and the candidate location points, it is preferable to ensure accessibility between all the keypoint with as few candidate location points selected as possible.
In the embodiment of the present disclosure, a target location point enabling communication between key location points may be determined among candidate location points, and the target location point and the key location point may be determined as target camera points. Therefore, the accessibility between the target camera points can be ensured, the moderate density of the target camera points can be ensured, and the scene rendering time in the scene browsing process is reduced.
In a possible manner, determining a target location point that enables communication between key location points among candidate location points, and determining the target location point and the key location point as target camera points may be: and taking all the key position points and the candidate position points as candidate camera points, taking each candidate camera point as a node, establishing edges between nodes represented by the candidate camera points which can be communicated to obtain a target graph structure, determining a minimum spanning tree containing target nodes according to the target graph structure under the condition that additional nodes are allowed to be added, wherein the target nodes are nodes corresponding to the key position points, the additional nodes are nodes corresponding to the target position points in the candidate position points, and then determining the target camera points according to the position points represented by each node in the minimum spanning tree.
By way of example, a communicable candidate camera point may be understood as a candidate camera point that is free of furniture, wall occlusions in the top view of the target scene. An edge is established between nodes characterized by communicable candidate camera points, the length of which may be the Euclidean distance between the candidate camera points. After the target graph structure is obtained, an independent node ID can be set for each node in the target graph structure, and the node ID corresponding to the key position point is recorded, so that whether the finally obtained minimum spanning tree contains the node corresponding to the key position point can be determined through the node ID.
After the target graph structure is obtained, a minimum spanning tree containing the target node may be determined based on a Steiner tree (STEINER TREE) algorithm, with additional nodes being allowed to be added. The additional nodes are nodes corresponding to the target position points in the candidate position points, namely the additional nodes are nodes screened out from the candidate position points, and the additional nodes can enable the target nodes to be communicated. The target node refers to a node corresponding to the key position point. If the node corresponding to some key position points cannot be connected with the node corresponding to other candidate position points and the node corresponding to other key position points, the node corresponding to the key position point can be deleted, that is, the node corresponding to the key position point may not be included in the minimum spanning tree.
It should be understood that the nature of the minimum spanning tree can ensure that all nodes in the tree are reachable, and because the minimum spanning tree includes nodes corresponding to key position points, the target camera points are determined according to the position points represented by each node in the minimum spanning tree, thereby ensuring that the target camera points are reachable, ensuring that the density of the target camera points is moderate, and reducing the scene rendering time in the scene browsing process.
After determining the target camera point location, a user roaming path may be generated from the target camera point location. It should be appreciated that the user roaming path is generated during the user's browsing of the indoor scene, as distinguished from the roaming path in each room and the roaming path between rooms in the foregoing. In the embodiment of the disclosure, the target camera point is selected from the continuous room roaming path, so that the problem of discontinuous camera point can be avoided, and the user roaming path generated according to the target camera point is continuous, so that the browsing experience of the user on the scene design effect is improved.
Based on the same inventive concept, the embodiments of the present disclosure also provide a roaming path generating apparatus, where the apparatus may be part or all of an electronic device through software, hardware, or a combination of both. Referring to fig. 2, the roaming path generating apparatus 200 may include:
a first determining module 201, configured to determine a top view of a target scene corresponding to an indoor scene;
a second determining module 202, configured to determine, in the top view of the target scene, reachable pixels in the indoor scene where no object shielding exists, and determine a roaming path in each room in the indoor scene according to the reachable pixels;
A third determining module 203, configured to determine a tree structure corresponding to the indoor scene, and determine a roaming path between rooms in the indoor scene according to the tree structure, where nodes in the tree structure represent rooms in the indoor scene, and a relationship between the nodes is used to represent a communication relationship between rooms in the indoor scene;
The generating module 204 is configured to select a target camera point in the roaming path in each room and the roaming paths between rooms, and generate a user roaming path according to the target camera point.
Optionally, the first determining module 201 is configured to:
determining an initial scene top view corresponding to the target scene;
And reducing the resolution of the initial scene top view to obtain a target scene top view corresponding to the indoor scene.
Optionally, the second determining module 202 is configured to:
taking all reachable pixel points in each room in the indoor scene as nodes, and establishing edges between adjacent nodes represented by the reachable pixel points to obtain a graph structure corresponding to each room;
and selecting a target pixel point from pixel points covered by an entrance of each room, taking a node represented by the target pixel point as a starting point, taking nodes represented by all reachable pixel points in the room as end points respectively, determining shortest paths from the starting point to all the end points according to the graph structure, and selecting the longest path from all the shortest paths as a roaming path of the room.
Optionally, the third determining module 203 is configured to:
Performing hierarchical traversal from the bottommost node of the tree structure;
In each traversal process, selecting a target pixel point from pixel points covered by a room entrance corresponding to a node, taking the target pixel point as a starting point, determining a father node of the node, taking the pixel point occupied by a roaming path of a room corresponding to the father node as an end point, determining shortest paths between the starting point and all the end points, and determining the shortest path in all the shortest paths as the roaming path between the room corresponding to the node and the room corresponding to the father node.
Optionally, the generating module 204 is configured to:
Selecting at least one of the following types of position points as target camera points on the roaming path in each room and the roaming paths among the rooms: and an inflection point, a starting point, an end point and an intersection point between the roaming paths on the roaming paths.
Optionally, the apparatus 200 further includes:
The clustering module is used for clustering all reachable pixel points in each room in the indoor scene, and determining the central point of the cluster as a key position point;
The generating module 204 is configured to:
selecting at least one type of candidate location points on the roaming path in each room and the roaming paths among the rooms: an inflection point, a starting point, an end point on the roaming path, and an intersection point between the roaming paths;
And determining a target position point which enables communication between the key position points in the candidate position points, and determining the target position point and the key position point as target camera points.
Optionally, the generating module 204 is configured to:
Taking all key position points and candidate position points as candidate camera points, taking each candidate camera point as a node, and establishing edges between nodes characterized by the candidate camera points which can be communicated to obtain a target graph structure, and determining a minimum spanning tree containing target nodes according to the target graph structure under the condition that additional nodes are allowed to be added, wherein the target nodes are nodes corresponding to the key position points, and the additional nodes are nodes corresponding to target position points in the candidate position points;
And determining a target camera point position according to the position point represented by each node in the minimum spanning tree.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Based on the same inventive concept, the embodiments of the present disclosure also provide a computer-readable medium having stored thereon a computer program which, when executed by a processing device, implements the steps of any of the roaming path generating methods described above.
Based on the same inventive concept, the embodiments of the present disclosure further provide an electronic device, including:
a storage device having a computer program stored thereon;
processing means for executing the computer program in the storage means to implement the steps of any of the roaming path generating methods described above.
Referring now to fig. 3, a schematic diagram of an electronic device 300 suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 3 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 3, the electronic device 300 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 301 that may perform various suitable actions and processes in accordance with a program stored in a Read Only Memory (ROM) 302 or a program loaded from a storage means 308 into a Random Access Memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic apparatus 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
In general, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 307 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 308 including, for example, magnetic tape, hard disk, etc.; and communication means 309. The communication means 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. While fig. 3 shows an electronic device 300 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via a communication device 309, or installed from a storage device 308, or installed from a ROM 302. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing means 301.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some embodiments, communications may be made using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: determining a target scene top view corresponding to the indoor scene; in the top view of the target scene, determining reachable pixels without article shielding in the indoor scene, and determining a roaming path in each room in the indoor scene according to the reachable pixels; determining a tree structure corresponding to the indoor scene, and determining a roaming path among all rooms in the indoor scene according to the tree structure, wherein nodes in the tree structure represent the rooms in the indoor scene, and the relation among the nodes is used for representing the communication relation among all rooms in the indoor scene; and selecting a target camera point in the roaming path in each room and the roaming paths among the rooms, and generating a user roaming path according to the target camera point.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented in software or hardware. The name of a module does not in some cases define the module itself.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, example 1 provides a roaming path generating method, including:
determining a target scene top view corresponding to the indoor scene;
In the top view of the target scene, determining reachable pixels without article shielding in the indoor scene, and determining a roaming path in each room in the indoor scene according to the reachable pixels;
Determining a tree structure corresponding to the indoor scene, and determining a roaming path among all rooms in the indoor scene according to the tree structure, wherein nodes in the tree structure represent the rooms in the indoor scene, and the relation among the nodes is used for representing the communication relation among all rooms in the indoor scene;
And selecting a target camera point in the roaming path in each room and the roaming paths among the rooms, and generating a user roaming path according to the target camera point.
According to one or more embodiments of the present disclosure, example 2 provides the method of example 1, the determining a target scene top view corresponding to an indoor scene, including:
determining an initial scene top view corresponding to the target scene;
And reducing the resolution of the initial scene top view to obtain a target scene top view corresponding to the indoor scene.
Example 3 provides the method of example 1, according to one or more embodiments of the present disclosure, the determining a roaming path in each room in the indoor scene from the reachable pixels, comprising:
taking all reachable pixel points in each room in the indoor scene as nodes, and establishing edges between adjacent nodes represented by the reachable pixel points to obtain a graph structure corresponding to each room;
and selecting a target pixel point from pixel points covered by an entrance of each room, taking a node represented by the target pixel point as a starting point, taking nodes represented by all reachable pixel points in the room as end points respectively, determining shortest paths from the starting point to all the end points according to the graph structure, and selecting the longest path from all the shortest paths as a roaming path of the room.
According to one or more embodiments of the present disclosure, example 4 provides the method of any one of examples 1-3, the determining a roaming path between rooms in the indoor scenario according to the tree structure, comprising:
Performing hierarchical traversal from the bottommost node of the tree structure;
In each traversal process, selecting a target pixel point from pixel points covered by a room entrance corresponding to a node, taking the target pixel point as a starting point, determining a father node of the node, taking the pixel point occupied by a roaming path of a room corresponding to the father node as an end point, determining shortest paths between the starting point and all the end points, and determining the shortest path in all the shortest paths as the roaming path between the room corresponding to the node and the room corresponding to the father node.
According to one or more embodiments of the present disclosure, example 5 provides the method of any one of examples 1 to 3, the selecting a target camera point in the roaming path in each room and the roaming paths between rooms, including:
Selecting at least one of the following types of position points as target camera points on the roaming path in each room and the roaming paths among the rooms: and an inflection point, a starting point, an end point and an intersection point between the roaming paths on the roaming paths.
According to one or more embodiments of the present disclosure, example 6 provides the method of any one of examples 1-3, the method further comprising:
clustering all reachable pixel points in each room in the indoor scene, and determining the central point of the cluster as a key position point;
The selecting a target camera point in the roaming path in each room and the roaming paths among the rooms comprises the following steps:
selecting at least one type of candidate location points on the roaming path in each room and the roaming paths among the rooms: an inflection point, a starting point, an end point on the roaming path, and an intersection point between the roaming paths;
And determining a target position point which enables communication between the key position points in the candidate position points, and determining the target position point and the key position point as target camera points.
According to one or more embodiments of the present disclosure, example 7 provides the method of example 6, the determining a target location point among the candidate location points that enables communication between the key location points, and determining the target location point and the key location point as target camera points, comprising:
Taking all key position points and candidate position points as candidate camera points, taking each candidate camera point as a node, and establishing edges between nodes characterized by the candidate camera points which can be communicated to obtain a target graph structure, and determining a minimum spanning tree containing target nodes according to the target graph structure under the condition that additional nodes are allowed to be added, wherein the target nodes are nodes corresponding to the key position points, and the additional nodes are nodes corresponding to target position points in the candidate position points;
And determining a target camera point position according to the position point represented by each node in the minimum spanning tree.
According to one or more embodiments of the present disclosure, example 8 provides a roaming path generating apparatus, the apparatus comprising:
the first determining module is used for determining a target scene top view corresponding to the indoor scene;
The second determining module is used for determining the reachable pixels without article shielding in the indoor scene in the top view of the target scene, and determining the roaming path in each room in the indoor scene according to the reachable pixels;
the third determining module is used for determining a tree structure corresponding to the indoor scene and determining a roaming path among all rooms in the indoor scene according to the tree structure, wherein nodes in the tree structure represent the rooms in the indoor scene, and the relation among the nodes is used for representing the communication relation among all rooms in the indoor scene;
And the generation module is used for selecting a target camera point in the roaming path in each room and the roaming paths among the rooms, and generating a user roaming path according to the target camera point.
According to one or more embodiments of the present disclosure, example 9 provides a computer-readable medium having stored thereon a computer program which, when executed by a processing device, implements the steps of the method of any of examples 1-7.
In accordance with one or more embodiments of the present disclosure, example 10 provides an electronic device, comprising:
a storage device having a computer program stored thereon;
processing means for executing the computer program in the storage means to implement the steps of the method of any one of examples 1-7.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims. The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.

Claims (10)

1. A roaming path generating method, the method comprising:
determining a target scene top view corresponding to the indoor scene;
In the top view of the target scene, determining reachable pixels without article shielding in the indoor scene, and determining a roaming path in each room in the indoor scene according to the reachable pixels;
Determining a tree structure corresponding to the indoor scene, and determining a roaming path among rooms corresponding to all nodes in the tree structure according to the reachable pixel points in the top view of the target scene, wherein the nodes in the tree structure represent the rooms in the indoor scene, and the relation among the nodes is used for representing the communication relation among the rooms in the indoor scene;
And selecting a target camera point in the roaming path in each room and the roaming paths among the rooms, and generating a user roaming path according to the target camera point.
2. The method of claim 1, wherein determining a target scene top view corresponding to an indoor scene comprises:
determining an initial scene top view corresponding to the target scene;
And reducing the resolution of the initial scene top view to obtain a target scene top view corresponding to the indoor scene.
3. The method of claim 1, wherein the determining a roaming path in each room in the indoor scene from the reachable pixels comprises:
taking all reachable pixel points in each room in the indoor scene as nodes, and establishing edges between adjacent nodes represented by the reachable pixel points to obtain a graph structure corresponding to each room;
and selecting a target pixel point from pixel points covered by an entrance of each room, taking a node represented by the target pixel point as a starting point, taking nodes represented by all reachable pixel points in the room as end points respectively, determining shortest paths from the starting point to all the end points according to the graph structure, and selecting the longest path from all the shortest paths as a roaming path of the room.
4. A method according to any one of claims 1-3, wherein said determining a roaming path between rooms corresponding to nodes in the tree structure from the reachable pixels comprises:
Performing hierarchical traversal from the bottommost node of the tree structure;
In each traversal process, selecting a target pixel point from reachable pixel points covered by a room entrance corresponding to a node, taking the target pixel point as a starting point, determining a father node of the node, taking a pixel point occupied by a roaming path of a room corresponding to the father node as an end point, determining shortest paths between the starting point and all the end points, and determining the shortest paths in all the shortest paths as the roaming paths between the room corresponding to the node and the room corresponding to the father node.
5. A method according to any one of claims 1-3, wherein selecting a target camera point in the roaming path in each room and between rooms comprises:
Selecting at least one of the following types of position points as target camera points on the roaming path in each room and the roaming paths among the rooms: and an inflection point, a starting point, an end point and an intersection point between the roaming paths on the roaming paths.
6. A method according to any one of claims 1-3, wherein the method further comprises:
clustering all reachable pixel points in each room in the indoor scene, and determining the central point of the cluster as a key position point;
The selecting a target camera point in the roaming path in each room and the roaming paths among the rooms comprises the following steps:
selecting at least one type of candidate location points on the roaming path in each room and the roaming paths among the rooms: an inflection point, a starting point, an end point on the roaming path, and an intersection point between the roaming paths;
And determining a target position point which enables communication between the key position points in the candidate position points, and determining the target position point and the key position point as target camera points.
7. The method of claim 6, wherein the determining a target location point among the candidate location points that enables communication between the key location points, and determining the target location point and the key location point as target camera points, comprises:
Taking all key position points and candidate position points as candidate camera points, taking each candidate camera point as a node, and establishing edges between nodes characterized by the candidate camera points which can be communicated to obtain a target graph structure, and determining a minimum spanning tree containing target nodes according to the target graph structure under the condition that additional nodes are allowed to be added, wherein the target nodes are nodes corresponding to the key position points, and the additional nodes are nodes corresponding to target position points in the candidate position points;
And determining a target camera point position according to the position point represented by each node in the minimum spanning tree.
8. A roaming path generating apparatus, the apparatus comprising:
the first determining module is used for determining a target scene top view corresponding to the indoor scene;
The second determining module is used for determining the reachable pixels without article shielding in the indoor scene in the top view of the target scene, and determining the roaming path in each room in the indoor scene according to the reachable pixels;
A third determining module, configured to determine a tree structure corresponding to the indoor scene, and determine, in the top view of the target scene, a roaming path between rooms corresponding to each node in the tree structure according to the reachable pixel points, where the nodes in the tree structure represent rooms in the indoor scene, and a relationship between the nodes is used to represent a communication relationship between rooms in the indoor scene;
And the generation module is used for selecting a target camera point in the roaming path in each room and the roaming paths among the rooms, and generating a user roaming path according to the target camera point.
9. A computer readable medium on which a computer program is stored, characterized in that the program, when being executed by a processing device, carries out the steps of the method according to any one of claims 1-7.
10. An electronic device, comprising:
a storage device having a computer program stored thereon;
Processing means for executing said computer program in said storage means to carry out the steps of the method according to any one of claims 1-7.
CN202110587665.7A 2021-05-27 Roaming path generation method and device, storage medium and electronic equipment Active CN113205601B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110587665.7A CN113205601B (en) 2021-05-27 Roaming path generation method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110587665.7A CN113205601B (en) 2021-05-27 Roaming path generation method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN113205601A CN113205601A (en) 2021-08-03
CN113205601B true CN113205601B (en) 2024-06-21

Family

ID=

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Design of Residential Area Roaming System and Information Management Based on Virtual Reality;Xiaodan Yu等;《2008 9th International Conference on Computer-Aided Industrial Design and Conceptual Design》;363-367 *
室内环境虚拟交互式设计系统的研发与实现;高亚峰;;现代电子技术(第08期);全文 *

Similar Documents

Publication Publication Date Title
CN107273083B (en) Interaction method, device, equipment and storage medium between terminal equipment
CN110070496B (en) Method and device for generating image special effect and hardware device
CN110795196A (en) Window display method, device, terminal and storage medium
CN110413367B (en) Task creation method and device, storage medium and electronic equipment
CN111652675A (en) Display method and device and electronic equipment
WO2024061064A1 (en) Display effect processing method and apparatus, electronic device, and storage medium
CN114997117A (en) Document editing method, device, terminal and non-transitory storage medium
CN111258582B (en) Window rendering method and device, computer equipment and storage medium
CN111158881B (en) Data processing method, device, electronic equipment and computer readable storage medium
WO2023169316A1 (en) User interface framework-based processing method and apparatus, device, and medium
WO2023138468A1 (en) Virtual object generation method and apparatus, device, and storage medium
CN113205601B (en) Roaming path generation method and device, storage medium and electronic equipment
WO2020077912A1 (en) Image processing method, device, and hardware device
CN114092642B (en) Three-dimensional house type model generation method, device and equipment
CN116048371A (en) Page component switching method, device, equipment, medium and product in application program
CN113506356B (en) Method and device for drawing area map, readable medium and electronic equipment
CN113709573B (en) Method, device, equipment and storage medium for configuring video special effects
CN114419299A (en) Virtual object generation method, device, equipment and storage medium
CN110796144B (en) License plate detection method, device, equipment and storage medium
CN113205601A (en) Roaming path generation method and device, storage medium and electronic equipment
CN111200705B (en) Image processing method and device
CN113961280A (en) View display method and device, electronic equipment and computer-readable storage medium
CN112884787B (en) Image clipping method and device, readable medium and electronic equipment
CN115908143B (en) Vehicle cross-layer parking method, device, electronic equipment and computer readable medium
CN112395826B (en) Text special effect processing method and device

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant