Raster map processing method, related device and computer program product
By converting the original raster map into a ternary image and performing binarization, the outlines of obstacles are extracted, editable gap areas are identified, and confidence conditions are filtered, thus solving the problem of inaccurate identification of gap areas in the map and improving map quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- IFLYTEK (SUZHOU) TECH CO LTD
- Filing Date
- 2026-02-09
- Publication Date
- 2026-05-19
AI Technical Summary
The initial map contains gaps that are marked as unknown, which affects the quality of path planning. Existing technologies struggle to effectively optimize the state identification of these areas.
The original raster map is converted into a ternary map, binarized to extract obstacle outlines, and editable gap regions are determined through masking. Regions that meet the gap confidence criteria are then selected and their states are edited to idle state.
It improves the accuracy of identifying passable gaps such as door gaps, corridors, and narrow passages, avoids incorrect identification of gaps, and improves map quality.
Smart Images

Figure CN122066818A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of robot map processing technology, and more specifically, to a grid map processing method, related equipment, and computer program product. Background Technology
[0002] Robots can build maps of their work area using onboard sensors and perform functions such as path planning based on these maps. Due to factors such as sensor accuracy and acquisition errors, some gaps in the initially constructed map may be marked as unknown. These gaps could be door gaps, corridors, or narrow passages.
[0003] If the map constructed above is used directly for path planning, it may affect the quality of the planned path. Therefore, there is an urgent need for a map post-processing optimization scheme to optimize the state recognition of the missing areas in the map and improve the map quality. Summary of the Invention
[0004] In view of the above problems, this application is made to provide a raster map processing method, related equipment, and computer program product to improve map quality. The specific solution is as follows:
[0005] Firstly, a raster map processing method is provided, including:
[0006] The original raster map to be processed is converted into a ternary graph, in which each raster is marked as one of three states: free, occupied, and unknown.
[0007] The tri-state image is binarized, and the outline of the obstacle is extracted from the binarized image;
[0008] The ternary image is masked based on the contour lines in the binarized image to determine the editable gap regions in the ternary image;
[0009] In all the gap regions, select the first gap region that meets the gap confidence condition, and edit the grid state corresponding to the first gap region in the three-state diagram to the idle state.
[0010] In one possible design, in another implementation of the first aspect of this application, the process of masking the ternary image based on the contour lines in the binarized image to determine the editable gap region in the ternary image includes:
[0011] Create a mask of the same size as the tri-state diagram. For each grid cell within the mask, if the grid cell satisfies both of the following conditions, then mark the mask value of the grid cell as a first value; otherwise, mark the mask value of the grid cell as a second value. The first value indicates that the corresponding grid cell is editable, and the second value indicates that the corresponding grid cell is not editable.
[0012] First condition: The raster belongs to the pixel corresponding to the contour line in the binary image;
[0013] Second condition: The grid state in the three-state diagram is unknown.
[0014] In one possible design, in another implementation of the first aspect of the embodiments of this application, the process of selecting a first gap region that satisfies the gap confidence condition from all the gap regions includes:
[0015] For each gap region, the confidence value of the gap region belonging to a real gap is evaluated from at least one of the three dimensions: the geometric features of the gap, the consistency of the occupancy status of the grids on both sides of the gap, and the path cost of the endpoints on both sides of the gap in the grid map.
[0016] Select the first gap region whose confidence value is not lower than the set gap confidence threshold.
[0017] In one possible design, in another implementation of the first aspect of the embodiments of this application, the geometric features of the notch include at least one of the following: the directional angle between the line segments on both sides of the notch, the width of the notch, and the parallelism of the line segments on both sides of the notch.
[0018] In one possible design, in another implementation of the first aspect of the embodiments of this application, before masking the tri-state image based on the contour lines in the binarized image, the following is further included:
[0019] The contour lines in the binarized image are smoothed.
[0020] In one possible design, in another implementation of the first aspect of the embodiments of this application, the process of smoothing the contour lines in the binarized image includes:
[0021] The contour lines in the binarized image are divided into several line segments;
[0022] The line segments in the binarized image are processed using one or more smoothing strategies to obtain the processed binarized image.
[0023] In one possible design, in another implementation of the first aspect of the embodiments of this application, the process of dividing the contour lines in the binarized image into several line segments includes:
[0024] The curvature abrupt change points on the contour line are detected as segmentation points, and the contour line is divided into several line segments.
[0025] Based on the curvature and point density of each line segment, it is determined whether the line segment is a straight line segment or a curved line segment. The point density is calculated based on the number of points in the line segment and the length of the line segment.
[0026] In a second aspect, an electronic device is provided, comprising: a memory and a processor;
[0027] The memory is used to store programs;
[0028] The processor is configured to execute the program to implement the various steps of the raster map processing method described in any of the first aspects of this application.
[0029] Thirdly, a readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the various steps of the raster map processing method described in any of the first aspects of this application.
[0030] Fourthly, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the various steps of the raster map processing method described in any of the first aspects of this application.
[0031] By employing the aforementioned technical solution, this application converts the original raster map into a ternary image and performs binarization processing to extract the outlines of obstacles from the binarized image. Based on this, this application performs masking processing on the ternary image based on the obstacle outlines in the binarized image, determining editable gap regions in the ternary image through the masking method. Then, it selects the first gap region that meets the gap confidence condition and edits the corresponding raster state of the first gap region in the ternary image to an idle state. Thus, this application performs masking processing on the ternary image based on the obstacle outlines in the binarized image, thereby determining editable gap regions and improving the accuracy of identifying passable gap regions such as door gaps, corridors, and narrow passages. Further selection of the first gap region that meets the gap confidence condition avoids incorrect gap identification. Based on the selected first gap region, the corresponding raster state in the ternary image is edited to an idle state, improving map quality. Attached Figure Description
[0032] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0033] Figure 1 A schematic diagram of an implementation system architecture for the raster map processing method provided in this application embodiment;
[0034] Figure 2 This is a schematic flowchart of a raster map processing method provided in an embodiment of this application;
[0035] Figure 3 This is a schematic flowchart of another raster map processing method provided in an embodiment of this application;
[0036] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0037] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0038] It is understood that before using the technical solutions disclosed in the various embodiments of this application, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this application in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0039] Some map processing solutions employ global filtering (such as median and Gaussian filtering algorithms) to optimize the map and suppress isolated noise points. However, these methods are prone to mistakenly filling in narrow passages or deleting real narrow gaps, i.e., identifying actual narrow passage areas as obstacles and filling them in, thus failing to guarantee the quality of the processed map.
[0040] This application provides a method for processing raster maps, which can optimize the original raster map, improve the accuracy of identifying gap areas in the map, and edit the raster state corresponding to the real gap areas that belong to passable areas to the idle state, thereby improving the map quality.
[0041] This application provides a raster map processing method that can be applied to, for example... Figure 1The system architecture shown may include a terminal 100 and a server 200. The server 200 may include one or more servers (…). Figure 1 (This example uses a server as an illustration).
[0042] Either terminal 100 or server 200 can be used independently to execute the raster map processing method provided in the embodiments of this application. Alternatively, terminal 100 and server 200 can also be used collaboratively to execute the raster map processing method provided in the embodiments of this application.
[0043] The following description Figure 1 The product form of the mid-terminal 100;
[0044] The terminal 100 in this application embodiment can be a mobile phone, tablet computer, wearable device, vehicle-mounted device, conference terminal, augmented reality (AR) / virtual reality (VR) device, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), etc., and this application embodiment does not impose any restrictions on it.
[0045] This application provides a raster map processing method, illustrated by applying the method to a computer device. Specifically, the computer device may be... Figure 1 The system consists of terminal 100 or a combination of terminal 100 and server 200. (Refer to...) Figure 2 The raster map processing method specifically includes the following steps:
[0046] Step S100: Convert the original raster map to be processed into a three-state map, wherein each raster in the three-state map is marked as one of three states: idle, occupied, and unknown.
[0047] Specifically, this application can receive a raw raster map to be optimized. This raw raster map can be a two-dimensional matrix raster map commonly used in ROS navigation systems, typically generated from sensor data, such as LiDAR scan results, and stored in matrix form. Each cell stores an coded value, with different coded values representing different raster states.
[0048] In this step, when converting the original raster map into a three-state map, a lookup table can be used. Specifically, this application can predefine a mapping table based on the encoding rules of the ROS navigation system. This mapping table records the mapping relationship between different encoded values and output values. The output value can have three types, corresponding to three states: idle, occupied, and unknown. For example, 0 represents the occupied state, 255 represents the idle state, and 100 represents the unknown state.
[0049] By looking up the mapping table, the original raster map can be converted into a three-state map, that is, the state corresponding to each raster is determined: idle, occupied, and unknown.
[0050] Step S110: Binarize the three-state image and extract the outline of the obstacle from the binarized image.
[0051] In this step, the tri-state image obtained in the previous step is binarized to generate a binarized image representing the occupied mask.
[0052] When performing binarization on a tri-state graph, you can make a copy of the tri-state graph, perform binarization on the copy, and keep one copy of the tri-state graph for use in subsequent steps.
[0053] An optional binarization process modifies the pixel values of graticules in the occupied state (pixel value 0) to 0 (representing the background), keeps the pixel values of graticules in the idle state (pixel value 255) at 255 (representing the foreground), and modifies the pixel values of graticules in the unknown state (pixel value 100) to 0 (representing the background). This binarization process provides clear boundaries for obstacle contour extraction.
[0054] After obtaining the binarized image, the outline of the obstacle is further extracted from the binarized image. The outline represents the boundary of the obstacle in the environment. The boundary of the gray-level jump in the binarized image can be used as the outline of the obstacle, that is, the boundary between the background (pixel value 0) and the foreground (pixel value 255).
[0055] In some possible implementations, the findContours function from image libraries such as OpenCV can be used to find the contours of all obstacles.
[0056] Step S120: Perform masking processing on the tri-state image based on the contour lines in the binarized image to determine the editable gap regions in the tri-state image.
[0057] In this step, a mask is generated based on the contour lines in the binarized image. The binary properties (0 and 1) of the mask are used as switches to control which grids in the three-state image can be edited (grids in the gap area can be edited) and which grids cannot be edited, that is, they remain in their original state.
[0058] A mask can be represented as:
[0059] M(x,y) = 1 ((x,y) belongs to the gap region)
[0060] M(x,y) = 0 ((x,y) belongs to the non-gap region)
[0061] In this step, the tri-state image is masked based on the obstacle outline in the binarized image, thereby determining the editable gap region. This gap region belongs to the obstacle outline in the binarized image, thus improving the accuracy of identifying narrow passable gap regions such as door gaps, corridors, and narrow passages formed by obstacle outlines.
[0062] Step S130: Select the first gap region that meets the gap confidence condition from all gap regions, and edit the grid state corresponding to the first gap region in the three-state diagram to the idle state.
[0063] Based on the previous step of identifying all editable gap regions in the three-state diagram, the gap regions are further filtered to select the first gap region that meets the gap confidence condition. This application believes that the confidence of the first gap region as a real passable area is high enough. Therefore, the grid state corresponding to the first gap region in the three-state diagram is edited to an idle state, which improves the accuracy of gap region identification.
[0064] The method described in this application can significantly improve the quality of raster maps in navigation and map display, and facilitate scenarios such as automatic zoning, route planning and human-computer visualization.
[0065] In some possible implementations, for second gap regions that do not meet the gap credibility condition, the grid state corresponding to the second gap region in the three-state diagram can be kept unchanged to avoid introducing false obstacles.
[0066] In some possible embodiments, after processing the tri-state diagram in step S130 above, the processed tri-state diagram can be output as a reconstructed diagram and saved as a PNG image file and a YAML file containing resolution, origin, and size information for subsequent publication and use.
[0067] In some embodiments of this application, step S120 described above is an optional implementation of masking the ternary image based on the contour lines in the binarized image to determine the editable gap region in the ternary image. The process of masking the ternary image may include:
[0068] Create a mask of the same size as the tri-state diagram. For each grid cell within the mask, if the grid cell satisfies both of the following conditions, mark the grid cell's mask value as a first value; otherwise, mark the grid cell's mask value as a second value. The first value indicates that the corresponding grid cell is editable (e.g., a value of 1), and the second value indicates that the corresponding grid cell is not editable (e.g., a value of 0).
[0069] First condition: The raster belongs to the pixel corresponding to the contour line in the binary image;
[0070] Second condition: The grid state in the three-state diagram is an unknown state.
[0071] In this embodiment, the editable gap regions in the determined ternary image belong to the pixels corresponding to the contour lines in the binarized image, thereby improving the accuracy of identifying narrow, passable gap regions such as door gaps, corridors, and narrow passages formed by obstacle contours. Furthermore, the grid state of the editable gap regions in the ternary image is limited to an unknown state; that is, only grids in an unknown state in the ternary image are allowed to be edited. This protects grid states already determined to be occupied or idle in the ternary image from being overwritten by editing, reducing the probability of misidentification of gaps.
[0072] In some embodiments of this application, an optional setting method for the gap confidence condition is provided, namely:
[0073] Evaluate the confidence level of a gap region as a true gap based on at least one of the following three dimensions, and select the first gap region with a confidence level not lower than a set gap confidence threshold:
[0074] First dimension: the geometric features of the gap;
[0075] Second dimension: Consistency of grid occupancy status on both sides of the gap;
[0076] The third dimension: the path cost of the two endpoints of the gap in the grid map.
[0077] Taking the assessment of the confidence level of a gap region as a genuine gap by considering all three dimensions mentioned above as an example, the confidence level of the gap can be expressed by the following formula:
[0078] confidence(gap) = w_g· G(gap) + w_t· T(gap) + w_r· R(gap)
[0079] Here, confidence(gap) represents the confidence value of the gap, and w_g, w_t, and w_r represent three weights, the sum of which equals 1.
[0080] G(gap) represents the gap confidence score based on the gap geometry features, which is the gap confidence value evaluated from the first dimension mentioned above.
[0081] R(gap) represents the gap confidence score based on the consistency of the occupancy status of the grids on both sides of the gap, that is, the gap confidence value is evaluated from the second dimension mentioned above.
[0082] T(gap) represents the gap confidence score based on the connectivity (or path cost) of the two endpoints of the gap in the grid map, which is to evaluate the gap confidence value from the third dimension mentioned above.
[0083] Next, the scoring process for each of the three dimensions will be explained.
[0084] G(gap): Gap confidence score based on gap geometry features
[0085] In this embodiment, the credibility of the gap is scored based on the geometric features of the gap, which include, but are not limited to: the directional angle between the line segments on both sides of the gap, the width of the gap, and the parallelism of the line segments on both sides of the gap.
[0086] The following example illustrates a method for calculating G(gap):
[0087] G(gap) = α · cos(θ_diff) + β · exp(-γ · d_gap) + δ · P_score
[0088] Parameter description:
[0089] θ_diff: the angle between the directions of the line segments on both sides of the gap, d_gap: the width of the gap, P_score: the parallelism score of the line segments on both sides of the gap, α, β, δ: normalized weighting coefficients.
[0090] As can be seen from the above formula, the smaller the angle between the line segments on both sides of the gap, the smaller the width of the gap, and the higher the parallelism score of the line segments on both sides of the gap, the higher the corresponding G(gap). That is, θ_diff and d_gap are negatively correlated with G(gap), and P_score is positively correlated with G(gap).
[0091] The above formula calculates the gap credibility score from the directional angle between the line segments on both sides of the gap, the width of the gap, and the parallelism of the line segments on both sides of the gap. This avoids misidentification of the gap caused by solely measuring the gap area and improves the accuracy of the gap credibility calculation results.
[0092] R(gap): Gap confidence score based on the consistency of occupancy status of the grids on both sides of the gap.
[0093] R(gap) = Sim(Region_A, Region_B)
[0094] Region_A and Region_B represent the occupancy status of the grid cells on both sides of the gap, respectively. The R(gap) score is the highest when the occupancy status of the grid cells on both sides is the same, for example, a value of 1. The R(gap) score is the lowest when the occupancy status of the grid cells on both sides is different, for example, a value of 0.
[0095] The above formula calculates the gap credibility score based on the consistency of the grid occupancy status on both sides of the gap, which can distinguish between real openings and map noise, and improve the accuracy of the gap credibility calculation results.
[0096] T(gap): Gap confidence score based on the path costs of the two endpoints of the gap in the raster map.
[0097] T(gap) = 1 - (C_shortest / C_max)
[0098] C_shortest: The shortest path cost from one end of the gap to the other end, treating the gap as an obstacle. C_max: The maximum path cost between two points on the map.
[0099] Among them, path cost can be based on path search algorithm examples such as Obtained through algorithms and other calculations.
[0100] The above formula calculates the gap confidence score based on the path costs of the two endpoints of the gap. If the path cost C_shortest is high, it means that the cost of traversing the gap is too high, which is unreasonable in a real environment. This implies that the gap is more likely to be a truly passable area, hence the higher T(gap). By analyzing the connectivity of the two endpoints of the gap on the map, the accuracy of the gap confidence calculation results can be improved.
[0101] The embodiments described above evaluate the credibility of gaps from three dimensions: the geometric features of the gaps, the consistency of the occupancy status of the grids on both sides of the gaps, and the path cost of the endpoints on both sides of the gaps in the grid map. These three dimensions evaluate the credibility of gaps from different perspectives, which can improve the accuracy of gap identification.
[0102] In some embodiments of this application, combined with Figure 3 The diagram illustrates another alternative implementation scheme for raster map processing, combined with... Figure 3 As shown:
[0103] Before performing masking processing on the ternary image based on the contour lines in the binarized image in step S120, the following steps can be further added:
[0104] Step S140: Smooth the contour lines in the binarized image.
[0105] By smoothing the contour lines in a binarized image, regular boundaries can be restored, providing a more accurate data foundation for obstacle contour extraction.
[0106] This embodiment provides an optional implementation method for smoothing contour lines.
[0107] First, the contour lines in the binarized image are divided into several line segments.
[0108] Furthermore, the line segments in the binarized image are processed using one or more smoothing strategies to obtain the processed binarized image.
[0109] Optionally, before dividing the contour lines in the binarized image into several line segments, noise removal can also be performed on the binarized image, specifically:
[0110] Filter connected components in the binarized image, calculate the area and aspect ratio of the connected components. If the area is less than a set area threshold and the aspect ratio meets the set noise condition (the threshold for aspect ratio can be set according to the specific scenario, and exceeding or falling below the threshold is considered to meet the noise condition), then the connected component can be removed, that is, the pixel value of the connected component is set to the background pixel value, such as 0.
[0111] Furthermore, isolated points in a binarized image can be identified, that is, a single pixel or a very small region in a binarized image that is significantly different from the surrounding environment, and isolated points can be removed using an opening operation.
[0112] By performing noise removal on the binarized image as described above, small isolated points and burrs in the binarized image can be removed.
[0113] When segmenting contour lines in a binarized image, this embodiment provides an optional line segmentation strategy, namely:
[0114] The curvature abrupt change points on the contour line are detected as segmentation points, and the contour line is divided into several line segments.
[0115] Based on the curvature and point density of each line segment, determine whether the line segment is a straight line segment or a curved segment.
[0116] The point density is calculated based on the number of points in the line segment and the length of the line segment.
[0117] The following example illustrates a method for calculating curvature and point density:
[0118]
[0119] kappa_i: Discrete curvature value calculated at point P_i, in radians;
[0120] V_prev: The forward vector at point P_i;
[0121] V_next: The backward vector at point P_i;
[0122] epsilon = 1e-6: A numerically stable constant to prevent division by zero and computational instability.
[0123] Point density calculation method:
[0124] rho = N / (L + epsilon)
[0125] rho: The calculated point density value;
[0126] N: The total number of midpoints in the outline segment;
[0127] L: Total length of the line segment.
[0128] In this embodiment, the curvature abrupt change points on the contour line are used as segmentation points, which can divide the contour line into several line segments. Based on this, the curvature and point density of each line segment are considered simultaneously, and the line segments are divided into straight line segments and curved line segments.
[0129] Furthermore, the process of applying one or more smoothing strategies to line segments in the binarized image as described above is introduced.
[0130] In one optional smoothing strategy, this embodiment can perform fitting processing on adjacent and collinear line segments in the binarized image, thereby eliminating short broken segments and reconnecting collinear line segments.
[0131] Another alternative smoothing strategy provides a method for merging endpoint nearest neighbors, specifically:
[0132] If both of the following conditions are met, the two line segments will be merged:
[0133] Condition a: d_endpoints < d_merge
[0134] Condition b: |Δθ| < θ_merge
[0135] Where d_endpoints represents the distance between the nearest endpoints of two line segments (which can be in pixels), and d_merge represents the endpoint merging distance threshold, which can range from 2 to 8 pixels.
[0136] Δθ represents the angle between the directions of two line segments (in radians or degrees), and θ_merge represents the angle threshold, which can range from 5° to 15°.
[0137] By merging the nearest neighbors at the endpoints as described above, short broken segments can be eliminated and nearly collinear segments can be reconnected.
[0138] Another optional smoothing strategy provides a parallel nearest neighbor merging method, specifically:
[0139] If both of the following conditions are met, the two line segments will be merged:
[0140] Condition c: min_distance_between_lines < d_par
[0141] Condition d: |Δθ| < θ_par
[0142] Here, min_distance_between_lines represents the minimum vertical distance between two line segments (which can be in pixels), and d_par represents the parallel merging distance threshold, which can range from 3 to 12 pixels (scaling with resolution).
[0143] Δθ represents the angle between the directions of two line segments (in radians or degrees), and θ_par represents the allowable angle threshold, which can range from 3° to 10°.
[0144] By using the parallel nearest neighbor merging process described above, duplicate jittery boundaries can be eliminated and single-rule edges can be restored.
[0145] Of course, the above only illustrates a few optional line segment smoothing strategies. Other line segment smoothing strategies can also be used, which will not be listed in this embodiment.
[0146] This application also provides an electronic device in its embodiments. (See reference...) Figure 4 The diagram illustrates a structural schematic suitable for implementing the electronic device in the embodiments of this application. The electronic device in the embodiments of this application may include, but is not limited to, fixed terminals such as mobile phones, tablets, wearable devices, etc. Figure 4 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0147] like Figure 4As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 1, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 2 or a program loaded from a storage device 8 into a random access memory (RAM) 3, to implement the raster map processing method of the foregoing embodiments of this application. When the electronic device is powered on, the RAM 3 also stores various programs and data required for the operation of the electronic device. The processing unit 1, ROM 2, and RAM 3 are interconnected via a bus 4. An input / output (I / O) interface 5 is also connected to the bus 4.
[0148] Typically, the following devices can be connected to I / O interface 5: input devices 6 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 7 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 8 including, for example, memory cards, hard drives, etc.; and communication devices 9. Communication device 9 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 4 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0149] This application also provides a computer program product including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the raster map processing methods provided in this application.
[0150] This application also provides a computer-readable storage medium that carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the raster map processing methods provided in this application.
[0151] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.
[0152] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0153] In the above embodiments, the implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, in the form of a computer program product.
[0154] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
[0155] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.
Claims
1. A raster map processing method, characterized in that, include: The original raster map to be processed is converted into a ternary graph, in which each raster is marked as one of three states: free, occupied, and unknown. The tri-state image is binarized, and the outline of the obstacle is extracted from the binarized image; The ternary image is masked based on the contour lines in the binarized image to determine the editable gap regions in the ternary image; In all the gap regions, select the first gap region that meets the gap confidence condition, and edit the grid state corresponding to the first gap region in the three-state diagram to the idle state.
2. The method according to claim 1, characterized in that, The process of masking the ternary image based on the contour lines in the binarized image to determine the editable gap regions in the ternary image includes: Create a mask of the same size as the tri-state diagram. For each grid cell within the mask, if the grid cell satisfies both of the following conditions, then mark the mask value of the grid cell as a first value; otherwise, mark the mask value of the grid cell as a second value. The first value indicates that the corresponding grid cell is editable, and the second value indicates that the corresponding grid cell is not editable. First condition: The raster belongs to the pixel corresponding to the contour line in the binary image; Second condition: The grid state in the three-state diagram is unknown.
3. The method according to claim 1, characterized in that, The process of selecting the first gap region that meets the gap confidence condition from all the gap regions includes: For each gap region, the confidence value of the gap region belonging to a real gap is evaluated from at least one of the three dimensions: the geometric features of the gap, the consistency of the occupancy status of the grids on both sides of the gap, and the path cost of the endpoints on both sides of the gap in the grid map. Select the first gap region whose confidence value is not lower than the set gap confidence threshold.
4. The method according to claim 3, characterized in that, The geometric features of the gap include at least one of the following: the directional angle between the line segments on both sides of the gap, the width of the gap, and the parallelism of the line segments on both sides of the gap.
5. The method according to any one of claims 1-4, characterized in that, Before performing masking processing on the tri-state image based on the contour lines in the binarized image, the method further includes: The contour lines in the binarized image are smoothed.
6. The method according to claim 5, characterized in that, The process of smoothing the contour lines in the binarized image includes: The contour lines in the binarized image are divided into several line segments; The line segments in the binarized image are processed using one or more smoothing strategies to obtain the processed binarized image.
7. The method according to claim 6, characterized in that, The process of dividing the contour lines in the binarized image into several line segments includes: The curvature abrupt change points on the contour line are detected as segmentation points, and the contour line is divided into several line segments. Based on the curvature and point density of each line segment, it is determined whether the line segment is a straight line segment or a curved line segment. The point density is calculated based on the number of points in the line segment and the length of the line segment.
8. An electronic device, characterized in that, include: Memory and processor; The memory is used to store programs; The processor is configured to execute the program to implement each step of the raster map processing method as described in any one of claims 1 to 8.
9. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements each step of the raster map processing method as described in any one of claims 1 to 8.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the various steps of the raster map processing method as described in any one of claims 1 to 8.