Map generation method and cleaning robot
By determining and updating the curved adjacency boundaries in the initial area segmentation map, the problem of too long and curved boundaries in traditional map area segmentation is solved, and the overall layout effect and aesthetics of the map are improved.
Patent Information
- Application Number
- CN202311872297.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-01
AI Technical Summary
In the traditional map area segmentation method, the unconditional horizontal and vertical extension of the boundary line causes the boundary line to be too long and there are subtle bending, affecting the overall layout effect and aesthetics of the map.
Determine the adjacent pixel sequence group in the foreground map of the initial area segmentation map, select the curved adjacency boundary, and update the curved adjacency boundary in the initial area segmentation map to generate the target area segmentation map.
By generating curved adjacency boundaries on the pixel level, the curved phenomenon of adjacent borders in adjacent map areas is eliminated, and the overall layout effect and aesthetics of the map are improved.
Smart Images

Figure CN120234378A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of map generation, and particularly to a map generation method and a cleaning robot. Background Art
[0002] With the development of map area segmentation technology, there has emerged map area segmentation technology. Using map area segmentation technology, it is possible to segment map areas corresponding to each room in the working map of a cleaning robot.
[0003] In traditional technology, when performing map area segmentation, map expansion is usually required so that the segmented map areas form a complete connected domain in the working map. Specifically, the boundary lines between the map areas can be extended horizontally and vertically unconditionally to ensure that the adjacent boundaries between the map areas are straight lines as much as possible.
[0004] However, extending the boundary lines horizontally and vertically unconditionally, on the one hand, easily leads to overly long boundary lines, and on the other hand, since the boundary lines are directly extended at the visual effect level, there will still be slight bends in the boundary lines, affecting the overall layout effect of the map. Summary of the Invention
[0005] Based on this, it is necessary to provide a map generation method and a cleaning robot that can improve the overall layout effect of the map for the above technical problems.
[0006] In a first aspect, the present application provides a map generation method. The method includes:
[0007] Determine a plurality of adjacent pixel sequence groups in the foreground map of the initial area segmentation map, where the pixel gradient change amplitude of the adjacent pixel sequence groups in a preset direction is greater than a preset amplitude;
[0008] Determine the curved adjacent boundaries between different map areas in the initial area segmentation map, and select the target pixel sequence groups corresponding to the curved adjacent boundaries from each of the adjacent pixel sequence groups, where the curved adjacent boundaries are adjacent boundaries that are not parallel to the preset direction;
[0009] Update the curved adjacent boundaries between different map areas in the initial area segmentation map according to the target pixel sequence groups to obtain a target area segmentation map.
[0010] In one embodiment, the step of selecting the target pixel sequence groups corresponding to the curved adjacent boundaries from each of the adjacent pixel sequence groups includes:
[0011] Locate the circumscribed rectangular area of the curved adjacent boundary in the initial region segmented map; for each group of adjacent pixel sequences, locate the interval connected region between the pixel sequences in the foreground map; select the target pixel sequence group corresponding to the curved adjacent boundary in each group of adjacent pixel sequences according to the overlap degree between the circumscribed rectangular area and each interval connected region.
[0012] In one embodiment, the selecting the target pixel sequence group corresponding to the curved adjacent boundary in each group of adjacent pixel sequences includes:
[0013] For each group of adjacent pixel sequences, locate the interval connected region between the pixel sequences in the foreground map; select the target pixel sequence group corresponding to the curved adjacent boundary in each group of adjacent pixel sequences according to the interval distance between the first central position of each interval connected region and the second central position of the curved adjacent boundary.
[0014] In one embodiment, the selecting the target pixel sequence group corresponding to the curved adjacent boundary in each group of adjacent pixel sequences includes:
[0015] Locate the circumscribed rectangular area of the curved adjacent boundary in the initial region segmented map; for each group of adjacent pixel sequences, locate the interval connected region between the pixel sequences in the foreground map; determine the overlap degree between the circumscribed rectangular area and each interval connected region, and the interval distance between the first central position of each interval connected region and the second central position of the curved adjacent boundary; select the target pixel sequence group corresponding to the curved adjacent boundary in each group of adjacent pixel sequences according to each overlap degree and each interval distance.
[0016] In one embodiment, the selecting the target pixel sequence group corresponding to the curved adjacent boundary in each group of adjacent pixel sequences according to each overlap degree and each interval distance includes:
[0017] Select the pixel sequence groups with an interval distance less than a preset distance threshold in each group of adjacent pixel sequences as the pixel sequence groups to be selected according to each interval distance; select the pixel sequence group with the highest overlap degree in each group of pixel sequence groups to be selected as the target pixel sequence group according to each overlap degree.
[0018] In one embodiment, the determining a plurality of groups of adjacent pixel sequences in the foreground map of the initial region segmented map includes:
[0019] Determine a first pixel sequence and a second pixel sequence in a preset direction in the foreground map, where the first pixel sequence and the second pixel sequence are adjacent; obtain the number of first pixels in the first pixel sequence and the number of second pixels in the second pixel sequence; if the absolute value of the difference between the number of first pixels and the number of second pixels is greater than a preset threshold, determine that the first pixel sequence and the second pixel sequence form an adjacent pixel sequence group.
[0020] In one embodiment, the updating of the curved adjacent boundary between different map regions in the initial region segmentation map according to the target pixel sequence group to obtain a target region segmentation map includes:
[0021] Determine the segmentation boundary between the first map region and the second map region corresponding to the curved adjacent boundary according to the target pixel sequence group; segment the first map region and the second map region respectively according to the segmentation boundary to obtain a plurality of segmented regions; use the segmentation boundary as a new adjacent boundary, and in the initial region segmentation map, merge each of the segmented regions into the first map region or the second map region respectively to obtain a target region segmentation map.
[0022] In one embodiment, the determining of the curved adjacent boundary between different map regions in the initial region segmentation map includes:
[0023] Traverse the adjacent boundaries between different map regions in the initial region segmentation map to obtain the position coordinates of all adjacent boundaries; screen the curved adjacent boundaries from all the adjacent boundaries according to the position coordinates of all the adjacent boundaries.
[0024] In one embodiment, before determining a plurality of adjacent pixel sequence groups in the foreground map of the initial region segmentation map, the method further includes:
[0025] Perform binarization processing on the initial region segmentation map to obtain a binarized image; separate the foreground and background of the binarized image according to the pixel value distribution of the binarized image to obtain the foreground map of each map region in the initial region segmentation map.
[0026] In a second aspect, the present application also provides a map generation device. The device includes:
[0027] A determination module, configured to determine a plurality of adjacent pixel sequence groups in the foreground map of the initial region segmentation map, where the pixel gradient change amplitude of the adjacent pixel sequence group in a preset direction is greater than a preset amplitude;
[0028] A selection module, configured to determine a curved adjacent boundary between different map regions in the initial region-segmented map, and select a target pixel sequence group corresponding to the curved adjacent boundary from each of the adjacent pixel sequence groups, where the curved adjacent boundary is an adjacent boundary that is not parallel to the preset direction;
[0029] A boundary update module, configured to update the curved adjacent boundary between different map regions in the initial region-segmented map according to the target pixel sequence group to obtain a target region-segmented map.
[0030] In a third aspect, the present application further provides a cleaning robot. The cleaning robot includes a detection sensor, a driving component, a cleaning component, a memory, and a processor. The memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0031] Determine a plurality of adjacent pixel sequence groups in the foreground map of the initial region-segmented map, where the pixel gradient change amplitude of the adjacent pixel sequence groups in the preset direction is greater than a preset amplitude; determine a curved adjacent boundary between different map regions in the initial region-segmented map, and select a target pixel sequence group corresponding to the curved adjacent boundary from each of the adjacent pixel sequence groups, where the curved adjacent boundary is an adjacent boundary that is not parallel to the preset direction; update the curved adjacent boundary between different map regions in the initial region-segmented map according to the target pixel sequence group to obtain a target region-segmented map.
[0032] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0033] Determine a plurality of adjacent pixel sequence groups in the foreground map of the initial region-segmented map, where the pixel gradient change amplitude of the adjacent pixel sequence groups in the preset direction is greater than a preset amplitude; determine a curved adjacent boundary between different map regions in the initial region-segmented map, and select a target pixel sequence group corresponding to the curved adjacent boundary from each of the adjacent pixel sequence groups, where the curved adjacent boundary is an adjacent boundary that is not parallel to the preset direction; update the curved adjacent boundary between different map regions in the initial region-segmented map according to the target pixel sequence group to obtain a target region-segmented map.
[0034] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0035] Determine multiple groups of adjacent pixel sequences in the foreground map of the initial region-segmented map, where the magnitude of the pixel gradient change of the adjacent pixel sequence groups in a preset direction is greater than a preset magnitude; determine the curved adjacent boundaries between different map regions in the initial region-segmented map, and select the target pixel sequence groups corresponding to the curved adjacent boundaries from each of the adjacent pixel sequence groups, where the curved adjacent boundaries are adjacent boundaries that are not parallel to the preset direction; update the curved adjacent boundaries between different map regions in the initial region-segmented map according to the target pixel sequence groups to obtain the target region-segmented map.
[0036] The above-mentioned map generation method and cleaning robot determine multiple groups of adjacent pixel sequences in the foreground map of the initial region-segmented map, where the magnitude of the pixel gradient change of the adjacent pixel sequence groups in a preset direction is greater than a preset magnitude. Since the foreground map does not include the background part in the initial region-segmented map, the pixel sequences in the adjacent pixel sequence groups will extend finitely in the foreground map and will not extend infinitely, resulting in overly long pixel sequences. Thus, determine the curved adjacent boundaries between different map regions in the initial region-segmented map, where the curved adjacent boundaries are adjacent boundaries that are not parallel to the preset direction, and select the target pixel sequence groups corresponding to the curved adjacent boundaries from the multiple adjacent pixel sequence groups; update the curved adjacent boundaries between different map regions in the initial region-segmented map according to the target pixel sequence groups to obtain the target region-segmented map. In this way, on the one hand, since the pixel sequences in the adjacent pixel sequence groups are not overly long, updating the curved adjacent boundaries according to the target pixel sequence groups to regenerate the adjacent boundaries of the adjacent map regions corresponding to the curved adjacent boundaries, the regenerated adjacent boundaries will not be overly long either. On the other hand, updating the curved adjacent boundaries according to the target pixel sequence groups realizes generating the adjacent boundaries of adjacent map regions at the pixel level, and can eliminate the curvature phenomenon of the adjacent boundaries of adjacent map regions at the pixel level. Therefore, the overall layout effect of the map can be improved. Brief Description of the Drawings
[0037] Figure 1 It is a flowchart of the map generation method in an embodiment;
[0038] Figure 2 It is a flowchart of selecting target pixel sequence groups in an embodiment;
[0039] Figure 3 It is a flowchart of determining multiple groups of adjacent pixel sequences in the foreground map of the initial region-segmented map in another embodiment;
[0040] Figure 4 It is a structural block diagram of a map generation device in an embodiment;
[0041] Figure 5 It is the internal structure diagram of the cleaning robot in an embodiment. Specific embodiments
[0042] In order to make the purpose, technical solutions and advantages of the present application clearer, the following further details the present application in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0043] In order to facilitate the cleaning robot to perform work tasks, the work map is usually divided into regions, so that the entire work map can be divided into individual room maps; when dividing the map into regions, map expansion is usually required, so that the divided map regions form a complete connected domain in the work map. Specifically, the boundary lines between the map regions can be extended horizontally and vertically unconditionally to ensure that the adjacent boundaries between the map regions are straight as much as possible; however, extending the boundary lines horizontally and vertically unconditionally will, on the one hand, easily lead to too long boundary lines, and on the other hand, since the boundary lines are directly extended at the visual effect level, there will still be slight bends in the boundary lines. These two defects will seriously affect the overall layout effect and aesthetics of the work map.
[0044] In one embodiment, as Figure 1 shown, a map generation method is provided. In this embodiment, the method is described by taking its application to a cleaning robot as an example. In this embodiment, the method includes the following steps:
[0045] Step 202, determine a plurality of adjacent pixel sequence groups in the foreground map of the initial region segmentation map, where the pixel gradient change amplitude of the adjacent pixel sequence groups in the preset direction is greater than the preset amplitude.
[0046] Among them, the initial region segmentation map is the work map of the cleaning robot for map region segmentation. Map region segmentation refers to dividing the map regions corresponding to each room in the work map into complete connected domains. At this time, the adjacent boundaries between the map regions in the work map may be straight or curved, thus affecting the overall layout effect and aesthetics of the work map;
[0047] As an example, in this embodiment, the foreground and background of the initial region segmentation map can be separated first to obtain the foreground maps of the map regions in the initial region segmentation map.
[0048] As an example, separating the foreground and background of the initial region segmentation map to obtain the foreground maps of the map regions in the initial region segmentation map includes:
[0049] By taking the map regions corresponding to each room region in the initial region-segmented map as the foreground and the regions in the initial region-segmented map other than the map regions corresponding to each room region as the background, foreground and background separation is performed on the initial region-segmented map to obtain the foreground map corresponding to the map regions of each room region in the initial region-segmented map.
[0050] In addition, it should be noted that the change in the pixel gradient of the adjacent pixel sequence group in the preset direction refers to the change in the number of pixel points in the adjacent pixel sequences. The amount of change in the number of pixel points can be used to characterize the change amplitude of the pixel gradient of the adjacent pixel sequence group in the preset direction. The more the number of pixel points changes, the higher the change amplitude of the pixel gradient. For example, it is assumed that the adjacent pixel sequence group includes a first pixel sequence and a second pixel sequence, the first pixel sequence and the second pixel sequence are adjacent, and the extension directions of the first pixel sequence and the second pixel sequence are the same, which can be both horizontal or both vertical. In this way, the absolute value of the difference in the number of pixel points between the first pixel sequence and the second pixel sequence is the change amplitude of the pixel gradient.
[0051] As an example, the preset amplitude can be determined according to the difference between the internal width of the room and the door width in the map image of the cleaning robot in the preset direction. For example, the preset amplitude can be set slightly smaller than the difference between the internal width of the room and the door width in the map image.
[0052] As an example, step 204 includes: repeatedly performing the determination step: determining a first pixel sequence and a second pixel sequence in the preset direction in the foreground map, where the first pixel sequence and the second pixel sequence are adjacent, and the preset direction can be horizontal or vertical. If the change amplitude of the pixel gradient of the first pixel sequence and the second pixel sequence in the preset direction is greater than the preset amplitude, then the first pixel sequence and the second pixel sequence are jointly used as the adjacent pixel sequence group; until all the adjacent pixel sequence groups in the foreground map are screened out.
[0053] In one embodiment, before determining multiple adjacent pixel sequence groups in the foreground map of the initial region-segmented map, the map generation method further includes:
[0054] Performing binarization processing on the initial region-segmented map to obtain a binarized image; according to the pixel value distribution of the binarized image, performing foreground and background separation on the binarized image to obtain the foreground map of each map region in the initial region-segmented map.
[0055] Specifically, perform binarization processing on the initial regional segmentation map to obtain a binary image. Among them, the pixel value of the map area corresponding to each room area in the binary image is the first preset pixel value, and the pixel value of the area other than the map area corresponding to each room area in the binary image is the second preset pixel value; use the separated image composed of the pixel points with the first preset pixel value in the binary image as the foreground map of each map area in the initial regional segmentation map; use the separated image composed of the pixel points with the second preset pixel value in the binary image as the background map.
[0056] Step 204: Determine the curved adjacent boundaries between different map areas in the initial regional segmentation map, and select the target pixel sequence group corresponding to the curved adjacent boundary in each adjacent pixel sequence group, where the curved adjacent boundary is an adjacent boundary that is not parallel to the preset direction.
[0057] Among them, the curved adjacent boundary is an adjacent boundary that is not parallel to the preset direction. The preset direction can be the horizontal direction or the vertical direction. If a part of the adjacent boundary is parallel to the horizontal direction and the other part of the adjacent boundary is parallel to the vertical direction, it is still considered that the adjacent boundary is a curved adjacent boundary.
[0058] As an example, step 204 includes: screening the curved adjacent boundaries between different map areas in the initial regional segmentation map, and determining the interval connected areas between the pixel sequences in each adjacent pixel sequence group in the foreground map; according to the matching degree between each interval connected area and the curved connection boundary, select the target pixel sequence group corresponding to the curved adjacent boundary in each adjacent pixel sequence group.
[0059] As an example, the matching degree is used to represent the interval distance between the center position of the interval connected area and the center position of the curved connection boundary. The larger the interval distance, the lower the matching degree; the smaller the interval distance, the higher the matching degree.
[0060] As an example, the matching degree is used to represent the overlap degree between the interval connected area and the circumscribed rectangle area of the curved connection boundary; the higher the overlap degree, the higher the matching degree; the lower the overlap degree, the lower the matching degree.
[0061] As an example, the matching degree is used to represent the overlap degree between the interval connected area and the circumscribed rectangle area of the curved connection boundary, and to represent the interval distance between the center position of the interval connected area and the center position of the curved connection boundary; the higher the overlap degree or the smaller the interval distance, the higher the matching degree; the lower the overlap degree or the larger the interval distance, the lower the matching degree.
[0062] Step 206: Update the curved adjacent boundaries between different map areas in the initial regional segmentation map according to the target pixel sequence group to obtain the target regional segmentation map.
[0063] As an example, step 206 includes: according to the segmentation boundary determined by the target pixel sequence group, regenerating the adjacent boundary between the first map area and the second map area corresponding to the curved adjacent boundary in the initial area segmentation map to obtain the target area segmentation map.
[0064] In one embodiment, updating the curved adjacent boundary between different map areas in the initial area segmentation map according to the target pixel sequence group to obtain the target area segmentation map includes:
[0065] According to the target pixel sequence group, determining the segmentation boundary between the first map area and the second map area corresponding to the curved adjacent boundary; according to the segmentation boundary, respectively segmenting the first map area and the second map area to obtain a plurality of segmented areas; using the segmentation boundary as the new adjacent boundary, merging each segmented area into the first map area or the second map area respectively in the initial area segmentation map to obtain the target area segmentation map.
[0066] Specifically, according to the target pixel sequence group, determining the segmentation boundary between the first map area and the second map area corresponding to the curved adjacent boundary, where the first map area and the second map area are adjacent, and the adjacent boundary between the first map area and the second map area is the above-mentioned curved adjacent boundary; according to the segmentation boundary, respectively segmenting the first map area and the second map area to obtain a plurality of segmented areas; using the segmentation boundary as the new adjacent boundary, merging the segmented areas on the side of the first map area into the first map area in the initial area segmentation map, and merging the segmented areas on the side of the second map area into the first map area in the initial area segmentation map to obtain the target area segmentation map.
[0067] In the above map generation method, a plurality of adjacent pixel sequence groups are determined in the foreground map of the initially segmented map. Among them, the amplitude of the pixel gradient of the adjacent pixel sequence group in the preset direction is greater than the preset amplitude. Since the foreground map does not include the background part of the initially segmented map, the pixel sequences in the adjacent pixel sequence group will be finitely extended in the foreground map and will not be infinitely extended to cause the pixel sequence to be too long. Thus, a curved adjacent boundary between different map regions is determined in the initially segmented map, where the curved adjacent boundary is an adjacent boundary that is not parallel to the preset direction, and a target pixel sequence group corresponding to the curved adjacent boundary is selected from the plurality of adjacent pixel sequence groups. According to the target pixel sequence group, the curved adjacent boundary between different map regions in the initially segmented map is updated to obtain a target region segmentation map. In this way, on the one hand, since the pixel sequences in the adjacent pixel sequence group are not too long, when updating the curved adjacent boundary according to the target pixel sequence group and regenerating the adjacent boundary of the adjacent map region corresponding to the curved adjacent boundary, the regenerated adjacent boundary will not be too long. On the other hand, updating the curved adjacent boundary according to the target pixel sequence group realizes generating the adjacent boundary of the adjacent map region at the pixel level, and can eliminate the bending phenomenon of the adjacent boundary of the adjacent map region at the pixel level. Therefore, the overall layout effect and aesthetics of the map can be improved.
[0068] In one embodiment, as Figure 2 shown, selecting a target pixel sequence group corresponding to the curved adjacent boundary from each adjacent pixel sequence group includes:
[0069] Step 302, locate the circumscribed rectangle area of the curved adjacent boundary in the initially segmented map.
[0070] Step 304, for each adjacent pixel sequence group, locate the interval connected area between the pixel sequences in the adjacent pixel sequence group in the foreground map.
[0071] As an example, steps 302 to 304 include: for each adjacent pixel sequence group, determine the connected area between the pixel sequences in the adjacent pixel sequence group in the foreground map as the interval connected area, and locate the first position information of the interval connected area in the map coordinate system; determine the circumscribed rectangle area of the curved adjacent boundary in the initially segmented map, and locate the second position information of the circumscribed rectangle area in the map coordinate system.
[0072] Step 306, determine the overlap degree between the circumscribed rectangle area and each interval connected area, and the interval distance between the first center position of each interval connected area and the second center position of the curved adjacent boundary.
[0073] Among them, the overlapping degree can be the intersection-over-union ratio of the circumscribed rectangle region and the spaced connected region; the first central position can be the region central position of the spaced connected region, or the midpoint position of the boundary of the spaced connected region in a preset direction, that is, the midpoint position of the pixel sequence corresponding to the spaced connected region; the second central position can be the midpoint position of the curved adjacent boundary.
[0074] As an example, step 306 includes: calculating the intersection-over-union ratio of the circumscribed rectangle region and the spaced connected region according to the first position information and the second position information, and using this intersection-over-union ratio as the overlapping degree between the circumscribed rectangle region and the spaced connected region; calculating the first central coordinates of the first central position of the spaced connected region according to the first position information, and calculating the second central coordinates of the second central position of the curved adjacent boundary according to the second position information; calculating the interval distance between the first central position of the spaced connected region and the second central position of the curved adjacent boundary according to the first central coordinates and the second central coordinates.
[0075] Step 308, select the target pixel sequence group corresponding to the curved adjacent boundary from each adjacent pixel sequence group according to each overlapping degree and each interval distance.
[0076] As an example, step 308 includes: performing a weighted sum of the overlapping degree and the reciprocal of the interval distance corresponding to each adjacent pixel sequence group to obtain the matching degree between each adjacent pixel sequence group and the curved adjacent boundary; selecting the adjacent pixel sequence group with the highest matching degree as the target pixel sequence group.
[0077] In one embodiment, the step of selecting the target pixel sequence group corresponding to the curved adjacent boundary from each of the adjacent pixel sequence groups according to each of the overlapping degrees and each of the interval distances includes:
[0078] Select, from each of the adjacent pixel sequence groups, the pixel sequence groups with an interval distance less than a preset distance threshold as the pixel sequence groups to be selected according to each of the interval distances; select, from each of the pixel sequence groups to be selected, the pixel sequence group with the highest overlapping degree as the target pixel sequence group according to each of the overlapping degrees.
[0079] Specifically, for each adjacent pixel sequence group, if the interval distance corresponding to the adjacent pixel sequence group is less than the preset distance threshold, then use the adjacent pixel sequence group as the pixel sequence group to be selected; select the pixel sequence group with the highest overlapping degree among all the pixel sequence groups to be selected as the target pixel sequence group.
[0080] In this embodiment, the circumscribed rectangular area of the curved adjacent boundary is located in the initially segmented map; for each group of adjacent pixel sequences, the interval connected area between the pixel sequences in the group of adjacent pixel sequences is located in the foreground map; the overlap degree between the circumscribed rectangular area and each interval connected area is determined, and the interval distance between the first central position of each interval connected area and the second central position of the curved adjacent boundary is determined; according to each overlap degree and each interval distance, the target pixel sequence group corresponding to the curved adjacent boundary is selected from each group of adjacent pixel sequences. In this way, the target pixel sequence group is accurately selected from each group of adjacent pixel sequences with both the interval distance and the overlap degree as the screening scales, which can ensure that the target pixel sequence group is sufficiently adapted to the curved adjacent boundary. Therefore, the curved adjacent boundary between different map areas is updated in the initially segmented map according to the sufficiently adapted target pixel sequence group, and the adjacent boundary in the initially segmented map will not be modified too much. While improving the overall layout effect and aesthetics of the map, the accuracy of the map can also be taken into account.
[0081] In one embodiment, selecting the target pixel sequence group corresponding to the curved adjacent boundary from each group of adjacent pixel sequences includes:
[0082] Locating the circumscribed rectangular area of the curved adjacent boundary in the initially segmented map; for each group of adjacent pixel sequences, locating the interval connected area between the pixel sequences in the group of adjacent pixel sequences in the foreground map; selecting the target pixel sequence group corresponding to the curved adjacent boundary from each group of adjacent pixel sequences according to the overlap degree between the circumscribed rectangular area and each interval connected area.
[0083] Wherein, the overlap degree can be the intersection-over-union ratio of the circumscribed rectangular area and the interval connected area.
[0084] Specifically, for each group of adjacent pixel sequences, the connected area of the intervals between the pixel sequences in the group of adjacent pixel sequences is determined as the interval connected area in the foreground map, and the first position information of the interval connected area is located in the map coordinate system; the circumscribed rectangular area of the curved adjacent boundary is determined in the initially segmented map, and the second position information of the circumscribed rectangular area is located in the map coordinate system; according to the first position information and the second position information, the intersection-over-union ratio of the circumscribed rectangular area and the interval connected area is calculated, and this intersection-over-union ratio is used as the overlap degree between the circumscribed rectangular area and the interval connected area; the group of adjacent pixel sequences with the highest overlap degree is selected as the target pixel sequence group.
[0085] In the above embodiments, the circumscribed rectangular area of the curved adjacent boundary is located in the initial area segmentation map; for each group of adjacent pixel sequences, the interval connected area between the pixel sequences in the group of adjacent pixel sequences is located in the foreground map; according to the overlap degree between the circumscribed rectangular area and each interval connected area, the target pixel sequence group corresponding to the curved adjacent boundary is selected from each group of adjacent pixel sequences. In this way, with the overlap degree as the screening scale, the target pixel sequence group is accurately screened from each group of adjacent pixel sequences, which can ensure that the target pixel sequence group is sufficiently adapted to the curved adjacent boundary. Therefore, the curved adjacent boundary between different map areas is updated in the initial area segmentation map according to the sufficiently adapted target pixel sequence group, and the adjacent boundary in the initial area segmentation map will not be modified too much. While improving the overall layout effect and aesthetics of the map, it can also take into account ensuring the accuracy of the map.
[0086] In one embodiment, selecting the target pixel sequence group corresponding to the curved adjacent boundary from each group of adjacent pixel sequences includes:
[0087] For each group of adjacent pixel sequences, the interval connected area between the pixel sequences in the group of adjacent pixel sequences is located in the foreground map; according to the interval distance between the first central position of each interval connected area and the second central position of the curved adjacent boundary, the target pixel sequence group corresponding to the curved adjacent boundary is selected from each group of adjacent pixel sequences.
[0088] Wherein, the first central position can be the regional central position of the interval connected area, or the midpoint position of the boundary of the interval connected area in a preset direction, that is, the midpoint position of the pixel sequence corresponding to the interval connected area; the second central position can be the midpoint position of the curved adjacent boundary.
[0089] Specifically, for each group of adjacent pixel sequences, the connected area of the interval between the pixel sequences in the group of adjacent pixel sequences is determined as the interval connected area in the foreground map, and the first position information of the interval connected area is located in the map coordinate system; the first central coordinate of the first central position of the interval connected area is calculated according to the first position information; the second central coordinate of the second central position of the curved adjacent boundary is calculated according to the position information of the curved connection boundary; according to the first central coordinate and the second central coordinate, the interval distance between the first central position of the interval connected area and the second central position of the curved adjacent boundary is calculated.
[0090] In this embodiment, for each adjacent pixel sequence group, an interval connected region between pixel sequences in the adjacent pixel sequence group is located in the foreground map; according to the interval distance between the first central position of each interval connected region and the second central position of the curved adjacent boundary, a target pixel sequence group corresponding to the curved adjacent boundary is selected from each adjacent pixel sequence group. In this way, with the interval distance as the screening scale, the target pixel sequence group is accurately screened from each adjacent pixel sequence group, which can ensure that the target pixel sequence group is sufficiently adapted to the curved adjacent boundary. Therefore, the curved adjacent boundary between different map regions is updated in the initial region segmentation map according to the sufficiently adapted target pixel sequence group, and the adjacent boundary in the initial region segmentation map will not be modified too much. While improving the overall layout effect and aesthetics of the map, it can also take into account ensuring the accuracy of the map.
[0091] In one embodiment, as Figure 3 shown, multiple adjacent pixel sequence groups are determined in the foreground map of the initial region segmentation map, including:
[0092] Step 402, determine a first pixel sequence and a second pixel sequence in the foreground map in a preset direction, where the first pixel sequence and the second pixel sequence are adjacent.
[0093] Among them, the preset direction can be the horizontal direction or the vertical direction. The first pixel sequence and the second pixel sequence are adjacent, and the extension directions of the first pixel sequence and the second pixel sequence are the same, both being the horizontal direction or the vertical direction.
[0094] Step 404, obtain the first pixel quantity in the first pixel sequence and the second pixel quantity in the second pixel sequence.
[0095] Step 406, if the absolute value of the difference between the first pixel quantity and the second pixel quantity is greater than a preset threshold, determine that the first pixel sequence and the second pixel sequence form an adjacent pixel sequence group.
[0096] As an example, steps 404 to 406 include: detecting the number of pixel points in the first pixel sequence in the foreground map to obtain the first pixel quantity, and detecting the number of pixel points in the second pixel sequence in the foreground map to obtain the second pixel quantity; calculating the absolute value of the difference between the first pixel quantity and the second pixel quantity. If the absolute value of the difference is greater than the preset threshold, it means that the pixel gradient change amplitude between the first pixel sequence and the second pixel sequence in the preset direction is greater than the preset amplitude. Therefore, the first pixel sequence and the second pixel sequence are jointly used as an adjacent pixel sequence group with a pixel gradient change amplitude greater than the preset amplitude in the preset direction. If the absolute value of the difference is less than or equal to the preset threshold, it means that the pixel gradient change amplitude between the first pixel sequence and the second pixel sequence in the preset direction is greater than the preset amplitude.
[0097] In this embodiment, by detecting the absolute value of the difference between the number of pixels in the first pixel sequence and the number of pixels in the second pixel sequence, the pixel gradient change amplitude between the first pixel sequence and the second pixel sequence in the preset direction can be detected. If the pixel gradient change amplitude is greater than the preset amplitude, it indicates that the first pixel sequence and the second pixel sequence may be pixel sequences near the curved adjacent boundary. Therefore, the first pixel sequence and the second pixel sequence are jointly used as an adjacent pixel sequence group, realizing the accurate screening of the adjacent pixel sequence group that may be near the curved adjacent boundary.
[0098] In one embodiment, determining the curved adjacent boundary between different map regions in the initial region segmentation map includes:
[0099] Traverse the adjacent boundaries between different map regions in the initial region segmentation map to obtain the position coordinates of all adjacent boundaries; according to the position coordinates of all adjacent boundaries, screen the curved adjacent boundaries among all adjacent boundaries.
[0100] Among them, in this embodiment, the map region information and adjacent boundary information in the initial region segmentation map can be preset in a container first, and then the adjacent boundaries between different map regions in the initial segmentation map can be traversed in the preset container. The preset container can be a map container; the position coordinates can be multiple row coordinates or multiple column coordinates in the horizontal direction.
[0101] Specifically, traverse the adjacent boundaries between different map regions in the initial region segmentation map in the preset container to obtain multiple row coordinates and multiple column coordinates of all adjacent boundaries. Among them, the preset container stores all map region information of the initial region segmentation map and the adjacent boundary information between map regions; if the extension direction of the adjacent boundary is horizontal, detect whether the first coordinate difference between two of the multiple row coordinates of the adjacent boundary is greater than the preset difference threshold. If the first coordinate difference is greater than the preset difference threshold, determine that the adjacent boundary is a curved adjacent boundary. If the first coordinate difference is not greater than the preset difference threshold, determine that the adjacent boundary is not a curved adjacent boundary; if the extension direction of the adjacent boundary is vertical, detect whether the second coordinate difference between two of the multiple column coordinates of the adjacent boundary is greater than the preset difference threshold. If the second coordinate difference is greater than the preset difference threshold, determine that the adjacent boundary is a curved adjacent boundary. If the second coordinate difference is not greater than the preset difference threshold, determine that the adjacent boundary is not a curved adjacent boundary.
[0102] As an example, the DFS (Depth First Search) algorithm can also be used to find the curved adjacent boundary in the initial region segmentation map.
[0103] As an example, the map area information can be the identifier or location information of the map area, etc., and the adjacent boundary information can be the identifier, length or location information of the adjacent boundary, etc.
[0104] In this embodiment, by detecting the coordinate differences between multiple row coordinates or multiple column coordinates of the adjacent boundary pairwise, it is possible to accurately identify whether the adjacent boundary is a curved adjacent boundary, laying a foundation for generating the target area segmentation map.
[0105] In one embodiment, first, the initial area segmentation map is binarized to obtain a binary image. Among them, the pixel value of the map area corresponding to each room area in the binary image is the first preset pixel value, and the pixel value of the area other than the map area corresponding to each room area in the binary image is the second preset pixel value; the separation image composed of the pixel points with the first preset pixel value in the binary image is used as the foreground map of each map area in the initial area segmentation map.
[0106] After obtaining the foreground map, a first pixel sequence and a second pixel sequence in a preset direction are determined in the foreground map, where the first pixel sequence and the second pixel sequence are adjacent; the number of pixel points in the first pixel sequence is detected in the foreground map to obtain a first pixel number, and the number of pixel points in the second pixel sequence is detected in the foreground map to obtain a second pixel number; the absolute value of the difference between the first pixel number and the second pixel number is calculated. If the absolute value of the difference is greater than a preset threshold, it means that the pixel gradient change amplitude between the first pixel sequence and the second pixel sequence in the preset direction is greater than the preset amplitude. Therefore, the first pixel sequence and the second pixel sequence are jointly used as an adjacent pixel sequence group. The accurate screening of the adjacent pixel sequence group near the possible curved adjacent boundary is realized.
[0107] Further, in a preset container, the adjacent boundaries between different map areas in the initial area segmentation map are traversed to obtain multiple row coordinates and multiple column coordinates of all adjacent boundaries, where the preset container stores all map area information of the initial area segmentation map and the adjacent boundary information between map areas; if the extension direction of the adjacent boundary is horizontal, it is detected whether the first coordinate difference between multiple row coordinates of the adjacent boundary pairwise is greater than a preset difference threshold. If the first coordinate difference is greater than the preset difference threshold, it is determined that the adjacent boundary is a curved adjacent boundary. If the first coordinate difference is not greater than the preset difference threshold, it is determined that the adjacent boundary is not a curved adjacent boundary; if the extension direction of the adjacent boundary is vertical, it is detected whether the second coordinate difference between multiple column coordinates of the adjacent boundary pairwise is greater than a preset difference threshold. If the second coordinate difference is greater than the preset difference threshold, it is determined that the adjacent boundary is a curved adjacent boundary. If the second coordinate difference is not greater than the preset difference threshold, it is determined that the adjacent boundary is not a curved adjacent boundary.
[0108] After filtering out all adjacent pixel sequence groups in the foreground map and the curved adjacent boundaries in the initial region segmentation map, for each adjacent pixel sequence group, determine the connected regions separated by the pixel sequences in the adjacent pixel sequence group in the foreground map as the separated connected regions, and locate the first position information of the separated connected regions in the map coordinate system; determine the circumscribed rectangle region of the curved adjacent boundary in the initial region segmentation map, and locate the second position information of the circumscribed rectangle region in the map coordinate system; calculate the intersection-over-union ratio of the circumscribed rectangle region and the separated connected regions according to the first position information and the second position information, and use this intersection-over-union ratio as the overlap degree between the circumscribed rectangle region and the separated connected regions; calculate the first central coordinate of the first central position of the separated connected regions according to the first position information, and calculate the second central coordinate of the second central position of the curved adjacent boundary according to the second position information; calculate the separation distance between the first central position of the separated connected regions and the second central position of the curved adjacent boundary according to the first central coordinate and the second central coordinate; select the adjacent pixel sequence groups with the separation distance less than the preset distance threshold as the pixel sequence groups to be selected; select the pixel sequence group with the highest overlap degree among the pixel sequence groups to be selected as the target pixel sequence group.
[0109] Further, according to the target pixel sequence group, determine the segmentation boundary between the first map region and the second map region corresponding to the curved adjacent boundary, where the first map region and the second map region are adjacent, and the adjacent boundary between the first map region and the second map region is the above-mentioned curved adjacent boundary; perform segmentation on the first map region and the second map region respectively according to the segmentation boundary to obtain a plurality of segmented regions; take the segmentation boundary as the new adjacent boundary, merge the segmented regions belonging to one side of the first map region into the first map region in the initial region segmentation map, and merge the segmented regions belonging to one side of the second map region into the first map region in the initial region segmentation map to obtain the target region segmentation map.
[0110] In the above embodiment, on the one hand, since the foreground map does not contain the background part in the initial region segmentation map, the pixel sequences in the adjacent pixel sequence groups will be extended finitely in the foreground map and will not be extended infinitely to cause the pixel sequences to be too long. Therefore, the curved adjacent boundary is updated according to the target pixel sequence group, and the adjacent boundary of the adjacent map regions corresponding to the curved adjacent boundary is regenerated, and the regenerated adjacent boundary will not be too long; on the other hand, updating the curved adjacent boundary according to the target pixel sequence group realizes generating the adjacent boundary of the adjacent map regions at the pixel level, and can eliminate the bending phenomenon of the adjacent boundary of the adjacent map regions at the pixel level. Therefore, the overall layout effect and aesthetics of the map can be improved.
[0111] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the indications of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of the steps or stages in other steps or other steps.
[0112] Based on the same inventive concept, an embodiment of the present application further provides a map generation device for implementing the above-mentioned map generation method. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the map generation device provided below can refer to the limitations on the map generation method in the above text, and will not be repeated here.
[0113] In one embodiment, as Figure 4 shown, a map generation device is provided, including: a determination module 502, a selection module 504, and a boundary update module 506, where:
[0114] The determination module is used to determine a plurality of adjacent pixel sequence groups in the foreground map of the initial area segmentation map, where the amplitude of the pixel gradient change of the adjacent pixel sequence groups in the preset direction is greater than the preset amplitude.
[0115] The selection module is used to determine the curved adjacent boundary between different map areas in the initial area segmentation map, and select the target pixel sequence group corresponding to the curved adjacent boundary in each of the adjacent pixel sequence groups, where the curved adjacent boundary is an adjacent boundary not parallel to the preset direction.
[0116] The boundary update module is used to update the curved adjacent boundary between different map areas in the initial area segmentation map according to the target pixel sequence group to obtain a target area segmentation map.
[0117] In one of the embodiments, the selection module is further used for:
[0118] Locate the circumscribed rectangular area of the curved adjacent boundary in the initial region segmented map; for each group of adjacent pixel sequences, locate the interval connected area between the pixel sequences in the foreground map; select the target pixel sequence group corresponding to the curved adjacent boundary in each group of adjacent pixel sequences according to the overlap degree between the circumscribed rectangular area and each interval connected area.
[0119] In one embodiment, the selection module is further configured to:
[0120] For each group of adjacent pixel sequences, locate the interval connected area between the pixel sequences in the foreground map; select the target pixel sequence group corresponding to the curved adjacent boundary in each group of adjacent pixel sequences according to the interval distance between the first central position of each interval connected area and the second central position of the curved adjacent boundary.
[0121] In one embodiment, the selection module is further configured to:
[0122] Locate the circumscribed rectangular area of the curved adjacent boundary in the initial region segmented map; for each group of adjacent pixel sequences, locate the interval connected area between the pixel sequences in the foreground map; determine the overlap degree between the circumscribed rectangular area and each interval connected area, and the interval distance between the first central position of each interval connected area and the second central position of the curved adjacent boundary; select the target pixel sequence group corresponding to the curved adjacent boundary in each group of adjacent pixel sequences according to each overlap degree and each interval distance.
[0123] In one embodiment, the selection module is further configured to:
[0124] Select the pixel sequence groups with an interval distance less than a preset distance threshold in each group of adjacent pixel sequences as the pixel sequence groups to be selected according to each interval distance; select the pixel sequence group with the highest overlap degree in each group of pixel sequence groups to be selected as the target pixel sequence group according to each overlap degree.
[0125] In one embodiment, the determination module is further configured to:
[0126] Determine a first pixel sequence and a second pixel sequence in a preset direction in the foreground map, where the first pixel sequence and the second pixel sequence are adjacent; obtain the first pixel quantity in the first pixel sequence and the second pixel quantity in the second pixel sequence; if the absolute value of the difference between the first pixel quantity and the second pixel quantity is greater than a preset threshold, determine that the first pixel sequence and the second pixel sequence form a group of adjacent pixel sequences.
[0127] In one embodiment, the boundary update module is further configured to:
[0128] Determine a segmentation boundary between a first map area and a second map area corresponding to the curved adjacent boundary according to the target pixel sequence group; segment the first map area and the second map area respectively according to the segmentation boundary to obtain a plurality of segmented areas; use the segmentation boundary as a new adjacent boundary, and merge each of the segmented areas into the first map area or the second map area respectively in the initial area segmentation map to obtain a target area segmentation map.
[0129] In one embodiment, the selection module is further configured to:
[0130] Traverse the adjacent boundaries between different map areas in the initial area segmentation map to obtain the position coordinates of all adjacent boundaries; screen the curved adjacent boundaries from all the adjacent boundaries according to the position coordinates of all the adjacent boundaries.
[0131] In one embodiment, the map generation device further includes:
[0132] A foreground and background separation module, which performs binarization processing on the initial area segmentation map to obtain a binarized image; separates the foreground and background of the binarized image according to the pixel value distribution of the binarized image to obtain the foreground map of each map area in the initial area segmentation map.
[0133] Each module in the above map generation device can be implemented in whole or in part by software, hardware and their combination. The above modules can be embedded in or independent of the processor in the cleaning robot in the form of hardware, or stored in the memory of the cleaning robot in the form of software, so as to facilitate the processor to call and execute the operations corresponding to the above modules.
[0134] In one embodiment, a cleaning robot is provided, and its internal structure diagram can be as Figure 5As shown in the figure. The cleaning robot includes a processor, a memory, a communication interface, an input device, a detection sensor, a driving component, and a cleaning component connected by a system bus. Among them, the processor of the cleaning robot is used to provide computing and control capabilities. The memory of the cleaning robot includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the cleaning robot is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a map generation method.
[0135] Those skilled in the art can understand that Figure 5 the structure shown in the figure is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the cleaning robot to which the solution of this application is applied. The specific cleaning robot may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0136] In one embodiment, a cleaning robot is further provided, including a detection sensor, a driving component, a cleaning component, a memory, and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.
[0137] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.
[0138] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.
[0139] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0140] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.
[0141] The above-described embodiments only represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A method for generating a map, characterized in that, The method includes: Determining a plurality of adjacent pixel sequence groups in the foreground map of the initial region segmentation map, where the magnitude of the pixel gradient change of the adjacent pixel sequence groups in a preset direction is greater than a preset magnitude; Determining a curved adjacent boundary between different map regions in the initial region segmentation map, and selecting a target pixel sequence group corresponding to the curved adjacent boundary from each of the adjacent pixel sequence groups, where the curved adjacent boundary is an adjacent boundary that is not parallel to the preset direction; Updating the curved adjacent boundary between different map regions in the initial region segmentation map according to the target pixel sequence group to obtain a target region segmentation map.
2. The method according to claim 1, characterized in that, The step of selecting a target pixel sequence group corresponding to the curved adjacent boundary from each of the adjacent pixel sequence groups includes: Locating the circumscribed rectangle region of the curved adjacent boundary in the initial region segmentation map; For each of the adjacent pixel sequence groups, locating the interval connected region between the pixel sequences in the foreground map; Selecting a target pixel sequence group corresponding to the curved adjacent boundary from each of the adjacent pixel sequence groups according to the overlap degree between the circumscribed rectangle region and each of the interval connected regions.
3. The method according to claim 1, wherein The step of selecting a target pixel sequence group corresponding to the curved adjacent boundary from each of the adjacent pixel sequence groups includes: For each of the adjacent pixel sequence groups, locating the interval connected region between the pixel sequences in the foreground map; Selecting a target pixel sequence group corresponding to the curved adjacent boundary from each of the adjacent pixel sequence groups according to the interval distance between the first central position of each of the interval connected regions and the second central position of the curved adjacent boundary.
4. The method according to claim 1, wherein The step of selecting a target pixel sequence group corresponding to the curved adjacent boundary from each of the adjacent pixel sequence groups includes: Locating the circumscribed rectangle region of the curved adjacent boundary in the initial region segmentation map; For each of the adjacent pixel sequence groups, locating the interval connected region between the pixel sequences in the foreground map; Determining the overlap degree between the circumscribed rectangle region and each of the interval connected regions, and the interval distance between the first central position of each of the interval connected regions and the second central position of the curved adjacent boundary; Selecting a target pixel sequence group corresponding to the curved adjacent boundary from each of the adjacent pixel sequence groups according to each of the overlap degrees and each of the interval distances.
5. The method according to claim 4, characterized in that, The step of selecting a target pixel sequence group corresponding to the curved adjacent boundary from each of the adjacent pixel sequence groups according to each of the overlap degrees and each of the interval distances includes: Selecting, according to each of the interval distances, pixel sequence groups with an interval distance less than a preset distance threshold from each of the adjacent pixel sequence groups as candidate pixel sequence groups; Selecting, according to each of the overlap degrees, the pixel sequence group with the highest overlap degree from each of the candidate pixel sequence groups as the target pixel sequence group.
6. The method according to claim 1, characterized in that, The step of determining a plurality of adjacent pixel sequence groups in the foreground map of the initial region segmentation map includes: Determine a first pixel sequence and a second pixel sequence in a preset direction in the foreground map, where the first pixel sequence and the second pixel sequence are adjacent; Obtain the number of first pixels in the first pixel sequence and the number of second pixels in the second pixel sequence; If the absolute value of the difference between the number of first pixels and the number of second pixels is greater than a preset threshold, determine that the first pixel sequence and the second pixel sequence form an adjacent pixel sequence group.
7. The method according to claim 1, characterized in that Updating the curved adjacent boundary between different map regions in the initial region segmentation map according to the target pixel sequence group to obtain a target region segmentation map includes: Determine the segmentation boundary between the first map region and the second map region corresponding to the curved adjacent boundary according to the target pixel sequence group; Segment the first map region and the second map region respectively according to the segmentation boundary to obtain a plurality of segmented regions; Using the segmentation boundary as a new adjacent boundary, merge each of the segmented regions into the first map region or the second map region in the initial region segmentation map to obtain a target region segmentation map.
8. The method according to claim 1, wherein Determining the curved adjacent boundary between different map regions in the initial region segmentation map includes: Traverse the adjacent boundaries between different map regions in the initial region segmentation map to obtain the position coordinates of all adjacent boundaries; Filter the curved adjacent boundaries from all the adjacent boundaries according to the position coordinates of all the adjacent boundaries.
9. The method according to claim 1, characterized in that, Before determining a plurality of adjacent pixel sequence groups in the foreground map of the initial region segmentation map, the method further includes: Perform binarization processing on the initial region segmentation map to obtain a binarized image; Separate the foreground and background of the binarized image according to the pixel value distribution of the binarized image to obtain the foreground map of each map region in the initial region segmentation map.
10. A cleaning robot, comprising a detection sensor, a driving component, a cleaning component, a memory, and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 9.