A path planning method and system based on terrain recognition
By constructing a directed graph and using terrain recognition technology, processing paths in segments, eliminating abnormal segments, and screening out paths that meet time thresholds, the problem of inaccurate path planning caused by the failure to consider terrain factors in existing technologies is solved, and more accurate path planning is achieved.
Patent Information
- Application Number
- CN202511105734.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-08
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2045-08-08
AI Technical Summary
Existing path planning methods do not fully consider terrain factors, resulting in inaccurate path planning, especially in areas with large variations in slope and terrain types.
By obtaining the starting and ending points of the path, a directed graph is constructed. Combined with terrain distribution information and image data, the path is segmented, the travel time is calculated, abnormal segments are eliminated, and paths with travel time less than the preset threshold are screened out.
The accuracy of path planning is improved, ensuring that the path planning method takes factors such as slope and contour lines into account, narrowing the range of path selection and improving the rationality and feasibility of path planning.
Smart Images

Figure CN120593779B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of path planning, and in particular to a path planning method and system based on terrain recognition. Background Art
[0002] Path planning is a crucial technology in fields such as intelligent transportation, robotic navigation, and drone flight. Its rationality directly impacts mission efficiency and safety. For ground transportation, travel time is significantly affected by terrain. Factors such as slope, surface roughness, and humidity directly impact the reliability of path planning.
[0003] Currently, mainstream path planning methods mainly rely on users setting waypoints and then calculating the route with the shortest time or the shortest distance when the starting and ending points of the route are known. Alternatively, the route passing through charging stations is automatically planned based on the vehicle's power level, with less consideration given to terrain factors such as slope. Therefore, the path planning methods currently available on the market are not accurate enough. Summary of the Invention
[0004] The present invention provides a path planning method and system based on terrain recognition to solve the technical problem of how to improve the accuracy of the path planning method.
[0005] In order to solve the above technical problems, the present invention provides a path planning method based on terrain recognition, comprising:
[0006] Obtaining a path starting point and a path end point; wherein the path starting point and the path end point are both within the target area;
[0007] Obtaining waypoint setting information and parsing the waypoint setting information to obtain a plurality of waypoints; constructing a directed graph using the path starting point, the waypoints, and the path end point as nodes, and determining a plurality of initial driving paths based on directed vectors of the directed graph;
[0008] obtaining terrain distribution information and image data of the target area, analyzing the image data based on the terrain distribution information to determine the distribution of multiple terrain types in the target area; and segmenting the initial driving path according to the distribution of the multiple terrain types to obtain multiple path segments, wherein each path segment corresponds to a terrain type;
[0009] Calculating the travel time of each initial driving path based on the length, direction, and attribute values corresponding to the terrain type of the path segments;
[0010] Acquiring contour line information of the target area, analyzing each path segment using the contour line information to obtain slope information of each path segment; analyzing the continuity of the contour lines based on the contour line information, and determining abnormal segments based on the continuity and the slope information;
[0011] Abnormal segments in the path segmentation are eliminated to obtain elimination results; based on the elimination results, initial driving paths whose travel time is less than a preset time threshold are screened out to obtain screening results; and while retaining at least one waypoint, the initial driving paths in the screening results are re-planned according to the path starting point and the path end point to determine at least one target path.
[0012] As a preferred solution, the terrain distribution information includes altitude distribution and mountain slope information; and analyzing the image data according to the terrain distribution information to determine the distribution of multiple terrain types in the target area includes:
[0013] Segmenting the image data to obtain a mountain image;
[0014] Converting the mountain image into a grayscale image, and identifying the grayscale image using a corner detection algorithm to obtain a number of corner points; the types of corner points include mountain top corner points, valley corner points, and mountain foot corner points;
[0015] Use the preset coordinate transformation matrix to obtain the coordinates of each corner point in the world coordinate system;
[0016] Fitting is performed based on the coordinates of each corner point in the world coordinate system to obtain a ridge curve; and then combining the ridge curve and each corner point to obtain mountain profile information;
[0017] Obtaining a three-dimensional model of the mountain based on the mountain profile information and the mountain inclination information;
[0018] Performing image recognition on the image data to obtain boundary lines of multiple terrain types; superimposing the boundary lines of multiple terrain types on the mountain stereo model to obtain a three-dimensional distribution of multiple terrain types in the target area.
[0019] As a preferred solution, the calculation of the travel time of each initial driving path according to the length, direction and attribute values corresponding to the terrain type of the path segments includes:
[0020] Obtaining the difficulty of the terrain type according to the attribute value corresponding to the terrain type;
[0021] Obtaining the congestion status of the path segment, and calculating the time required to pass the path segment based on the length, direction, and difficulty of the path segment;
[0022] According to the difficulty of the passage and the attribute value corresponding to the terrain type, query a preset mapping relationship database to obtain the weight of the terrain type;
[0023] Based on the weight of the terrain type and in combination with the travel time of the path segments, the travel time of the initial driving path is calculated.
[0024] As a preferred solution, the method of obtaining the waypoint setting information and parsing the waypoint setting information to obtain a number of waypoints includes:
[0025] Obtaining user demand information and analyzing the user demand information to obtain road smoothness requirements, location requirements, time requirements, and charging requirements;
[0026] According to the time requirement and the charging requirement, based on the starting point of the route, a plurality of charging points within a reachable range and a required arrival time for each of the charging points are obtained;
[0027] Calculating the relative height difference between each charging point according to the travel direction from the starting point of the path to the end point of the path, and correcting the required arrival time according to the relative height difference to obtain a corrected time;
[0028] determining at least one charging point as a first planning point based on the corrected time;
[0029] determining at least one second planning point according to the location requirements;
[0030] Invoking a satellite navigation system to perform preliminary planning based on the path starting point and the path ending point, and determining at least one third planning point;
[0031] The plurality of waypoints are obtained according to the first planning point, the second planning point and the third planning point.
[0032] As a preferred solution, the analysis based on the contour line information to obtain the continuity of the contour line, and determining the abnormal segmentation according to the continuity and the slope information, includes:
[0033] When there are breakpoints on the contour lines, the continuity and breakpoint coordinates of each contour line containing the breakpoints are obtained through the neighborhood search algorithm;
[0034] Calculating the boundary range of the isolated area based on the coordinates of the breakpoints; calculating the boundary range of the connected area based on the continuity of the contour lines;
[0035] By querying a preset abnormal feature database, a connected abnormal region and an isolated abnormal region are obtained according to the boundary range of the isolated region and the boundary range of the connected region; and then a geometric shape feature is extracted based on the connected abnormal region;
[0036] Establishing a spatial clustering model based on the geometric shape features, and obtaining spatial distribution patterns of the connected abnormal regions and the isolated abnormal regions respectively through the spatial clustering model;
[0037] Calculating the distance between each connected abnormal region according to the spatial distribution pattern;
[0038] Merge the connected abnormal regions whose distance is less than the preset distance threshold to obtain the merged region, and combine it with the isolated abnormal regions to obtain the target abnormal region;
[0039] The abnormal segment is obtained based on the target abnormal area and the slope information of each path segment.
[0040] As a preferred solution, the step of removing abnormal segments from the path segments to obtain removal results includes:
[0041] Performing intersection processing on all the abnormal segments and all the path segments to obtain an intersection processing result;
[0042] The intersection processing results are eliminated from all path segments, and the remaining path segments are used as the elimination results.
[0043] As a preferred solution, the path planning method is applied to a terminal; the step of obtaining a path starting point and a path end point includes:
[0044] In response to the user's destination setting operation, the destination setting operation is parsed to obtain the destination coordinates, and the destination is determined as the end point of the path; the current position coordinates of the terminal are obtained, and the current position coordinates are determined as the starting point of the path.
[0045] Accordingly, the present invention also provides a path planning system based on terrain recognition, including an acquisition module, a driving path determination module, a segmentation module, a calculation module, an analysis module and a planning module; wherein,
[0046] The acquisition module is used to acquire a path starting point and a path end point; wherein the path starting point and the path end point are both within the target area;
[0047] The driving route determination module is configured to obtain waypoint setting information and parse the waypoint setting information to obtain a plurality of waypoints; construct a directed graph using the path starting point, the waypoints, and the path end point as nodes; and determine a plurality of initial driving routes based on directed vectors of the directed graph;
[0048] The segmentation module is configured to obtain terrain distribution information and image data of the target area, analyze the image data based on the terrain distribution information, determine the distribution of multiple terrain types in the target area, and segment the initial driving path according to the distribution of the multiple terrain types to obtain multiple path segments, wherein each path segment corresponds to a terrain type;
[0049] The calculation module is used to calculate the travel time of each initial driving path based on the length, direction and attribute values corresponding to the terrain type of the path segment;
[0050] The analysis module is configured to obtain contour line information of the target area, analyze each path segment using the contour line information, and obtain slope information of each path segment; obtain the continuity of the contour lines based on the contour line information analysis, and determine abnormal segments based on the continuity and the slope information;
[0051] The planning module is configured to eliminate abnormal segments from the path segments to obtain an elimination result; based on the elimination result, screen out initial driving paths from the elimination result whose travel time is less than a preset time threshold to obtain a screening result; and, while retaining at least one waypoint, re-plan the initial driving paths in the screening result based on the path starting point and the path ending point to determine at least one target path.
[0052] As a preferred solution, the terrain distribution information includes altitude distribution and mountain inclination information; the segmentation module analyzes the image data according to the terrain distribution information to determine the distribution of multiple terrain types in the target area, including:
[0053] The segmentation module segments the image data to obtain a mountain image;
[0054] Converting the mountain image into a grayscale image, and identifying the grayscale image using a corner detection algorithm to obtain a number of corner points; the types of corner points include mountain top corner points, valley corner points, and mountain foot corner points;
[0055] Use the preset coordinate transformation matrix to obtain the coordinates of each corner point in the world coordinate system;
[0056] Fitting is performed based on the coordinates of each corner point in the world coordinate system to obtain a ridge curve; and then combining the ridge curve and each corner point to obtain mountain profile information;
[0057] Obtaining a three-dimensional model of the mountain based on the mountain profile information and the mountain inclination information;
[0058] Performing image recognition on the image data to obtain boundary lines of multiple terrain types; superimposing the boundary lines of multiple terrain types on the mountain stereo model to obtain a three-dimensional distribution of multiple terrain types in the target area.
[0059] As a preferred solution, the calculation module calculates the travel time of each initial driving path based on the length, direction and attribute values corresponding to the terrain type of the path segments, including:
[0060] The calculation module obtains the difficulty of the terrain type according to the attribute value corresponding to the terrain type;
[0061] Obtaining the congestion status of the path segment, and calculating the time required to pass the path segment based on the length, direction, and difficulty of the path segment;
[0062] According to the difficulty of the passage and the attribute value corresponding to the terrain type, query a preset mapping relationship database to obtain the weight of the terrain type;
[0063] Based on the weight of the terrain type and in combination with the travel time of the path segments, the travel time of the initial driving path is calculated.
[0064] As a preferred solution, the driving route determination module obtains waypoint setting information and parses the waypoint setting information to obtain a number of waypoints, including:
[0065] The driving route determination module obtains user demand information and analyzes the user demand information to obtain road smoothness requirements, location requirements, time requirements, and charging requirements;
[0066] According to the time requirement and the charging requirement, based on the starting point of the route, a plurality of charging points within a reachable range and a required arrival time for each of the charging points are obtained;
[0067] Calculating the relative height difference between each charging point according to the travel direction from the starting point of the path to the end point of the path, and correcting the required arrival time according to the relative height difference to obtain a corrected time;
[0068] determining at least one charging point as a first planning point based on the corrected time;
[0069] determining at least one second planning point according to the location requirements;
[0070] Invoking a satellite navigation system to perform preliminary planning based on the path starting point and the path ending point, and determining at least one third planning point;
[0071] The plurality of waypoints are obtained according to the first planning point, the second planning point and the third planning point.
[0072] As a preferred solution, the analysis module obtains the continuity of the contour lines based on the contour line information analysis, and determines the abnormal segmentation according to the continuity and the slope information, including:
[0073] When there are breakpoints on the contour lines, the analysis module obtains the continuity and breakpoint coordinates of each contour line containing the breakpoints through a neighborhood search algorithm;
[0074] Calculating the boundary range of the isolated area based on the coordinates of the breakpoints; calculating the boundary range of the connected area based on the continuity of the contour lines;
[0075] By querying a preset abnormal feature database, a connected abnormal region and an isolated abnormal region are obtained according to the boundary range of the isolated region and the boundary range of the connected region; and then a geometric shape feature is extracted based on the connected abnormal region;
[0076] Establishing a spatial clustering model based on the geometric shape features, and obtaining spatial distribution patterns of the connected abnormal regions and the isolated abnormal regions respectively through the spatial clustering model;
[0077] Calculating the distance between each connected abnormal region according to the spatial distribution pattern;
[0078] Merge the connected abnormal regions whose distance is less than the preset distance threshold to obtain the merged region, and combine it with the isolated abnormal regions to obtain the target abnormal region;
[0079] The abnormal segment is obtained based on the target abnormal area and the slope information of each path segment.
[0080] As a preferred solution, the planning module eliminates abnormal segments in the path segments to obtain elimination results, including: the planning module performs intersection processing on all the abnormal segments and all the path segments to obtain intersection processing results; eliminates the intersection processing results from all the path segments and uses the remaining path segments as the elimination results.
[0081] As a preferred solution, the path planning system is applied to a terminal; the acquisition module acquires the path starting point and the path end point, including: the acquisition module responds to the user's destination setting operation, parses the destination setting operation, obtains the destination coordinates, and determines the destination as the path end point; acquires the current position coordinates of the terminal, and determines the current position coordinates as the path starting point.
[0082] Compared with the prior art, the present invention has the following beneficial effects:
[0083] The present invention provides a path planning method and system based on terrain recognition, the path planning method comprising: obtaining a path starting point and a path end point; wherein the path starting point and the path end point are both within a target area; obtaining waypoint setting information, and parsing the waypoint setting information to obtain a plurality of waypoints; constructing a directed graph with the path starting point, the waypoints, and the path end point as nodes, and determining a plurality of initial driving paths based on directed vectors of the directed graph; obtaining terrain distribution information and image data of the target area, analyzing the image data according to the terrain distribution information, and determining the distribution of a plurality of terrain types in the target area; and segmenting the initial driving path according to the distribution of the plurality of terrain types to obtain a plurality of path segments; wherein each path segment A path segment corresponds to a terrain type; based on the length, direction and attribute value corresponding to the terrain type of the path segment, the travel time of each initial driving path is calculated; the contour line information of the target area is obtained, and the contour line information is used to analyze each path segment to obtain the slope information of each path segment; the continuity of the contour line is obtained based on the contour line information analysis, and abnormal segments are determined based on the continuity; the abnormal segments in the path segment are eliminated to obtain a elimination result; based on the elimination result, the initial driving paths with a travel time less than a preset time threshold are screened out in the elimination result to obtain a screening result; and while retaining at least one waypoint, the initial driving paths in the screening result are re-planned according to the path starting point and the path end point to determine at least one target path. The present invention applies to constructing a directed graph to obtain an initial driving path, analyzing terrain distribution information and image data to determine the distribution of multiple terrain types, and then segmenting the initial driving path, and calculating the travel time of each path segment. Compared with the existing technical solutions, the present application determines the travel time based on the terrain type for path segment screening, narrowing multiple initial driving paths based on the directed graph to a smaller range, effectively improving the accuracy of path planning; in addition, further considering the contour information of the target area, analyzing the slope information, combining the continuity of the contour lines to analyze abnormal segments, and filtering out driving paths with a travel time less than a preset time threshold after eliminating the abnormal segments, and then replanning the target path, which can ensure that the path planning method further takes into account factors such as slope and contour line anomalies, and further improves the accuracy of path planning. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] Figure 1 : A flow chart of an embodiment of a path planning method based on terrain recognition provided by the present invention.
[0085] Figure 2 : A flow chart of a preferred implementation of an embodiment of a path planning method based on terrain recognition provided by the present invention.
[0086] Figure 3 : A flow chart of another preferred implementation of an embodiment of a path planning method based on terrain recognition provided by the present application.
[0087] Figure 4 : A structural diagram of an embodiment of a path planning system based on terrain recognition provided by the present invention. DETAILED DESCRIPTION
[0088] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0089] Example 1
[0090] Please refer to Figure 1 , Figure 1 The present invention provides a path planning method based on terrain recognition, including steps S101 to S106; wherein,
[0091] Step S101: Obtain the path starting point and path end point.
[0092] In this embodiment, it should be noted that the path starting point and the path end point are both within the target area, and the subsequent analysis and path planning steps are also mainly performed based on the data within the target area.
[0093] In some preferred embodiments, the path planning method can be applied to a terminal, which can be a vehicle-mounted terminal, an unmanned aerial vehicle terminal, or a user's mobile phone or other device.
[0094] For the above-mentioned preferred embodiment, in some examples, step S101 of obtaining the path starting point and path end point includes: responding to the user's destination setting operation, parsing the destination setting operation, obtaining the destination coordinates, and determining the destination as the path end point; obtaining the current position coordinates of the terminal, and determining the current position coordinates as the path starting point.
[0095] In other examples, the starting point of the path in step S101 can also be obtained in the following manner: responding to the user's departure setting operation, parsing the departure setting operation, obtaining the departure coordinates, and setting the departure coordinates as the starting point of the path, and the subsequent path planning steps are also based on the departure point set by the user as the path starting point.
[0096] Step S102: Obtaining waypoint setting information and parsing the waypoint setting information to obtain a number of waypoints; constructing a directed graph with the path starting point, the waypoints, and the path end point as nodes, and determining multiple initial driving paths based on the directed vectors of the directed graph.
[0097] In this embodiment, the user can set user demand information in the terminal, and the terminal obtains the waypoint setting information according to the user demand information set by the user.
[0098] In some preferred embodiments, Figure 2 As shown, step S102 obtains the waypoint setting information and parses the waypoint setting information to obtain a number of waypoints, including steps S201 to S205. Each step is described in detail as follows:
[0099] Step S201 : obtaining user demand information and analyzing the user demand information to obtain road smoothness requirements, location requirements, time requirements, and charging requirements.
[0100] Step S202 : According to the time requirement and the charging requirement, based on the starting point of the route, a plurality of charging points within a reachable range and the time required to reach each of the charging points are obtained.
[0101] Step S203 : calculating the relative height difference between each charging point according to the travel direction from the starting point of the path to the end point of the path, and correcting the required arrival time according to the relative height difference to obtain a corrected time.
[0102] Step S204, determining at least one charging point as a first planning point based on the corrected time; determining at least one second planning point based on the location requirements; calling the satellite navigation system, performing preliminary planning based on the path starting point and path end point, and determining at least one third planning point.
[0103] Step S205: Obtain the plurality of waypoints according to the first planning point, the second planning point, and the third planning point.
[0104] In this preferred embodiment, the user's demand information can be quantified into factors such as road smoothness requirements, location requirements, time requirements and charging requirements. For example, the location requirement can be understood as the location that the user wants to pass through. The charging requirement can be understood as the user's desire to charge. In addition to the user's active request to the system, the system can also use a pre-designed program algorithm to identify it based on the current power of the terminal. The time requirement can be understood as the user's priority for the time factor (some users also consider the power of the terminal, or when the execution subject is a vehicle, consider the fuel level of the vehicle and set the driving distance as the priority factor). The road smoothness requirement can be understood as the user's desire for the road to be as smooth as possible during driving, to reduce the fluctuations in altitude, etc. It can be understood that the above content is only an example and does not constitute a specific limitation of the embodiment.
[0105] Furthermore, the user's demand information can be input by the user through voice or text in a mobile phone app, and then the input content is understood and recognized by the existing voice recognition model.
[0106] Preferably, the starting point of the path, the waypoint and the end point of the path are used as nodes to construct a directed graph, and multiple initial driving paths are determined based on the directed vectors of the directed graph, specifically as follows:
[0107] The path starting point is used as the starting point of the directed graph, the path end point is used as the end point of the directed graph, the path starting point, the path end point and the waypoint are used as nodes to construct a directed graph, and the multiple driving paths are determined according to the directed vector of the target directed graph.
[0108] For example, the starting point of the path is A1 and the end point of the path is A n , starting from the path starting point A1, and heading to the path end point A n The waypoints of all paths can be recorded as A2, A3, ..., A n-1 .
[0109] Furthermore, by constructing directed vectors between nodes, multiple initial driving paths are determined, and then the multiple initial driving paths are screened using pre-designed data rules to determine at least one target path. For example, the pre-designed data rules may include, but are not limited to, defining the positive direction from the path starting point to the path ending point as the positive direction, and eliminating initial driving paths with the reverse direction.
[0110] Step S103: Obtain terrain distribution information and image data of the target area, analyze the image data based on the terrain distribution information, and determine the distribution of multiple terrain types in the target area; and segment the initial driving path according to the distribution of the multiple terrain types to obtain multiple path segments; wherein each path segment corresponds to a terrain type.
[0111] In this embodiment, the image data may be satellite remote sensing data, which may include multiple resolutions and spectra. The terrain distribution information mainly includes altitude distribution and mountain slope information, which may be obtained from a terrain database of the target area.
[0112] In some preferred embodiments, step S103 of analyzing the image data according to the terrain distribution information to determine the distribution of multiple terrain types in the target area includes steps S301 to S306. Each step is described in detail as follows:
[0113] Step S301 : segment the image data to obtain a mountain image.
[0114] Step S302 : converting the mountain image into a grayscale image, and identifying the grayscale image using a corner detection algorithm to obtain a number of corner points; the types of corner points include mountain top corner points, valley corner points, and mountain foot corner points.
[0115] Step S303: using a preset coordinate conversion matrix to obtain the coordinates of each corner point in the world coordinate system.
[0116] Step S304 , performing fitting based on the coordinates of each corner point in the world coordinate system to obtain a ridge curve; and then combining the ridge curve and each corner point to obtain mountain profile information.
[0117] Step S305: obtaining a three-dimensional model of the mountain according to the mountain profile information and the mountain inclination information.
[0118] Step S306 , performing image recognition on the image data to obtain boundary lines of various terrain types; superimposing the boundary lines of various terrain types on the mountain stereo model to obtain a three-dimensional distribution of various terrain types in the target area.
[0119] In this implementation, the world coordinate system (WCS) is a standard reference framework used in fields such as computer graphics, robotics, and physics to describe the position and orientation of objects. In three-dimensional space, the WCS is typically a fixed, global coordinate system, relative to which all objects and coordinate systems can be defined and described.
[0120] This embodiment identifies corner points such as mountain top corners, valley corners, and mountain foot corners, converts them to the world coordinate system for fitting, obtains ridge curves and then obtains mountain profile information. By combining the terrain distribution information, an accurate mountain stereo model can be constructed; further, the boundary lines of various terrain types obtained based on image data are superimposed on the above-mentioned mountain stereo model to obtain an accurate three-dimensional distribution of various terrain types in the target area. This three-dimensional distribution includes the boundaries between different terrain types and the height information of different terrain types.
[0121] Furthermore, the initial driving path may be segmented according to different terrain types. Each initial driving path may be divided into two or more path segments, and each path segment corresponds to one terrain type.
[0122] Step S104 : Calculate the travel time of each initial driving path according to the length, direction and attribute values corresponding to the terrain type of the path segments.
[0123] In this embodiment, after segmentation in step S103, the length, direction, and other information of the path segment can be obtained. It should be noted that since the segmentation is based on the terrain type, the segmentation does not mean that the path segment is straight, and it may also be curved.
[0124] In some preferred embodiments, step S104 calculates the travel time of each initial driving path based on the attribute values corresponding to the length, direction and terrain type of the path segment, including: obtaining the difficulty of the terrain type based on the attribute value corresponding to the terrain type; obtaining the congestion situation of the path segment, and calculating the time required for the path segment in combination with the length, direction and difficulty of the path segment; querying a preset mapping relationship database based on the difficulty of the travel and the attribute value corresponding to the terrain type to obtain the weight of the terrain type; calculating the travel time of the initial driving path based on the weight of the terrain type and the time required for the path segment.
[0125] In this preferred embodiment, based on the congestion situation of the path segment, combined with the length, direction and difficulty of the path segment, the time required for the path segment can be preliminarily estimated; based on the difficulty of travel and the attribute value corresponding to the terrain type, a preset mapping relationship database is queried (the mapping relationship database can pre-store the relationship between the attribute value, the difficulty of travel and the weight) to obtain the weight of the terrain type; by assigning different weights to different path segments and different terrain types, the travel time of the complete initial driving path is calculated. In this way, factors such as the different difficulties of travel of different terrain types (or path segments) and the different proportions of different terrain types (or path segments) in the initial driving path can be taken into account, thereby further improving the accuracy of path planning.
[0126] Step S105, obtaining the contour line information of the target area, using the contour line information to analyze each path segment, and obtaining the slope information of each path segment; based on the contour line information analysis, the continuity of the contour line is obtained, and the abnormal segment is determined according to the continuity and the slope information.
[0127] In this embodiment, the contour line information can be obtained by querying a preset geographic database. The contour lines can be drawn based on geographic data, altitude (or elevation data), etc. of the target area.
[0128] Using existing methods, based on the contour information and the path segments obtained in the above steps, the slope information of each path segment can be determined. This slope information can be the slope from the starting point to the end point of the path segment, or the slope in a certain direction of the path segment, depending on the application scenario of the technical solution.
[0129] In a preferred embodiment, the step S105 of analyzing the contour line information to obtain the continuity of the contour line and determining the abnormal segmentation according to the continuity and the slope information includes:
[0130] When there are breakpoints on the contour lines, the continuity and breakpoint coordinates of each contour line containing the breakpoints are obtained through the neighborhood search algorithm;
[0131] Calculating the boundary range of the isolated area based on the coordinates of the breakpoints; calculating the boundary range of the connected area based on the continuity of the contour lines;
[0132] By querying a preset abnormal feature database, a connected abnormal region and an isolated abnormal region are obtained according to the boundary range of the isolated region and the boundary range of the connected region; and then a geometric shape feature is extracted based on the connected abnormal region;
[0133] Establishing a spatial clustering model based on the geometric shape features, and obtaining spatial distribution patterns of the connected abnormal regions and the isolated abnormal regions respectively through the spatial clustering model;
[0134] Calculating the distance between each connected abnormal region according to the spatial distribution pattern;
[0135] Merge the connected abnormal regions whose distance is less than the preset distance threshold to obtain the merged region, and combine it with the isolated abnormal regions to obtain the target abnormal region;
[0136] The abnormal segment is obtained based on the target abnormal area and the slope information of each path segment.
[0137] In this embodiment, with respect to the aforementioned preset abnormal feature database, abnormal regions can be determined based on pre-designed rules or features. For example, the abnormality can be determined by referring to the "elevation anomaly" rule or the "traffic status anomaly" rule. This embodiment identifies isolated abnormal regions through breakpoint segmentation and connects abnormal regions through contour continuity segmentation. The geometric features of the connected abnormal regions are extracted, clustered to obtain spatial distribution patterns, and merged regions are obtained, thereby obtaining target abnormal regions. Based on the target abnormal regions and combined with the slope information of each path segment, abnormal segments are accurately identified. This embodiment allows the subsequent steps to filter out abnormal path segments that do not meet the requirements, further ensuring the rationality and feasibility of path planning.
[0138] Step S106: Eliminate abnormal segments from the path segments to obtain an elimination result; based on the elimination result, screen out initial driving paths from the elimination result whose travel time is less than a preset time threshold to obtain a screening result; and while retaining at least one waypoint, re-plan the path of the initial driving path in the screening result based on the path starting point and the path end point to determine at least one target path.
[0139] In this step, the abnormal segments in the path segments are eliminated to obtain the elimination results, including: performing intersection processing on all the abnormal segments and all the path segments to obtain the intersection processing results; eliminating the intersection processing results from all the path segments and using the remaining path segments as the elimination results.
[0140] Furthermore, further screening is performed using a preset time threshold to further narrow the range of path options. While retaining at least one waypoint (e.g., by deleting some waypoints or updating or readjusting them based on user needs), the directed graph or topological relationship is reconstructed, thereby replanning the path based on the starting and ending points, resulting in at least one target path. It will be appreciated that when there are two or more target paths, all of them can be pushed to the user for selection.
[0141] Accordingly, if Figure 4 As shown, the present invention also provides a path planning system 400 based on terrain recognition, including an acquisition module 401, a driving path determination module 402, a segmentation module 403, a calculation module 404, an analysis module 405 and a planning module 406; wherein,
[0142] The acquisition module 401 is used to acquire a path starting point and a path end point; wherein the path starting point and the path end point are both within the target area;
[0143] The driving route determination module 402 is configured to obtain waypoint setting information and parse the waypoint setting information to obtain a plurality of waypoints; construct a directed graph using the path starting point, the waypoints, and the path end point as nodes; and determine a plurality of initial driving routes based on directed vectors of the directed graph;
[0144] The segmentation module 403 is configured to obtain terrain distribution information and image data of the target area, analyze the image data based on the terrain distribution information, determine the distribution of multiple terrain types in the target area, and segment the initial driving path according to the distribution of the multiple terrain types to obtain multiple path segments, wherein each path segment corresponds to a terrain type;
[0145] The calculation module 404 is used to calculate the travel time of each initial driving path based on the length, direction and attribute values corresponding to the terrain type of the path segment;
[0146] The analysis module 405 is configured to obtain contour line information of the target area, analyze each path segment using the contour line information, and obtain slope information of each path segment; determine the continuity of the contour lines based on the contour line information analysis, and determine abnormal segments based on the continuity and the slope information;
[0147] The planning module 406 is configured to eliminate abnormal segments from the path segments to obtain elimination results; based on the elimination results, screen out initial driving paths whose travel time is less than a preset time threshold from the elimination results to obtain screening results; and, while retaining at least one waypoint, re-plan the initial driving paths in the screening results based on the path starting point and the path ending point to determine at least one target path.
[0148] As a preferred solution, the terrain distribution information includes altitude distribution and mountain inclination information; the segmentation module 403 analyzes the image data according to the terrain distribution information to determine the distribution of multiple terrain types in the target area, including:
[0149] The segmentation module 403 segments the image data to obtain a mountain image;
[0150] Converting the mountain image into a grayscale image, and identifying the grayscale image using a corner detection algorithm to obtain a number of corner points; the types of corner points include mountain top corner points, valley corner points, and mountain foot corner points;
[0151] Use the preset coordinate transformation matrix to obtain the coordinates of each corner point in the world coordinate system;
[0152] Fitting is performed based on the coordinates of each corner point in the world coordinate system to obtain a ridge curve; and then combining the ridge curve and each corner point to obtain mountain profile information;
[0153] Obtaining a three-dimensional model of the mountain based on the mountain profile information and the mountain inclination information;
[0154] Performing image recognition on the image data to obtain boundary lines of multiple terrain types; superimposing the boundary lines of multiple terrain types on the mountain stereo model to obtain a three-dimensional distribution of multiple terrain types in the target area.
[0155] As a preferred solution, the calculation module 404 calculates the travel time of each initial driving path based on the length, direction, and attribute values corresponding to the terrain type of the path segments, including:
[0156] The calculation module 404 obtains the difficulty of the terrain type according to the attribute value corresponding to the terrain type;
[0157] Obtaining the congestion status of the path segment, and calculating the time required to pass the path segment based on the length, direction, and difficulty of the path segment;
[0158] According to the difficulty of the passage and the attribute value corresponding to the terrain type, query a preset mapping relationship database to obtain the weight of the terrain type;
[0159] Based on the weight of the terrain type and in combination with the travel time of the path segments, the travel time of the initial driving path is calculated.
[0160] As a preferred solution, the driving route determination module 402 obtains waypoint setting information and parses the waypoint setting information to obtain several waypoints, including:
[0161] The driving route determination module 402 obtains user demand information and analyzes the user demand information to obtain road smoothness requirements, location requirements, time requirements, and charging requirements;
[0162] According to the time requirement and the charging requirement, based on the starting point of the route, a plurality of charging points within a reachable range and a required arrival time for each of the charging points are obtained;
[0163] Calculating the relative height difference between each charging point according to the travel direction from the starting point of the path to the end point of the path, and correcting the required arrival time according to the relative height difference to obtain a corrected time;
[0164] determining at least one charging point as a first planning point based on the corrected time;
[0165] determining at least one second planning point according to the location requirements;
[0166] Invoking the satellite navigation system 400 to perform preliminary planning based on the path starting point and the path ending point to determine at least one third planning point;
[0167] The plurality of waypoints are obtained according to the first planning point, the second planning point and the third planning point.
[0168] As a preferred solution, the analysis module 405 obtains the continuity of the contour lines based on the contour line information analysis, and determines the abnormal segmentation according to the continuity and the slope information, including:
[0169] When there are breakpoints on the contour lines, the analysis module 405 obtains the continuity and breakpoint coordinates of each contour line containing the breakpoints through a neighborhood search algorithm;
[0170] Calculating the boundary range of the isolated area based on the coordinates of the breakpoints; calculating the boundary range of the connected area based on the continuity of the contour lines;
[0171] By querying a preset abnormal feature database, a connected abnormal region and an isolated abnormal region are obtained according to the boundary range of the isolated region and the boundary range of the connected region; and then a geometric shape feature is extracted based on the connected abnormal region;
[0172] Establishing a spatial clustering model based on the geometric shape features, and obtaining spatial distribution patterns of the connected abnormal regions and the isolated abnormal regions respectively through the spatial clustering model;
[0173] Calculating the distance between each connected abnormal region according to the spatial distribution pattern;
[0174] Merge the connected abnormal regions whose distance is less than the preset distance threshold to obtain the merged region, and combine it with the isolated abnormal regions to obtain the target abnormal region;
[0175] The abnormal segment is obtained based on the target abnormal area and the slope information of each path segment.
[0176] As a preferred solution, the planning module 406 eliminates abnormal segments in the path segments to obtain elimination results, including: the planning module 406 performs intersection processing on all the abnormal segments and all the path segments to obtain intersection processing results; eliminates the intersection processing results from all the path segments, and uses the remaining path segments as the elimination results.
[0177] As a preferred solution, the path planning system 400 is applied to the terminal; the acquisition module 401 acquires the path starting point and the path end point, including: the acquisition module 401 responds to the user's destination setting operation, parses the destination setting operation, obtains the destination coordinates, and determines the destination as the path end point; acquires the current position coordinates of the terminal, and determines the current position coordinates as the path starting point.
[0178] Compared with the prior art, the present invention has the following beneficial effects:
[0179] The present invention provides a path planning method and system based on terrain recognition, the path planning method comprising: obtaining a path starting point and a path end point; wherein the path starting point and the path end point are both within a target area; obtaining waypoint setting information, and parsing the waypoint setting information to obtain a plurality of waypoints; constructing a directed graph with the path starting point, the waypoints, and the path end point as nodes, and determining a plurality of initial driving paths based on directed vectors of the directed graph; obtaining terrain distribution information and image data of the target area, analyzing the image data according to the terrain distribution information, and determining the distribution of a plurality of terrain types in the target area; and segmenting the initial driving path according to the distribution of the plurality of terrain types to obtain a plurality of path segments; wherein each path segment A path segment corresponds to a terrain type; based on the length, direction and attribute value corresponding to the terrain type of the path segment, the travel time of each initial driving path is calculated; the contour line information of the target area is obtained, and the contour line information is used to analyze each path segment to obtain the slope information of each path segment; the continuity of the contour line is obtained based on the contour line information analysis, and abnormal segments are determined based on the continuity; the abnormal segments in the path segment are eliminated to obtain a elimination result; based on the elimination result, the initial driving paths with a travel time less than a preset time threshold are screened out in the elimination result to obtain a screening result; and while retaining at least one waypoint, the initial driving paths in the screening result are re-planned according to the path starting point and the path end point to determine at least one target path. The present invention applies to constructing a directed graph to obtain an initial driving path, analyzing terrain distribution information and image data to determine the distribution of multiple terrain types, and then segmenting the initial driving path, and calculating the travel time of each path segment. Compared with the existing technical solutions, the present application determines the travel time based on the terrain type for path segment screening, narrowing multiple initial driving paths based on the directed graph to a smaller range, effectively improving the accuracy of path planning; in addition, further considering the contour information of the target area, analyzing the slope information, combining the continuity of the contour lines to analyze abnormal segments, and filtering out driving paths with a travel time less than a preset time threshold after eliminating the abnormal segments, and then replanning the target path, which can ensure that the path planning method further takes into account factors such as slope and contour line anomalies, and further improves the accuracy of path planning.
[0180] The specific embodiments described above further illustrate the objectives, technical solutions, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. A path planning method based on terrain recognition, characterized in that: include: Obtaining a path starting point and a path end point; wherein the path starting point and the path end point are both within the target area; Obtaining waypoint setting information and parsing the waypoint setting information to obtain a plurality of waypoints; constructing a directed graph using the path starting point, the waypoints, and the path end point as nodes, and determining a plurality of initial driving paths based on directed vectors of the directed graph; obtaining terrain distribution information and image data of the target area, analyzing the image data based on the terrain distribution information to determine the distribution of multiple terrain types in the target area; and segmenting the initial driving path according to the distribution of the multiple terrain types to obtain multiple path segments, wherein each path segment corresponds to a terrain type; Calculating the travel time of each initial driving path based on the length, direction, and attribute values corresponding to the terrain type of the path segments; Acquiring contour line information of the target area, analyzing each path segment using the contour line information to obtain slope information of each path segment; analyzing the continuity of the contour lines based on the contour line information, and determining abnormal segments based on the continuity and the slope information; Abnormal segments in the path segmentation are eliminated to obtain elimination results; based on the elimination results, initial driving paths whose travel time is less than a preset time threshold are screened out to obtain screening results; and while retaining at least one waypoint, the initial driving paths in the screening results are re-planned according to the path starting point and the path end point to determine at least one target path.
2. A path planning method based on terrain recognition according to claim 1, characterized in that: Calculating the travel time of each initial driving path according to the length, direction, and attribute values corresponding to the terrain type of the path segments includes: Obtaining the difficulty of the terrain type according to the attribute value corresponding to the terrain type; Obtaining the congestion status of the path segment, and calculating the time required to pass the path segment based on the length, direction, and difficulty of the path segment; According to the difficulty of the passage and the attribute value corresponding to the terrain type, query a preset mapping relationship database to obtain the weight of the terrain type; Based on the weight of the terrain type and in combination with the travel time of the path segments, the travel time of the initial driving path is calculated.
3. The path planning method based on terrain recognition according to claim 1, characterized in that: The obtaining of the waypoint setting information and parsing of the waypoint setting information to obtain a number of waypoints include: Obtaining user demand information and analyzing the user demand information to obtain road smoothness requirements, location requirements, time requirements, and charging requirements; According to the time requirement and the charging requirement, based on the starting point of the route, a plurality of charging points within a reachable range and a required arrival time for each of the charging points are obtained; Calculating the relative height difference between each charging point according to the travel direction from the starting point of the path to the end point of the path, and correcting the required arrival time according to the relative height difference to obtain a corrected time; Determining at least one charging point as a first planning point based on the corrected time; determining at least one second planning point based on the location requirements; and invoking a satellite navigation system to perform preliminary planning based on the path starting point and the path ending point to determine at least one third planning point. The plurality of waypoints are obtained according to the first planning point, the second planning point and the third planning point.
4. The path planning method based on terrain recognition according to claim 1, characterized in that: The analyzing the contour line information to obtain the continuity of the contour line, and determining the abnormal segmentation according to the continuity and the slope information, includes: When there are breakpoints on the contour lines, the continuity and breakpoint coordinates of each contour line containing the breakpoints are obtained through the neighborhood search algorithm; Calculating the boundary range of the isolated area based on the coordinates of the breakpoints; calculating the boundary range of the connected area based on the continuity of the contour lines; By querying a preset abnormal feature database, a connected abnormal region and an isolated abnormal region are obtained according to the boundary range of the isolated region and the boundary range of the connected region; and then a geometric shape feature is extracted based on the connected abnormal region; Establishing a spatial clustering model based on the geometric shape features, and obtaining spatial distribution patterns of the connected abnormal regions and the isolated abnormal regions respectively through the spatial clustering model; Calculating the distance between each connected abnormal region according to the spatial distribution pattern; Merge the connected abnormal regions whose distance is less than the preset distance threshold to obtain the merged region, and combine it with the isolated abnormal regions to obtain the target abnormal region; The abnormal segment is obtained based on the target abnormal area and the slope information of each path segment.
5. The path planning method based on terrain recognition according to claim 1, characterized in that: The step of removing abnormal segments from the path segments to obtain removal results includes: Performing intersection processing on all the abnormal segments and all the path segments to obtain an intersection processing result; The intersection processing results are eliminated from all path segments, and the remaining path segments are used as the elimination results.
6. The path planning method based on terrain recognition according to claim 1, characterized in that: Applied to terminals; The step of obtaining the path starting point and the path ending point includes: In response to a user's destination setting operation, the destination setting operation is parsed to obtain the destination coordinates, and the destination is determined as the end point of the route; The current location coordinates of the terminal are acquired, and the current location coordinates are determined as the starting point of the path.
7. A path planning system based on terrain recognition, characterized in that: It includes an acquisition module, a driving path determination module, a segmentation module, a calculation module, an analysis module and a planning module; among which, The acquisition module is used to acquire a path starting point and a path end point; wherein the path starting point and the path end point are both within the target area; The driving route determination module is configured to obtain waypoint setting information and parse the waypoint setting information to obtain a plurality of waypoints; construct a directed graph using the path starting point, the waypoints, and the path end point as nodes; and determine a plurality of initial driving routes based on directed vectors of the directed graph; The segmentation module is configured to obtain terrain distribution information and image data of the target area, analyze the image data based on the terrain distribution information, determine the distribution of multiple terrain types in the target area, and segment the initial driving path according to the distribution of the multiple terrain types to obtain multiple path segments, wherein each path segment corresponds to a terrain type; The calculation module is used to calculate the travel time of each initial driving path based on the length, direction and attribute values corresponding to the terrain type of the path segment; The analysis module is configured to obtain contour line information of the target area, analyze each path segment using the contour line information, and obtain slope information of each path segment; obtain the continuity of the contour lines based on the contour line information analysis, and determine abnormal segments based on the continuity and the slope information; The planning module is configured to eliminate abnormal segments from the path segments to obtain an elimination result; based on the elimination result, screen out initial driving paths from the elimination result whose travel time is less than a preset time threshold to obtain a screening result; and, while retaining at least one waypoint, re-plan the initial driving paths in the screening result based on the path starting point and the path ending point to determine at least one target path.
8. A path planning system based on terrain recognition as claimed in claim 7, characterized in that: The calculation module calculates the travel time of each initial driving path based on the length, direction and attribute values corresponding to the terrain type of the path segments, including: The calculation module obtains the difficulty of the terrain type according to the attribute value corresponding to the terrain type; Obtaining the congestion status of the path segment, and calculating the time required to pass the path segment based on the length, direction, and difficulty of the path segment; According to the difficulty of the passage and the attribute value corresponding to the terrain type, query a preset mapping relationship database to obtain the weight of the terrain type; Based on the weight of the terrain type and in combination with the travel time of the path segments, the travel time of the initial driving path is calculated.
9. The path planning system based on terrain recognition according to claim 7, characterized in that: The driving route determination module obtains waypoint setting information and parses the waypoint setting information to obtain a number of waypoints, including: The driving route determination module obtains user demand information and analyzes the user demand information to obtain road smoothness requirements, location requirements, time requirements, and charging requirements; According to the time requirement and the charging requirement, based on the starting point of the route, a plurality of charging points within a reachable range and a required arrival time for each of the charging points are obtained; Calculating the relative height difference between each charging point according to the travel direction from the starting point of the path to the end point of the path, and correcting the required arrival time according to the relative height difference to obtain a corrected time; Determining at least one charging point as a first planning point based on the corrected time; determining at least one second planning point based on the location requirements; and invoking a satellite navigation system to perform preliminary planning based on the path starting point and the path ending point to determine at least one third planning point. The plurality of waypoints are obtained according to the first planning point, the second planning point and the third planning point.
10. The path planning system based on terrain recognition according to claim 7, characterized in that: The analysis module obtains the continuity of the contour lines based on the contour line information analysis, and determines the abnormal segmentation according to the continuity and the slope information, including: When there are breakpoints on the contour lines, the analysis module obtains the continuity and breakpoint coordinates of each contour line containing the breakpoints through a neighborhood search algorithm; Calculating the boundary range of the isolated area based on the coordinates of the breakpoints; calculating the boundary range of the connected area based on the continuity of the contour lines; By querying a preset abnormal feature database, a connected abnormal region and an isolated abnormal region are obtained according to the boundary range of the isolated region and the boundary range of the connected region; and then a geometric shape feature is extracted based on the connected abnormal region; Establishing a spatial clustering model based on the geometric shape features, and obtaining spatial distribution patterns of the connected abnormal regions and the isolated abnormal regions respectively through the spatial clustering model; Calculating the distance between each connected abnormal region according to the spatial distribution pattern; Merge the connected abnormal regions whose distance is less than the preset distance threshold to obtain the merged region, and combine it with the isolated abnormal regions to obtain the target abnormal region; The abnormal segment is obtained based on the target abnormal area and the slope information of each path segment.