CN105138859B - Three-dimensional panorama roams method for searching and system - Google Patents
Three-dimensional panorama roams method for searching and system Download PDFInfo
- Publication number
- CN105138859B CN105138859B CN201510640981.0A CN201510640981A CN105138859B CN 105138859 B CN105138859 B CN 105138859B CN 201510640981 A CN201510640981 A CN 201510640981A CN 105138859 B CN105138859 B CN 105138859B
- Authority
- CN
- China
- Prior art keywords
- node
- obstacle
- list
- nodes
- key
- 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.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 37
- 238000004364 calculation method Methods 0.000 claims description 8
- 230000006870 function Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 2
- 238000011156 evaluation Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000010276 construction Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明公开了一种三维全景漫游寻路方法及系统,属于路径规划技术领域,该方法包括:获取三维全景图以及与所述三维全景图中的节点相关的信息;以JSON(JavaScript Object Notation)数据交换格式描述与所述节点相关的信息的数据结构并获得无向图;根据所述数据结构和所述无向图,建立障碍物列表和关键节点列表;在所述三维全景图中的节点中设定起始节点和目标节点;利用与所述障碍物列表和所述关键节点列表相结合的A*算法计算所述起始节点与所述目标节点之间的路径。利用该寻路方法,可以在起始节点与目标节点之间存在障碍物时将路径截成两段或者多段进行寻路,显著减少遍历的节点,从而可以提高路径搜索效率。
The invention discloses a three-dimensional panoramic roaming pathfinding method and system, which belong to the technical field of path planning. The method includes: obtaining a three-dimensional panoramic image and information related to nodes in the three-dimensional panoramic image; using JSON (JavaScript Object Notation) The data exchange format describes the data structure of the information related to the node and obtains an undirected graph; according to the data structure and the undirected graph, an obstacle list and a key node list are established; nodes in the three-dimensional panorama Set a start node and a target node in ; use the A* algorithm combined with the obstacle list and the key node list to calculate the path between the start node and the target node. With this pathfinding method, when there is an obstacle between the starting node and the target node, the path can be cut into two or more sections for pathfinding, and the number of traversed nodes can be significantly reduced, thereby improving the path search efficiency.
Description
技术领域technical field
本发明涉及路径规划技术领域,具体而言,涉及一种三维全景漫游寻路方法及系统。The present invention relates to the technical field of path planning, in particular to a three-dimensional panoramic roaming pathfinding method and system.
背景技术Background technique
目前,属于虚拟现实(Virtual Reality)的重要组成部分的三维全景漫游(Panorama)技术具有广阔的市场应用前景,对智慧城市、智慧校园、展览、旅游、房地产、城市规划等领域的建设与发展有着重要的意义。当在三维全景漫游中采用现有的作为一种最短路径算法的A*(A-star)算法来进行路径导航和路径规划时,由于A*算法依赖于启发函数,如果起始节点与目标节点之间存在障碍物,则A*算法需要遍历较多的节点,导致路径搜索效率较低且消耗资源。由此可以看出,三维全景漫游中需要一种能够通过改进A*算法来在起始节点与目标节点之间存在障碍物的情况下提高路径搜索效率的三维全景漫游寻路方法。At present, the three-dimensional panorama roaming (Panorama) technology, which is an important part of virtual reality (Virtual Reality), has broad market application prospects, and has great influence on the construction and development of smart cities, smart campuses, exhibitions, tourism, real estate, urban planning and other fields. Significance. When using the existing A* (A-star) algorithm as a shortest path algorithm for path navigation and path planning in the three-dimensional panoramic roaming, since the A* algorithm depends on the heuristic function, if the starting node and the target node If there are obstacles between them, the A* algorithm needs to traverse more nodes, resulting in low path search efficiency and resource consumption. It can be seen that, in the 3D panoramic roaming, there is a need for a 3D panoramic roaming pathfinding method that can improve the path search efficiency in the case of obstacles between the starting node and the target node by improving the A* algorithm.
发明内容Contents of the invention
鉴于此,本发明的目的在于提供一种三维全景漫游寻路方法及系统,以改善利用现有A*算法的三维全景漫游在起始节点与目标节点之间存在障碍物的情况下路径搜索效率较低的问题。In view of this, the object of the present invention is to provide a three-dimensional panoramic roaming pathfinding method and system, to improve the path search efficiency in the case of obstacles between the starting node and the target node in the three-dimensional panoramic roaming using the existing A* algorithm lower question.
本发明第一实施例提供一种三维全景漫游寻路方法,包括:获取三维全景图以及与所述三维全景图中的节点相关的信息;以JSON(JavaScript Object Notation)数据交换格式描述与所述节点相关的信息的数据结构并获得无向图;根据所述数据结构和所述无向图,建立障碍物列表和关键节点列表;在所述三维全景图中的节点中设定起始节点和目标节点;利用与所述障碍物列表和所述关键节点列表相结合的A*算法计算所述起始节点与所述目标节点之间的路径。The first embodiment of the present invention provides a method for 3D panoramic roaming pathfinding, including: acquiring a 3D panorama and information related to nodes in the 3D panorama; The data structure of node-related information and obtain an undirected graph; according to the data structure and the undirected graph, establish an obstacle list and a key node list; set the starting node and the node in the three-dimensional panorama A target node: using the A* algorithm combined with the obstacle list and the key node list to calculate a path between the starting node and the target node.
本发明第二实施例提供一种三维全景漫游寻路系统,包括:获取模块,用于获取三维全景图以及与所述三维全景图中的节点相关的信息;描述模块,用于以JSON数据交换格式描述与所述节点相关的信息的数据结构并获得无向图;建立模块,用于根据所述数据结构和所述无向图,建立障碍物列表和关键节点列表;设定模块,用于在所述三维全景图中的节点中设定起始节点和目标节点;计算模块,用于利用与所述障碍物列表和所述关键节点列表相结合的A*算法计算所述起始节点与所述目标节点之间的路径。The second embodiment of the present invention provides a three-dimensional panorama roaming pathfinding system, including: an acquisition module, used to acquire a three-dimensional panorama and information related to nodes in the three-dimensional panorama; a description module, used to exchange JSON data The format describes the data structure of the information related to the nodes and obtains an undirected graph; a building module is used to create a list of obstacles and a list of key nodes according to the data structure and the undirected graph; a setting module is used to Set a starting node and a target node in the nodes in the three-dimensional panorama; a calculation module is used to calculate the starting node and the target node using the A* algorithm combined with the obstacle list and the key node list The path between the target nodes.
在本发明各实施例提供的三维全景漫游寻路方法及系统中,通过以JSON数据交换格式描述与所获取三维全景图中节点相关的信息的数据结构并获得无向图,并因此建立障碍物列表和关键节点列表,此后在三维全景图中的节点中设定好起始节点和目标节点的情况下利用与所建立的障碍物列表和关键节点列表相结合的A*算法计算所设定的起始节点与目标节点之间的路径。相对于在三维全景漫游中采用现有的A*算法进行路径导航和路径规划,由于在发明中预先建立障碍物列表和关键节点列表,并在此基础上结合A*算法,所以可以在起始节点与目标节点之间存在障碍物时将路径截成两段或者多段进行寻路,显著减少遍历的节点,从而可以提高路径搜索效率。In the 3D panorama roaming pathfinding method and system provided by each embodiment of the present invention, the undirected graph is obtained by describing the data structure of the information related to the nodes in the acquired 3D panorama in the JSON data exchange format, and thus establishing obstacles list and key node list, then use the A* algorithm combined with the established obstacle list and key node list to calculate the set The path between the start node and the destination node. Compared with using the existing A* algorithm for path navigation and path planning in the three-dimensional panoramic roaming, since the obstacle list and the key node list are pre-established in the invention, and the A* algorithm is combined on this basis, it can be used at the beginning When there is an obstacle between the node and the target node, the path is cut into two or more sections for pathfinding, which significantly reduces the number of traversed nodes, thereby improving the efficiency of path search.
为使本发明的上述和其他目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附图式,作详细说明如下。In order to make the above and other objects, features and advantages of the present invention more comprehensible, preferred embodiments will be described in detail below together with the accompanying drawings.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。通过附图所示,本发明的上述及其它目的、特征和优势将更加清晰。在全部附图中相同的附图标记指示相同的部分。并未刻意按实际尺寸等比例缩放绘制附图,重点在于示出本发明的主旨。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required in the embodiments. Obviously, the accompanying drawings in the following description are only some of the present invention. Embodiments, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort. The above and other objects, features and advantages of the present invention will be more clearly illustrated by the accompanying drawings. Like reference numerals designate like parts throughout the drawings. The drawings are not intentionally scaled according to the actual size, and the emphasis is on illustrating the gist of the present invention.
图1为本发明第一实施例提供的三维全景漫游寻路方法的流程图;FIG. 1 is a flowchart of a three-dimensional panoramic roaming pathfinding method provided by the first embodiment of the present invention;
图2为本发明第一实施例提供的三维全景漫游寻路方法中的具体寻路算法的流程图;2 is a flowchart of a specific pathfinding algorithm in the three-dimensional panoramic roaming pathfinding method provided by the first embodiment of the present invention;
图3为本发明第二实施例提供的三维全景漫游寻路系统的结构示意图。FIG. 3 is a schematic structural diagram of a three-dimensional panoramic roaming pathfinding system provided by a second embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整的描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
在进行具体实施例的描述之前,先简要描述三维全景漫游寻路中需要使用的一些函数。在进行路径搜索时,需要使用由以下公式(1)表示的估价函数:Before describing specific embodiments, some functions that need to be used in 3D panoramic roaming pathfinding are briefly described. When performing path search, an evaluation function represented by the following formula (1) needs to be used:
f(m)=g(m)+h(m) (1)f(m)=g(m)+h(m) (1)
其中,m表示当前节点,g(m)表示起始节点与当前节点的实际距离,h(m)表示当前节点m与目标节点的最短路径(忽略障碍物),f(m)表示当前节点m的估价函数。Among them, m represents the current node, g(m) represents the actual distance between the starting node and the current node, h(m) represents the shortest path between the current node m and the target node (ignoring obstacles), f(m) represents the current node m evaluation function.
通常可以采用曼哈顿距离来计算当前节点m与目标节点end之间的实际距离。曼哈顿距离计算由以下公式(2)表示:Usually, the Manhattan distance can be used to calculate the actual distance between the current node m and the target node end. The Manhattan distance calculation is expressed by the following formula (2):
h(m)=l×(|mx-endx|+|my-endy|) (2)h(m)=l×(|mx-endx|+|my-endy|) (2)
其中,l表示移动权值,mx、my、endx、endy分别表示当前节点m与目标节点end的平面横坐标和纵坐标。Among them, l represents the moving weight, mx, my, endx, endy respectively represent the plane abscissa and ordinate of the current node m and the target node end.
还可以采用两点间距离公式来计算当前节点m与目标节点end之间的实际距离。在平面坐标的情况下,可以采用由以下公式(3)表示的距离长度公式:The actual distance between the current node m and the target node end can also be calculated by using the distance formula between two points. In the case of plane coordinates, a distance length formula represented by the following formula (3) can be employed:
其中,mx、my、endx、endy分别表示当前节点m与目标节点end的横坐标和纵坐标。Among them, mx, my, endx, and endy represent the abscissa and ordinate of the current node m and the target node end respectively.
在空间坐标的情况下,可以采用由以下公式(4)表示的距离长度公式:In the case of spatial coordinates, a distance length formula represented by the following formula (4) may be employed:
其中,mx、my、mz、endx、endy、endz分别表示当前节点m与目标节点end的三维坐标。Among them, mx, my, mz, endx, endy, and endz represent the three-dimensional coordinates of the current node m and the target node end respectively.
此外,如果地图较大,还可以选择使用地球两点距离公式,其包括由以下公式(5)表示的Great-circle distance公式和由以下公式(6)表示的Haversine公式:In addition, if the map is large, you can also choose to use the distance formula between two points on the earth, which includes the Great-circle distance formula represented by the following formula (5) and the Haversine formula represented by the following formula (6):
其中,R为地球半径,θm和θend分别表示当前节点m与目标节点end的纬度,和分别表示当前节点m与目标节点end的经度。Among them, R is the radius of the earth, θ m and θ end represent the latitudes of the current node m and the target node end respectively, with Respectively represent the longitude of the current node m and the target node end.
在本发明各实施例提供的三维全景漫游寻路方法及系统中,通过以JSON数据交换格式描述与所获取三维全景图中节点相关的信息的数据结构并获得无向图,并因此建立障碍物列表和关键节点列表,此后在三维全景图中的节点中设定好起始节点和目标节点的情况下利用与所建立的障碍物列表和关键节点列表相结合的A*算法计算所设定的起始节点与目标节点之间的路径。相对于在三维全景漫游中采用现有的A*算法进行路径导航和路径规划,由于在发明中预先建立障碍物列表和关键节点列表,并在此基础上结合A*算法,所以可以在起始节点与目标节点之间存在障碍物时将路径截成两段或者多段进行寻路,显著减少遍历的节点,从而可以提高路径搜索效率。In the 3D panorama roaming pathfinding method and system provided by each embodiment of the present invention, the undirected graph is obtained by describing the data structure of the information related to the nodes in the acquired 3D panorama in the JSON data exchange format, and thus establishing obstacles list and key node list, then use the A* algorithm combined with the established obstacle list and key node list to calculate the set The path between the start node and the destination node. Compared with using the existing A* algorithm for path navigation and path planning in the three-dimensional panoramic roaming, since the obstacle list and the key node list are pre-established in the invention, and the A* algorithm is combined on this basis, it can be used at the beginning When there is an obstacle between the node and the target node, the path is cut into two or more sections for pathfinding, which significantly reduces the number of traversed nodes, thereby improving the efficiency of path search.
第一实施例first embodiment
图1为本发明第一实施例提供的三维全景漫游寻路方法的流程图。请参阅图1,本发明第一实施例提供的三维全景漫游寻路方法可以包括以下步骤S11至步骤S15。FIG. 1 is a flow chart of a method for finding a path for a three-dimensional panoramic roaming provided by the first embodiment of the present invention. Please refer to FIG. 1 , the 3D panoramic roaming pathfinding method provided by the first embodiment of the present invention may include the following steps S11 to S15.
在步骤S11中,获取三维全景图以及与所述三维全景图中的节点相关的信息。In step S11, a 3D panorama and information related to nodes in the 3D panorama are acquired.
具体地,可以通过使用相机对一个场景的各个节点进行360°环视拍摄以获得各个节点的图片素材,然后通过筛选、匹配、拼接、融合和渲染等来生成全景贴图,并基于所生成的全景贴图来生成三维全景图。此外,还应记录与所述三维全景图中的节点相关的信息,其中与所述节点相关的信息可以包括所述节点的经度和纬度坐标、位置名称以及与其他节点的关联性等。Specifically, a camera can be used to take a 360° look-around shot of each node of a scene to obtain the image material of each node, and then generate a panoramic texture by filtering, matching, splicing, fusion and rendering, etc., and based on the generated panoramic texture to generate 3D panoramas. In addition, information related to the nodes in the 3D panorama should also be recorded, where the information related to the nodes may include the longitude and latitude coordinates of the nodes, location names, and associations with other nodes.
在步骤S12中,以JSON数据交换格式描述与所述节点相关的信息的数据结构并获得无向图。In step S12, the data structure of the information related to the nodes is described in JSON data exchange format and an undirected graph is obtained.
JSON数据交换格式由键值对(key-value)和数组构成,采用JSON数据交换格式可以提高与所述节点相关的信息的可读性并且可以减小复杂性。无向图可以表示每个对象的节点和边。所述数据结构可以包括所述节点的唯一标识、标题、全景贴图路径、是否能够自由旋转、自由旋转速度、信息提示框、纬度、经度、是否为障碍节点、是否为关键节点以及能够跳转至的其他节点等。例如,以下示出以JSON数据交换格式描述的与所述节点相关的信息的一种示例性数据结构。The JSON data exchange format is composed of a key-value pair (key-value) and an array, and adopting the JSON data exchange format can improve readability of information related to the nodes and can reduce complexity. An undirected graph can represent nodes and edges for each object. The data structure may include the node's unique identifier, title, panorama texture path, whether it can rotate freely, free rotation speed, information prompt box, latitude, longitude, whether it is an obstacle node, whether it is a key node, and whether it can jump to other nodes etc. For example, an exemplary data structure of information related to the nodes described in the JSON data exchange format is shown below.
需要注意的是,在提供的上述示例性数据结构中,并未给出每个节点的value,而仅示出每个节点的key。It should be noted that, in the above exemplary data structure provided, the value of each node is not given, but only the key of each node is shown.
在步骤S13中,根据所述数据结构和所述无向图,建立障碍物列表和关键节点列表。In step S13, an obstacle list and a key node list are established according to the data structure and the undirected graph.
所建立的障碍物列表中的障碍物由相邻的障碍节点形成,所建立的关键节点列表中的关键节点与形成所述障碍物的端部障碍节点相关联。Obstacles in the established obstacle list are formed by adjacent obstacle nodes, and key nodes in the established key node list are associated with end obstacle nodes forming the obstacle.
在步骤S14中,在所述三维全景图中的节点中设定起始节点start和目标节点end。In step S14, a start node start and a target node end are set among the nodes in the three-dimensional panorama.
当用户期望在所呈现的三维全景图中漫游时,可以随自己喜好将所述三维全景图中的节点中的两个节点分别设定为起始节点和目标节点。When the user desires to roam in the presented 3D panorama, two nodes among the nodes in the 3D panorama can be set as the start node and the target node respectively according to his preference.
在步骤S15中,利用与所述障碍物列表和所述关键节点列表相结合的A*算法计算所述起始节点start与所述目标节点end之间的路径。In step S15, the path between the starting node start and the target node end is calculated by using the A* algorithm combined with the obstacle list and the key node list.
具体地,图2中示出了利用与所述障碍物列表和所述关键节点列表相结合的A*算法计算所述起始节点与所述目标节点之间的路径的一种具体流程图。下文中将与障碍物列表和关键节点列表相结合的A*星算法称为HRPA*算法(HRPA*,High-efficiency RoutePlanning A*algorithm)。请参阅图2,利用HRPA*算法计算起始节点与目标节点之间的路径可以包括以下步骤S21至步骤S34。Specifically, FIG. 2 shows a specific flowchart for calculating a path between the starting node and the target node by using the A* algorithm combined with the obstacle list and the key node list. Hereinafter, the A* star algorithm combined with the obstacle list and the key node list is called HRPA* algorithm (HRPA*, High-efficiency Route Planning A* algorithm). Referring to FIG. 2 , calculating the path between the starting node and the target node using the HRPA* algorithm may include the following steps S21 to S34.
在步骤S21中,初始化开放(OPEN)列表和关闭(CLOSED)列表。OPEN列表用于保存所有已经生成但是还未进行评估的节点,CLOSED列表用于保存所有到当前待评估节点为止的所有已经被评估过的距离目标节点路径长度最短的节点集合。OPEN列表和CLOSED列表在算法结束前不断发生变化。OPEN列表和CLOSED列表的初始列表长度均为0。In step S21, an open (OPEN) list and a closed (CLOSED) list are initialized. The OPEN list is used to save all the nodes that have been generated but not yet evaluated, and the CLOSED list is used to save all the nodes that have been evaluated and have the shortest path length from the target node to the current node to be evaluated. The OPEN list and CLOSED list are constantly changing until the end of the algorithm. The initial list length of both the OPEN list and the CLOSED list is 0.
在步骤S22中,将所述起始节点start加入所述OPEN列表中,之后执行步骤S23。在步骤S23中,判断所述障碍物列表中是否存在与由所述起始节点start和所述目标节点end限定的线段相交的障碍物,当判断得出所述障碍物列表中存在与由所述起始节点start和所述目标节点end限定的线段相交的第一障碍物时,执行步骤S24,否则执行步骤S31。于一种具体实施方式中,所述判断所述障碍物列表中是否存在与由起始节点start和所述目标节点end限定的线段相交的障碍物,可以包括:计算由所述障碍物列表中每个障碍物的两端端点限定的线段与由起始节点start和所述目标节点end限定的线段的叉乘乘积,如果所述叉乘乘积为非零值,则判定所述障碍物与由起始节点start和所述目标节点end限定的线段相交,否则判定所述障碍物不与由所述起始节点start和所述目标节点end限定的线段相交。In step S22, the start node start is added to the OPEN list, and then step S23 is executed. In step S23, it is judged whether there is an obstacle intersecting the line segment defined by the start node start and the target node end in the obstacle list, If it is the first obstacle intersected by the line segment defined by the start node start and the target node end, execute step S24, otherwise execute step S31. In a specific implementation manner, the judging whether there is an obstacle intersecting the line segment defined by the starting node start and the target node end in the obstacle list may include: calculating The cross product product of the line segment defined by the two end points of each obstacle and the line segment defined by the start node start and the target node end, if the cross product product is non-zero, then it is determined that the obstacle and the line segment defined by The line segment defined by the start node start and the target node end intersects, otherwise it is determined that the obstacle does not intersect the line segment defined by the start node start and the target node end.
在步骤S24中,获取每个所述第一障碍物的两端障碍节点temp1和temp2,其中temp1的坐标可以被记为temp1_x和temp1_y,temp2的坐标可以被记为temp2_x和temp2_y,之后执行步骤S25。In step S24, the obstacle nodes temp1 and temp2 at both ends of each first obstacle are obtained, wherein the coordinates of temp1 can be recorded as temp1_x and temp1_y, and the coordinates of temp2 can be recorded as temp2_x and temp2_y, and then step S25 is performed .
在步骤S25中,针对每个所述第一障碍物查找所述关键节点列表中是否存在与该第一障碍物两端的端部障碍节点temp1和temp2相关联的关键节点,如果查找到与所述第一障碍物两端的端部障碍节点temp1和temp2相关联的关键节点时,则执行步骤S27,否则执行步骤S26。In step S25, for each of the first obstacles, it is searched whether there are key nodes associated with the end obstacle nodes temp1 and temp2 at both ends of the first obstacle in the list of key nodes, if found If the end obstacle nodes at both ends of the first obstacle are key nodes associated with temp1 and temp2, then step S27 is executed; otherwise, step S26 is executed.
在步骤S26中,获取分别与所述第一障碍物两端的端部障碍节点temp1和temp2相邻的第一非障碍节点和第二非障碍节点,并选取所述第一非障碍节点和第二非障碍节点中与所述起始节点start和所述目标节点end二者的距离(利用上述公式(1)中计算)最近的一个非障碍节点作为临时目标节点end’,之后执行步骤S28。In step S26, the first non-obstacle node and the second non-obstacle node adjacent to the end obstacle nodes temp1 and temp2 at both ends of the first obstacle are obtained, and the first non-obstacle node and the second non-obstacle node are selected. Among the non-obstacle nodes, the non-obstacle node whose distance (calculated by the above formula (1)) is closest to both the start node start and the target node end is used as the temporary target node end', and then step S28 is executed.
在步骤S27中,针对每个所述第一障碍物选取所述关键节点中与该第一障碍物的障碍节点temp1的距离(利用上述公式(2)-(6)中一者计算)最近的一个关键节点作为第一关键节点temp1_key并选取所述关键节点中与该第一障碍物的障碍节点temp2的距离(利用上述公式(2)-(6)中一者计算)最近的一个关键节点作为第二关键节点temp2_key,然后选取所述第一关键节点temp1_key和所述第二关键节点temp2_key中与所述起始节点start和所述目标节点end二者的距离(利用上述公式(1)中计算)最近的一个关键节点作为临时目标节点end’,之后执行步骤S28。In step S27, for each of the first obstacles, select the one with the shortest distance (calculated using one of the above formulas (2)-(6)) to the obstacle node temp1 of the first obstacle among the key nodes A key node is used as the first key node temp1_key and the distance (using one of the above formulas (2)-(6) to calculate) the nearest key node to the obstacle node temp2 of the first obstacle in the key nodes is selected as The second key node temp2_key, then select the distance between the first key node temp1_key and the second key node temp2_key with the start node start and the target node end (using the above formula (1) to calculate ) the nearest key node as the temporary target node end', and then execute step S28.
在步骤S28中,获取所述起始节点start的所有相邻节点并将所述相邻节点加入所述OPEN列表中,之后执行步骤S29。在步骤S29中,计算获得所述相邻节点中与所述临时目标节点end’的距离(利用上述公式(2)-(6)中一者计算)最近的一个相邻节点,将所述起始节点start加入所述CLOSED列表中同时从所述OPEN列表中删除所述起始节点start,并将所述一个相邻节点设定为新的起始节点start,之后执行步骤S30。In step S28, all adjacent nodes of the starting node start are acquired and added to the OPEN list, and then step S29 is executed. In step S29, calculate and obtain the adjacent node with the closest distance (using one of the above formulas (2)-(6)) to the temporary target node end' in the adjacent nodes, and the starting The start node start is added to the CLOSED list while the start node start is deleted from the OPEN list, and the one adjacent node is set as a new start node start, and then step S30 is executed.
在步骤S30中,判断是否将所述临时目标节点end’设定为所述新的起始节点start(即判断当前节点是否与所述临时目标节点end’重合),如果所述临时目标节点end’未被设定为所述新的起始节点start,则返回执行步骤S28,否则返回执行步骤S22。In step S30, it is judged whether to set the temporary target node end' as the new starting node start (that is, to judge whether the current node coincides with the temporary target node end'), if the temporary target node end 'is not set as the new starting node start, return to step S28, otherwise return to step S22.
在步骤S31中,获取所述起始节点start的所有相邻节点并将所述相邻节点加入所述OPEN列表中,之后执行步骤S32。在步骤S32中,计算获得所述相邻节点中与所述目标节点end的距离(利用上述公式(2)-(6)中一者计算)最近的一个相邻节点,将所述起始节点start加入所述CLOSED列表中同时从所述OPEN列表中删除所述起始节点start,并将所述一个相邻节点设定为新的起始节点,之后执行步骤S33。在步骤S33中,判断所述新的起始节点start是否与所述目标节点end重合,如果是,则执行骤S34,否则返回执行步骤S31。在步骤S34中,将所述目标节点end加入所述CLOSED列表中,并通过所述关闭列表中的所有节点来绘制所设定的起始节点与目标节点之间的路径。In step S31, all adjacent nodes of the starting node start are acquired and added to the OPEN list, and then step S32 is executed. In step S32, calculate and obtain the nearest adjacent node with the distance (using one of the above formulas (2)-(6)) from the target node end among the adjacent nodes, and the starting node start is added to the CLOSED list, and at the same time, the start node start is deleted from the OPEN list, and the one adjacent node is set as a new start node, and then step S33 is executed. In step S33, it is judged whether the new start node start coincides with the target node end, if yes, execute step S34, otherwise return to execute step S31. In step S34, add the target node end into the CLOSED list, and draw the set path between the starting node and the target node through all the nodes in the closed list.
在本发明实施例中,采用最小二叉堆维护OPEN列表,因此可以方便地进行插入节点、删除节点、排序、取出最小节点等操作,从而可以提高遍历OPEN列表中的节点的效率。In the embodiment of the present invention, the minimum binary heap is used to maintain the OPEN list, so operations such as inserting nodes, deleting nodes, sorting, and taking out the smallest node can be conveniently performed, thereby improving the efficiency of traversing nodes in the OPEN list.
于一种具体实施方式中,在利用HRPA*算法计算起始节点start与目标节点end之间的路径之前,先判断所设定的起始节点start与目标节点end是否重合,并且仅在判断出所设定的起始节点start与目标节点end不重合时才利用HRPA*算法计算所设定的起始节点start与目标节点end之间的路径。此外,在通过CLOSED列表中的所有节点绘制所设定的起始节点与目标节点之间的路径之后,可以清空OPEN列表和CLOSED列表,以备下次计算使用。In a specific implementation manner, before using the HRPA* algorithm to calculate the path between the starting node start and the target node end, it is first judged whether the set starting node start and the target node end overlap, and only after judging the When the set start node start and the target node end do not coincide, the HRPA* algorithm is used to calculate the path between the set start node start and the target node end. In addition, after drawing the set path between the starting node and the target node through all the nodes in the CLOSED list, the OPEN list and the CLOSED list can be cleared for the next calculation.
在本发明实施例提供的三维全景漫游寻路方法中,通过以JSON数据交换格式描述与所获取三维全景图中节点相关的信息的数据结构并获得无向图,并因此建立障碍物列表和关键节点列表,此后在三维全景图中的节点中设定好起始节点和目标节点的情况下利用与所建立的障碍物列表和关键节点列表相结合的A*算法即HRPA*算法计算所设定的起始节点与目标节点之间的路径。相对于在三维全景漫游中采用现有的A*算法进行路径导航和路径规划,由于在发明中预先建立障碍物列表和关键节点列表,并使用以此为基础的HRPA*算法,所以可以在起始节点与目标节点之间存在障碍物时将路径截成两段或者多段进行寻路,显著减少遍历的节点,从而可以提高路径搜索效率。In the 3D panoramic roaming pathfinding method provided by the embodiment of the present invention, the data structure of the information related to the nodes in the obtained 3D panoramic image is described in the JSON data exchange format and an undirected graph is obtained, and the obstacle list and key Node list, after that, in the case of setting the start node and target node in the nodes in the three-dimensional panorama, use the A* algorithm combined with the established obstacle list and key node list, that is, the HRPA* algorithm to calculate the set The path between the start node and the destination node of . Compared with using the existing A* algorithm for path navigation and path planning in the three-dimensional panoramic roaming, since the obstacle list and the key node list are pre-established in the invention, and the HRPA* algorithm based on this is used, it can be used at the beginning When there is an obstacle between the start node and the target node, the path is cut into two or more sections for pathfinding, which significantly reduces the number of traversed nodes, thereby improving the efficiency of path search.
第二实施例second embodiment
图3为本发明第二实施例提供的三维全景漫游寻路系统的结构示意图。请参阅图3,本发明第二实施例提供的三维全景漫游寻路系统200可以包括获取模块210、描述模块220、建立模块230、设定模块240以及计算模块250。FIG. 3 is a schematic structural diagram of a three-dimensional panoramic roaming pathfinding system provided by a second embodiment of the present invention. Referring to FIG. 3 , the 3D panoramic roaming pathfinding system 200 provided by the second embodiment of the present invention may include an acquisition module 210 , a description module 220 , an establishment module 230 , a setting module 240 and a calculation module 250 .
获取模块210用于获取三维全景图以及与所述三维全景图中的节点相关的信息。The acquisition module 210 is used to acquire the 3D panorama and information related to the nodes in the 3D panorama.
描述模块220用于以JSON数据交换格式描述与所述节点相关的信息的数据结构并获得无向图。The description module 220 is used for describing the data structure of the information related to the nodes in JSON data exchange format and obtaining the undirected graph.
建立模块230用于根据所述数据结构和所述无向图,建立障碍物列表和关键节点列表。The building module 230 is used for building an obstacle list and a key node list according to the data structure and the undirected graph.
设定模块240用于在所述三维全景图中的节点中设定起始节点和目标节点。The setting module 240 is used for setting a start node and a target node among the nodes in the 3D panorama.
计算模块250用于利用与所述障碍物列表和所述关键节点列表相结合的A*算法即本发明实施例中的HPRA*算法计算所述起始节点与所述目标节点之间的路径。The calculation module 250 is used to calculate the path between the starting node and the target node by using the A* algorithm combined with the obstacle list and the key node list, that is, the HPRA* algorithm in the embodiment of the present invention.
以上各模块可以是由软件代码实现,此外,以上各模块同样可以由硬件例如集成电路芯片实现。Each of the above modules may be implemented by software codes. In addition, each of the above modules may also be implemented by hardware such as an integrated circuit chip.
本实施例对三维全景漫游寻路系统200的各功能模块实现各自功能的具体过程,请参见上述图1至图2所示实施例中描述的具体内容,此处不再赘述。For the specific process of realizing the respective functions of each functional module of the three-dimensional panoramic roaming pathfinding system 200 in this embodiment, please refer to the specific content described in the embodiment shown in FIGS.
需要说明的是,本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。对于装置类实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. For the same and similar parts in each embodiment, refer to each other, that is, Can. For the device-type embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for related parts, please refer to part of the description of the method embodiments.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, in this document, the term "comprising", "comprising" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional same elements in the process, method, article or apparatus comprising said element.
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps for implementing the above embodiments can be completed by hardware, and can also be completed by instructing related hardware through a program. The program can be stored in a computer-readable storage medium. The above-mentioned The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, and the like.
以上所述,仅是本发明的较佳实施例而已,并非对本发明作任何形式上的限制,虽然本发明已以较佳实施例揭露如上,然而并非用以限定本发明,任何熟悉本专业的技术人员,在不脱离本发明技术方案范围内,当可利用上述揭示的技术内容做出些许更动或修饰为等同变化的等效实施例,但凡是未脱离本发明技术方案内容,依据本发明的技术实质对以上实施例所作的任何简单修改、等同变化与修饰,均仍属于本发明技术方案的范围内。The above description is only a preferred embodiment of the present invention, and does not limit the present invention in any form. Although the present invention has been disclosed as above with preferred embodiments, it is not intended to limit the present invention. Anyone familiar with this field Those skilled in the art, without departing from the scope of the technical solution of the present invention, may use the technical content disclosed above to make some changes or modify equivalent embodiments with equivalent changes, but as long as they do not depart from the technical solution of the present invention, according to the technical content of the present invention Any simple modifications, equivalent changes and modifications made to the above embodiments by the technical essence still belong to the scope of the technical solutions of the present invention.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510640981.0A CN105138859B (en) | 2015-09-30 | 2015-09-30 | Three-dimensional panorama roams method for searching and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510640981.0A CN105138859B (en) | 2015-09-30 | 2015-09-30 | Three-dimensional panorama roams method for searching and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105138859A CN105138859A (en) | 2015-12-09 |
CN105138859B true CN105138859B (en) | 2018-02-16 |
Family
ID=54724204
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510640981.0A Expired - Fee Related CN105138859B (en) | 2015-09-30 | 2015-09-30 | Three-dimensional panorama roams method for searching and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105138859B (en) |
Families Citing this family (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105652876A (en) * | 2016-03-29 | 2016-06-08 | 北京工业大学 | Mobile robot indoor route planning method based on array map |
CN105841704B (en) * | 2016-04-13 | 2019-01-18 | 京信通信系统(中国)有限公司 | A kind of determination method and device of movement routine |
US20180181676A1 (en) * | 2016-12-22 | 2018-06-28 | Google Inc. | Nodes in directed acyclic graph |
CN107687859A (en) * | 2017-09-06 | 2018-02-13 | 电子科技大学 | Most short method for searching based on A star algorithms |
CN107952243B (en) * | 2017-11-29 | 2020-08-04 | 杭州电魂网络科技股份有限公司 | Path determining method and device |
CN109011575B (en) * | 2018-07-04 | 2019-07-02 | 苏州玩友时代科技股份有限公司 | A kind of automatic method for searching, device and equipment |
CN110487295A (en) * | 2019-09-06 | 2019-11-22 | 中国计量大学 | A kind of time-optimized smooth A* algorithm |
CN110544045B (en) * | 2019-09-10 | 2022-04-22 | 浙江中控技术股份有限公司 | Production flow chart drawing method and device |
CN111062875B (en) * | 2019-12-19 | 2021-11-12 | 广州启量信息科技有限公司 | Coordinate conversion method and device for air panoramic roaming data |
CN113368499B (en) * | 2020-03-09 | 2022-09-06 | 柏项网络科技(上海)有限公司 | Path finding method and device and computer readable storage medium |
CN113543280A (en) * | 2021-05-27 | 2021-10-22 | 新华三技术有限公司成都分公司 | Neighbor relation discovery method and device, electronic equipment and storage medium |
CN114037816B (en) * | 2021-11-01 | 2025-05-23 | 南京脑科医院 | A three-dimensional scene video generation method, system, device and medium |
CN117234205A (en) * | 2023-09-01 | 2023-12-15 | 上海鲸鱼机器人科技有限公司 | Mobile path planning method, system, equipment and medium for mobile robot |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101241507A (en) * | 2008-01-17 | 2008-08-13 | 腾讯科技(深圳)有限公司 | Map road-seeking method and system |
CN104457775A (en) * | 2014-12-12 | 2015-03-25 | 北京航天宏图信息技术有限责任公司 | Path determination method and device, and navigation instrument |
-
2015
- 2015-09-30 CN CN201510640981.0A patent/CN105138859B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101241507A (en) * | 2008-01-17 | 2008-08-13 | 腾讯科技(深圳)有限公司 | Map road-seeking method and system |
CN104457775A (en) * | 2014-12-12 | 2015-03-25 | 北京航天宏图信息技术有限责任公司 | Path determination method and device, and navigation instrument |
Non-Patent Citations (2)
Title |
---|
GIS导航系统的最短路径选择算法的研究;李双梁;《中国优秀硕士学位论文全文数据库 信息科技辑》;20130315(第03期);第3、11-12、20-21、24-26页 * |
Improved decremental algorithms for maintaining transitive closure and all-pairs shortest paths;Stirender Baswana et al.;《Journal of Algorithms》;20071231;第62卷(第2期);第74-92页 * |
Also Published As
Publication number | Publication date |
---|---|
CN105138859A (en) | 2015-12-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105138859B (en) | Three-dimensional panorama roams method for searching and system | |
US9880019B2 (en) | Generation of intersection information by a mapping service | |
US8935096B2 (en) | Apparatus for fast path search by learning heuristic function and method thereof | |
CN104266656B (en) | For the method for searching shortest route and device of road network | |
CN100514332C (en) | Method for annotating electronic map through photograph collection having position information | |
CN109478184B (en) | Identifying, processing, and displaying clusters of data points | |
AU2015332046B2 (en) | Street-level guidance via route path | |
CN112989220B (en) | A motion trajectory processing method, medium, device and equipment | |
US9053555B1 (en) | Creating a mesh from a sparse structure-from-motion point cloud using co-visibility of points | |
CN109974725A (en) | A kind of road network topology construction method, guidance path calculation method and device | |
CN103927934A (en) | Closed fence drawing method and system | |
US10288437B2 (en) | Routing with data version stitching | |
US9201974B2 (en) | Method and apparatus for incorporating media elements from content items in location-based viewing | |
US20150155009A1 (en) | Method and apparatus for media capture device position estimate- assisted splicing of media | |
CN110442659B (en) | A kind of area division method and apparatus | |
EP2815385A1 (en) | Method and apparatus for generating panoramic maps with elements of subtle movement | |
CN109459048A (en) | Map loading method and equipment for robot | |
CN114322994A (en) | A method and device for multi-point cloud map fusion based on offline global optimization | |
CN103900596A (en) | Method and device for planning navigation path based on road sections | |
CN108549649A (en) | It is a kind of that method and system is recommended based on the rural tourism of seasonal characteristic and position feature | |
CN117707170A (en) | A global path planning method for unmanned transport vehicles in underground mines | |
CN114046798B (en) | A route planning method, device and storage medium for assisting city exploration | |
Zheng et al. | A PostGIS-based pedestrian way finding module using OpenStreetMap data | |
Wang et al. | A system of automatic generation of landmark-based pedestrian navigation instructions and its effectiveness for wayfinding | |
Pendleton | The world according to Bing |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20180216 Termination date: 20200930 |