Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The unmanned automobile technology has wide application prospect, and the high-precision map plays a vital role in enhancing the navigation and perception capability of the unmanned automobile. The accuracy of the map determines the safety and reliability of the unmanned system. Most of the high-precision maps used in the unmanned automobile technology are edited according to crowd-sourced data. The crowd-sourced data are vehicle position and pose data, camera data or laser radar point cloud data acquired in real time after a data acquisition mode is started for vehicles of different vehicle types. When editing a high-precision map according to crowdsourcing data, it is difficult for a computer of a general editor to load a large-scale city map, and therefore, the large-scale city map needs to be segmented, so that the editor can take a local map to be edited.
In the related art, a map segmentation method based on tiles has been developed, and an electronic map is segmented into tiles according to preset tile boundaries. However, the map segmentation method does not consider the connection relationship among map elements and the number of elements contained in the local map, and the local map obtained by the map segmentation method has the problems that editing of the local map is difficult for editors due to the fact that edge map elements are difficult to edit and the difference of editable primitive data in the local map is large.
In order to alleviate the above problem, the inventors of the present application propose a method, an apparatus, a device, and a storage medium for iteratively segmenting a map, which are provided by the embodiments of the present application. Obtaining a map to be divided; determining a segmentation mode for segmenting the map to be segmented according to preset map parameters and the parameters of the map to be segmented, wherein the segmentation mode comprises a first segmentation mode and a second segmentation mode; segmenting the map to be segmented by utilizing the first segmentation mode, and if the segmented map obtained by segmenting in the first segmentation mode meets preset conditions, successfully segmenting to obtain the segmented map as a target map; if the map to be segmented obtained by the segmentation in the first segmentation mode does not meet the preset condition, the segmentation in the first segmentation mode fails, the map to be segmented is segmented in the second segmentation mode, and if the map to be segmented obtained by the segmentation in the second segmentation mode meets the preset condition, the segmentation succeeds, and the segmented map is obtained to serve as a target map; and taking the target map as a new map to be divided, returning to the step of determining a dividing mode for dividing the map to be divided according to preset map parameters and the parameters of the map to be divided until the first dividing mode and the second dividing mode fail to divide when the divided map obtained by the first dividing mode and the divided map obtained by the second dividing mode do not meet the preset conditions, and completing the division of the map to be divided to obtain a plurality of target maps. Therefore, by adopting the method, the map to be segmented is subjected to adaptive iterative segmentation according to the parameters of the map to be segmented and the preset conditions, so that an editor can obtain the segmented map to be edited, and the editor can conveniently edit the map to be segmented.
Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Referring to fig. 1, an embodiment of the present application provides a map iterative segmentation method, which describes a step flow of a terminal device side, and the method may include steps S110 to S150.
Step S110: and acquiring a map to be divided.
In the embodiment of the present application, the obtaining of the map to be divided may be that the terminal device obtains the map to be divided from the associated cloud or the electronic device through a wireless communication technology (such as WIFI, bluetooth, zigbEE, and the like), may also be that the SPI (serial port communication interface) is used to obtain the map to be divided from the associated electronic device, and may also be that the map to be divided, which is stored in the storage unit of the terminal device in advance, is directly obtained. Wherein. The to-be-divided map can be a high-precision map generated by processing vehicle position and attitude data, camera data or laser radar point cloud data acquired in real time after a data acquisition mode is started according to vehicles of different vehicle types and the data is transmitted to associated cloud end/electronic equipment, and can be a large-scale urban map, a country map, a scenic spot map and the like.
Step S120: determining a segmentation mode for segmenting the map to be segmented according to preset map parameters and the parameters of the map to be segmented, wherein the segmentation mode comprises a first segmentation mode and a second segmentation mode.
In this embodiment of the application, the preset map parameter may be pre-stored in the terminal device storage unit, may be obtained from an associated cloud or electronic device through a wireless communication technology, and may be obtained from an associated electronic device through the SPI.
It should be understood that the preset map parameters may be a length and a width of a map with minimum accuracy into which the large-scale high-precision map can be divided, which are previously set by an editor, or a length and a width of a map with minimum accuracy into which the large-scale high-precision map obtained through third-party experimental data can be divided.
Specifically, a segmentation mode for segmenting the map to be segmented is determined according to preset map parameters and the parameters of the map to be segmented, wherein the segmentation mode comprises a first segmentation mode and a second segmentation mode, the first segmentation mode comprises a transverse segmentation mode or a vertical segmentation mode, and when the first segmentation mode is the transverse segmentation mode, the second segmentation mode is the vertical segmentation mode; and when the first cutting mode is a vertical cutting mode, the second cutting mode is a transverse cutting mode.
The method for determining the segmentation mode of the map to be segmented according to the preset map parameters and the parameters of the map to be segmented can be that a first ratio of the length of the preset map to the length of the map to be segmented and a second ratio of the width of the preset map to the width of the map to be segmented are calculated according to the length and the width of the preset map and the length and the width of the map to be segmented; if the first ratio is larger than the second ratio, determining that a first cutting mode for cutting the map to be cut is a transverse cutting mode; if the first ratio is smaller than the first ratio, determining that a first cutting mode for cutting the map to be cut is a vertical cutting mode; and if the first ratio is equal to the second ratio and the first difference of the number of map elements in the map obtained by transversely cutting the map to be divided is not less than the second difference of the number of map elements in the map obtained by vertically cutting the map to be divided, determining that the first dividing mode for dividing the map to be divided is a vertical dividing mode.
Illustratively, a proportional relation is made between the length and the width of the complete map to be divided, for example, the proportional relation between the length and the width of the complete map to be divided is 3:1; making a proportional relation between the length and the width of a preset map stored in the terminal device in advance, wherein the proportional relation between the length and the width of the preset map is 2:1; comparing the length of the current map to be divided with the length of a preset map to obtain a first ratio
And comparing the width of the current map to be divided with the width of the preset map to obtain a second ratio 1 (1:1). Wherein the first ratio is greater than the second ratio
Determining that the first cutting mode for cutting the map to be cut is a transverse cutting mode and the second cutting mode is a vertical cutting mode。
Making a proportional relation between the length and the width of the complete map to be divided, for example, the proportional relation between the length and the width of the complete map to be divided is 3:1; making a proportional relation between the length and the width of a preset map stored in the terminal device in advance, wherein the proportional relation between the length and the width of the preset map is 3:1; comparing the length of the current map to be divided with the length of a preset map to obtain a first ratio 1 (1:1); and comparing the width of the current map to be divided with the width of the preset map to obtain a second ratio 1 (1:1). The first ratio is equal to a second ratio (1=1), and if a first difference value of the number of map elements in the map to be divided obtained by transversely cutting the map to be divided is 1000, a second difference value of the number of map elements in the map to be divided obtained by vertically cutting the map to be divided is 500. And determining that the first cutting mode for cutting the map to be cut is a vertical cutting mode, wherein the first difference value is larger than the second difference value (1000 > < 500 >.
Specifically, the crosscutting manner may be performed at different transverse scales, for example, the map to be divided is cut at a one-third scale, a two-thirds scale, a half scale or other positions in the transverse direction of the map to be divided.
In an optional implementation manner of the embodiment of the present application, considering that the segmentation algorithm is simple at a half scale and time is saved, when the map to be segmented is segmented by using the transverse cutting method, the map to be segmented may be segmented by using a bisection method, that is, the map to be segmented is transversely cut at a half scale.
Similarly, the vertical cutting mode may cut the map to be cut at a different vertical scale, for example, at a one-third scale, a two-thirds scale, a half scale or other positions in the vertical direction of the map to be cut.
In an optional implementation manner of the embodiment of the present application, considering that the segmentation algorithm is simple at a half scale and time is saved, when the map to be segmented is segmented in the vertical segmentation manner, the segmentation algorithm may be a binary method, that is, the segmentation algorithm may be performed at a half scale.
Optionally, the transverse cutting mode can be that the map is straightly cut from the transverse direction of the map to be cut; the map can also be transversely split according to the shape of the map element of the map to be split which is split at the transverse position and the mode of reserving the shape outline of the figure. Similarly, the vertical cutting mode can be a straight vertical cutting map from the map to be cut; the map can also be vertically split according to the graph of the map elements of the map to be split, which is split at the vertical position, and the mode of keeping the shape outline of the graph.
Step S130: and segmenting the map to be segmented by using the first segmentation mode, and if the segmented map obtained by segmenting by using the first segmentation mode meets preset conditions, successfully segmenting, and obtaining the segmented map as a target map.
In this embodiment of the application, the preset condition may be pre-stored in the terminal device, may also be obtained from an associated cloud or electronic device through a wireless communication technology, and may also be obtained from an associated electronic device through the SPI; the preset condition can be set by a user independently, and can also be obtained through third-party experimental data. Specifically, the preset condition may be that the length of the segmented map is greater than a preset length threshold, the width of the segmented map is greater than a preset width threshold, and the number of map elements in the segmented map is greater than a preset map element number threshold; or the length of the segmented map is greater than a preset length threshold, the width of the segmented map is greater than a preset width threshold, or the number of map elements in the segmented map is greater than a preset map element number threshold.
The preset length threshold, the preset width threshold and the preset map element number threshold may be set by a user, or may be obtained through third-party experimental data. Specifically, the map elements may include: lane lines, lanes themselves, traffic lights, pedestrian crossings, speed limit information boards, and the like, wherein one lane line represents one map element. For example, the preset length threshold obtained through third-party experimental data may be 30KM, the preset width threshold may be 30KM, and the preset map element number threshold may be 3000-80000.
It should be noted that there is more than one map after being split, and the obtained map after being split is successfully split when meeting the preset conditions, that is, the map obtained after being split is successfully split when all the maps meet the preset conditions.
If the length of the map obtained by the first segmentation mode is larger than a preset length threshold value, the width of the map obtained by the first segmentation mode is larger than a preset width threshold value, and the number of map elements in the segmented map is larger than a preset map element number threshold value, the segmentation is successful, and the segmented map is obtained to serve as a target map.
Step S140: and if the map to be segmented obtained by the segmentation in the first segmentation mode does not meet the preset condition, the first segmentation mode fails to segment, the map to be segmented is segmented in the second segmentation mode, and if the map to be segmented obtained by the segmentation in the second segmentation mode meets the preset condition, the map to be segmented is successfully segmented, and the segmented map is obtained to serve as a target map.
In the implementation of the application, if the length of the map to be segmented obtained by the segmentation in the first segmentation mode is smaller than the preset length threshold value, the width of the map to be segmented is smaller than the preset width threshold value, or the number of map elements in the map to be segmented is smaller than the preset map element number threshold value, the segmentation in the first segmentation mode fails, and the map to be segmented is segmented in the second segmentation mode; if the length of the map obtained by segmentation in the second segmentation mode is greater than the preset length threshold, the width of the map obtained by segmentation is greater than the preset width threshold, and the number of map elements in the segmented map is greater than the preset map element number threshold, the segmentation is successful, and the segmented map is obtained as a target map.
It should be noted that the first cutting manner is different from the second cutting manner, and when the first cutting manner is a transverse cutting manner, the second cutting manner is a vertical cutting manner; and when the first cutting mode is a vertical cutting mode, the second cutting mode is a transverse cutting mode.
For the process of obtaining the preset condition, the preset length threshold, the preset width threshold, and the preset map element number threshold, reference may be made to the foregoing detailed description of step S130, which is not described in detail herein.
Step S150: and taking the target map as a new map to be divided, returning to the step of determining a dividing mode for dividing the map to be divided according to preset map parameters and the parameters of the map to be divided until the first dividing mode and the second dividing mode fail to divide when the divided map obtained by the first dividing mode and the divided map obtained by the second dividing mode do not meet the preset conditions, and completing the division of the map to be divided to obtain a plurality of target maps.
The target map can be a segmented map meeting preset conditions obtained by segmenting the map to be segmented by utilizing the first segmentation mode; or when the map to be divided is not successfully divided by using the first dividing mode, dividing the map to be divided by using the second dividing mode to obtain the divided map meeting the preset conditions. The length of the target map is larger than a preset length threshold, the width of the target map is larger than a preset width threshold, and the number of map elements in the segmented map is larger than a preset map element number threshold.
In the embodiment of the application, the first segmentation mode is used for successfully segmenting the map to be segmented, and the number of the obtained target maps is more than one, and the second segmentation mode is used for successfully segmenting the map to be segmented, and the number of the obtained target maps is more than one. The step of taking the target map to be cut as a new map to be cut, and returning to determine a cutting mode for cutting the map to be cut according to preset map parameters and the parameters of the map to be cut until the first cutting mode and the second cutting mode fail to cut when the map obtained by the first cutting mode and the map obtained by the second cutting mode do not meet the preset conditions, and completing the cutting of the map to be cut to obtain a plurality of target maps, wherein the step of taking all the target maps as the new map to be cut by a parallel processing mode, and returning to the step of determining the cutting mode for cutting the map to be cut according to the preset map parameters and the parameters of the map to be cut until the first cutting mode and the second cutting mode fail to cut when the map obtained by the first cutting mode and the second cutting mode do not meet the preset conditions, and completing the cutting of the map to be cut to obtain a plurality of target maps; or respectively processing all the target maps as new maps to be divided, and returning to the step of determining a dividing mode for dividing the maps to be divided according to preset map parameters and the parameters of the maps to be divided until the first dividing mode and the second dividing mode fail to divide when the divided maps obtained by the first dividing mode and the divided maps obtained by the second dividing mode do not meet the preset conditions, and completing the division of the maps to be divided to obtain a plurality of target maps.
In an optional implementation manner of the embodiment of the application, the parallel processing manner is time-saving, so that all target maps can be used as new maps to be divided in parallel, and the step of determining the dividing manner for dividing the maps to be divided according to preset map parameters and the parameters of the maps to be divided is returned until the first dividing manner and the second dividing manner fail to divide when the divided maps obtained by the first dividing manner and the divided maps obtained by the second dividing manner do not meet the preset conditions, and the dividing of the maps to be divided is completed to obtain a plurality of target maps.
It should be understood that in the embodiment of the present application, it should be satisfied that the iterative segmentation of the map to be segmented is terminated, and when neither the map after segmentation obtained by using the first segmentation manner nor the map after segmentation obtained by using the second segmentation manner satisfies the preset condition, the first segmentation manner and the second segmentation manner are failed to segment, and then the segmentation of the map to be segmented is terminated.
According to the technical scheme, the map to be divided is obtained; determining a segmentation mode for segmenting the map to be segmented according to preset map parameters and the parameters of the map to be segmented, wherein the segmentation mode comprises a first segmentation mode and a second segmentation mode; segmenting the map to be segmented by using the first segmentation mode, and if the segmented map obtained by segmenting by using the first segmentation mode meets preset conditions, successfully segmenting the map to be segmented, and obtaining the segmented map as a target map; if the map to be segmented obtained by the segmentation in the first segmentation mode does not meet the preset condition, the segmentation in the first segmentation mode fails, the map to be segmented is segmented in the second segmentation mode, and if the map to be segmented obtained by the segmentation in the second segmentation mode meets the preset condition, the segmentation succeeds, and the segmented map is obtained to serve as a target map; and taking the target map as a new map to be divided, returning to the step of determining a dividing mode for dividing the map to be divided according to preset map parameters and the parameters of the map to be divided until the first dividing mode and the second dividing mode fail to divide when the divided map obtained by the first dividing mode and the divided map obtained by the second dividing mode do not meet the preset conditions, and completing the division of the map to be divided to obtain a plurality of target maps. Therefore, by adopting the method, the map is subjected to adaptive iterative segmentation according to the parameters of the map and the preset conditions, so that an editor obtains a local map to be edited, and the editor can conveniently edit the map.
Referring to fig. 2, another embodiment of the present application provides a map iterative segmentation method, which describes a step flow of a terminal device side, and the method may include steps S210 to S280.
Step S210: and acquiring a map to be divided.
Step S220: determining a segmentation mode for segmenting the map to be segmented according to preset map parameters and the parameters of the map to be segmented, wherein the segmentation mode comprises a first segmentation mode and a second segmentation mode.
Step S230: and segmenting the map to be segmented by using the first segmentation mode, and if the segmented map obtained by segmenting by using the first segmentation mode meets preset conditions, successfully segmenting, and obtaining the segmented map as a target map.
Step S240: and if the map to be segmented obtained by the segmentation in the first segmentation mode does not meet the preset condition, the first segmentation mode fails to segment, the map to be segmented is segmented in the second segmentation mode, and if the map to be segmented obtained by the segmentation in the second segmentation mode meets the preset condition, the map to be segmented is successfully segmented, and the segmented map is obtained to serve as a target map.
For the detailed description of step S210 to step S240, reference may be made to the detailed description of step S110 to step S140, which is not repeated herein.
Step S250: and selecting the map elements positioned at the edge of the target map, wherein the map elements positioned at the edge of the target map are map elements within a preset distance range from the outer contour of the target map.
In the implementation of the present application, the map element located at the edge of the target map is a map element within a preset distance range from the outer contour of the target map, where the preset distance range may be pre-stored in a storage unit of a terminal device, may be obtained from an associated cloud or an electronic device through a wireless communication technology, and may be obtained from an associated electronic device through an SPI; the data acquisition method can be set by a user independently or can be obtained through third-party experimental data. For example, the preset distance range of 20m is stored in the storage unit of the device terminal, which is obtained through third-party experimental data.
In some embodiments, each map element in a complete map corresponds to a unique ID, and the selected map element located at the edge of the target map may be a map element with a complete ID within a preset distance range from the outer contour of the target map, or a map element with a complete shape profile within a preset distance range from the outer contour of the target map.
Step S260: and obtaining the map elements missing in the target map according to the selected map elements and a preset map element association relation mapping table.
In the implementation of the application, after the complete map to be divided is obtained, the preset map element association relation mapping table corresponding to the map to be divided can be obtained. It should be noted that, according to a complete map, a preset map element association mapping table corresponding to the map may be obtained, a map element in the map is selected, and the ID of the selected map element, the attribute of the selected map element, the position of the selected map element, and the map element associated with the selected map element in the preset map element association mapping table corresponding to the map may be searched by a method of sequential search, binary search, block search, or hash table search. For example, an intersection with ID 262 is associated with a lane with ID 264, a traffic light with ID 272 is associated with a road with ID 274 and a stop line with ID 276, a lane line with ID 282 is associated with a lane line with ID 284, and the like.
The map elements missing in the target map obtained according to the map elements within the preset distance range from the outer contour of the target map and the preset map element association relationship mapping table may be that, after the map elements within the preset distance range from the outer contour of the target map are selected, the ID of the map elements, the attributes and the positions of the map elements and the map elements associated with the map elements in the preset map element association relationship mapping table corresponding to the complete map to be divided are searched by a hash table searching method, and if the map elements associated with the map elements are missing in the target map, the map elements associated with the map elements are missing in the target map.
For example, map elements (e.g., traffic lights) within a preset distance range from the outer contour of the target map are selected, other map elements (e.g., sidewalks with IDs 271, roads with IDs 274, and stop lines with IDs 276) associated with the selected map elements are found in the preset map element association mapping table according to information of the selected map elements (e.g., traffic lights with IDs 272), and if a map element (e.g., sidewalks with IDs 271) associated with the map element is absent from the target map, the map element (sidewalk with IDs 271) absent from the target map is the map element missing from the target map.
Step S270: and repairing the target map according to the missing map elements.
In the embodiment of the application, map elements at the edge position of the target map may be lost due to segmentation, so that editors can edit the map edge elements conveniently, the target map can be repaired, and the repaired target map is used as a new map to be segmented.
The target map is repaired according to the missing map element, and the shape contour of the missing map element in the target map may be supplemented according to the attribute, the position, the shape contour and the like of the missing map element in a preset map element association relationship mapping table. For example, the lane associated with the edge crossing is supplemented, the association of the edge traffic lights to the road and the stop line is supplemented, the missing lane and lane line of the edge road are supplemented, and the like.
Step S280: and taking the repaired target map as a new map to be divided, and returning to the step of determining a dividing mode for dividing the map to be divided according to preset map parameters and the parameters of the map to be divided until the first dividing mode and the second dividing mode fail to divide when the divided map obtained by the first dividing mode and the divided map obtained by the second dividing mode do not meet the preset conditions, and completing the division of the map to be divided to obtain a plurality of target maps.
According to the technical scheme, the map to be divided is obtained; determining a segmentation mode for segmenting the map to be segmented according to preset map parameters and the parameters of the map to be segmented, wherein the segmentation mode comprises a first segmentation mode and a second segmentation mode; segmenting the map to be segmented by using the first segmentation mode, and if the segmented map obtained by segmenting by using the first segmentation mode meets preset conditions, successfully segmenting the map to be segmented, and obtaining the segmented map as a target map; if the map to be segmented obtained by the segmentation in the first segmentation mode does not meet the preset condition, the segmentation in the first segmentation mode fails, the map to be segmented is segmented in the second segmentation mode, and if the map to be segmented obtained by the segmentation in the second segmentation mode meets the preset condition, the segmentation succeeds, and the segmented map is obtained to serve as a target map; selecting map elements positioned at the edge of the target map, wherein the map elements positioned at the edge of the target map are map elements within a preset distance range from the outer contour of the target map; obtaining map elements missing in the target map according to the selected map elements and a preset map element association relation mapping table; repairing the target map according to the missing map elements; and taking the repaired target map as a new map to be divided, and returning to the step of determining a dividing mode for dividing the map to be divided according to preset map parameters and the parameters of the map to be divided until the first dividing mode and the second dividing mode fail to divide when the divided map obtained by the first dividing mode and the divided map obtained by the second dividing mode do not meet the preset conditions, and completing the division of the map to be divided to obtain a plurality of target maps. Therefore, by adopting the method, the map to be segmented is subjected to adaptive iterative segmentation according to the parameters of the map to be segmented and the preset conditions, and missing map elements in the segmented map are repaired in the segmentation process, so that an editor can obtain the segmented map to be edited, and the editor can conveniently edit the map to be segmented.
Referring to fig. 3, another embodiment of the present application provides a map iterative segmentation method, which describes a step flow of a terminal device side, and the method may include steps S310 to S380.
Step S310: and acquiring a map to be divided.
Step S320: determining a segmentation mode for segmenting the map to be segmented according to preset map parameters and the parameters of the map to be segmented, wherein the segmentation mode comprises a first segmentation mode and a second segmentation mode.
Step S330: and segmenting the map to be segmented by utilizing the first segmentation mode, and if the segmented map obtained by segmenting in the first segmentation mode meets preset conditions, successfully segmenting to obtain the segmented map as a target map.
Step S340: and if the map to be segmented obtained by the segmentation in the first segmentation mode does not meet the preset condition, the first segmentation mode fails to segment, the map to be segmented is segmented in the second segmentation mode, and if the map to be segmented obtained by the segmentation in the second segmentation mode meets the preset condition, the map to be segmented is successfully segmented, and the segmented map is obtained to serve as a target map.
Step S350: and taking the target map as a new map to be divided, returning to the step of determining a dividing mode for dividing the map to be divided according to preset map parameters and the parameters of the map to be divided until the first dividing mode and the second dividing mode fail to divide when the divided map obtained by the first dividing mode and the divided map obtained by the second dividing mode do not meet the preset conditions, and completing the division of the map to be divided to obtain a plurality of target maps.
For the detailed description of step S310 to step S350, reference may be made to the detailed description of step S110 to step S150, which is not repeated herein.
Step S360: and selecting the map elements positioned at the edge of the target map, wherein the map elements positioned at the edge of the target map are map elements within a preset distance range from the outer contour of the target map.
Step S370: and obtaining the map elements missing in the target map according to the selected map elements and a preset map element association relation mapping table.
Step S380: and repairing the target map according to the missing map elements.
In the embodiment of the application, map elements at the edge positions of a plurality of target maps obtained by completing the segmentation of the map to be segmented may be lost due to the segmentation, so that editors can edit the edge elements of the target maps conveniently, and the target maps can be repaired. The target map is a segmented map which is obtained after the segmentation of the map to be segmented is completed and repaired, namely a local map which is finally obtained by an editor and used for editing.
For the detailed description of step S360 to step S380, reference may be made to the detailed description of step S250 to step S270, which is not repeated herein.
According to the technical scheme, the map to be divided is obtained; determining a segmentation mode for segmenting the map to be segmented according to preset map parameters and the parameters of the map to be segmented, wherein the segmentation mode comprises a first segmentation mode and a second segmentation mode; segmenting the map to be segmented by using the first segmentation mode, and if the segmented map obtained by segmenting by using the first segmentation mode meets preset conditions, successfully segmenting the map to be segmented, and obtaining the segmented map as a target map; if the map to be segmented obtained by the segmentation in the first segmentation mode does not meet the preset condition, the segmentation in the first segmentation mode fails, the map to be segmented is segmented in the second segmentation mode, and if the map to be segmented obtained by the segmentation in the second segmentation mode meets the preset condition, the segmentation succeeds, and the segmented map is obtained to serve as a target map; taking the target map as a new map to be divided, returning to the step of determining a dividing mode for dividing the map to be divided according to preset map parameters and the parameters of the map to be divided until the first dividing mode and the second dividing mode fail to divide when the divided map obtained by the first dividing mode and the divided map obtained by the second dividing mode do not meet the preset conditions, and completing the division of the map to be divided to obtain a plurality of target maps; selecting map elements positioned at the edge of the target map, wherein the map elements positioned at the edge of the target map are map elements within a preset distance range from the outer contour of the target map; obtaining map elements missing in the target map according to the selected map elements and a preset map element association relation mapping table; and repairing the target map according to the missing map elements. Therefore, by adopting the method, the map to be segmented is subjected to adaptive iterative segmentation according to the parameters of the map to be segmented and the preset conditions, and the map elements missing in the multiple segmented maps obtained after the segmentation of the map to be segmented are repaired, so that an editor can obtain the segmented map to be edited, and the editor can conveniently edit the map to be segmented.
Referring to fig. 4, a map iterative partitioning apparatus according to an embodiment of the present application is shown, where the apparatus 400 includes: the map to be split processing method comprises a map to be split obtaining unit 410, a splitting mode determining unit 420, a first splitting unit 430, a second splitting unit 440 and an iterative splitting unit 450.
Specifically, the map to be divided acquiring unit 410 is configured to acquire a map to be divided; the segmentation mode determining unit 420 is configured to determine a segmentation mode for segmenting the map to be segmented according to a preset map parameter and the parameter of the map to be segmented, where the segmentation mode includes a first segmentation mode and a second segmentation mode; the first segmentation unit 430 is configured to segment the map to be segmented by using the first segmentation mode, and if the segmented map obtained by the segmentation by using the first segmentation mode meets a preset condition, the segmentation is successful, and the segmented map is obtained and used as a target map; the second segmentation unit 440 is configured to segment the map to be segmented in the second segmentation mode if the segmented map obtained by the segmentation in the first segmentation mode does not meet the preset condition, and obtain the segmented map as a target map if the segmentation in the second segmentation mode is successful if the segmented map meets the preset condition; and the iterative segmentation unit 450 is configured to use the target map as a new map to be segmented, and return a step of determining a segmentation mode for segmenting the map to be segmented according to preset map parameters and the parameters of the map to be segmented until the first segmentation mode and the second segmentation mode fail to segment when both the segmented map obtained by the first segmentation mode and the segmented map obtained by the second segmentation mode do not meet the preset conditions, so that the map to be segmented is segmented, and a plurality of target maps are obtained.
As an implementation manner, the to-be-divided map obtaining unit 410 obtains the to-be-divided map from the associated cloud terminal through a wireless communication technology. The segmentation mode determination unit 420 calculates a first ratio of the length of the preset map to the length of the map to be segmented and a second ratio of the width of the preset map to the width of the map to be segmented according to the length and the width of the preset map pre-stored in the device terminal and the length and the width of the map to be segmented; when the first ratio is larger than the second ratio, determining that a first segmentation mode for segmenting the map to be segmented is a transverse segmentation mode, and determining that a second segmentation mode is a vertical segmentation mode; and when the second ratio is greater than the first ratio, determining that the first cutting mode for cutting the map to be cut is a vertical cutting mode. The first segmentation unit 430 segments the map to be segmented by using the first segmentation mode, and if the length of the segmented map obtained by the segmentation by using the first segmentation mode is greater than a preset length threshold, the width of the segmented map is greater than a preset width threshold, and the number of map elements in the segmented map is greater than a preset map element number threshold, the segmentation is successful, and the segmented map is obtained as a target map. A second segmentation unit 440, configured to, if the length of the segmented map obtained by the segmentation in the first segmentation manner is smaller than the preset length threshold, the width of the segmented map is smaller than the preset width threshold, or the number of map elements in the segmented map is smaller than the preset map element number threshold, fail to segment the first segmentation manner, and segment the map to be segmented in the second segmentation manner; if the length of the map obtained by segmentation in the second segmentation mode is greater than the preset length threshold, the width of the map obtained by segmentation is greater than the preset width threshold, and the number of map elements in the segmented map is greater than the preset map element number threshold, the segmentation is successful, and the segmented map is obtained as a target map. The iterative segmentation unit 450 is configured to use the target map as a new map to be segmented, and return to the step of determining a segmentation mode for segmenting the map to be segmented according to a preset map parameter and a parameter of the map to be segmented until the first segmentation mode and the second segmentation mode fail to be segmented when both the segmented map obtained by using the first segmentation mode and the segmented map obtained by using the second segmentation mode do not meet the preset condition, and segment the map to be segmented to obtain a plurality of target maps; selecting map elements positioned at the edge of the target map, wherein the map elements positioned at the edge of the target map are map elements within a preset distance range from the outer contour of the target map; obtaining map elements missing in the target map according to the selected map elements and a preset map element association relation mapping table; and repairing the target map according to the missing map elements.
By adopting the technical scheme, the self-adaptive iterative segmentation is carried out on the map to be segmented according to the parameters of the map to be segmented, the number of map elements contained in the map to be segmented, the characteristics of the high-precision map contained in the preset map parameters and the preset conditions, and missing elements in a plurality of segmented maps obtained by repairing after the segmentation of the map to be segmented are completed, so that an editor can obtain the segmented map to be edited, and the editor can conveniently edit the map to be segmented.
It should be noted that, the embodiments of the present disclosure are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment. For any processing manner described in the method embodiment, the processing manner may be implemented by a corresponding processing module in the apparatus embodiment, and details in the apparatus embodiment are not described any more.
Referring to fig. 5, based on the above-mentioned map iterative partitioning method, the present application further provides another electronic device 500 including a processor that can execute the above-mentioned map iterative partitioning method, where the electronic device 500 further includes one or more processors 510, a memory 520, and one or more application programs. The memory 520 stores programs that can execute the content of the foregoing embodiments, and the processor 510 can execute the programs stored in the memory 520. The electronic device 500 may be a vehicle, a smart robot, a tablet computer, a personal computer, and the like, among others.
Processor 510 may include, among other things, one or more cores for processing data and a message matrix unit. The processor 510 interfaces with various components throughout the electronic device using various interfaces and circuitry to perform various functions of the electronic device 500 and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 520 and invoking data stored in the memory 520. Alternatively, the processor 510 may be implemented in hardware using at least one of Digital Signal Processing (DSP), field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 510 may integrate one or a combination of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is to be understood that the modem may be implemented by a communication chip without being integrated into the processor.
The Memory 520 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 520 may be used to store instructions, programs, code, sets of codes, or sets of instructions. The memory 520 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as obtaining a map to be divided, etc.), instructions for implementing various method embodiments described below, and the like. The data storage area can also store data created by the terminal in use (such as a map to be divided, preset map parameters, preset conditions) and the like.
Referring to fig. 6, a block diagram of a computer-readable storage medium 600 according to an embodiment of the present application is shown. The computer-readable storage medium 600 has stored therein a program code 610, said program code 610 being invokable by the processor for performing the method described in the above-described method embodiments.
The computer-readable storage medium 600 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 600 includes a non-volatile computer-readable storage medium. The computer readable storage medium 600 has storage space for program code 610 for performing any of the method steps of the method described above. These program codes 610 can be read from or written to one or more computer program products. The program code 610 may be compressed, for example, in a suitable form.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.