WO2020215910A1 - 封闭空间的区域分割方法、装置和可移动设备 - Google Patents

封闭空间的区域分割方法、装置和可移动设备 Download PDF

Info

Publication number
WO2020215910A1
WO2020215910A1 PCT/CN2020/078543 CN2020078543W WO2020215910A1 WO 2020215910 A1 WO2020215910 A1 WO 2020215910A1 CN 2020078543 W CN2020078543 W CN 2020078543W WO 2020215910 A1 WO2020215910 A1 WO 2020215910A1
Authority
WO
WIPO (PCT)
Prior art keywords
point
candidate
points
line segment
area
Prior art date
Application number
PCT/CN2020/078543
Other languages
English (en)
French (fr)
Inventor
吴晨豪
吴旻升
张一茗
陈震
Original Assignee
速感科技(北京)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 速感科技(北京)有限公司 filed Critical 速感科技(北京)有限公司
Publication of WO2020215910A1 publication Critical patent/WO2020215910A1/zh
Priority to US17/509,039 priority Critical patent/US20220044410A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/162Segmentation; Edge detection involving graph-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30241Trajectory

Definitions

  • the invention relates to the field of movable equipment, and in particular to a method, device and movable equipment for dividing a closed space.
  • Movable equipment refers to equipment that autonomously performs preset tasks in a set enclosed space.
  • movable equipment usually includes but is not limited to cleaning robots (such as smart sweepers, smart floor cleaners, window cleaning robots), companion mobile robots (Such as smart electronic pets, nanny robots), service mobile robots (such as hospitality robots in hotels, hotels, and meeting places), industrial inspection intelligent equipment (such as electric inspection robots, intelligent forklifts, etc.), security robots (such as home or Commercial intelligent security robot).
  • cleaning robots such as smart sweepers, smart floor cleaners, window cleaning robots
  • companion mobile robots such as smart electronic pets, nanny robots
  • service mobile robots such as hospitality robots in hotels, hotels, and meeting places
  • industrial inspection intelligent equipment such as electric inspection robots, intelligent forklifts, etc.
  • security robots such as home or Commercial intelligent security robot.
  • Movable devices move in a closed space. In order to better complete preset tasks, it is usually necessary to distinguish each room, such as moving to a designated room, local cleaning, etc. In related technologies, the center of the room is usually identified first, and then expanded from the center to the boundary to complete the room segmentation. However, this room segmentation method will have certain problems in accuracy and segmentation efficiency.
  • the present invention provides a method, device and movable equipment for dividing a closed space.
  • a method for dividing a closed space area including:
  • the processing the track points and identifying the correct door in the enclosed space in combination with the map includes:
  • the track point includes: a real track point and/or a virtual track point
  • the acquiring of the track point includes:
  • the acquiring a map of the enclosed space includes:
  • the determining candidate points according to the track points includes:
  • a line segment formed by the intersection of a straight line passing through the trajectory point and in an optional direction and the boundary of obstacles on both sides of the trajectory point is determined as an optional line segment;
  • the determining the shortest line segment to be adopted in the selectable line segments includes:
  • the shortest line segment is selected from all the selectable line segments, and the shortest line segment is determined as the shortest line segment to be adopted; or,
  • the shortest line segment is selected from all the selectable line segments, and if the length of the shortest line segment is within the preset length range, the shortest line segment is determined as the shortest line segment to be adopted; or,
  • An optional line segment with a length within a preset length range is selected from all the selectable line segments, and the shortest line segment among the optional line segments with a length within the preset length range is determined as the shortest line segment to be adopted.
  • the clustering of the candidate points includes: corresponding to two candidate points, and if the distance between the two candidate points is less than the sum of the radii corresponding to the two candidate points, then The two candidate points are classified into the same cluster; wherein the radius corresponding to the candidate point is half the length of the shortest line segment where the candidate point is located;
  • the determining the cluster representative points in the clusters includes: in each cluster, determining the corresponding candidate point with the smallest radius as the cluster representative point of the corresponding cluster;
  • the screening of the candidate doors to obtain a reasonable door includes: traversing each candidate door, obtaining the area of the enclosed area corresponding to each candidate door, and the length of the enclosed area in a preset direction The ratio of the length to the length of the candidate door; if the area is within the preset area and the length ratio is within the preset length ratio, then the candidate door is retained as a reasonable door.
  • the screening of the cluster representative points to determine candidate gates includes:
  • the constructed map includes at least two dimensions, the at least two dimensions include a first dimension and a second dimension, and the first dimension is The dimension where the measurement value is located, the second dimension is the dimension where the projection distance value is located, and the projection distance value is the component of the distance value between each selected point and the cluster representative point in a direction perpendicular to the measurement value;
  • the gate corresponding to the cluster representative point is determined as a candidate gate, otherwise the cluster is eliminated Class representative point
  • the positive relationship means that as the projection distance value between the selected points and the cluster representative points decreases, the metric value of the corresponding selected points in the first dimension remains unchanged or decreases.
  • the determining the selection area where the cluster representative point is located includes:
  • the two-dimensional direction is the length direction, and the selection rectangle is determined, where N and M are set values, and N is less than or equal to M;
  • the selecting several points in the selection area includes:
  • the constructing a map with the selected points in the selection area includes:
  • the length and width directions parallel to the selected area rectangle are respectively used as the horizontal and vertical coordinates to construct a two-dimensional graph; the projection distance value and measurement value of each selected point are respectively used as the horizontal and vertical coordinates in the two-dimensional graph. coordinate;
  • determining the gate corresponding to the cluster representative point as a candidate gate includes:
  • the cluster representative points are retained, and the gate corresponding to the cluster representative point is determined as a candidate gate.
  • the performing region fusion on the region divided by the reasonable door, and selecting the correct door from the reasonable door includes:
  • a first line segment and a second line segment are respectively determined in the first candidate area and the second candidate area.
  • the first line segment is a line segment formed by the midpoint of a reasonable gate and the first intersection point
  • the second The line segment is the line segment formed by the midpoint of the reasonable door and the second intersection point
  • the first intersection point is the intersection point of the first ray and the first candidate area at the farthest point in the direction perpendicular to the reasonable door
  • the second intersection point is the first The intersection of the two rays and the second candidate area at the farthest point in the direction perpendicular to the reasonable door
  • the first ray is a ray starting from the midpoint of the reasonable door and extending to the first candidate area and perpendicular to the direction of the reasonable door
  • the second ray is a ray that starts from the midpoint of the reasonable door, extends to the second candidate area, and is perpendicular to the direction of the reasonable door;
  • the distance value corresponding to the scattered point includes: a first distance value and a first distance value.
  • the first distance value is the distance value from the intersection of a straight line passing the scatter point and parallel to the reasonable gate on the first side of the scatter point and the boundary of the candidate area where the scatter point is located to the scatter point
  • the second distance value is the distance value from the intersection of a straight line passing through the scatter point and parallel to the reasonable gate on the second side of the scatter point and the boundary of the candidate area where the scatter point is located to the scatter point;
  • the first side and the second side of the scatter point are the two directions of the straight line passing through the scatter point and parallel to the reasonable gate with respect to the scatter point;
  • it also includes:
  • the predetermined tasks of the movable equipment are performed in the sub-area.
  • an area segmentation device in a closed space including: a map acquisition module for acquiring a map of the closed space; a track point acquisition module for acquiring track points; and an identification module for The track points are processed, and the correct door in the enclosed space is identified in combination with the map; a segmentation module is used to segment the enclosed space by using the correct door in combination with the map.
  • the identification module includes: a candidate point determination unit, configured to determine candidate points according to the track points; a clustering unit, configured to cluster the candidate points and determine cluster representative points in the cluster ; Candidate gate determination unit, used to screen the cluster representative points to determine candidate gates; Reasonable gate determination unit, used to screen candidate gates to obtain reasonable gates; Area fusion unit, used to screen the reasonable Regions divided by doors are merged, and correct doors are selected from the reasonable doors.
  • the trajectory points include: real trajectory points, and/or virtual trajectory points
  • the trajectory point acquisition module is specifically configured to: acquire the real trajectory points actually passed by the movable device in the enclosed space; and/ Or, using a preset virtual trajectory point generating algorithm to generate virtual trajectory points on the map of the enclosed space.
  • the candidate point determination unit is specifically configured to: corresponding to each trajectory point, determine the line segment formed by the intersection of a straight line passing through the trajectory point and in an optional direction and the boundary of obstacles on both sides of the trajectory point as Optional line segment; determine the shortest line segment to be adopted among the selectable line segments; determine the midpoint of the shortest line segment to be adopted as a candidate point.
  • the candidate point determining unit is further specifically configured to: select the shortest line segment from all the selectable line segments, and determine the shortest line segment as the shortest line segment to be adopted; or, select from all the selectable line segments The shortest line segment, if the length of the shortest line segment is within the preset length range, the shortest line segment is determined as the shortest line segment to be adopted; or, among all the selectable line segments, the length is within the preset length range The shortest line segment among the selectable line segments whose length is within the preset length range is determined as the shortest line segment to be adopted.
  • the clustering unit is specifically configured to correspond to two candidate points, and if the distance between the two candidate points is less than the sum of the radii corresponding to the two candidate points, then the two candidate points are classified Are the same cluster; wherein the radius corresponding to the candidate point is half of the length of the shortest line segment where the candidate point is located.
  • the clustering unit is further specifically configured to: in each cluster, determine the candidate point with the smallest corresponding radius as the cluster representative point of the corresponding cluster.
  • the candidate gate determining unit is specifically used to: determine the selection area where the cluster representative point is located; select a number of points in the selection area, and draw a straight line parallel to the shortest line segment where the cluster representative point is located through each selected point, and calculate The measurement value of the intersection of each straight line and the boundary of the obstacles on both sides thereof; a graph is constructed using the selected points in the selected area, wherein the constructed graph includes at least two dimensions, the at least two dimensions It includes a first dimension and a second dimension, where the first dimension is the dimension where the metric value is located, the second dimension is the dimension where the projection distance value is located, and the projection distance value is each selected point and cluster representative point The component of the distance value in the direction perpendicular to the metric value; if the projection distance values between the selected points and the cluster representative points have a positive relationship with their corresponding metric values, the cluster is represented The door corresponding to the point is determined as a candidate door, otherwise the cluster representative point is eliminated; the positive relationship means that as the projection distance value between
  • the gate determining unit is further specifically configured to: take the cluster representative point as the center, take N times the length of the shortest line segment where the cluster representative point is located, and take M times the length of the shortest line segment where the cluster representative point is located.
  • determine the selection rectangle where N and M are set values, and N is less than or equal to M; select a number of points parallel to the length of the selection rectangle, and cross each point as the shortest line segment parallel to the cluster representative point Calculate the measurement value of the intersection of the straight line and the boundary of the obstacles on both sides; the coordinate of each point in the length direction parallel to the selected area rectangle and the measurement value are respectively used as the horizontal and vertical coordinates to construct a two-dimensional Figure; if the two-dimensional graph is a valley graph, the cluster representative points are retained, and the gate corresponding to the cluster representative point is determined as a candidate gate.
  • the reasonable door determining unit is specifically configured to: traverse each candidate door to obtain the area of the enclosed area corresponding to each candidate door, and the length of the enclosed area in the preset direction and the length of the candidate door If the area is within the preset area and the length ratio is within the preset length ratio, then the candidate door is retained as a reasonable door.
  • the area fusion unit is specifically configured to: traverse each reasonable door, and obtain the two areas connected by each reasonable door as the first candidate area and the second candidate area; in the first candidate area and the second candidate area; A first line segment and a second line segment are respectively determined in the candidate area.
  • the first line segment is a line segment formed by the midpoint of a reasonable door and the first intersection point
  • the second line segment is formed by the midpoint of a reasonable door and the second intersection point.
  • the first intersection point is the intersection point of the first ray and the first candidate area at the farthest point perpendicular to the reasonable door
  • the second intersection point is the second ray and the second candidate area perpendicular to the reasonable door.
  • the farthest intersection point in the direction, the first ray is a ray that starts from the midpoint of the reasonable door, extends to the first candidate area, and is perpendicular to the direction of the reasonable door, and the second ray is from the middle of the reasonable door
  • the distance value corresponding to the scattered point includes: a first distance value and a second distance value, and the first distance value is a straight line passing through the scattered point and parallel to the reasonable gate on the first side of the scattered point The distance value from the intersection with the boundary of the candidate area where the scatter point is located to the scatter point; the second distance value is a straight line passing through the scatter point and parallel to the reasonable gate on the second side of the scatter point and the The distance value from the intersection of the boundary of the candidate area where the scatter point is located to the
  • the map acquisition module is specifically configured to: acquire an original map, process the original map, and extract a contour;
  • it further includes: an execution module, which is used to execute a predetermined task of the movable device in each area obtained by the area division.
  • a non-transitory computer-readable storage medium When instructions in the storage medium are executed by a processor of a removable device, the removable device can execute the same as in the first aspect.
  • the described closed space area division method When instructions in the storage medium are executed by a processor of a removable device, the removable device can execute the same as in the first aspect.
  • a removable device including: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured to read the executable instructions in the memory. The instruction is executed to execute the closed space area division method as described in the first aspect.
  • the movable device further includes: an execution component, which is configured to perform a predetermined task of the movable device in each area in each area obtained by the area division under the control of the processor.
  • an execution component which is configured to perform a predetermined task of the movable device in each area in each area obtained by the area division under the control of the processor.
  • Fig. 1 is a flowchart of a method for dividing a closed space according to an embodiment of the present invention.
  • Fig. 2a is a schematic diagram of a flow of preprocessing the original map to obtain a map of a closed space in an embodiment of the present invention
  • 2b is a schematic diagram of the outline of a tree structure extracted in an embodiment of the present invention.
  • Figure 2c is a schematic diagram of an original map according to an embodiment of the present invention.
  • 2d is a schematic diagram of a closed space map obtained after preprocessing the original map according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of the process of identifying the correct door in a map of a closed space in an embodiment of the present invention
  • 4a is a schematic diagram of track points and corresponding candidate points in an embodiment of the present invention.
  • 4b is a schematic diagram of candidate point clustering and cluster representative points in an embodiment of the present invention.
  • Figures 5a-5d are schematic diagrams of candidate gates obtained by screening cluster representative points in an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of screening candidate doors to determine a reasonable door in an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of performing regional fusion on reasonable doors to determine the correct door in an embodiment of the present invention.
  • 8a-8g are simulation diagrams from determining the track point to determining the correct door in the embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of a closed space area dividing device provided by an embodiment of the present invention.
  • Fig. 10 is a schematic structural diagram of a movable device provided by an embodiment of the present invention.
  • the enclosed space mentioned in the present invention refers to a completely enclosed area space or a partially enclosed area space; correspondingly, the enclosed space map referred to in the present invention refers to a map of an at least partially enclosed area space, for example, the map is
  • the map of the completely enclosed area space is shown in Fig. 2d or Fig. 4b.
  • the area space K enclosed by the complete white enclosed boundary is the all enclosed area space; for another example, this
  • the map includes a closed part and a non-closed part, as shown in Fig. 4a, Fig. 5a-5d or Fig. 6, as shown in Fig.
  • the boundary w2 and the boundary w3 constitute the closed part
  • the boundary w2 and the boundary w4 Form a non-enclosed part
  • the map includes both a partially or fully enclosed area space and an open area space extending from the partially or fully enclosed area space.
  • the map includes both a partial or complete indoor area space It also includes a map of the external open area space (such as courtyard, etc.) connected to the indoor area space.
  • Fig. 1 is a flowchart of a method for dividing a closed space provided by an embodiment of the present invention. As shown in Fig. 1, it includes the following steps:
  • the map of the enclosed space to be divided is directly input, and the input map is directly used as the map of the enclosed space. or,
  • the original map is preprocessed, and the preprocessed map is used as a closed space map.
  • the original map is constructed by a movable device.
  • the movable device is a cleaning robot.
  • the cleaning robot can construct a map at the same time while performing a cleaning task, and use the map constructed by the cleaning robot as the original map.
  • steps S11 and S12 can be reversed, that is, in some embodiments, step S11 is performed first and then step S12, while in some embodiments, step S12 is performed first and then step S11 is performed; for some embodiments Steps S11 and S12 can be performed simultaneously or in any order.
  • step S12 is executed first to obtain a map of the enclosed space by preprocessing the original map, and then step S12 is executed to obtain the track points from the map of the enclosed space; if there is a track at the beginning Point coordinate values (such as x, y values or x, y, z values), steps S11 and S12 can be performed at the same time or in no order.
  • step S12 The combination of these sequences naturally includes the sequence of performing step S12 first and then performing S11.
  • step S12 several track points can be obtained by directly inputting the coordinate values of the track points. Therefore, those skilled in the art should understand that the order of step S11 and step S12 should not limit the claims of the present invention.
  • S13 Process the track points, and identify the correct door in the enclosed space in combination with the map.
  • the door is first identified, and the area is divided based on the door.
  • the division of regions based on gates is more in line with objective laws, which makes the results of region division more accurate.
  • Door recognition is based on the processing of track points, combined with the map of the enclosed space.
  • the track points include real track points, and/or virtual track points.
  • the real trajectory point is the trajectory point that the movable device actually passes in the enclosed space.
  • the virtual trajectory point is a virtual point obtained by an algorithm based on a map in a closed space, for example, a virtual point obtained by a triangulation algorithm.
  • trajectory points can be obtained by recording the real trajectory points actually passed by the movable device in the enclosed space, and/or using a preset algorithm to generate virtual trajectory points.
  • the different regions divided by the correct door are used as the region segmentation result. For example, taking room division as an example, each area separated by the correct door is regarded as a room.
  • the mobile device after the mobile device divides the enclosed space, it can perform tasks in different areas. For example, taking a mobile device as a cleaning robot as an example, after the cleaning robot divides each room, it can perform room-by-room cleaning, thereby improving cleaning efficiency and saving time.
  • the correct door is identified in the enclosed space and the correct door is used for region segmentation. Since the door segmentation criterion is more in line with the objective law, the accuracy of region segmentation is improved, which can further facilitate the regional execution of mobile devices Tasks to improve the efficiency of task execution. Further, by processing the track points to identify the door, the algorithm complexity can be reduced and the calculation speed can be improved.
  • the obtaining a map of the enclosed space may optionally include: obtaining an original map, processing the original map, and extracting contours; screening the extracted contours, and drawing a map of the enclosed space with the reserved contours.
  • the specific form of the original map is different, and its processing method may be different.
  • the original map can be at least one form among grayscale maps, color maps, vector diagrams, scatter maps, etc.; no matter which form of the original map, it can be processed to finally extract its outline.
  • Fig. 2a is a schematic flow chart of preprocessing the original gray map to obtain the map of the closed space in the embodiment of the present invention. Taking the original gray map as an example, as shown in Figure 2a, the preprocessing process includes:
  • thresholding the original map refers to converting the grayscale map into a binary map. For example, setting a threshold and setting the pixel value of pixels with a grayscale value greater than the threshold to 255 (white ), otherwise set to 0 (black) to get a binary map.
  • S22 Perform morphological processing on the binary map and extract contours.
  • Morphology namely Mathematical Morphology
  • the main application is to extract image components that are meaningful for expressing and depicting the shape of an area from an image, so that subsequent recognition work can capture the target object
  • the most essential (most discrimination) shape features such as boundaries, connected areas, etc.
  • Morphological processing includes corrosion, expansion, opening and closing operations.
  • the morphological closing operation can be performed on the binary image, thereby increasing the connected domain of the map and eliminating some noise at the same time.
  • morphological processing is not a necessary step of the present invention. Even if morphological processing is not performed on the binary map, as long as the outline can be extracted through the binary map, the correct gate can still be found through subsequent steps to perform region segmentation.
  • the color map cannot be directly thresholded, if the original color map is obtained, it can be converted into a grayscale map, and then thresholded through step S21, and then morphological analysis of the obtained binary map through step S22 ; It is also possible to directly perform morphological processing on the color original map, and then extract the contour without thresholding.
  • Existing contour extraction algorithms can be used when extracting contours, for example, tree structure extraction contours, where the contour with the largest area is used as the outer contour of the room, and the contour with the smaller area is used as the inner contour of the room.
  • contour c0 (node 0) and contour h00 (node 1) and h01 (node 2) constitute area A; contour c000 (node 3) and contour h0000 (node 5) constitute area B; contour c010 (node 4) Contour h0100 (node 6) forms area C; contour c01000 (node 7) is area D; contour c01001 (node 8) is area E.
  • the nodes in the contour tree can be traversed from top to bottom.
  • area A is the largest area
  • areas B and C are sub-areas of area A; among them, area C is the sub-area with the largest area in area A, so only sub-area C is retained and sub-area B is removed
  • the internal contours are retained, and the internal contour noise is removed (for example, removing areas with an area less than 1 m 2 can remove areas that are useless for room segmentation such as table legs).
  • the retained contours are taken as the boundaries of the obstacles in the map, and the map for subsequent processing is drawn.
  • the original grayscale map is processed in step S21 to obtain a binary map as shown in Fig. 2c, and after morphological processing in step S22 and contour extraction, area O is obtained, where area O includes sub-regions F, G, H, K
  • area O includes sub-regions F, G, H, K
  • the sub-region K with the largest area is retained, and the sub-regions F, G, and H are eliminated to obtain the closed space map as shown in FIG. 2d.
  • Fig. 3 is a schematic diagram of the process of processing the track points in the embodiment of the present invention to identify the correct door in the enclosed space. As shown in Fig. 3, the process includes:
  • the candidate point is the midpoint of the shortest line segment to be adopted; the shortest line segment to be adopted is determined in the optional line segment; the optional line segment is the line passing through the track point and the direction is the optional direction and the obstacles on both sides of the track point The line segment formed by the intersection of the object boundary.
  • the optional direction can be selected according to needs, for example, taking a certain direction as the reference (for example, taking the x-axis as the reference), choosing two directions parallel and perpendicular to the reference direction as the optional directions; or choosing to be in line with the reference direction 4 directions of 0°(180°), 45°(225°), 90°(270°), 135°(315°) are optional directions.
  • point t is the trajectory point
  • the selectable directions are the directions of three straight lines L1, L2, and L3 (shown as dashed lines in Figure 4a).
  • the straight line L1 and the obstacle boundary w1, w2 intersect at p1 and p2, respectively Point; straight line L2 and obstacle boundary w1, w2 intersect at points p3 and p4 respectively; straight line L3 and obstacle boundary w3, w4 intersect at obstacle boundary points p5 and p6 respectively, then the optional line segments passing through trajectory point t are : Line segment p1-p2, line segment p3-p4 and line segment p5-p6.
  • the shortest line segment to be adopted is the shortest line segment among all the selectable line segments. For example, in line segments p1-p2, line segments p3-p4, and line segments p5-p6, line segment p1-p2 is the shortest line segment, then line segment p1 -p2 is determined as the shortest line segment.
  • the shortest line segment to be used not only meets the shortest limit, but also requires the shortest line segment to be within a preset length range (called "distance range rule").
  • the preset length range is a parameter related to the horizontal size of the door, such as It can be 0.5 meters to 2.5 meters, when the line segment p1-p2 is the shortest line segment, if the line segment p1-p2 is still within the range of 0.5 meters to 2.5 meters, the line segment p1-p2 is determined as the shortest line segment, otherwise, if the shortest line segment (Such as line segment p1-p2) is not within the range of 0.5 meters to 2.5 meters, there is no candidate point corresponding to the current track point, and the track point (such as track point t) is eliminated.
  • the shortest line segment to be adopted is the shortest line segment among the selectable line segments whose length is within the preset length range.
  • the difference from the previous embodiment is that in the previous embodiment, the shortest line segment is selected first, and then it is determined whether the shortest line segment is within the preset length range.
  • the selectable line segments are first selected to meet the preset length range.
  • Optional line segment also called "distance range rule"
  • all the optional line segments passing through the track point t include: line segment p1-p2, line segment p3-p4 and line segment p5-p6, then these three line segments are respectively compared with the preset length range, assuming line segment p1-p2 and line segment p3 -p4 is within the preset length range, and the line segment p5-p6 is not within the preset length range, then the shortest line segment is selected from the line segment p1-p2 and line segment p3-p4, assuming that the line segment p1-p2 is shorter than the line segment p3-p4, Then the shortest line segment to be adopted is the line segment p1-p2.
  • the boundary of each obstacle is determined.
  • the boundary w1 to w4 of the obstacle in Fig. 4a are determined in position, and each track point is also determined in position, and the optional direction is determined.
  • the length of each optional line segment mentioned above can be calculated according to the determined parameters.
  • the midpoint is used as the candidate point.
  • the shortest line segment to be adopted is the line segment p1-p2
  • the midpoint C1 of the line segment p1-p2 is used as the candidate point.
  • the above embodiment sets the number of selectable directions, that is, the number of selectable line segments is determined.
  • the shortest line segment is the shortest among these selectable line segments. Since the selectable directions do not include all directions, Therefore, the shortest line segment is not necessarily the shortest line segment in all directions.
  • selectable line segments can be determined from all directions across the track point, and the shortest line segment can be selected from the selectable line segments in all directions. In this case, the shortest line segment is the actual shortest line segment in all directions.
  • S32 Cluster candidate points, and determine cluster representative points in the cluster.
  • the candidate points are clustered through the clustering rules, and the cluster representative points in the cluster are determined by the selection rules of the cluster representative points; the clustering rules and the selection rules of the cluster representative points can be set as needed.
  • the clustering rules are as follows:
  • the radius corresponding to the candidate point is half of the length of the shortest line segment where the candidate point is located.
  • the shortest line segment where the candidate point C1 is located is the line segment p1-p2
  • the radius corresponding to the candidate point C1 refers to half the length of the line segment p1-p2.
  • the radius corresponding to candidate point C1 is also the distance from candidate point C1 to point p1 or the distance from C1 to point p2.
  • the selection rules of cluster representative points are as follows:
  • the candidate point with the smallest corresponding radius is determined as the cluster representative point of the corresponding cluster. It can be understood that, equivalent to the radius, the diameter of the candidate points can also be compared, and the candidate point with the smallest diameter is used as the cluster representative point of the corresponding cluster.
  • the diameter of the candidate point refers to the length of the shortest line segment where the candidate point is located.
  • the movable device 10 starts from the lower left corner of the figure, moves from left to right, and from bottom to top, along the inner boundary of the enclosed space map.
  • the black dots in the figure represent the track points, and the black dots pass
  • the dotted line in represents the shortest line segment that passes the track point. According to the definition of “candidate point” above, the white dots in the middle of these dotted lines represent possible candidate points.
  • the above-mentioned "distance range rule" used to select candidate points divides the dotted line in the figure into white dot candidate points and white square culling candidate points, that is, the shortest line segment of white dots (such as 62, 63, etc.) Within the preset length range, and the shortest line segment of the white square (such as 61, 65, etc.) is outside the preset length range.
  • S33 Screen the cluster representative points to determine candidate gates.
  • the cluster representative points are screened by the cluster representative points' screening rules to determine candidate gates; the cluster representative points' screening rules can be set according to actual requirements.
  • the screening rule of the cluster representative points is based on the gate criterion, the cluster representative points that meet the gate criterion are retained, and the cluster representative points that do not meet the gate criterion are discarded.
  • the gate criterion refers to:
  • the gate corresponding to the cluster representative point is determined as a candidate gate, otherwise all The cluster representative points.
  • the positive relationship means that, in the constructed graph, as the projection distance value between the selected points decreases (that is, as the selected point gets closer and closer to the cluster representative point in the second dimension) , The measurement value of the corresponding selected point in the first dimension remains unchanged or decreases.
  • the selection area is determined as follows: the cluster representative point is the center, the cluster representative point is N times the length of the shortest line segment as the width, the measurement value direction is the width direction, and the cluster representative point is The length of the shortest line segment is M times the length, and the second dimension direction is the length direction to determine the selection rectangle, where N and M are set values, and N is less than or equal to M.
  • a number of points are selected parallel to the length of the selection rectangle, and a straight line parallel to the shortest line segment where the cluster representative point is located is drawn through each selected point, and the measurement value of the intersection of the straight line and the boundary of the obstacle on both sides of the line is calculated. It is also possible to randomly select several selected points within the selection rectangle.
  • the constructed graph can also be two-dimensional, three-dimensional or multi-dimensional. Taking two-dimensional as an example, the graph can be constructed as follows:
  • the length and width directions parallel to the selected area rectangle are respectively used as the horizontal and vertical coordinates to construct a two-dimensional graph; the projection distance value and measurement value of each selected point are respectively used as the horizontal and vertical coordinates in the two-dimensional graph. coordinate.
  • the cluster representative point is retained, and the gate corresponding to the cluster representative point is determined as a candidate gate; otherwise, the cluster representative point is eliminated.
  • the valley chart refers to the selected point closer to the cluster representative point in the second dimension (that is, the smaller the projection distance value from the cluster representative point), and the metric value remains unchanged or smaller, which meets the above requirements.
  • the projection distance value of the selected point is in a positive relationship with the metric value, and the gate corresponding to the cluster representative point is a candidate gate.
  • the candidate point 66 and the candidate point 88 belong to a cluster
  • the candidate point 97, the candidate point 98 and the candidate point 99 belong to a cluster.
  • N and M are selected as 1 and 2, respectively.
  • the shortest line segments where the two candidate points are located are represented by L1 and L2 respectively, and the length of the shortest line segment is represented by d1.
  • d2 indicate that the selection rectangle A1 with the candidate point 88 and the selection rectangle A2 with the candidate point 98 as the center are obtained respectively.
  • the length direction of the selection rectangle is represented by L3 and L4 respectively, and then select a number of points in the direction parallel to L3 and L4, and make a straight line parallel to L1 and L2 through each point, and calculate the straight line and the obstacle boundary on both sides The measure of the intersection.
  • the measurement value is the distance between the intersection of the above-mentioned straight line and the boundary of the two obstacles on both sides as an example.
  • Figure 5b which corresponds to the selection rectangle A1
  • the selected click is from left to right
  • the above metric values are d1+d3, d1, d1+d3+d4.
  • the metric value is not limited to the distance value between the intersection of the above-mentioned straight line and the boundary of the two obstacles on both sides thereof, and can also be selected as other values, for example, a value that passes through the selected point and is parallel to the L1 direction in Figure 5b.
  • the sum of the distances from each of these points to the boundary of L1 and the upper and lower obstacles is taken as Point 88 measure.
  • a two-dimensional graph as shown in Figure 5c can be constructed, see Figure 5c, where the metric value, that is, the direction of the line segment L1 is the first dimension of the two-dimensional graph , The dimension perpendicular to the measurement value, that is, the direction of the line segment L1 is the second dimension of the two-dimensional graph.
  • the selection rectangle A1 in Figure 5b select several points in the selection area A1, such as selecting points q1 and q2.
  • the measurement value of the candidate point 88 is d1, which is far away from the candidate point 88 and
  • the metric values of the selected points q1 and q2 in A1 are d1+d3 and d1+d3+d4, respectively, which are greater than d1, then the two-dimensional graph is a valley graph, that is, the cluster representative point or the vicinity of the candidate point in the graph
  • the metric value of the selected point is less than or equal to the metric value of the dimension that is perpendicular to the direction of the metric value and is farther from the cluster representative point or candidate point, indicating that the cluster representative point or candidate point and/or its nearby location Located in the narrow area of the selection rectangle A1, it is likely to correspond to the door in the actual enclosed space map, so the candidate point 88 is reserved; the door that the candidate point 88 may correspond to may be the shortest line segment L1 where the candidate point 88 is located, then the shortest The line segment L1 serves as a candidate gate.
  • the candidate point 98 in FIG. 5c also satisfies the gate criterion, and the shortest line segment L2 where the candidate point 98 is located is also used as a candidate gate.
  • the gate criterion is also satisfied, and the gates that the candidate point 88 and the candidate point 98 may represent are candidate gates, respectively.
  • the constructed graph is not limited to a two-dimensional graph, and may also be a three-dimensional or more multi-dimensional graph.
  • a three-dimensional map can also be constructed.
  • the values corresponding to the three dimensions of the three-dimensional map are: metric value, and two-dimensional position coordinates in the two-dimensional map.
  • the gate corresponding to the cluster representative point is a candidate gate.
  • it can also be a four-dimensional graph.
  • a four-dimensional graph is composed of three-dimensional space coordinates and one-dimensional measurements.
  • the three-dimensional space coordinates include two-dimensional horizontal coordinates and one-dimensional height coordinates. If a point is selected to the cluster representing the point on the height coordinate
  • the projection distance has the above-mentioned positive relationship with the measured value of the selected point, and the height coordinate of the representative point of the cluster may represent that the distance from the upper edge of the door frame to the ground is less than the distance from the ceiling to the ground on both sides of the door frame, which should be regarded as Candidate door.
  • the candidate door obtained through the above steps does not correspond to a real door in the actual enclosed space. Therefore, in the preferred embodiment of the present invention, the candidate gates need to be screened through the following steps to remove unreasonable candidate gates.
  • each candidate door is traversed to obtain the area of the enclosed area corresponding to each candidate door, and the ratio of the length of the enclosed area in the preset direction to the length of the candidate door; if the area is in Within the preset area range and the length ratio is within the preset length ratio range, the candidate door is retained as a reasonable door, otherwise the candidate door is eliminated.
  • the closed area corresponding to the candidate door refers to the closed area formed by the candidate door and the boundary closest to the candidate door in the map, and the preset direction is, for example, the long axis direction of the closed area.
  • the candidate doors are represented by 61 and 62 respectively, and the lengths of the corresponding candidate doors are represented by X1 and X2, respectively.
  • the closed area formed by the candidate door and its nearest boundary is represented by D1 and D2, respectively.
  • the areas of D1 and D2 are denoted by S1 and S2, respectively, and the lengths of the closed areas D1 and D2 in the long axis direction are denoted by Y1 and Y2, respectively, corresponding to candidate gate 61.
  • the ratio Y1/X1 of the length Y1 of D1 in the preset direction to the length X1 of the candidate door is within the preset length ratio (the preset length ratio is usually greater than 2), then the candidate door 61 is a reasonable door, otherwise, if S1 is not within the preset area range, and/or Y1/X1 is outside the preset length ratio range, the candidate door 61 is not a reasonable door, and the candidate door 61 is eliminated.
  • the judgment process of the candidate door 62 is also similar, that is, if only S2 is within the preset area range and Y2/X2 is within the preset length ratio range, the candidate door 62 is a reasonable door.
  • this false door can be eliminated by the following steps of regional fusion.
  • the regional integration process can include:
  • a first line segment and a second line segment are respectively determined in the first candidate area and the second candidate area.
  • the first line segment is a line segment formed by the midpoint of a reasonable gate and the first intersection point
  • the second The line segment is the line segment formed by the midpoint of the reasonable door and the second intersection point
  • the first intersection point is the intersection point of the first ray and the first candidate area at the farthest point in the direction perpendicular to the reasonable door
  • the second intersection point is the first The intersection of the two rays and the second candidate area at the farthest point in the direction perpendicular to the reasonable door
  • the first ray is a ray starting from the midpoint of the reasonable door and extending to the first candidate area and perpendicular to the direction of the reasonable door
  • the second ray is a ray that starts from the midpoint of the reasonable door, extends to the second candidate area, and is perpendicular to the direction of the reasonable door;
  • the distance value corresponding to the scattered point includes: a first distance value and a first distance value.
  • the first distance value is the distance value from the intersection of a straight line passing through the scatter point and parallel to the reasonable gate on the first side of the scatter point and the boundary of the candidate area to the scatter point;
  • the second distance value is the distance value from the intersection of a straight line passing through the scatter point and parallel to the reasonable gate on the second side of the scatter point and the boundary of the candidate area to the scatter point;
  • the first side of the scatter point And the second side are the two directions of the above-mentioned straight line passing through the scatter point and parallel to the reasonable door with respect to the scatter point;
  • the right side of the reasonable gate 71 is the first candidate area
  • the left side is the second candidate area
  • the midpoint of the reasonable gate 71 is Pc
  • the first and second points of intersection are Pi and Pj
  • the first line segment and the second line segment are respectively the line segment Pc-Pi and the line segment Pc-Pj.
  • the first line segment and the second line segment are based on the first candidate area and the second candidate area.
  • the reasonable gate 71 is the correct gate; otherwise, if the variance is less than the preset value, it means that the two The side areas are basically the same and should be considered as the same area. At this time, the rational gate 71 is eliminated, so that the first candidate area and the second candidate area are merged into one area.
  • FIG. 8a shows a track point in the map, and the track point may be a real track point and/or a virtual track point.
  • Fig. 8b shows candidate points obtained after screening in the vertical direction. Screening in the vertical direction means that the optional direction of the straight line passing through the track point is selected as the vertical direction.
  • Figure 8c shows the candidate points after clustering.
  • Figure 8d shows cluster representative points and the represented gates, and the represented gates are represented by line segments.
  • Figure 8e shows the candidate gates determined after screening the cluster representative points. Each candidate gate is represented by a thick black line; it is understandable that Figure 8e includes candidate gates in the horizontal direction.
  • FIG. 8f shows a schematic diagram of reasonable doors determined after screening candidate doors. It can be seen that after screening candidate doors, unreasonable room areas are eliminated, and the areas divided by the reserved reasonable doors meet a physical requirement. The nature of the room, that is, the room size and structure are reasonable.
  • Figure 8g shows a schematic diagram of the correct door determined after the area fusion. It can be seen that after the room fusion, the redundant doors in the corridor are eliminated.
  • Fig. 9 is a schematic structural diagram of a closed space area dividing device provided by an embodiment of the present invention. As shown in FIG. 9, the device includes a map acquisition module 91, a track point acquisition module 92, an identification module 93 and a segmentation module 94.
  • the map obtaining module 91 is used to obtain a map of a closed space
  • the track point acquisition module 92 is used to acquire track points
  • the recognition module 93 is configured to process the track points and identify the correct door in the enclosed space in combination with the map;
  • the segmentation module 94 is configured to segment the enclosed space by using the correct door and the map.
  • the identification module 93 includes:
  • a candidate point determining unit configured to determine candidate points according to the track points
  • the clustering unit is used to cluster the candidate points and determine cluster representative points in the cluster
  • Candidate gate determination unit used to screen the cluster representative points and determine candidate gates
  • a reasonable door determining unit used to screen the candidate doors to obtain a reasonable door
  • the region fusion unit is used to perform region fusion on the region divided by the reasonable door, and select the correct door from the reasonable door.
  • the track points include real track points and/or virtual track points
  • the track point acquisition module is specifically configured to:
  • a preset virtual track point generation algorithm is used to generate virtual track points in the map.
  • the candidate point determination unit is specifically configured to:
  • a line segment formed by the intersection of a straight line passing through the trajectory point and in an optional direction and the boundary of obstacles on both sides of the trajectory point is determined as an optional line segment;
  • the midpoint of the shortest line segment to be adopted is determined as a candidate point.
  • the candidate point determination unit is further specifically configured to:
  • the shortest line segment is selected from all the selectable line segments, and the shortest line segment is determined as the shortest line segment to be adopted; or,
  • the shortest line segment is selected from all the selectable line segments, and if the length of the shortest line segment is within the preset length range, the shortest line segment is determined as the shortest line segment to be adopted; or,
  • An optional line segment with a length within a preset length range is selected from all the selectable line segments, and the shortest line segment among the optional line segments with a length within the preset length range is determined as the shortest line segment to be adopted.
  • the clustering unit is specifically used for:
  • the radius corresponding to the candidate point is half of the length of the shortest line segment where the candidate point is located.
  • the clustering unit is also specifically used for:
  • the candidate point with the smallest radius is determined as the cluster representative point of the corresponding cluster.
  • the candidate gate determining unit is specifically configured to:
  • the constructed map includes at least two dimensions, the at least two dimensions include a first dimension and a second dimension, and the first dimension is The dimension where the measurement value is located, the second dimension is the dimension where the projection distance value is located, and the projection distance value is the component of the distance value between each selected point and the cluster representative point in a direction perpendicular to the measurement value;
  • the gate corresponding to the cluster representative point is determined as a candidate gate, otherwise the cluster is eliminated Class representative point
  • the positive relationship means that as the projection distance value between the selected points and the cluster representative points decreases, the metric value of the corresponding selected points in the first dimension remains unchanged or decreases.
  • the door determining unit is further specifically used for:
  • N times the length of the shortest line segment where the cluster representative point is as wide, and M times the length of the shortest line segment where the cluster representative point is as long, determine the selection rectangle, where N and M are Set the value, and N is less than M;
  • the cluster representative points are retained, and the gate corresponding to the cluster representative point is determined as a candidate gate.
  • the reasonable gate determining unit is specifically used for:
  • the candidate door is retained as a reasonable door.
  • the regional fusion unit is specifically used for:
  • a first line segment and a second line segment are respectively determined in the first candidate area and the second candidate area.
  • the first line segment is a line segment formed by the midpoint of a reasonable gate and the first intersection point
  • the second The line segment is the line segment formed by the midpoint of the reasonable door and the second intersection point
  • the first intersection point is the intersection point of the first ray and the first candidate area at the farthest point in the direction perpendicular to the reasonable door
  • the second intersection point is the first The intersection of the two rays and the second candidate area at the farthest point in the direction perpendicular to the reasonable door
  • the first ray is a ray starting from the midpoint of the reasonable door and extending to the first candidate area and perpendicular to the direction of the reasonable door
  • the second ray is a ray that starts from the midpoint of the reasonable door, extends to the second candidate area, and is perpendicular to the direction of the reasonable door;
  • the first distance value and the second distance value is the intersection of a straight line passing through the scatter point and parallel to the reasonable gate on the first side of the scatter point and the boundary of the candidate area where the scatter point is located.
  • the distance value of the scattered point; the second distance value is the intersection of a straight line passing through the scattered point and parallel to the reasonable gate on the second side of the scattered point and the boundary of the candidate area where the scattered point is located to the scattered point
  • the distance value of the scatter point; the first side and the second side of the scatter point are the two directions of a straight line passing through the scatter point and parallel to the reasonable gate with respect to the scatter point;
  • the map acquisition module is specifically used to:
  • it further includes:
  • the execution module is used to execute the predetermined tasks of the movable device in each area divided into areas.
  • FIG. 10 is a schematic structural diagram of a removable device provided by an embodiment of the present invention, including a processor 101 and a memory 102 for storing executable instructions of the processor; the processor is configured to read the executable instructions in the memory Instructions to execute the above-mentioned closed space area division method.
  • the movable device further includes: an execution component, which is configured to perform a predetermined task of the movable device in each region in each region obtained by the region division under the control of the processor.
  • the embodiment of the present invention also provides a non-transitory computer-readable storage medium.
  • the removable device can perform the region division of the enclosed space as described above. method.
  • each part of the present invention can be implemented by hardware, software, firmware or a combination thereof.
  • multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system.
  • a logic gate circuit for implementing logic functions on data signals
  • PGA programmable gate array
  • FPGA field programmable gate array
  • the functional units in the various embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or software functional modules. If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it may also be stored in a computer readable storage medium.
  • the aforementioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.

Abstract

本发明涉及一种封闭空间的区域分割方法、装置和可移动设备,属于可移动设备领域。该方法包括:获取封闭空间的地图;获取轨迹点;对所述轨迹点进行处理,并结合所述地图识别出所述封闭空间中的正确门;采用所述正确门结合所述地图对所述封闭空间进行区域分割。本发明通过识别封闭空间中的门并通过识别出的门结合封闭空间地图对区域进行分割,更符合客观规律,能够提高区域划分的准确度和效率。

Description

封闭空间的区域分割方法、装置和可移动设备 技术领域
本发明涉及可移动设备领域,尤其涉及一种封闭空间的区域分割方法、装置和可移动设备。
背景技术
可移动设备是指在设定封闭空间内自主执行预设任务的设备,目前可移动设备通常包括但不限于清洁机器人(例如智能扫地机、智能擦地机、擦窗机器人)、陪伴性移动机器人(例如智能电子宠物、保姆机器人)、服务型移动机器人(例如酒店、旅馆、会晤场所的接待机器人)、工业巡检智能设备(例如电力巡检机器人、智能叉车等)、安防机器人(例如家用或商用智能警卫机器人)。
可移动设备在封闭空间中移动,为了更好地完成预设任务,通常需要分辨各个房间,比如,移动到指定房间,局域清扫等。相关技术中,通常是先识别出房间中心,再从中心向外扩展到边界处,完成房间分割。但是,这种房间分割方式会在准确度、分割效率等方面存在一定问题。
发明内容
为至少在一定程度上克服相关技术中存在的问题,本发明提供一种封闭空间的区域分割方法、装置和可移动设备。
根据本发明实施例的第一方面,提供一种封闭空间的区域分割方法,包括:
获取封闭空间的地图;
获取轨迹点;
对所述轨迹点进行处理,并结合所述地图识别出所述封闭空间中的正确门;
采用所述正确门结合所述地图对所述封闭空间进行区域分割。
优选地,所述对所述轨迹点进行处理,并结合所述地图识别出所述封闭空间中的正确门,包括:
根据所述轨迹点确定候选点;
对所述候选点进行聚类,以及确定聚类中的聚类代表点;
对所述聚类代表点进行筛选,确定候选门;
对所述候选门进行筛选得到合理门;
对所述合理门分割的区域进行区域融合,在所述合理门中筛选出正确门。
优选地,所述轨迹点包括:真实轨迹点,和/或,虚拟轨迹点,所述获取轨迹点,包括:
获取可移动设备在所述封闭空间中实际经过的真实轨迹点;和/或,
采用预设的虚拟轨迹点生成算法,在所述封闭空间的地图中生成虚拟轨迹点;
优选地,所述获取封闭空间的地图,包括:
获取原始地图,对所述原始地图进行处理,并提取轮廓;
对提取的轮廓进行筛选,并以保留的轮廓绘制封闭空间的地图。
优选地,所述根据所述轨迹点确定候选点,包括:
对应各个轨迹点,将经过所述轨迹点、且方向为可选方向的直线与所述轨迹点两侧的障碍物边界的交点构成的线段,确定为可选线段;
在所述可选线段中确定出待采用的最短线段;
将所述待采用的最短线段的中点确定为候选点;
所述在所述可选线段中确定出待采用的最短线段,包括:
在所有所述可选线段中选择出最短线段,将所述最短线段确定为待采用的最短线段;或者,
在所有所述可选线段中选择出最短线段,若所述最短线段的长度在预设长度范围内,则将所述最短线段确定为待采用的最短线段;或者,
在所有所述可选线段中选择出长度在预设长度范围内的可选线段,将所述长度在预设长度范围内的可选线段中的最短线段确定为待采用的最短线段。
优选地,所述对所述候选点进行聚类,包括:对应两个候选点,如果所述两个候选点之间的距离小于所述两个候选点所对应的半径之和,则将所述两个候选点归为同一个聚类;其中,所述候选点所对应的半径为所述候选点所在最短线段的长度的一半;
优选地,所述确定聚类中的聚类代表点,包括:在每个聚类中,将所对应的半径最小的候选点确定为相应聚类的聚类代表点;
优选地,所述对所述候选门进行筛选得到合理门,包括:遍历每个候选门,获取每个候选门所对应 的封闭区域的面积,以及,所述封闭区域在预设方向上的长度与所述候选门的长度之比;如果所述面积在预设面积范围内,且所述长度之比在预设长度比的范围内,则保留所述候选门作为合理门。
优选地,所述对所述聚类代表点进行筛选,确定候选门,包括:
确定聚类代表点所在的选区区域;
在所述选区区域内选取若干点,过每个选取点作平行于聚类代表点所在最短线段的直线,计算各所述直线与其两侧的障碍物边界交点的度量值;
以所述选区区域内所选取的所述若干点构建图,其中,所构建的图包括至少两个维度,所述至少两个维度包括第一维度和第二维度,所述第一维度为所述度量值所在的维度,所述第二维度为投影距离值所在的维度,所述投影距离值为各选取点与聚类代表点的距离值在垂直于所述度量值方向上的分量;
如果若干所述选取点与所述聚类代表点之间的投影距离值与其相应的度量值呈正向关系,则将所述聚类代表点所对应的门确定为候选门,否则剔除所述聚类代表点;
所述正向关系是指,随着若干选取点与聚类代表点之间的投影距离值的下降,相应的选取点在第一维度上的度量值不变或减少。
优选地,所述确定聚类代表点所在的选区区域,包括:
以聚类代表点为中心,以聚类代表点所在最短线段的长度的N倍为宽,以度量值方向为宽度方向,以聚类代表点所在最短线段的长度的M倍为长,以第二维度方向为长度方向,确定选区矩形,其中,N和M为设置值,且N小于等于M;
所述在所述选区区域内选取若干点,包括:
在平行于所述选区矩形的长度方向选取若干点,或在所述选区矩形内任选若干选取点;
所述以所述选区区域内所选取的所述若干点构建图,包括:
以平行于所述选区矩形的长度方向和宽度方向分别作为横纵坐标值,构建二维图;以每个选取点的投影距离值和度量值分别作为所述二维图中的横坐标和纵坐标;
所述如果若干所述选取点与所述聚类代表点之间的投影距离值与其相应的度量值呈正向关系,则将所述聚类代表点所对应的门确定为候选门,包括:
如果所述二维图为谷形图,则保留所述聚类代表点,将所述聚类代表点所对应的门确定为候选门。
优选地,所述对所述合理门分割的区域进行区域融合,在所述合理门中筛选出正确门,包括:
遍历每个合理门,获取每个合理门所连接的两个区域作为第一候选区域和第二候选区域;
在所述第一候选区域和所述第二候选区域中分别确定第一线段和第二线段,所述第一线段为合理门的中点与第一交点构成的线段,所述第二线段为合理门的中点与第二交点构成的线段,所述第一交点是第一射线与第一候选区域在垂直于合理门方向上的最远处的交点,所述第二交点是第二射线与第二候选区域在垂直于合理门方向上的最远处的交点,所述第一射线是从合理门的中点出发、向第一候选区域延伸、且垂直于合理门方向的射线,所述第二射线是从合理门的中点出发、向第二候选区域延伸、且垂直于合理门方向的射线;
在所述第一线段和所述第二线段上选取数量相同的散点,并计算每个散点所对应的距离值,所述散点所对应的距离值包括:第一距离值和第二距离值,所述第一距离值为经过所述散点且与合理门平行的直线在该散点的第一侧与所述散点所在候选区域边界的交点至所述散点的距离值;所述第二距离值为经过所述散点且与合理门平行的直线在该散点的第二侧与所述散点所在候选区域边界的交点至所述散点的距离值;所述散点的第一侧与第二侧分别为经过所述散点且与合理门平行的直线相对于该散点的两个方向;
计算所述第一候选区域和所述第二候选区域内的所有散点所对应的距离值的方差,如果所述方差大于预设值,则保留所述合理门作为正确门,否则,将所述第一候选区域和所述第二候选区域融合为同一个区域。
优选地,还包括:
在区域分割得到的各区域内,分区域执行可移动设备的预定任务。
根据本发明实施例的第二方面,提供一种封闭空间的区域分割装置,包括:地图获取模块,用于获取封闭空间的地图;轨迹点获取模块,用于获取轨迹点;识别模块,用于对所述轨迹点进行处理,并结合所述地图识别出所述封闭空间中的正确门;分割模块,用于采用所述正确门结合所述地图对所述封闭空间进行区域分割。
优选地,所述识别模块包括:候选点确定单元,用于根据所述轨迹点确定候选点;聚类单元,用于对所述候选点进行聚类,以及确定聚类中的聚类代表点;候选门确定单元,用于对所述聚类代表点进行筛选,确定候选门;合理门确定单元,用于对所述候选门进行筛选得到合理门;区域融合单元,用于对所述合理门分割的区域进行区域融合,在所述合理门中筛选出正确门。
优选地,所述轨迹点包括:真实轨迹点,和/或,虚拟轨迹点,所述轨迹点获取模块具体用于:获取可移动设备在所述封闭空间中实际经过的真实轨迹点;和/或,采用预设的虚拟轨迹点生成算法,在所述封闭空间的地图中生成虚拟轨迹点。
优选地,候选点确定单元具体用于:对应各个轨迹点,将经过所述轨迹点、且方向为可选方向的直线与所述轨迹点两侧的障碍物边界的交点构成的线段,确定为可选线段;在所述可选线段中确定出待采用的最短线段;将所述待采用的最短线段的中点确定为候选点。
优选地,候选点确定单元进一步具体用于:在所有所述可选线段中选择出最短线段,将所述最短线段确定为待采用的最短线段;或者,在所有所述可选线段中选择出最短线段,若所述最短线段的长度在预设长度范围内,则将所述最短线段确定为待采用的最短线段;或者,在所有所述可选线段中选择出长度在预设长度范围内的可选线段,将所述长度在预设长度范围内的可选线段中的最短线段确定为待采用的最短线段。
优选地,聚类单元具体用于:对应两个候选点,如果所述两个候选点之间的距离小于所述两个候选点所对应的半径之和,则将所述两个候选点归为同一个聚类;其中,所述候选点所对应的半径为所述候选点所在最短线段的长度的一半。
优选地,聚类单元还具体用于:在每个聚类中,将所对应的半径最小的候选点确定为相应聚类的聚类代表点。
优选地,候选门确定单元具体用于:确定聚类代表点所在的选区区域;在所述选区区域内选取若干点,过每个选取点作平行于聚类代表点所在最短线段的直线,计算各所述直线与其两侧的障碍物边界交点的度量值;以所述选区区域内所选取的所述若干点构建图,其中,所构建的图包括至少两个维度,所述至少两个维度包括第一维度和第二维度,所述第一维度为所述度量值所在的维度,所述第二维度为投影距离值所在的维度,所述投影距离值为各选取点与聚类代表点的距离值在垂直于所述度量值方向上的分量;如果若干所述选取点与所述聚类代表点之间的投影距离值与其相应的度量值呈正向关系,则将所述聚类代表点所对应的门确定为候选门,否则剔除所述聚类代表点;所述正向关系是指,随着若干选取点与聚类代表点之间的投影距离值的下降,相应的选取点在第一维度上的度量值不变或减少。
优选地,所述门确定单元进一步具体用于:以聚类代表点为中心,以聚类代表点所在最短线段的长度的N倍为宽,以聚类代表点所在最短线段的长度的M倍为长,确定选区矩形,其中,N和M为设置值,且N小于等于M;在平行于所述选区矩形的长度方向选取若干点,过每个点作平行于聚类代表点所在最短线段的直线,计算所述直线与其两侧的障碍物边界交点的度量值;以每个点在平行于所述选区矩形的长度方向的坐标以及所述度量值分别作为横纵坐标值,构建二维图;如果所述二维图为谷形图,则保留所述聚类代表点,将所述聚类代表点所对应的门确定为候选门。
优选地,合理门确定单元具体用于:遍历每个候选门,获取每个候选门所对应的封闭区域的面积,以及,所述封闭区域在预设方向上的长度与所述候选门的长度之比;如果所述面积在预设面积范围内,且,所述长度之比在预设长度比的范围内,则保留所述候选门作为合理门。
优选地,区域融合单元具体用于:遍历每个合理门,获取每个合理门所连接的两个区域作为第一候选区域和第二候选区域;在所述第一候选区域和所述第二候选区域中分别确定第一线段和第二线段,所述第一线段为合理门的中点与第一交点构成的线段,所述第二线段为合理门的中点与第二交点构成的线段,所述第一交点是第一射线与第一候选区域在垂直于合理门方向上的最远处的交点,所述第二交点是第二射线与第二候选区域在垂直于合理门方向上的最远处的交点,所述第一射线是从合理门的中点出发、向第一候选区域延伸、且垂直于合理门方向的射线,所述第二射线是从合理门的中点出发、向第二候选区域延伸、且垂直于合理门方向的射线;在所述第一线段和所述第二线段上选取数量相同的散点,并计算每个散点所对应的距离值,所述散点所对应的距离值包括:第一距离值和第二距离值,所述第一距离值为经过所述散点且与合理门平行的直线在该散点的第一侧与所述散点所在候选区域边界的交点至所述散点的距离值;所述第二距离值为经过所述散点且与合理门平行的直线在该散点的第二侧与所述散点所在候选区域边界的交点至所述散点的距离值;所述散点的第一侧与第二侧分别为经过所述散点且与合理门平行的直线相对于该散点的两个方向;计算所述第一候选区域和所述第二候选区域内的所有散点所对应的距离值的方差,如果所述方差大于预设值,则保留所述合理门作为正确门,否则,将所述第一候选区域和所述第二候选区域融合为同一个区域。
优选地,地图获取模块具体用于:获取原始地图,对所述原始地图进行处理,并提取轮廓;
对提取的轮廓进行筛选,并以保留的轮廓绘制封闭空间的地图。
优选地,还包括:执行模块,用于在区域分割得到的各区域内,分区域执行可移动设备的预定任务。
根据本发明实施例的第三方面,提供一种非临时性计算机可读存储介质,当所述存储介质中的指令由可移动设备的处理器执行时,使得可移动设备能够执行如第一方面所述的封闭空间的区域分割方法。
根据本发明实施例的第四方面,提供一种可移动设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为读取所述存储器中的可执行指令,以执行如第一方面所述的封闭空间的区域分割方法。
优选的,可移动设备还包括:执行部件,用于在处理器的控制下,在区域分割得到的各区域内,分区域执行可移动设备的预定任务。
本发明的实施例提供的技术方案可以包括以下有益效果:
在封闭空间中识别出正确门,以及采用正确门进行区域分割,由于以门进行分割基准更符合客观规律,从而提高区域分割的准确度,进而可以利于可移动设备分区域执行任务,提高任务执行效率。进一步的,通过对轨迹点进行处理识别出门,可以降低算法复杂度,提高运算速度。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本发明。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本发明的实施例,并与说明书一起用于解释本发明的原理。
图1是本发明一个实施例提供的封闭空间的区域分割方法的流程图。
图2a是本发明实施例中对原始地图进行预处理得到封闭空间的地图的流程示意图;
图2b是本发明实施例中提取的一种树型结构的轮廓示意图;
图2c是本发明实施例一种原始地图的示意图;
图2d是本发明实施例一种对原始地图进行预处理后得到的封闭空间的地图的示意图;
图3是本发明实施例中在封闭空间的地图中识别正确门的流程示意图;
图4a是本发明实施例中轨迹点及所对应的候选点的示意图;
图4b是本发明实施例中候选点聚类及聚类代表点的示意图;
图5a-图5d是本发明实施例中对聚类代表点进行筛选得到候选门的示意图。
图6是本发明实施例中对候选门进行筛选确定合理门的示意图;
图7是本发明实施例中对合理门进行区域融合确定正确门的示意图;
图8a-图8g是本发明实施例中从确定轨迹点到确定出正确门的仿真图;
图9是本发明一个实施例提供的封闭空间的区域分割装置的结构示意图;
图10是本发明一个实施例提供的可移动设备的结构示意图。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本发明相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本发明的一些方面相一致的装置和方法的例子。
本发明所说的封闭空间是指全部封闭的区域空间或者部分封闭的区域空间;相应的,本发明所说的封闭空间的地图,是指至少部分封闭的区域空间的地图,比如,该地图是全部封闭的区域空间的地图,具体如图2d或者图4b所示,如在图2d中,由完整的白色封闭边界围成的区域空间K即为所述全部封闭的区域空间;又比如,该地图包括封闭部分和非封闭部分,具体如图4a、图5a-5d或者图6所示,如在图4a中,边界w2和边界w3组成封闭部分,边界w2和边界w4以及边界w3和边界w4组成非封闭部分;又比如,该地图既包括部分或全部封闭的区域空间、又包括由该部分或全部封闭的区域空间延伸出去的开放区域空间,比如该地图是既包括部分或完整室内区域空间又包括与该室内区域空间相连的外部开放区域空间(如庭院等)的地图。
图1是本发明一个实施例提供的封闭空间的区域分割方法的流程图,如图1所示,包括以下步骤:
S11:获取封闭空间的地图。
一些实施例中,直接将待分割的封闭空间的地图输入,将输入的地图直接作为封闭空间的地图。或者,
一些实施例中,对原始地图进行预处理,将预处理后的地图作为封闭空间的地图。原始地图是可移动设备构建的,比如,可移动设备为清洁机器人,清洁机器人在执行清洁任务的过程中,可以同时构建地图,将清洁机器人构建的地图作为原始地图。
以对原始地图进行预处理获取封闭空间的地图为例,预处理过程的相关内容请参见图2a-图2d。
S12:获取轨迹点;
对于不同情况,上述步骤S11及步骤S12的顺序可以调换,即有的实施例是先执行步骤S11再执行步骤S12,而有的实施例则是先执行步骤S12再执行步骤S11;对于一些实施例,可以同时或不分顺 序地执行步骤S11和S12。比如若在初始时仅有原始地图,则先执行步骤S12,通过对原始地图预处理获取封闭空间的地图,然后执行步骤S12,从封闭空间的地图中获取轨迹点;若在初始时已有轨迹点的坐标值(比如x、y值或x、y、z值),可以同时或不分顺序地执行步骤S11和S12,这些顺序的组合中自然也包括先执行步骤S12再执行S11的顺序,而对于步骤S12:可以通过直接输入轨迹点的坐标值等方式获取若干轨迹点。因此,本领域技术人员应当理解,不应以步骤S11与步骤S12的顺序对本发明的权利要求加以限制。
S13:对所述轨迹点进行处理,并结合所述地图识别出所述封闭空间中的正确门。
与通常采用的以区域中心向外扩展的方式不同的是,本发明实施例中,在区域分割时,是先识别出门,以门为基准进行区域划分。以门为基准进行区域划分更符合客观规律,从而使得区域划分的结果更为准确。
门识别是基于对轨迹点的处理,并结合封闭空间的地图得到的。
一些实施例中,轨迹点包括:真实轨迹点,和/或,虚拟轨迹点。
真实轨迹点是可移动设备在封闭空间中实际经过的轨迹点。
虚拟轨迹点是基于封闭空间的地图、采用算法得到的虚拟点,比如,通过三角剖分算法得到的虚拟点。
因此,可以通过记录可移动设备在封闭空间中实际经过的真实轨迹点,和/或,采用预设算法生成虚拟轨迹点,从而获取上述的轨迹点。
正确门识别过程的相关内容请参见图3-图7。
S14:采用所述正确门结合所述地图对所述封闭空间进行区域分割。
在识别出正确门后,将正确门划分开的不同区域作为区域分割结果。比如,以房间分割为例,则将正确门分开的各个区域分别作为一个房间。
进一步的,可移动设备对封闭空间进行区域分割后,可以分区域执行任务。比如,以可移动设备为清洁机器人为例,清洁机器人划分出各个房间后,可以进行分房间清扫,从而提高清扫效率,节约时间。
本实施例中,在封闭空间中识别出正确门,以及采用正确门进行区域分割,由于以门进行分割基准更符合客观规律,从而提高区域分割的准确度,进而可以利于可移动设备分区域执行任务,提高任务执行效率。进一步的,通过对轨迹点进行处理识别出门,可以降低算法复杂度,提高运算速度。
所述获取封闭空间的地图,可选地,可以包括:获取原始地图,对所述原始地图进行处理,并提取轮廓;对提取的轮廓进行筛选,并以保留的轮廓绘制封闭空间的地图。原始地图的具体形式不同,其处理方式可能有所不同。原始地图可以是灰度地图、彩色地图、矢量图、散点图等形式中的至少一种形式;无论哪种形式的原始地图,都可以通过处理,最后提取出其轮廓。图2a是本发明实施例中对灰度原始地图进行预处理得到封闭空间的地图的流程示意图。以灰度原始地图为例,如图2a所示,该预处理流程包括:
S21:对灰度原始地图进行阈值化,得到二值地图。
原始地图是灰度地图,则对原始地图进行阈值化是指将灰度地图转换为二值地图,比如,设置一个阈值,将灰度值大于该阈值的像素点的像素值设置为255(白色),反之设置为0(黑色),从而得到二值地图。
优选地,S22:对二值地图进行形态学处理,并提取轮廓。
形态学,即数学形态学(Mathematical Morphology),在图像处理中有广泛的应用,主要应用是从图像中提取对于表达和描绘区域形状有意义的图像分量,使后续的识别工作能够抓住目标对象最为本质(最具区分能力——most discrimination)的形状特征,像是边界、连通区域等。
形态学处理包括腐蚀、膨胀、开运算和闭运算等。
本实施例中,可以对二值图像进行形态学闭运算,从而增加地图的连通域,同时消除一些噪点。但形态学处理并非本发明的必须步骤,即使不对二值地图进行形态学处理,只要能够通过二值地图提取轮廓,依然可以通过后续步骤找到正确门从而进行区域分割。
由于彩色地图无法直接进行阈值化,所以若获取的是彩色原始地图,则可以将其转化为灰度地图,再通过上述步骤S21进行阈值化再通过步骤S22对得到的二值地图进行形态学分析;也可以对彩色原始地图直接进行形态学处理,然后提取轮廓,而不进行阈值化。提取轮廓时可以采用已有的轮廓提取算法,比如,树型结构提取轮廓,其中,面积最大的轮廓作为房间的外轮廓,面积较小的作为房间的内轮廓。
一种树型结构的轮廓可以如图2b所示。图2b中,轮廓c0(节点0)与轮廓h00(节点1)和h01(节点2)构成区域A;轮廓c000(节点3)与轮廓h0000(节点5)构成区域B;轮廓c010(节点4)与轮廓h0100(节点6)构成区域C;轮廓c01000(节点7)内为区域D;轮廓c01001(节点8)内为区域E。
S23:对提取的轮廓进行筛选,并以保留的轮廓绘制封闭空间的地图。
在提取出如图2b所示的树型结构的内外部轮廓后,可以自上而下的遍历轮廓树中的节点,一方面,在最大区域中的各子区域中仅保留面积最大子区域(如图2b所示的区域A为最大区域,而区域B、C为区域A的子区域;其中,区域C是区域A中面积最大的子区域,所以仅保留子区域C而去除子区域B);另一方面,根据面积和周长保留内部的轮廓,去除内部的轮廓噪声(例如,去除面积小于1m 2的区域,可以去除类似于桌子腿等对于房间分割无用的区域)。
对于保留的所有内外部轮廓,将保留的轮廓作为地图中的各障碍物的边界,绘制得到后续处理的地图。
比如,灰度原始地图经步骤S21处理得到如图2c所示的二值地图,经过步骤S22的形态学处理并提取轮廓后,得到区域O,其中区域O包含子区域F、G、H、K,经过步骤S23筛选,保留了面积最大的子区域K(图中白色封闭边界围成的区域空间),而剔除了子区域F、G、H,得到如图2d所示的封闭空间的地图。
本实施例中,通过对原始地图进行预处理,可以过滤掉一些不需要的区域(比如图2c中的区域F、G、H),保留了需要分割的封闭空间的地图(仅保留了图2c中的区域K)。
图3是本发明实施例中对所述轨迹点进行处理,识别出所述封闭空间中的正确门的流程示意图,如图3所示,该流程包括:
S31:根据轨迹点确定候选点。
候选点是待采用的最短线段的中点;待采用的最短线段是在可选线段中确定出的;可选线段是经过轨迹点、且方向为可选方向的直线与轨迹点两侧的障碍物边界的交点构成的线段。
可选方向可以根据需要选定,比如,以某个方向为基准(比如以x轴为基准),选择平行、垂直于该基准方向的两个方向为可选方向;或者选择与该基准方向成0°(180°)、45°(225°)、90°(270°)、135°(315°)的4个方向为可选方向。
比如,参见图4a,点t为轨迹点,可选方向为三条直线L1、L2、L3的方向(在图4a中以虚线表示),直线L1与障碍物边界w1、w2分别相交于p1和p2点;直线L2与障碍物边界w1、w2分别相交于p3和p4点;直线L3与障碍物边界w3、w4分别相交于障碍物边界p5和p6点,则经过轨迹点t的可选线段分别为:线段p1-p2、线段p3-p4和线段p5-p6。
一些实施例中,待采用的最短线段是所有可选线段中的最短线段,比如,线段p1-p2、线段p3-p4和线段p5-p6中,线段p1-p2是最短线段,则将线段p1-p2确定为最短线段。
一些实施例中,待采用的最短线段不仅满足最短限定,还需要最短线段在预设长度范围内(称为“距离范围规则”),预设长度范围是与门的水平尺寸相关的参数,比如可以是0.5米至2.5米,则在线段p1-p2是最短线段时,如果线段p1-p2还在0.5米至2.5米范围内,则将线段p1-p2确定为最短线段,否则,如果最短线段(如线段p1-p2)不在0.5米至2.5米范围内,则对应当前轨迹点没有候选点,剔除该轨迹点(如轨迹点t)。
一些实施例中,待采用的最短线段是长度在预设长度范围内的可选线段中的最短线段。与上一实施例不同的是,上一实施例是先选择出最短线段,再判断最短线段是否在预设长度范围内,本实施例是在可选线段中先选择出满足预设长度范围的可选线段(也称为“距离范围规则”),再在满足预设长度范围的可选线段中确定出最短线段。比如,经过轨迹点t的所有可选线段包括:线段p1-p2、线段p3-p4和线段p5-p6,则分别将这三条线段与预设长度范围进行比较,假设线段p1-p2和线段p3-p4在预设长度范围内,线段p5-p6不在预设长度范围内,则在线段p1-p2和线段p3-p4中选择出最短线段,假设为线段p1-p2比线段p3-p4短,则待采用的最短线段是线段p1-p2。
需要说明的是,在提取轮廓后,各障碍物的边界是确定的,比如,图4a中的障碍物的边界w1至w4是位置确定的,各轨迹点也是位置确定的,可选方向是确定的,则上述的各可选线段的长度能够根据各确定的参数计算得到。
在确定出待采用的最短线段后,将其中点作为候选点,比如,参见图4a,待采用的最短线段是线段p1-p2,则将线段p1-p2的中点C1作为候选点。
需要说明的是,上述实施例设定了可选方向的数量,即可选线段的数量是确定的,此时的最短线段是这些可选线段中最短的,由于可选方向没有包括所有方向,因此,最短线段不一定是所有方向上实际上最短的线段。在其它的实施例中,可以从过轨迹点的所有方向上确定可选线段,并从所有方向的可选线段上选择最短线段,此时的最短线段就是所有方向上实际最短的线段了。
S32:对候选点进行聚类,以及确定聚类中的聚类代表点。
通过聚类规则对候选点进行聚类,以及通过聚类代表点的选取规则确定聚类中的聚类代表点;聚类规则以及聚类代表点的选取规则可以根据需要设置。
一些实施例中,聚类规则如下:
对应两个候选点,如果所述两个候选点之间的距离小于所述两个候选点所对应的半径之和,则将所述两个候选点归为同一个聚类,否则归为不同的聚类;其中,所述候选点所对应的半径为所述候选点所在最短线段的长度的一半。比如,图4a中的候选点C1,该候选点C1所在最短线段为线段p1-p2,则候选点C1所对应的半径是指线段p1-p2的长度的一半。在上述实施例中,由于C1是最短线段p1-p2的中点,所以候选点C1所对应的半径也是候选点C1至点p1的距离或C1至点p2的距离。
一些实施例中,聚类代表点的选取规则如下:
将每个聚类中,将所对应的半径最小的候选点确定为相应聚类的聚类代表点。可以理解的是,与半径等同,也可以比较候选点的直径,将直径最小的候选点作为相应聚类的聚类代表点。候选点的直径是指候选点所在最短线段的长度。
比如,参见图4b,假设候选点68和候选点72之间的距离为D 68-72,候选点68和候选点72所对应的半径分别为R 68和R 72,若D 68-72>R 68+R 72,则候选点68和候选点72分属两个聚类。若D 68-72<R 68+R 72,则候选点68和候选点72属于一个聚类;此时,假设同一个聚类中仅包括两个候选点68和72,若R 68<R 72,则将候选点68确定为该聚类的聚类代表点。
再比如,参见图4b,可移动装置10从图中左下角出发,自左向右、自下向上沿封闭空间的地图的内部边界移动,图中黑色圆点代表轨迹点,而过黑色圆点的虚线代表过该轨迹点的最短线段,按照上述“候选点”定义,则这些虚线中间的白色圆点代表可能的候选点。设用于筛选候选点的上述“距离范围规则”将图中虚线中点分为白色圆点的候选点和白色方形的剔除候选点,即白色圆点(如62、63等)的最短线段在所述预设长度范围内,而白色方形(如61、65等)所在的最短线段超出了所述预设长度范围。
以内墙53南侧(下方)与外墙之间的点为例:首先,由于轨迹点11的最短线段和轨迹点15的最短线段都超过上述预设长度范围,则剔除其对应的白色方形点61和65,因此只有轨迹点12至14在该聚类中;然后,对比轨迹点12、13、14各自的最短线段的长度,轨迹点/候选点的最短线段由LS表示,比如轨迹点12的最短线段的长度以LS 12表示,而候选点62的最短线段的长度以LS 62表示,由于轨迹点12与候选点62具有同一条最短线段,因此LS 12=LS 62。由于LS 62>LS 63=LS 64,则选择候选点63或候选点64代表该聚类,比如只保留候选点63,则轨迹点12、14及其相应的候选点62、64都去掉,同时以候选点63代替其轨迹点13,因此最后只保留候选点63作为聚类代表点以代表该聚类。
S33:对所述聚类代表点进行筛选,确定候选门。
通过聚类代表点的筛选规则对所述聚类代表点进行筛选,确定候选门;聚类代表点的筛选规则可以根据实际需求设置。
一些实施例中,聚类代表点的筛选规则是依据门判据进行筛选,保留满足门判据的聚类代表点,舍弃不满足门判据的聚类代表点。
门判据是指:
确定聚类代表点所在的选区区域;
在所述选区区域内选取若干点,过每个选取点作平行于聚类代表点所在最短线段的直线,计算各所述直线与其两侧的障碍物边界交点的度量值;
以选区区域内所选取的所述若干点构建图,其中,所构建的图包括至少两个维度,所述至少两个维度包括第一维度和第二维度,所述第一维度为所述度量值所在的维度(比如所构建的图中的y轴);所述第二维度为投影距离值所在的维度,所述投影距离值为各选取点与聚类代表点的距离值在垂直于所述度量值方向上的分量(比如所构建的图中的x轴)。
如果所构建的图中的若干选取点与聚类代表点之间的投影距离值与其相应的度量值呈正向关系,则将所述聚类代表点所对应的门确定为候选门,否则剔除所述聚类代表点。所述正向关系是指,在所构建的图中,随着选取点之间的投影距离值的下降(即随着选取点在所述第二维度上越来越靠近所述聚类代表点),相应的选取点在第一维度上的度量值不变或减少。
一些实施例中,采用如下方式确定选区区域:以聚类代表点为中心,以聚类代表点所在最短线段的长度的N倍为宽,以度量值方向为宽度方向,以聚类代表点所在最短线段的长度的M倍为长,以第二维度方向为长度方向,确定选区矩形,其中,N和M为设置值,且N小于等于M。
相应的,可以采用如下方式在选区区域内选取若干点,以及确定度量值:
在平行于所述选区矩形的长度方向选取若干点,过每个选取点作平行于聚类代表点所在最短线段的直线,计算所述直线与其两侧的障碍物边界交点的度量值。也可以在所述选区矩形内任取若干选取点。
在选取若干点后,所构建的图也可以是二维、三维或更多维的,以二维为例,则可以采用如下方式构建图:
以平行于所述选区矩形的长度方向和宽度方向分别作为横纵坐标值,构建二维图;以每个选取点的投影距离值和度量值分别作为所述二维图中的横坐标和纵坐标。
相应的,如果所述二维图为谷形图,则保留所述聚类代表点,将所述聚类代表点所对应的门确定为候选门,否则剔除该聚类代表点。
其中,谷形图是指在第二维度上距离聚类代表点越近的选取点(即其与聚类代表点的投影距离值越小),其度量值不变或越小,即满足上述的选取点的投影距离值与所述度量值呈正向关系,则该聚类代表点所对应的门为候选门。下面以二维空间进行说明:
比如,参见图5a,假设候选点66和候选点88属于一个聚类,候选点97、候选点98和候选点99属于一个聚类。
参见图5b,假设聚类代表点分别是候选点88和候选点98,N和M分别选为1和2,两个候选点所在最短线段分别用L1和L2表示,最短线段的长度分别用d1和d2表示,则分别得到以候选点88的选区矩形A1和以候选点98为中心的选区矩形A2。
选区矩形的长度方向分别用L3和L4表示,则分别在平行于L3和L4的方向上选取若干点,并过每个点平行于L1和L2作直线,计算所作直线与其两侧的障碍物边界交点的度量值。
本实施例中以度量值是上述的直线与其两侧的两个障碍物边界交点之间的距离值为例,比如,参见图5b,对应选区矩形A1,所选取的点按从左到右的顺序,上述的度量值分别为d1+d3,d1,d1+d3+d4。
需要说明的是,度量值不限于上述的直线与其两侧的两个障碍物边界交点之间的距离值,还可以选择为其他值,比如,过选取点且平行于图5b中的L1方向的直线上的任意数量的点到该选取点在前述直线两侧的障碍物边界的距离之和,比如在线段L1上选10个点,这些点各自到L1与上下障碍物边界的距离之和作为点88的度量值。
对应每个聚类代表点或候选点的坐标和度量值,可以构建如图5c所示的二维图,参见图5c,其中度量值即线段L1的方向为所述二维图的第一维度,垂直于度量值即线段L1方向的维度为所述二维图的第二维度。以图5b中的选区矩形A1作为选区区域,在选区区域A1中选取若干点,比如选取点q1与q2,如图5b所示,候选点88的度量值为d1,距离候选点88较远且在A1内的选取点q1与q2的度量值分别为d1+d3和d1+d3+d4,均大于d1,则该二维图为谷形图,即图形中聚类代表点或候选点附近范围的选取点的度量值小于或等于与所述度量值的方向垂直的维度距该聚类代表点或候选点较远范围的度量值,说明该聚类代表点或候选点和/或其附近位置处于选区矩形A1中的较窄区域内,很可能对应于实际的封闭空间地图中的门,因此保留候选点88;候选点88可能对应的门可能为候选点88所在的最短线段L1,则最短线段L1作为候选门。类似的,图5c中的候选点98也满足门判据,候选点98所在的最短线段L2也作为候选门。类似的,如果构建的二维图是图5d所示,在该图中,也满足门判据,候选点88和候选点98所可能代表的门分别为候选门。
需要说明的是,虽然上面以二维空间进行了说明,但是,所构建的图并不限于二维图,还可以是三维或更多维的图。比如,还可以构建三维图,三维图的三个维度所对应的值分别是:度量值,二维地图中的二维位置坐标。在所述构建的三维图中,如果聚类代表点是鞍点,即满足所述距离值与所述度量值呈正向关系,则该聚类代表点所对应的门是候选门。当然也可以是四维图,比如以三维空间坐标及一维度量值构成四维图,其中的三维空间坐标包括二维水平坐标和一维高度坐标,若选取点到聚类代表点在高度坐标上的投影距离与所述选取点的度量值呈上述的正向关系,则该聚类代表点的高度坐标有可能代表门框上沿到地面的距离小于门框两侧天花板到地面的距离值,即应该作为候选门。
有时,通过上述步骤得到的候选门在实际的封闭空间中并不对应一个真实的门。因此,在本发明的优选实施例中,还需要通过以下步骤对候选门进行筛选,去除不合理的候选门。
S34:对候选门进行筛选,得到合理门。
具体的,遍历每个候选门,获取每个候选门所对应的封闭区域的面积,以及,所述封闭区域在预设方向上的长度与所述候选门的长度之比;如果所述面积在预设面积范围内,且,所述长度之比在预设长度比的范围内,则保留所述候选门作为合理门,否则剔除该候选门。
候选门所对应的封闭区域是指候选门与地图中与候选门距离最近的边界所组成的封闭区域,所述预设方向比如是封闭区域的长轴方向。比如,参见图6,候选门分别用61和62表示,相应的候选门的长度分别用X1和X2表示,则候选门与其最近的边界构成的封闭区域分别用D1和D2表示,所述封闭区域D1和D2的面积分别用S1和S2表示,所述封闭区域D1和D2的长轴方向的长度分别用Y1和Y2表示,则对应候选门61,如果S1在预设面积范围内,且封闭区域D1在预设方向上的长度Y1与所述候选门的长度X1之比Y1/X1在预设长度比(预设长度比通常大于2)范围内,则候选门61为合理门,否则,如果S1不在预设面积范围内,和/或,Y1/X1在预设长度比范围外,则候选门61不是合理门,剔除该候选门61。候选门62的判定过程也类似,即,只有S2在预设面积范围内,且Y2/X2在预设长 度比范围内,则候选门62为合理门。
在有的情况下,比如地图上的错误或误差,即使通过上述过程,仍会使可移动设备在实际地图中没有门的位置认为错误地认为有所述合理门或候选门,因此在有的优选实施例中,可以通过下述区域融合的步骤将这种虚假的门消除。
S35:对合理门划分的区域进行区域融合,确定正确门。
区域融合过程可以包括:
遍历每个合理门,获取每个合理门所连接的两个区域作为第一候选区域和第二候选区域;
在所述第一候选区域和所述第二候选区域中分别确定第一线段和第二线段,所述第一线段为合理门的中点与第一交点构成的线段,所述第二线段为合理门的中点与第二交点构成的线段,所述第一交点是第一射线与第一候选区域在垂直于合理门方向上的最远处的交点,所述第二交点是第二射线与第二候选区域在垂直于合理门方向上的最远处的交点,所述第一射线是从合理门的中点出发、向第一候选区域延伸、且垂直于合理门方向的射线,所述第二射线是从合理门的中点出发、向第二候选区域延伸、且垂直于合理门方向的射线;
在所述第一线段和所述第二线段上选取数量相同的散点,并计算每个散点所对应的距离值,所述散点所对应的距离值包括:第一距离值和第二距离值,所述第一距离值为经过所述散点且与合理门平行的直线在该散点的第一侧与所述候选区域边界的交点至所述散点的距离值;所述第二距离值为经过所述散点且与合理门平行的直线在该散点的第二侧与所述候选区域边界的交点至所述散点的距离值;所述散点的第一侧与第二侧分别为上述经过所述散点且与合理门平行的直线相对于该散点的两个方向;
计算所述第一候选区域和所述第二候选区域内的所有散点(即所述第一线段和所述第二线段上的所有散点)所对应的距离值的方差,如果所述方差大于预设值,则保留所述合理门作为正确门,否则,将所述第一候选区域和所述第二候选区域融合为同一个区域。
比如,参见图7,合理门71的右侧是第一候选区域、左侧是第二候选区域,合理门71的中点是Pc,第一交点和第二交点分别是Pi和Pj,则第一线段和第二线段分别是线段Pc-Pi和线段Pc-Pj,如图7所示,假设在第一线段和第二线段上分别依据所述第一候选区域和所述第二候选区域的尺寸分别等间距选择12个散点,则对应每个散点的距离值包括经过该散点且与合理门平行的直线在该散点的第一侧和第二侧(在图7中分别对应于该散点的上下侧)与其所在的候选区域的边界的交点至该散点的距离值,假设右侧的12个散点的距离值分别用Da i 1和Da i 2(i=1,2,...,12)表示,左侧的12个散点的距离值分别用Db i 1和Db i 2(i=1,2,...,12)表示,则一共可以获取到48个距离值,之后计算这48个距离值的方差,如果该方差大于预设值(比如3000),则合理门71为正确门;否则,如果该方差小于该预设值,则表明两侧区域基本相同,应该认为是同一个区域,此时剔除合理门71,使所述第一候选区域和所述第二候选区域融合为一个区域。
以区域分割是分割房间为例,从确定轨迹点到确定出正确门的仿真图可以参见图8a-图8g。其中,图8a示出了地图中的轨迹点,该轨迹点可以是真实轨迹点和/或虚拟轨迹点。图8b示出了在竖直方向上经过筛选后得到的候选点,在竖直方向上筛选是指经过轨迹点的直线的可选方向选择为竖直方向。图8c示出了聚类后的候选点。图8d示出了聚类代表点及所代表的门,所代表的门用线段表示。图8e示出了对聚类代表点进行筛选后确定的候选门,各候选门用黑粗线段表示;可以理解的是,图8e中包括了水平方向上的候选门,相应的,虽未在图中示出,类似8b,会存在水平方向上经过筛选后的候选点;可以看出,算法提取了所有正确门的位置,但保留了很多不必要的门的位置。图8f示出了对候选门进行筛选后确定的合理门的示意图,可以看出,经过候选门的筛选,剔除了不合理的房间区域,所保留的合理门所分割的区域在物理上满足一个房间的性质,即房间大小和结构是合理的。图8g示出了区域融合后确定的正确门的示意图,可以看出,经过房间融合后,走廊上冗余的门被剔除了。
图9是本发明一个实施例提供的封闭空间的区域分割装置的结构示意图。如图9所示,该装置包括地图获取模块91,轨迹点获取模块92,识别模块93和分割模块94。
地图获取模块91,用于获取封闭空间的地图;
轨迹点获取模块92,用于获取轨迹点;
识别模块93,用于对所述轨迹点进行处理,并结合所述地图识别出所述封闭空间中的正确门;
分割模块94,用于采用所述正确门结合所述地图对所述封闭空间进行区域分割。
一些实施例中,所述识别模块93包括:
候选点确定单元,用于根据所述轨迹点确定候选点;
聚类单元,用于对所述候选点进行聚类,以及确定聚类中的聚类代表点;
候选门确定单元,用于对所述聚类代表点进行筛选,确定候选门;
合理门确定单元,用于对所述候选门进行筛选得到合理门;
区域融合单元,用于对所述合理门分割的区域进行区域融合,在所述合理门中筛选出正确门。
一些实施例中,所述轨迹点包括:真实轨迹点,和/或,虚拟轨迹点,所述轨迹点获取模块具体用于:
获取可移动设备在所述封闭空间的地图中实际经过的真实轨迹点;和/或,
采用预设的虚拟轨迹点生成算法,在所述地图中生成虚拟轨迹点。
一些实施例中,候选点确定单元具体用于:
对应各个轨迹点,将经过所述轨迹点、且方向为可选方向的直线与所述轨迹点两侧的障碍物边界的交点构成的线段,确定为可选线段;
在所述可选线段中确定出待采用的最短线段;
将所述待采用的最短线段的中点确定为候选点。
一些实施例中,候选点确定单元进一步具体用于:
在所有所述可选线段中选择出最短线段,将所述最短线段确定为待采用的最短线段;或者,
在所有所述可选线段中选择出最短线段,若所述最短线段的长度在预设长度范围内,则将所述最短线段确定为待采用的最短线段;或者,
在所有所述可选线段中选择出长度在预设长度范围内的可选线段,将所述长度在预设长度范围内的可选线段中的最短线段确定为待采用的最短线段。
一些实施例中,聚类单元具体用于:
对应两个候选点,如果所述两个候选点之间的距离小于所述两个候选点所对应的半径之和,则将所述两个候选点归为同一个聚类;
其中,所述候选点所对应的半径为所述候选点所在最短线段的长度的一半。
一些实施例中,聚类单元还具体用于:
在每个聚类中,将所对应的半径最小的候选点确定为相应聚类的聚类代表点。
一些实施例中,候选门确定单元具体用于:
确定聚类代表点所在的选区区域;
在所述选区区域内选取若干点,过每个选取点作平行于聚类代表点所在最短线段的直线,计算各所述直线与其两侧的障碍物边界交点的度量值;
以所述选区区域内所选取的所述若干点构建图,其中,所构建的图包括至少两个维度,所述至少两个维度包括第一维度和第二维度,所述第一维度为所述度量值所在的维度,所述第二维度为投影距离值所在的维度,所述投影距离值为各选取点与聚类代表点的距离值在垂直于所述度量值方向上的分量;
如果若干所述选取点与所述聚类代表点之间的投影距离值与其相应的度量值呈正向关系,则将所述聚类代表点所对应的门确定为候选门,否则剔除所述聚类代表点;
所述正向关系是指,随着若干选取点与聚类代表点之间的投影距离值的下降,相应的选取点在第一维度上的度量值不变或减少。
一些实施例中,门确定单元进一步具体用于:
以聚类代表点为中心,以聚类代表点所在最短线段的长度的N倍为宽,以聚类代表点所在最短线段的长度的M倍为长,确定选区矩形,其中,N和M为设置值,且N小于M;
在平行于所述选区矩形的长度方向选取若干点,过每个点作平行于聚类代表点所在最短线段的直线,计算所述直线与其两侧的障碍物边界交点的度量值;
以每个点的坐标以及所述度量值分别作为横纵坐标值,构建二维图;
如果所述二维图为谷形图,则保留所述聚类代表点,将所述聚类代表点所对应的门确定为候选门。
一些实施例中,合理门确定单元具体用于:
遍历每个候选门,获取每个候选门所对应的封闭区域的面积,以及,所述封闭区域在预设方向上的长度与所述候选门的长度之比;
如果所述面积在预设面积范围内,且,所述长度之比在预设长度比的范围内,则保留所述候选门作为合理门。
一些实施例中,区域融合单元具体用于:
遍历每个合理门,获取每个合理门所连接的两个区域作为第一候选区域和第二候选区域;
在所述第一候选区域和所述第二候选区域中分别确定第一线段和第二线段,所述第一线段为合理门的中点与第一交点构成的线段,所述第二线段为合理门的中点与第二交点构成的线段,所述第一交点是第一射线与第一候选区域在垂直于合理门方向上的最远处的交点,所述第二交点是第二射线与第二候选区域在垂直于合理门方向上的最远处的交点,所述第一射线是从合理门的中点出发、向第一候选区域延伸、且垂直于合理门方向的射线,所述第二射线是从合理门的中点出发、向第二候选区域延伸、且垂直 于合理门方向的射线;
在所述第一线段和所述第二线段上选取数量相同的散点,并计算每个散点所对应的距离值,对应每个散点,所述散点所对应的距离值包括:第一距离值和第二距离值,所述第一距离值为经过所述散点且与合理门平行的直线在该散点的第一侧与所述散点所在候选区域边界的交点至所述散点的距离值;所述第二距离值为经过所述散点且与合理门平行的直线在该散点的第二侧与所述散点所在候选区域边界的交点至所述散点的距离值;所述散点的第一侧与第二侧分别为经过所述散点且与合理门平行的直线相对于该散点的两个方向;
计算所述第一候选区域和所述第二候选区域内的所有散点所对应的距离值的方差,如果所述方差大于预设值,则保留所述合理门作为正确门,否则,将所述第一候选区域和所述第二候选区域融合为同一个区域。
一些实施例中,地图获取模块具体用于:
获取原始地图,并对所述原始地图进行处理,并提取轮廓;
对提取的轮廓进行筛选,并以保留的轮廓绘制封闭空间的地图。
一些实施例中,还包括:
执行模块,用于在区域分割得到的各区域内,分区域执行可移动设备的预定任务。
图10是本发明一个实施例提供的可移动设备的结构示意图,包括处理器101和用于存储处理器可执行指令的存储器102;所述处理器被配置为读取所述存储器中的可执行指令,以执行上述的封闭空间的区域分割方法。
一些实施例中,可移动设备还包括:执行部件,用于在处理器的控制下,在区域分割得到的各区域内,分区域执行可移动设备的预定任务。
本发明实施例还提供了一种非临时性计算机可读存储介质,当所述存储介质中的指令由可移动设备的处理器执行时,使得可移动设备能够执行如上述的封闭空间的区域分割方法。
关于上述实施例中的装置和设备,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
可以理解的是,上述各实施例中相同或相似部分可以相互参考,在一些实施例中未详细说明的内容可以参见其他实施例中相同或相似的内容。
需要说明的是,在本发明的描述中,术语“第一”、“第二”等仅用于描述目的,而不能理解为指示或暗示相对重要性。此外,在本发明的描述中,除非另有说明,“多个”的含义是指至少两个。
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本发明的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本发明的实施例所属技术领域的技术人员所理解。
应当理解,本发明的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。
本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。
此外,在本发明各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。
上述提到的存储介质可以是只读存储器,磁盘或光盘等。
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。尽管上面已经示出和描述了本发明的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本发明的限制,本领域的普通技术人员在本发明的范围内可以对上述实施例进行变化、修改、替换和变型。

Claims (12)

  1. 一种封闭空间的区域分割方法,其特征在于,包括:
    获取封闭空间的地图;
    获取轨迹点;
    对所述轨迹点进行处理,并结合所述地图识别出所述封闭空间中的正确门;
    采用所述正确门结合所述地图对所述封闭空间进行区域分割。
  2. 根据权利要求1所述的,其特征在于,所述对所述轨迹点进行处理,并结合所述地图识别出所述封闭空间中的正确门,包括:
    根据所述轨迹点确定候选点;
    对所述候选点进行聚类,以及确定聚类中的聚类代表点;
    对所述聚类代表点进行筛选,确定候选门;
    对所述候选门进行筛选得到合理门;
    对所述合理门分割的区域进行区域融合,在所述合理门中筛选出正确门。
  3. 根据权利要求1所述的方法,其特征在于,
    所述轨迹点包括:真实轨迹点,和/或,虚拟轨迹点,所述获取轨迹点,包括:获取可移动设备在所述封闭空间中实际经过的真实轨迹点;和/或,采用预设的虚拟轨迹点生成算法,在所述封闭空间的地图中生成虚拟轨迹点;
    和/或;
    所述获取封闭空间的地图,包括:
    获取原始地图,对所述原始地图进行处理,并提取轮廓;
    对提取的轮廓进行筛选,并以保留的轮廓绘制封闭空间的地图。
  4. 根据权利要求2所述的方法,其特征在于,所述根据所述轨迹点确定候选点,包括:
    对应各个轨迹点,将经过所述轨迹点、且方向为可选方向的直线与所述轨迹点两侧的障碍物边界的交点构成的线段,确定为可选线段;
    在所述可选线段中确定出待采用的最短线段;
    将所述待采用的最短线段的中点确定为候选点;和/或,
    所述在所述可选线段中确定出待采用的最短线段,包括:
    在所有所述可选线段中选择出最短线段,将所述最短线段确定为待采用的最短线段;或者,
    在所有所述可选线段中选择出最短线段,若所述最短线段的长度在预设长度范围内,则将所述最短线段确定为待采用的最短线段;或者,
    在所有所述可选线段中选择出长度在预设长度范围内的可选线段,将所述长度在预设长度范围内的可选线段中的最短线段确定为待采用的最短线段。
  5. 根据权利要求2所述的方法,其特征在于,
    所述对所述候选点进行聚类,包括:对应两个候选点,如果所述两个候选点之间的距离小于所述两个候选点所对应的半径之和,则将所述两个候选点归为同一个聚类;其中,所述候选点所对应的半径为所述候选点所在最短线段的长度的一半;和/或,
    所述确定聚类中的聚类代表点,包括:在每个聚类中,将所对应的半径最小的候选点确定为相应聚类的聚类代表点;和/或,
    所述对所述候选门进行筛选得到合理门,包括:遍历每个候选门,获取每个候选门所对应的封闭区域的面积,以及,所述封闭区域在预设方向上的长度与所述候选门的长度之比;如果所述面积在预设面积范围内,且,所述长度之比在预设长度比的范围内,则保留所述候选门作为合理门。
  6. 根据权利要求2所述的方法,其特征在于,所述对所述聚类代表点进行筛选,确定候选门,包括:
    确定聚类代表点所在的选区区域;
    在所述选区区域内选取若干点,过每个选取点作平行于聚类代表点所在最短线段的直线,计算各所述直线与其两侧的障碍物边界交点的度量值;
    以所述选区区域内所选取的所述若干点构建图,其中,所构建的图包括至少两个维度,所述至少两个维度包括第一维度和第二维度,所述第一维度为所述度量值所在的维度,所述第二维度为投影距离值所在的维度,所述投影距离值为各选取点与聚类代表点的距离值在垂直于所述度量值方向上的分量;
    如果若干所述选取点与所述聚类代表点之间的投影距离值与其相应的度量值呈正向关系,则将所述聚类代表点所对应的门确定为候选门,否则剔除所述聚类代表点;
    所述正向关系是指,随着若干选取点与聚类代表点之间的投影距离值的下降,相应的选取点在第一维度上的度量值不变或减少。
  7. 根据权利要求6所述的方法,其特征在于,
    所述确定聚类代表点所在的选区区域,包括:
    以聚类代表点为中心,以聚类代表点所在最短线段的长度的N倍为宽,以度量值方向为宽度方向,以聚类代表点所在最短线段的长度的M倍为长,以第二维度方向为长度方向,确定选区矩形,其中,N和M为设置值,且N小于等于M;
    所述在所述选区区域内选取若干点,包括:
    在平行于所述选区矩形的长度方向选取若干点,或在所述选区矩形内任选若干选取点;
    所述以所述选区区域内所选取的所述若干点构建图,包括:
    以平行于所述选区矩形的长度方向和宽度方向分别作为横纵坐标值,构建二维图;以每个选取点的投影距离值和度量值分别作为所述二维图中的横坐标和纵坐标;
    所述如果若干所述选取点与所述聚类代表点之间的投影距离值与其相应的度量值呈正向关系,则将所述聚类代表点所对应的门确定为候选门,包括:
    如果所述二维图为谷形图,则保留所述聚类代表点,将所述聚类代表点所对应的门确定为候选门。
  8. 根据权利要求2所述的方法,其特征在于,所述对所述合理门分割的区域进行区域融合,在所述合理门中筛选出正确门,包括:
    遍历每个合理门,获取每个合理门所连接的两个区域作为第一候选区域和第二候选区域;
    在所述第一候选区域和所述第二候选区域中分别确定第一线段和第二线段,所述第一线段为合理门的中点与第一交点构成的线段,所述第二线段为合理门的中点与第二交点构成的线段,所述第一交点是第一射线与第一候选区域在垂直于合理门方向上的最远处的交点,所述第二交点是第二射线与第二候选区域在垂直于合理门方向上的最远处的交点,所述第一射线是从合理门的中点出发、向第一候选区域延伸、且垂直于合理门方向的射线,所述第二射线是从合理门的中点出发、向第二候选区域延伸、且垂直于合理门方向的射线;
    在所述第一线段和所述第二线段上选取数量相同的散点,并计算每个散点所对应的距离值,所述散点所对应的距离值包括:第一距离值和第二距离值,所述第一距离值为经过所述散点且与合理门平行的直线在该散点的第一侧与所述散点所在候选区域边界的交点至所述散点的距离值;所述第二距离值为经过所述散点且与合理门平行的直线在该散点的第二侧与所述散点所在候选区域边界的交点至所述散点的距离值;所述散点的第一侧与第二侧分别为经过所述散点且与合理门平行的直线相对于该散点的两个方向;
    计算所述第一候选区域和所述第二候选区域内的所有散点所对应的距离值的方差,如果所述方差大于预设值,则保留所述合理门作为正确门,否则,将所述第一候选区域和所述第二候选区域融合为同一个区域。
  9. 根据权利要求1-8任一项所述的方法,其特征在于,还包括:
    在区域分割得到的各区域内,分区域执行可移动设备的预定任务。
  10. 一种封闭空间的区域分割装置,其特征在于,包括:
    地图获取模块,用于获取封闭空间的地图;
    轨迹点获取模块,用于获取轨迹点;
    识别模块,用于对所述轨迹点进行处理,并结合所述地图识别出所述封闭空间中的正确门;
    分割模块,用于采用所述正确门结合所述地图对所述封闭空间进行区域分割。
  11. 一种非临时性计算机可读存储介质,当所述存储介质中的指令由可移动设备的处理器执行时,使得可移动设备能够执行如权利要求1-9任一项所述的封闭空间的区域分割方法。
  12. 一种可移动设备,其特征在于,包括:
    处理器和用于存储处理器可执行指令的存储器;
    所述处理器被配置为读取所述存储器中的可执行指令,以执行如权利要求1-9任一项所述的封闭空间的区域分割方法。
PCT/CN2020/078543 2019-04-26 2020-03-10 封闭空间的区域分割方法、装置和可移动设备 WO2020215910A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/509,039 US20220044410A1 (en) 2019-04-26 2021-10-24 Method, apparatus for zone division of closed space and mobile device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910342612.1A CN111862133B (zh) 2019-04-26 2019-04-26 封闭空间的区域分割方法、装置和可移动设备
CN201910342612.1 2019-04-26

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/509,039 Continuation US20220044410A1 (en) 2019-04-26 2021-10-24 Method, apparatus for zone division of closed space and mobile device

Publications (1)

Publication Number Publication Date
WO2020215910A1 true WO2020215910A1 (zh) 2020-10-29

Family

ID=72940740

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/078543 WO2020215910A1 (zh) 2019-04-26 2020-03-10 封闭空间的区域分割方法、装置和可移动设备

Country Status (3)

Country Link
US (1) US20220044410A1 (zh)
CN (1) CN111862133B (zh)
WO (1) WO2020215910A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114415658A (zh) * 2021-12-10 2022-04-29 深圳拓邦股份有限公司 一种房间分区缺口识别方法及室内机器人

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115393234A (zh) * 2021-05-25 2022-11-25 速感科技(北京)有限公司 地图区域融合方法、装置、自主移动设备和存储介质
CN115393372A (zh) * 2021-05-25 2022-11-25 速感科技(北京)有限公司 地图分区方法、装置、自主移动设备和存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008136570A1 (en) * 2007-05-07 2008-11-13 Acerobot Co., Ltd. Cleaning robot unit and cleaning method using the same
CN104825101A (zh) * 2014-02-12 2015-08-12 Lg电子株式会社 机器人清洁器及其控制方法
CN107833230A (zh) * 2017-11-09 2018-03-23 北京进化者机器人科技有限公司 室内环境地图的生成方法及装置
CN108143364A (zh) * 2017-12-28 2018-06-12 湖南格兰博智能科技有限责任公司 一种自移动清洁机器人清洁地图区域划分的方法

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5014509B2 (ja) * 2005-09-20 2012-08-29 福井コンピュータ株式会社 閉領域識別方法
DE102015119501A1 (de) * 2015-11-11 2017-05-11 RobArt GmbH Unterteilung von Karten für die Roboternavigation
CN108154516B (zh) * 2018-01-30 2020-06-09 北京进化者机器人科技有限公司 面向封闭空间的点云拓扑分割方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008136570A1 (en) * 2007-05-07 2008-11-13 Acerobot Co., Ltd. Cleaning robot unit and cleaning method using the same
CN104825101A (zh) * 2014-02-12 2015-08-12 Lg电子株式会社 机器人清洁器及其控制方法
CN107833230A (zh) * 2017-11-09 2018-03-23 北京进化者机器人科技有限公司 室内环境地图的生成方法及装置
CN108143364A (zh) * 2017-12-28 2018-06-12 湖南格兰博智能科技有限责任公司 一种自移动清洁机器人清洁地图区域划分的方法

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114415658A (zh) * 2021-12-10 2022-04-29 深圳拓邦股份有限公司 一种房间分区缺口识别方法及室内机器人

Also Published As

Publication number Publication date
US20220044410A1 (en) 2022-02-10
CN111862133B (zh) 2023-07-21
CN111862133A (zh) 2020-10-30

Similar Documents

Publication Publication Date Title
WO2020215910A1 (zh) 封闭空间的区域分割方法、装置和可移动设备
Oesau et al. Indoor scene reconstruction using feature sensitive primitive extraction and graph-cut
Ochmann et al. Automatic reconstruction of parametric building models from indoor point clouds
CN105654021B (zh) 检测人群对目标位置关注度的方法及设备
Purushwalkam et al. Audio-visual floorplan reconstruction
CN110197153B (zh) 一种户型图中墙体自动识别方法
CN112966696A (zh) 一种处理三维点云的方法、装置、设备以及存储介质
CN112180931B (zh) 扫地机的清扫路径规划方法、装置及可读存储介质
Palou et al. Monocular depth ordering using T-junctions and convexity occlusion cues
CN108154516B (zh) 面向封闭空间的点云拓扑分割方法及装置
CN105976376B (zh) 一种基于部件模型的高分辨sar图像目标检测方法
JP6781432B2 (ja) 電波伝搬シミュレーションモデルの作成方法、作成システム、作成装置および作成プログラム
CN111402160B (zh) 一种点云数据去噪方法、装置、设备和存储介质
CN111402161B (zh) 点云障碍物的去噪方法、装置、设备和存储介质
US20220375170A1 (en) System for generation of floor plans and three-dimensional models
CN114365974B (zh) 一种室内清洁分区方法、装置和扫地机器人
Green et al. Normal distribution transform graph-based point cloud segmentation
Luperto et al. Robust structure identification and room segmentation of cluttered indoor environments from occupancy grid maps
US20230281350A1 (en) A Computer Implemented Method of Generating a Parametric Structural Design Model
GB2584839A (en) Mapping of an environment
WO2022045877A1 (en) A system and method for identifying occupancy of parking lots
An et al. Ceiling vision-based active SLAM framework for dynamic and wide-open environments
Grotz et al. Graph-based visual semantic perception for humanoid robots
Zhang et al. 3D reconstruction of weak feature indoor scenes based on hector SLAM and floorplan generation
CN113139982B (zh) 一种室内房间点云的自动分割方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20795702

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20795702

Country of ref document: EP

Kind code of ref document: A1