Robot clean partition method and device, storage medium and electronic equipment
Patent Information
- Application Number
- CN202311582254.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-23
- Publication Date
- 2025-05-23
AI Technical Summary
The cleaning partitioning technology of existing robots relies on manual partitioning, resulting in high cost and low efficiency, especially in the case of complex cleaning areas.
By obtaining the robot cleaning area map, fitting the outline map, determining the segmentation point and the first segmentation line, automatically segmenting the cleaning area map, realizing automatic partitioning of the robot cleaning area.
Improves the efficiency of cleaning partitions, eliminates manual partitioning, reduces costs, and is suitable for complex cleaning areas.
Smart Images

Figure CN120032121A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of robotics technology, and in particular, to a robot cleaning zoning method, device, storage medium, and electronic device. Background Art
[0002] With the development of robotics technology, the safety, simplicity of operation and flexibility of robots have been continuously improved, their advantages have been fully utilized, and they have been applied in more and more fields.
[0003] When the robot is cleaning a space, if it can clean by area, it can not only improve the cleaning efficiency, but also avoid disturbing the users and improve the user experience. Therefore, it is necessary to divide the cleaning area into zones.
[0004] At present, most of the robot cleaning zoning technology relies on manual zoning, which increases the cost. In the case of complex cleaning areas, manual zoning is time-consuming and inefficient. Summary of the invention
[0005] In order to overcome the problems existing in the related art, the present application provides a robot cleaning zoning method, device, storage medium and electronic device, which can improve the cleaning zoning efficiency and reduce the cost.
[0006] According to a first aspect of an embodiment of the present application, a robot cleaning zoning method is provided, comprising the following steps:
[0007] Acquire a robot cleaning area map; fit the contour of the robot cleaning area map to obtain a robot cleaning contour map; wherein the robot cleaning contour map includes a plurality of contour vertices;
[0008] Among the plurality of contour vertices, if a line connecting a previous contour vertex of the contour vertex and a next contour vertex of the contour vertex is not within the robot cleaning contour graph, determining the contour vertex as a segmentation point;
[0009] Determine at least one first segmentation line according to the segmentation point;
[0010] The robot cleaning area map is segmented according to at least one first segmentation line to obtain a target cleaning partition of the robot.
[0011] According to a second aspect of an embodiment of the present application, a robot cleaning partitioning device is provided, comprising:
[0012] The cleaning contour map acquisition module is used to obtain the robot cleaning area map; fit the contour of the robot cleaning area map to obtain the robot cleaning contour map; wherein the robot cleaning contour map includes a number of contour vertices;
[0013] A segmentation point determination module is used to determine, among a plurality of contour vertices, a contour vertex as a segmentation point if a line connecting a previous contour vertex and a next contour vertex of the contour vertex is not within the robot cleaning contour graph;
[0014] A first cutting line determining module, used to determine at least one first cutting line according to the cutting point;
[0015] The target cleaning partition obtaining module is used to segment the robot cleaning area map according to at least one first segmentation line to obtain the target cleaning partition of the robot.
[0016] According to a third aspect of an embodiment of the present application, there is provided an electronic device, comprising a display, a processor and a memory; the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the robot cleaning zoning method as described above.
[0017] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the robot cleaning zoning method as described above is implemented.
[0018] The embodiment of the present application obtains a robot cleaning area map; fits the contour of the robot cleaning area map to obtain a robot cleaning contour map; wherein the robot cleaning contour map includes a number of contour vertices; among the several contour vertices, if the line connecting the previous contour vertex of the contour vertex and the next contour vertex of the contour vertex is not within the robot cleaning contour map, the contour vertex is determined to be a segmentation point; according to the segmentation point, at least one first segmentation line is determined; according to the at least one first segmentation line, the robot cleaning area map is segmented to obtain the target cleaning partition of the robot. The present application determines the segmentation point, determines the first segmentation line based on the segmentation point, and uses the first segmentation line to segment the cleaning area map to obtain the target cleaning partition, thereby realizing automatic partitioning of the robot cleaning area, improving the efficiency of cleaning partitioning, eliminating the need for manual partitioning, and reducing costs.
[0019] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application.
[0020] For better understanding and implementation, the present invention is described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A flowchart of a robot cleaning zoning method shown as an embodiment of the present application;
[0022] Figure 2 A schematic diagram of segmentation points in a robot cleaning zoning method according to an embodiment of the present application;
[0023] Figure 3 This is a flow chart after step S10 in the robot cleaning zoning method according to one embodiment of the present application;
[0024] Figure 4 This is a flow chart before step S20 in the robot cleaning zoning method according to one embodiment of the present application;
[0025] Figure 5 This is a flow chart of step S30 in the robot cleaning zoning method according to one embodiment of the present application;
[0026] Figure 6 A schematic diagram of a first segmentation starting point in a robot cleaning zoning method according to an embodiment of the present application;
[0027] Figure 7 A schematic diagram of a first dividing line in a robot cleaning zoning method according to an embodiment of the present application;
[0028] Figure 8 This is a flow chart of step S40 in the robot cleaning zoning method according to one embodiment of the present application;
[0029] Fig. 9 This is a flow chart of step S42 in the robot cleaning zoning method according to one embodiment of the present application;
[0030] Fig.10 A flowchart of a robot cleaning zoning method shown as another embodiment of the present application;
[0031] Fig.11 This is a schematic block diagram of the structure of a robot cleaning partition device according to one embodiment of the present application;
[0032] Fig.12 The present invention is a block diagram showing the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0033] In order to make the objectives, technical solutions and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0034] It should be clear that the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the embodiments of the present application.
[0035] When the following description relates to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. In the description of the present application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances. The singular forms of "a", "said" and "the" used in the present application and the appended claims are also intended to include the majority form, unless the context clearly indicates other meanings. The words "if" / "if" used herein can be interpreted as "at the time of" or "when" or "in response to determination".
[0036] In addition, in the description of this application, unless otherwise specified, "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0037] In order to better understand the technical solution of the present application, some robots in the technology are briefly introduced here.
[0038] The robot includes a robot chassis, a robot base, and a robotic arm. The robot chassis can be docked or moved in the working environment. The robot base is installed on the robot chassis, and the robotic arm is installed on the robot base. The robotic arm includes multiple joints, and a joint refers to a device that connects two parts. The connection is not a fixed connection, but a limited relative movement can occur. Optionally, the movement may include rotation and translation. The robotic arm realizes its own movement by controlling the movement of the joints. The end of the robotic arm, that is, the end of the most tail joint, is used to interact with the environment, for example, to perform cleaning operations such as wiping and spraying on the work object.
[0039] The robot also includes one or more processors; the processor can be used to control the end of the robot arm to move along a preset working path toward the working object according to the robot control signal. Optionally, the processor can execute the robot cleaning zoning method of the present application.
[0040] Optionally, the processor can be built into the robot as a whole with the robot; the processor can also be placed outside the robot to independently control the movement of the robot. Optionally, the processor can also only execute the robot cleaning partition method, that is, the robot cleaning partition method of the present application can also be executed by other processing centers connected to the processor, and the other processing centers transmit the obtained robot cleaning partition method to the processor, and the processor further executes and controls the robot cleaning partition method.
[0041] The robot cleaning zoning method of the embodiment of the present application can be applied to robot cleaning zoning scenarios. The inventors found in the process of implementing the present invention that most robot cleaning zoning technologies rely on manual zoning, which increases costs. In the case of complex cleaning areas, manual zoning is time-consuming and inefficient.
[0042] To this end, the present application determines a segmentation point, determines a first segmentation line based on the segmentation point, uses the first segmentation line to segment the cleaning area map, obtains the target cleaning partition, and realizes automatic partitioning of the robot cleaning area, thereby improving the efficiency of cleaning partitioning, eliminating the need for manual partitioning, and reducing costs.
[0043] Based on this, the present application proposes a robot cleaning zoning method, device, storage medium and electronic device.
[0044] See also Figure 1 The robot cleaning zoning method provided in the embodiment of the present application comprises the following steps:
[0045] S10: Obtain a robot cleaning area map; fit the contour of the robot cleaning area map to obtain a robot cleaning contour map; wherein the robot cleaning contour map includes a plurality of contour vertices.
[0046] The robot cleaning area map refers to the map of the area to be cleaned. It can be the environmental data of the area to be cleaned scanned by the robot, and the robot cleaning area map is generated based on the environmental data. Specifically, the robot is equipped with a laser radar or a camera, and the laser point cloud data of the area to be cleaned is obtained by the laser radar, or the video image data of the area to be cleaned is obtained by the camera. The laser point cloud data or the video image data is calculated using a map construction algorithm to generate a robot cleaning area map. The map construction algorithm can be a SLAM (simultaneous localization and mapping) algorithm.
[0047] The contour of the robot cleaning area map is fitted by using an edge detection algorithm to obtain the contour of the robot cleaning area map, and fitting the contour using a polygon fitting algorithm. The edge detection algorithm includes but is not limited to the Sober algorithm, the Laplacian algorithm, the Prewitt algorithm, the Roberts algorithm, and the Canny algorithm, and the polygon fitting algorithm includes but is not limited to the least squares method, the Ramer-Douglas-Peucker algorithm, and the convex hull algorithm.
[0048] In the embodiment of the present application, the robot cleaning area map includes but is not limited to a grid map, a truncated signed distance field (TSDF) map and a semantic map. The robot cleaning contour map includes a polygonal contour and an area image surrounded by the polygonal contour, and the polygonal contour includes a plurality of contour vertices.
[0049] S20: If, among the plurality of contour vertices, a line connecting a previous contour vertex of the contour vertex and a next contour vertex of the contour vertex is not within the robot cleaning contour graph, the contour vertex is determined to be a segmentation point.
[0050] In the embodiments of this application, please refer to Figure 2 , all contour vertices can be numbered. For contour vertex i, the previous contour vertex of the contour vertex is numbered i-1, and the next contour vertex of the contour vertex is numbered i+1. Then the line L1 between contour vertex i-1 and contour vertex i+1 is not in the robot cleaning contour map, and contour vertex i is determined to be a split point. For contour vertex i-1, the previous contour vertex of the contour vertex is numbered i-2, and the next contour vertex of the contour vertex is numbered i. Then the line L2 between contour vertex i-2 and contour vertex i is in the robot cleaning contour map, and contour vertex i-1 is determined not to be a split point. According to the above determination method, it is possible to determine which contour vertices among all contour vertices are split points.
[0051] S30: Determine at least one first dividing line according to the dividing point.
[0052] In the embodiment of the present application, the contour of the robot cleaning area map includes a plurality of contour points. After the segmentation point is determined, the line connecting the segmentation point and the contour points in the contour of the robot cleaning area map can be used as the first segmentation line.
[0053] S40: Segment the robot cleaning area map according to at least one first segmentation line to obtain a target cleaning partition of the robot.
[0054] In the embodiment of the present application, the robot cleaning area map is segmented using the first segmentation line, and the robot cleaning area map can be divided into two target cleaning areas. Optionally, for each target cleaning area, the segmentation point of the target cleaning area and the corresponding first segmentation line can also be determined according to steps S10 to S30, and the target cleaning area can be further segmented according to the first segmentation line of the target cleaning area until the segmentation points of each cleaning area after the robot cleaning area map is segmented cannot be determined, thereby segmenting the robot cleaning area map into several cleaning areas.
[0055] By using the embodiments of the present application, a robot cleaning area map is obtained; the contour of the robot cleaning area map is fitted to obtain a robot cleaning contour map; wherein the robot cleaning contour map includes a number of contour vertices; among the several contour vertices, if the line connecting the previous contour vertex of the contour vertex and the next contour vertex of the contour vertex is not within the robot cleaning contour map, the contour vertex is determined to be a segmentation point; according to the segmentation point, at least one first segmentation line is determined; according to the at least one first segmentation line, the robot cleaning area map is segmented to obtain the target cleaning partition of the robot. The present application determines the segmentation point, determines the first segmentation line based on the segmentation point, and uses the first segmentation line to segment the cleaning area map to obtain the target cleaning partition, thereby realizing automatic partitioning of the robot cleaning area, improving the efficiency of cleaning partitioning, eliminating the need for manual partitioning, and reducing costs.
[0056] In an alternative embodiment, see Figure 3 , after step S10, steps S101 to S105 are included, which are specifically as follows:
[0057] S101: Binarizing the robot cleaning area map to obtain a binary image.
[0058] Among them, the binary image is a black and white image, the black pixel value is 0, the white pixel value is 255, the black part represents the inaccessible area, and the white part represents the accessible area.
[0059] S102: corroding the binary image to obtain a corroded binary image.
[0060] In the embodiment of the present application, the binary image is eroded to remove small white spots in the binary image.
[0061] S103: performing corrosion expansion on the corroded binary image to obtain an expanded image.
[0062] In the embodiment of the present application, the eroded binary image is subjected to erosion dilation, so that the small black dots in the eroded binary image can be connected into blocks, and the small white dots can be removed at the same time.
[0063] S104: Obtain the contour of the expanded image, perform polygon fitting on the contour, and obtain the fitted contour.
[0064] In the embodiment of the present application, since the contour of the expanded image is irregular and has burrs, polygon fitting is performed on the contour to obtain a contour with a regular shape.
[0065] S105: Filling with white the black areas in the fitted contour whose areas are smaller than the third preset area threshold, to obtain a pre-processed robot cleaning area map.
[0066] The third preset area threshold can be manually set according to needs.
[0067] In an embodiment of the present application, it is considered that there are large black areas and small black areas in the image. Generally, the large black areas are obstacles, and the small black areas are noise points. The small black areas are filled with white to remove the noise points, and the preprocessed robot cleaning area map is obtained.
[0068] By performing preprocessing operations such as binarization, corrosion expansion, and polygon fitting on the robot cleaning area map, it is convenient to partition the cleaning area later.
[0069] In an alternative embodiment, see Figure 4 , before step S20, including steps S201 to S203, which are as follows:
[0070] S201: traverse each contour vertex, and if a first distance between a contour vertex and a previous contour vertex and a second distance between a contour vertex and a next contour vertex are both less than a preset distance threshold, delete the contour vertex; and / or,
[0071] S202: if the angle between the line connecting the contour vertex and the previous contour vertex and the line connecting the contour vertex and the next contour vertex is less than a first preset angle, delete the contour vertex; and / or,
[0072] S203: If the angle between the line connecting the contour vertex and the previous contour vertex and the line connecting the contour vertex and the next contour vertex is greater than a second preset angle, delete the contour vertex.
[0073] Among them, the preset distance threshold, the first preset angle and the second preset angle can be set according to needs.
[0074] In an embodiment of the present application, after the contour of the robot cleaning area map is fitted with a polygon, there will still be many noise points in the fitted polygonal contour, which will affect the subsequent search for segmentation points. To determine whether a contour point in the contour is a noise point, it is necessary to compare each contour point with the two adjacent contour points. If the distance to the two adjacent contour points is too short, or the angle between the two lines connecting the two adjacent contour points is too small or too large, the contour point is considered to be a noise point and needs to be filtered out, thereby ensuring the accuracy of subsequent segmentation point extraction.
[0075] In an alternative embodiment, see Figure 5 , step S30, including steps S301 to S303, are as follows:
[0076] S301: traverse each contour vertex, and determine the contour vertex corresponding to the angle between the line connecting the contour vertex and the segmentation point, and the line connecting the segmentation point and the contour vertex before the segmentation point is greater than the first preset angle threshold as the segmentation starting point, and the segmentation starting point with the smallest angle as the first segmentation starting point; determine the contour vertex corresponding to the angle between the line connecting the contour vertex and the segmentation point, and the line connecting the segmentation point and the contour vertex next to the segmentation point is greater than the second preset angle threshold as the segmentation ending point, and the segmentation ending point with the smallest angle as the first segmentation ending point.
[0077] The first preset angle threshold and the second preset angle threshold may be preset angle values.
[0078] In the embodiment of the present application, there may be multiple segmentation starting points that meet the requirement that the included angle is greater than the first preset angle threshold, and the segmentation starting point with the smallest included angle is used as the first segmentation starting point. There may be multiple segmentation ending points that meet the requirement that the included angle is greater than the second preset angle threshold, and the segmentation ending point with the smallest included angle is used as the first segmentation ending point.
[0079] See also Figure 6 , the previous contour vertex of the segmentation point k is contour vertex k-1, the next contour vertex of the segmentation point is contour vertex k+1, the first segmentation starting point is contour vertex P, and the first segmentation ending point is contour vertex Q. The angle between the line connecting contour vertex P and segmentation point k, and the line connecting segmentation point k and contour vertex k-1 is greater than the first preset angle threshold, and the angle between the line connecting contour vertex Q and segmentation point k, and the line connecting segmentation point k and contour vertex k+1 is greater than the second preset angle threshold. Wherein, the first preset angle threshold and the second preset angle threshold are both θ.
[0080] S302: Determine, from the contour points of the contour, a first contour point that is shortest from the first segmentation start point and a second contour point that is shortest from the first segmentation end point.
[0081] In the embodiments of this application, please refer to Figure 6 , the contour 10 of the robot cleaning area map is an irregular shape in the figure, the robot cleaning contour map 20 is a polygon in the figure, the first contour point with the shortest distance to the first segmentation starting point P is recorded as P', and the second contour point with the shortest distance to the first segmentation ending point Q is recorded as Q'. Since the contour 10 of the robot cleaning area map coincides with the robot cleaning contour map 20 at the first segmentation starting point and the first segmentation ending point Q, the first contour point P' is located at the same position as the first segmentation starting point P, and the second contour point Q' is located at the same position as the first segmentation ending point Q.
[0082] S303: Calculate the distance between any contour point between the first contour point and the second contour point and the segmentation point, determine the contour point with the shortest distance as the target contour point, and determine the line connecting the target contour point and the segmentation point as the first segmentation line.
[0083] In the embodiments of this application, please refer to Figure 7 , the contour points between the first contour point P' and the second contour point Q' include n1, n2, n3, ..., the contour point with the shortest distance to the segmentation point k is the contour point n1, i.e., the target contour point, and the line connecting the target contour point and the segmentation point k is the line segment L, i.e., the first segmentation line. The first segmentation line L divides the robot cleaning area map into two segmentation areas 11.
[0084] In an alternative embodiment, see Figure 8 , step S40, including steps S41 to S42, are as follows:
[0085] S41: Segmenting the robot cleaning area map according to at least one first segmentation line to obtain at least one first segmentation result;
[0086] S42: Determine an optimal segmentation result from at least one first segmentation result; wherein the optimal segmentation result includes two target cleaning partitions.
[0087] In the embodiment of the present application, since there are multiple first segmentation lines, each first segmentation line can be used to divide the robot cleaning area map into two segmentation areas, namely, the first segmentation results. In order to improve the quality of the cleaning partition, an optimal segmentation result can be screened out from the multiple first segmentation results. Specifically, the first segmentation result that meets the preset conditions can be determined as the optimal segmentation result. Among them, the target cleaning partition is the segmentation area corresponding to the optimal segmentation result.
[0088] Optionally, for each target cleaning partition in the optimal segmentation result, the segmentation point of the target cleaning partition and the corresponding first segmentation line can be determined according to steps S10 to S30, and the target cleaning partition can continue to be segmented according to the first segmentation line of the target cleaning partition until the segmentation points of each cleaning partition after the robot cleaning area map is segmented cannot be determined, thereby dividing the robot cleaning area map into several cleaning partitions.
[0089] In an alternative embodiment, see Fig. 9 The first segmentation result includes two segmentation areas. Step S42 includes steps S421 to S423, which are specifically as follows:
[0090] S421: traverse each first segmentation result to determine whether the first segmentation result meets a preset condition;
[0091] S422: If yes, determine whether there is a segmentation area whose contour is fitted as a rectangle in the first segmentation result, and if yes, take the first segmentation result corresponding to the segmentation area with the highest rectangle fitting score as the optimal segmentation result;
[0092] S423: If it does not exist, compare the lengths of the first segmentation lines corresponding to the first segmentation results, and take the first segmentation result corresponding to the first segmentation line with the smallest length as the optimal segmentation result.
[0093] In the embodiment of the present application, if the first segmentation result does not meet the preset conditions, the first segmentation result will not be segmented further. If the first segmentation result meets the preset conditions, the contours of the two segmented areas in the first segmentation result are obtained, and the contours of the two segmented areas are fitted. If the contour can be fitted into a rectangle, the rectangle fitting score when the contour is fitted into a rectangle is obtained, and the rectangle fitting scores corresponding to several first segmentation results are compared. The first segmentation result corresponding to the segmentation area with the highest rectangle fitting score is used as the optimal segmentation result. If the contours cannot be fitted into a rectangle, the lengths of the first segmentation lines corresponding to each first segmentation result are obtained, and the lengths of the first segmentation lines are compared. The first segmentation result corresponding to the first segmentation line with the smallest length is used as the optimal segmentation result.
[0094] By performing contour fitting on the first segmentation result and comparing the lengths of the first segmentation lines, an optimal segmentation result can be automatically and quickly screened out from a number of first segmentation results.
[0095] In an optional embodiment, step S421 includes step S4211, which is specifically as follows:
[0096] S4211: If the length of the first segmentation line corresponding to the first segmentation result is less than or equal to the preset length threshold, and the contour widths of the two segmentation regions are both greater than the preset width threshold, and the areas of the two segmentation regions are both greater than the preset area threshold, it is determined that the first segmentation result meets the preset conditions.
[0097] Among them, the preset length threshold, the preset width threshold and the preset area threshold can all be set as required.
[0098] In an embodiment of the present application, since there are multiple first segmentation lines, each first segmentation line can be used to divide the robot cleaning area map into two segmentation areas, namely, the first segmentation results. In order to improve the quality of the cleaning partitions, before selecting an optimal segmentation result from multiple first segmentation results, the first segmentation results are preliminarily screened, that is, the first segmentation results are required to meet certain requirements. Specifically, the length of the first segmentation line corresponding to the first segmentation result is compared with a preset length threshold, the contour line width of the two segmentation areas in the first segmentation result is compared with a preset width threshold, and the area of the two segmentation areas in the first segmentation result is compared with a preset area threshold to determine whether the first segmentation result meets the preset conditions. If the length of the first segmentation line corresponding to the first segmentation result is greater than the preset length threshold, or at least one of the contour line widths of the two segmentation areas is less than the preset width threshold, or at least one of the areas of the two segmentation areas is less than the preset area threshold, it is determined that the first segmentation result does not meet the preset conditions.
[0099] In an alternative embodiment, see Fig.10 The robot cleaning zoning method includes steps S50 to S60, which are as follows:
[0100] S50: Obtain the main direction and area of each target cleaning partition.
[0101] In the embodiment of the present application, the main direction of each target cleaning partition can be calculated by using the image distance method. The calculation formula of the image distance is as follows:
[0102]
[0103] Among them, C and R represent the columns and rows of the image respectively, and f(x,y) is the pixel value of the coordinate (x,y). p and q constitute different orders of the image, and the physical meaning of each order is: 0th order moment (m00): the zeroth order moment is related to the mass of the object (target mass); 1st order moment (m01, m10): related to the shape (the zeroth order moment and the first order moment can be used to calculate the center of gravity); 2nd order moment (m02, m11, m20): the second order moment shows the degree of expansion of the curve around the average value of the straight line; 3rd order moment (m03, m12, m21, m30): the third order moment is a measure of the symmetry about the average value. Based on these orders, the center of mass can be calculated from the zeroth order moment and the first order moment, and the image direction can be calculated from the second order moment. The specific calculation process is: first find the center of mass,
[0104]
[0105] Then ask:
[0106]
[0107] Then, the main direction of the image is:
[0108]
[0109] S60: If the angle between the main directions of two adjacent target cleaning partitions is smaller than a preset threshold, and the sum of the areas of the two adjacent target cleaning partitions is smaller than or equal to the preset area threshold, the two adjacent target cleaning partitions are merged to obtain a merged cleaning partition.
[0110] In an embodiment of the present application, if the main directions of two adjacent target cleaning partitions are relatively close, after the two adjacent target cleaning partitions are merged, if the area of the merged region exceeds the preset area threshold, the two adjacent target cleaning partitions will not be merged; if the area of the merged region does not exceed the preset area threshold, the two adjacent target cleaning partitions will be merged to obtain a merged cleaning partition.
[0111] By merging adjacent target cleaning partitions, it can be ensured that the number of target cleaning partitions will not be too large, thereby facilitating the improvement of the subsequent cleaning efficiency of the robot.
[0112] The present application also provides an apparatus embodiment that can be used to execute the contents of the robot cleaning zoning method in the embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the contents of the robot cleaning zoning method in the embodiment of the present application.
[0113] See also Fig.11 , a robot cleaning partition device 7 disclosed in an embodiment of the present application includes:
[0114] The cleaning contour map acquisition module 71 is used to obtain a robot cleaning area map; fit the contour of the robot cleaning area map to obtain a robot cleaning contour map; wherein the robot cleaning contour map includes a plurality of contour vertices;
[0115] A segmentation point determination module 72 is used to determine, among a plurality of contour vertices, a contour vertex as a segmentation point if a line connecting a previous contour vertex and a next contour vertex of the contour vertex is not within the robot cleaning contour graph;
[0116] A first segmentation line determination module 73, used to determine at least one first segmentation line according to the segmentation point;
[0117] The target cleaning partition obtaining module 74 is used to segment the robot cleaning area map according to at least one first segmentation line to obtain the target cleaning partition of the robot.
[0118] The robot cleaning zoning device provided in the above embodiment and the robot cleaning zoning method provided in the embodiment of the present application belong to the same concept. For the implementation process, please refer to steps S10 to S40 of the method embodiment for details, which will not be repeated here.
[0119] The present application also provides a device embodiment that can be used to execute the contents of the robot cleaning zoning method in the embodiment of the present application. For details not disclosed in the device embodiment of the present application, please refer to the contents of the robot cleaning zoning method in the embodiment of the present application.
[0120] See also Fig.12 The present application also provides an electronic device 300, which can be a computer, a robot cleaning partition device, etc. In an exemplary embodiment of the present application, the electronic device 300 is a robot cleaning partition device, which includes: at least one processor 301, at least one memory 302, at least one display, at least one network interface 303, a user interface 304, and at least one communication bus 305.
[0121] The user interface 304 is mainly used to provide an input interface for the user and obtain data input by the user. Optionally, the user interface may also include a standard wired interface or a wireless interface.
[0122] The network interface 303 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0123] The communication bus 305 is used to realize the connection and communication between these components.
[0124] Among them, the processor 301 may include one or more processing cores. The processor uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions of the electronic device and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory, and calling data stored in the memory. Optionally, the processor can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor can integrate one or more combinations of central processing unit (Central Processing Unit, CPU), image processor (Graphics Processing Unit, GPU) and modem. Among them, the CPU mainly processes the operating system, user interface and application program, etc.; the GPU is responsible for rendering and drawing the content to be displayed by the display layer; the modem is used to process wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor, but implemented by a single chip.
[0125] Among them, the memory 302 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory includes a non-transitory computer-readable storage medium. The memory can be used to store instructions, programs, codes, code sets or instruction sets. The memory may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory may also be optionally at least one storage device located away from the aforementioned processor. As Fig.12 As shown, the memory as a computer storage medium may include an operating system, a network communication module, a user interface module, and an operating application program.
[0126] The processor can be used to call the application of the robot cleaning zoning method of the robot cleaning zoning device stored in the memory, and specifically execute the method steps of the above-mentioned embodiment. The specific execution process can refer to the specific description shown in the method embodiment, which will not be repeated here.
[0127] The present application also provides a computer-readable storage medium on which a computer program is stored, and the instructions are suitable for being loaded by a processor and executing the method steps of the above-mentioned embodiment. The specific execution process can refer to the specific description shown in the embodiment, and will not be repeated here. The device where the storage medium is located can be a personal computer, a laptop computer, a smart phone, a tablet computer, a picture director device and other electronic devices.
[0128] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are merely schematic, wherein the components described as separate parts may or may not be physically separated, and the parts displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.
[0129] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0130] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the function selected in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 function selected in a box or multiple boxes.
[0131] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 steps for the function selected in a box or multiple boxes.
[0132] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0133] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0134] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0135] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0136] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A robot cleaning partition method, It is characterized in that The steps include: Acquire a robot cleaning area map; fit the contour of the robot cleaning area map to obtain a robot cleaning contour map; wherein the robot cleaning contour map includes a plurality of contour vertices; Among the plurality of contour vertices, if a line connecting a previous contour vertex of the contour vertex and a next contour vertex of the contour vertex is not within the robot cleaning contour graph, determining the contour vertex as a segmentation point; Determine at least one first segmentation line according to the segmentation point; The robot cleaning area map is segmented according to at least one of the first segmentation lines to obtain a target cleaning partition of the robot.
2. The robot cleaning zoning method according to claim 1, Features: The step of determining at least one first segmentation line according to the segmentation point comprises: Traversing each of the contour vertices, determining the contour vertices corresponding to the angles between the contour vertex and the segmentation point, and the line between the segmentation point and the contour vertex before the segmentation point is greater than the first preset angle threshold as the segmentation starting point, and the segmentation starting point with the smallest angle as the first segmentation starting point; determining the contour vertices corresponding to the angles between the contour vertex and the segmentation point, and the line between the segmentation point and the contour vertex next to the segmentation point is greater than the second preset angle threshold as the segmentation ending point, and the segmentation ending point with the smallest angle as the first segmentation ending point; Determine, from the contour points of the contour, a first contour point that is shortest from the first segmentation starting point and a second contour point that is shortest from the first segmentation ending point; The distance between any contour point between the first contour point and the second contour point and the segmentation point is calculated, the contour point with the shortest distance is determined as the target contour point, and the line connecting the target contour point and the segmentation point is determined as the first segmentation line.
3. The robot cleaning zoning method according to claim 1, Features: The step of segmenting the robot cleaning area map according to at least one of the first segmentation lines to obtain a target cleaning partition of the robot includes: Segmenting the robot cleaning area map according to at least one of the first segmentation lines to obtain at least one first segmentation result; An optimal segmentation result is determined from at least one of the first segmentation results; wherein the optimal segmentation result includes two target cleaning partitions.
4. The robot cleaning zoning method according to claim 3, Features: The first segmentation result includes two segmentation areas; The step of determining an optimal segmentation result from at least one first segmentation result comprises: Traversing each of the first segmentation results, and determining whether the first segmentation result meets a preset condition; If yes, determine whether there is a segmentation area whose contour is fitted as a rectangle in the first segmentation result, and if yes, take the first segmentation result corresponding to the segmentation area with the highest rectangle fitting score as the optimal segmentation result; If it does not exist, the lengths of the first segmentation lines corresponding to the first segmentation results are compared, and the first segmentation result corresponding to the first segmentation line with the smallest length is taken as the optimal segmentation result.
5. The robot cleaning zoning method according to claim 4, Features: The step of determining whether the first segmentation result meets a preset condition comprises: If the length of the first segmentation line corresponding to the first segmentation result is less than or equal to a preset length threshold, and the contour line widths of the two segmentation regions are both greater than a preset width threshold, and the areas of the two segmentation regions are both greater than a preset area threshold, it is determined that the first segmentation result meets the preset conditions.
6. The robot cleaning zoning method according to any one of claims 1 to 5, Features: Among the plurality of contour vertices, if a line connecting a previous contour vertex of the contour vertex and a next contour vertex of the contour vertex is not within the robot cleaning contour graph, before the step of determining the contour vertex as a segmentation point, the method includes: Traversing each of the contour vertices, if a first distance between the contour vertex and a previous contour vertex of the contour vertex and a second distance between the contour vertex and a next contour vertex of the contour vertex are both less than a preset distance threshold, deleting the contour vertex; and / or, If the angle between the line connecting the contour vertex and the previous contour vertex of the contour vertex and the line connecting the contour vertex and the next contour vertex of the contour vertex is less than a first preset angle, delete the contour vertex; and / or, If the angle between the line connecting the contour vertex and the previous contour vertex of the contour vertex and the line connecting the contour vertex and the next contour vertex of the contour vertex is greater than a second preset angle, the contour vertex is deleted.
7. The robot cleaning zoning method according to any one of claims 1 to 5, It is characterized in that Also includes: Obtaining the main direction and area of each target cleaning partition; If the angle between the main directions of two adjacent target cleaning partitions is less than a preset threshold, and the sum of the areas of the two adjacent target cleaning partitions is less than or equal to the preset area threshold, the two adjacent target cleaning partitions are merged to obtain a merged cleaning partition.
8. The robot cleaning zoning method according to any one of claims 1 to 5, Features: After the step of obtaining the robot cleaning area map, the method further comprises: Binarizing the robot cleaning area map to obtain a binary image; Corroding the binary image to obtain a corroded binary image; Performing corrosion expansion on the corroded binary image to obtain an expanded image; Acquire the contour of the expanded image, perform polygon fitting on the contour, and obtain a fitted contour; The black areas in the fitted contour whose areas are smaller than the third preset area threshold are filled with white, so as to obtain a preprocessed robot cleaning area map.
9. A robot cleaning partition device, It is characterized in that include: A cleaning contour map acquisition module is used to acquire a robot cleaning area map; fit the contour of the robot cleaning area map to acquire a robot cleaning contour map; wherein the robot cleaning contour map includes a plurality of contour vertices; A segmentation point determination module, configured to determine, among a plurality of the contour vertices, if a line connecting a previous contour vertex of the contour vertex and a next contour vertex of the contour vertex is not within the robot cleaning contour graph, the contour vertex as a segmentation point; A first cutting line determining module, used for determining at least one first cutting line according to the cutting point; The target cleaning partition obtaining module is used to segment the robot cleaning area map according to at least one of the first segmentation lines to obtain the target cleaning partition of the robot.
10. An electronic device comprising a display, a processor and a memory; It is characterized in that The memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the robot cleaning zoning method according to any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the robot cleaning zoning method according to any one of claims 1 to 8 is implemented.