A method for a cleaning robot to obtain the area of ​​a cleanable area

By identifying and calculating the area occupied by unit pixels in the cleaning robot environment plan, the problem of traversing areas in the prior art is solved, and a more efficient and accurate area calculation is achieved.

CN113888574BActive Publication Date: 2025-09-05AMICRO SEMICONDUCTOR CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111167538.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-07
Publication Date
2025-09-05
Estimated Expiration
2041-10-07

AI Technical Summary

Technical Problem

Existing cleaning robots need to traverse the entire area when obtaining the area of ​​sweeping, resulting in inefficiency.

Method used

By obtaining the current environment plan of the cleaning robot, performing image preprocessing, identifying the contour lines, filtering out the sweeping area, calculating the area occupied by unit pixels, and accurately obtaining the sweeping area area without traversing the area.

Benefits of technology

The method for obtaining the area of ​​the cleanable area is simplified, and the calculation accuracy and the working efficiency of the cleaning robot are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113888574B_ABST
    Figure CN113888574B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for a cleaning robot to obtain the area of ​​a cleanable area, specifically comprising: obtaining a plan view of the cleaning robot's current environment; determining the cleanable area within the plan view of the cleaning robot's current environment; obtaining the number of pixels within the cleanable area within the plan view of the cleaning robot's current environment; and calculating the area of ​​the cleanable area within the plan view of the cleaning robot's current environment based on the area occupied by each pixel. The present invention enables the cleaning robot to obtain the area of ​​the cleanable area without having to traverse the cleanable area, thus simplifying the method for the cleaning robot to obtain the area of ​​the cleanable area. At the same time, the accuracy of the calculation of the cleanable area area by calculating the area occupied by each pixel is improved, thereby improving the working efficiency of the cleaning robot.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cleaning robots, and in particular to a method for a cleaning robot to obtain the area of ​​a cleanable region. Background Art

[0002] With the rapid development of science and technology, cleaning robots have been widely used in daily life. As a mobile device with intelligent planning and cleaning, cleaning robots can autonomously plan cleaning routes and cleaning task sequences. Before the cleaning robot executes the autonomously planned cleaning route, the cleaning robot needs to obtain the current environmental information. The current environmental information includes: obstacle locations and task area related information, etc. The task area related information includes the area and range of the cleanable area. The cleaning robot obtains the area and range of the cleanable area to achieve better cleaning routes and cleaning task planning. In the current existing technology, the cleaning robot generally needs to traverse the cleanable area before obtaining the area of ​​the cleanable area, which will reduce the working efficiency of the cleaning robot. Summary of the Invention

[0003] To solve the above problems, the present invention provides a method for a cleaning robot to obtain the area of ​​a cleanable area, which simplifies the method for the cleaning robot to obtain the area of ​​the cleanable area and improves the accuracy of the cleaning robot in obtaining the area of ​​the cleanable area. The specific technical solutions of the present invention are as follows:

[0004] A method for a cleaning robot to obtain the area of ​​a cleanable area, specifically comprising: obtaining a plan view of the environment in which the cleaning robot is currently located; determining the cleanable area within the plan view of the environment in which the cleaning robot is currently located; obtaining the number of pixels within the cleanable area within the plan view of the environment in which the cleaning robot is currently located; and calculating the area of ​​the cleanable area within the plan view of the environment in which the cleaning robot is currently located based on the area occupied by unit pixels.

[0005] Compared with the existing technology, this technical solution obtains the number of pixels in the cleanable area in the plan view of the environment in which the cleaning robot is currently located, and obtains the area of ​​the cleanable area through the area occupied by unit pixels and the number of pixels in the cleanable area. The cleaning robot does not need to traverse the cleanable area to obtain the area of ​​the cleanable area, which simplifies the method for the cleaning robot to obtain the area of ​​the cleanable area. At the same time, the accuracy of the calculation of the area of ​​the cleanable area is improved by calculating the area occupied by unit pixels, thereby improving the rationality of the cleaning task planning of the cleaning robot and improving the work efficiency of the cleaning robot.

[0006] Furthermore, the method for the cleaning robot to obtain the area of ​​the cleanable area also includes, before executing the method for determining the cleanable area within the plan view of the environment in which the cleaning robot is currently located: performing image preprocessing on the plan view of the environment in which the cleaning robot is currently located to obtain all contour lines in the plan view of the environment in which the cleaning robot is currently located.

[0007] Furthermore, the image preprocessing of the plan view of the cleaning robot's current environment refers to binarizing the plan view of the cleaning robot's current environment so that the plan view of the cleaning robot's current environment is processed into a binary image. This technical solution processes the plan view of the cleaning robot's current environment into a binary image by performing threshold segmentation on the environment plan view. Since each pixel in a binary image has only two possible values ​​or grayscale states, the plan view of the cleaning robot's current environment, after being converted into a binary image, can more accurately identify all contour lines, thereby improving the contour line recognition accuracy of this technical solution.

[0008] Furthermore, the obtaining of all contour lines in the plan view of the environment in which the cleaning robot is currently located specifically includes: using the findContours function based on contour detection to identify contour pixel points in the plan view of the environment in which the cleaning robot is currently located, which is processed into a binary image, and composing all contour lines in the plan view of the environment in which the cleaning robot is currently located based on all identified contour pixel points.

[0009] Furthermore, the image preprocessing of the plan view of the cleaning robot's current environment may also include dividing the plan view of the cleaning robot's current environment into a non-obstacle area and an obstacle area, and covering the non-obstacle area and the obstacle area with different colors. In this technical solution, the use of different areas covered with different colors allows for clear distinction between the different areas, facilitating identification of all contour lines in the plan view of the cleaning robot's current environment.

[0010] Furthermore, obtaining all contour lines in the plan view of the environment currently located by the cleaning robot specifically includes: identifying boundaries between regions of different colors, and using all boundaries between regions covered by the different colors as all contour lines in the plan view of the environment currently located by the cleaning robot. This technical solution obtains all contour lines in the plan view of the environment currently located by the cleaning robot by identifying boundaries between regions of different colors as contour lines of the regions.

[0011] Furthermore, the determining of the cleanable area within the plan view of the environment currently located by the cleaning robot specifically includes: selecting a contour line that meets a preset first feature from all contour lines in the plan view of the environment currently located by the cleaning robot as the contour line of the cleanable area, and determining the area enclosed by the contour line of the cleanable area as the cleanable area within the plan view of the environment currently located by the cleaning robot. In this technical solution, by presetting the first feature, a contour line that best meets the contour line of the cleanable area is selected from all contour lines in the plan view of the environment currently located by the cleaning robot through feature screening, thereby improving the accuracy of determining the range of the cleanable area.

[0012] Furthermore, the contour line meeting the preset first feature refers to the contour line with the longest line segment length and connected end to end among all the contour lines.

[0013] Furthermore, the method of obtaining the number of pixel points in the cleanable area within the plane map of the environment in which the cleaning robot is currently located specifically includes: obtaining the centroid point of the cleanable area; determining whether the centroid point of the cleanable area is an obstacle point or a non-obstacle point; if the centroid point of the cleanable area is a non-obstacle point, selecting the centroid point of the cleanable area as the trigger point of the cleanable area; if the centroid point of the cleanable area is an obstacle point, selecting a non-obstacle point within the four or eight neighborhoods of the centroid point of the cleanable area as the trigger point; with the trigger point of the cleanable area as the center, the pixel points around it are covered point by point until all the pixel points in the entire cleanable area are covered, and the number of pixel points in the cleanable area is recorded. In this technical solution, the number of pixel points in the cleanable area is recorded by covering every pixel point within the outline of the cleanable area, and the number of pixel points in the cleanable area can be obtained without the cleaning robot traversing the cleanable area.

[0014] Furthermore, the method for obtaining the area occupied by the unit pixel specifically includes: setting a reference object of a first area in the environment currently located by the cleaning robot; determining the area occupied by the reference object within the plan view of the environment currently located by the cleaning robot; obtaining the number of pixels within the area occupied by the reference object within the plan view of the environment currently located by the cleaning robot; using the first area of ​​the reference object as the dividend, the number of pixels within the area occupied by the reference object as the divisor, and the quotient of the first area of ​​the reference object and the number of pixels within the area occupied by the reference object as the area occupied by the unit pixel. This technical solution obtains the area occupied by the unit pixel by setting a reference object. When the area of ​​the reference object is known, the area occupied by the unit pixel can be obtained by obtaining the number of pixels within the area occupied by the reference object. This enables this technical solution to flexibly and accurately obtain the area of ​​the cleanable area in the environment currently located by the cleaning robot in accordance with the different methods or angles of obtaining the plan view of the environment currently located by the cleaning robot according to the different environments currently located by the cleaning robot.

[0015] Furthermore, determining the reference object occupied area within the plan view of the environment currently located by the cleaning robot specifically includes: selecting a contour line that meets a preset second feature from all contour lines in the plan view of the environment currently located by the cleaning robot as the reference object occupied area contour line, and determining the area surrounded by the reference object occupied area contour line as the reference object occupied area within the plan view of the environment currently located by the cleaning robot. In this technical solution, a feature screening method is adopted to select a contour line that meets the reference object occupied area feature from all contour lines, and at the same time, in the form of preset features.

[0016] Furthermore, obtaining the number of pixels within the reference object occupied area within the floor plan of the environment currently located by the cleaning robot specifically includes: obtaining the centroid of the reference object occupied area; using the centroid of the reference object occupied area as a trigger point for the reference object occupied area; and covering the pixels surrounding the trigger point of the reference object occupied area point by point, until all pixels within the entire reference object occupied area are covered, and recording the number of pixels within the cleanable area. In this technical solution, by covering all pixels within the outline of the reference object occupied area, the number of pixels within the reference object occupied area can be accurately counted, thereby improving the accuracy of the area occupied per pixel.

[0017] Furthermore, the calculation of the cleanable area within the floor plan of the cleaning robot's current environment based on the area occupied by a unit pixel specifically includes: taking the product of the area occupied by a unit pixel and the number of pixels within the cleanable area as the cleanable area within the floor plan of the cleaning robot's current environment. This technical solution allows the cleaning robot to obtain the area of ​​the cleanable area without having to traverse the cleanable area, thereby simplifying the method for the cleaning robot to obtain the area of ​​the cleanable area. At the same time, the accuracy of the calculation of the cleanable area by calculating the area occupied by a unit pixel is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 The figure is a flow chart of a method for a cleaning robot to obtain the area of ​​a cleanable area according to an embodiment of the present invention. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described below are only used to explain the present invention and are not intended to limit the present invention. In addition, it is also understood that for ordinary technicians in this field, making some changes in design, manufacturing or production based on the technical content disclosed in the present invention is just a conventional technical means and should not be understood as insufficient disclosure of the present application.

[0020] Unless otherwise defined, the technical terms or scientific terms involved in the present invention should be understood by people with ordinary skills in the technical neighborhood to which this application belongs. The terms "include", "comprising", "having" and any variations thereof involved in this application are intended to cover non-exclusive inclusions, such as: a process, method, system product or device that includes a series of steps or modules is not limited to the listed steps or units, but may also include steps or modules that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The terms "first", "second", "third" etc. involved in this application are merely used to distinguish similar correspondences and do not represent a specific ordering of objects.

[0021] In one embodiment of the present invention, a method for a cleaning robot to obtain the area of ​​a cleanable area is provided. Figure 1 As shown, the method for the cleaning robot to obtain the area of ​​the cleanable area specifically includes:

[0022] Obtain a plan view of the current environment of the cleaning robot; wherein, the method of obtaining the plan view of the current environment of the cleaning robot may be, but is not limited to, acquiring the plan view through an image acquisition device mounted on the body of the cleaning robot, or acquiring the plan view through an image acquisition device disposed outside the body of the cleaning robot and transmitting the plan view to the cleaning robot through a wired or wireless network; the image acquisition device may be, but is not limited to, a monocular camera or a binocular camera or other device with an image acquisition function.

[0023] Determine a cleanable area within the plan view of the environment in which the cleaning robot is currently located; wherein the cleanable area refers to an area range in which the cleaning robot can perform cleaning tasks in the environment in which the cleaning robot is currently located.

[0024] Obtain the number of pixels in the cleanable area within the floor plan of the environment in which the cleaning robot is currently located; wherein, the method for obtaining the number of pixels in the cleanable area within the floor plan of the environment in which the cleaning robot is currently located may be, but is not limited to, calculation using an algorithm with pixel number statistics, such as a flooding algorithm to traverse the cleanable area.

[0025] The area of ​​the cleanable area within the current floor plan of the cleaning robot's environment is calculated based on the area occupied by each pixel. The area occupied by each pixel in the floor plan of the cleaning robot's environment corresponds to the area of ​​the actual environment. For example, if the area occupied by each pixel is 1 square meter, then each pixel in the floor plan of the cleaning robot's environment corresponds to an area of ​​1 square meter in the actual environment.

[0026] Specifically, calculating the area of ​​the cleanable area within the plan view of the cleaning robot's current environment based on the area occupied by each pixel includes multiplying the number of pixels within the cleanable area by the area occupied by each pixel, and taking the product as the area of ​​the cleanable area. Because the area occupied by each pixel effectively reflects the area corresponding to each pixel in the plan view of the cleaning robot's current environment, the area of ​​the cleanable area within the cleaning robot's current environment can be calculated through mathematical conversion.

[0027] Based on the above embodiments, a preferred embodiment of the present invention provides a method for a cleaning robot to obtain the area of ​​a cleanable area. In this embodiment, before executing the determination of the cleanable area in the plan view of the environment in which the cleaning robot is currently located, it also includes: performing image preprocessing on the plan view of the environment in which the cleaning robot is currently located to obtain all the contour lines in the plan view of the environment in which the cleaning robot is currently located. The purpose of the image preprocessing is to make the contour lines in the plan view of the environment in which the cleaning robot is currently located easier to distinguish. The means of image preprocessing may include but are not limited to performing threshold segmentation on the plan view of the environment in which the cleaning robot is currently located to process it into a binary image, or covering the plan view of the environment in which the cleaning robot is currently located with different colors according to obstacle areas and non-obstacle areas.

[0028] Based on the above embodiments, a preferred embodiment of the present invention provides a method for a cleaning robot to obtain the area of ​​a cleanable area. In this embodiment, the floor plan of the current environment of the cleaning robot is subjected to binary image preprocessing through threshold segmentation, so that the floor plan of the current environment of the cleaning robot after image preprocessing is a binary image.

[0029] Furthermore, the plan view of the cleaning robot's current environment, which has been preprocessed into a binary image, is then used to identify all contour pixels in the plan view using a findContours function based on contour detection. All contour lines in the plan view of the cleaning robot's current environment are then formed based on all identified contour pixels. Specifically, the findContours function is a commonly used contour detection function in the cross-platform computer vision and machine learning software library OpenCV, and its detailed description is omitted here.

[0030] Based on the above embodiments, a preferred embodiment of the present invention provides a method for a cleaning robot to obtain the area of ​​a cleanable area. In this embodiment, the plan view of the environment in which the cleaning robot is currently located is divided into obstacle areas and non-obstacle areas, and different colors are used to cover different areas.

[0031] Preferably, in this embodiment, the plan view of the environment in which the cleaning robot is currently located is divided into two areas: obstacle area and non-obstacle area, and different colors are used to cover these two areas. It should be noted that the covering colors used in these two areas are two easily distinguishable colors, such as red and green, black and white, etc., so as to better distinguish the dividing line between the two, thereby more accurately identifying the area boundaries and obtaining all the contour lines in the plan view of the environment in which the cleaning robot is currently located.

[0032] Specifically, the method for obtaining all contour lines in the plan view of the environment in which the cleaning robot is currently located is to identify the boundaries of areas of different colors and use all boundaries between areas covered by different colors as all contour lines in the plan view of the environment in which the cleaning robot is currently located.

[0033] Based on the above embodiments, a preferred embodiment of the present invention provides a method for a cleaning robot to obtain the area of ​​a cleanable area. In this embodiment, the method of determining the cleanable area within the plan view of the environment in which the cleaning robot is currently located specifically includes: selecting a contour line that meets a preset first feature from all contour lines in the plan view of the environment in which the cleaning robot is currently located as the contour line of the cleanable area, and determining the non-obstacle area within the area surrounded by the contour line of the cleanable area as the cleanable area within the plan view of the environment in which the cleaning robot is currently located. Specifically, the preset first feature refers to a feature that is pre-stored in the cleaning robot by the user based on the commonly used environment of the cleaning robot, and is used to filter out the contour line of the cleanable area. The preset first feature can be adjusted according to the environmental changes of the cleaning robot and the needs of the user.

[0034] Preferably, in a preferred embodiment of the present invention, the preset first feature is the line segment with the longest length and connected end to end among all the contour lines. The cleaning robot uses the preset first feature to select a contour line with the longest line segment and connected end to end from all the contour lines as the contour line of the cleanable area, and determines the non-obstacle area within the area surrounded by the contour line of the cleanable area as the cleanable area within the plan view of the environment in which the cleaning robot is currently located. It should be noted that the preset first feature in this embodiment is a feature for selecting the contour line of the cleanable area determined by the inventor through repeated experiments, and the preset first feature can be adjusted accordingly according to changes in the application environment of the cleaning robot.

[0035] Based on the above embodiments, a preferred embodiment of the present invention provides a method for a cleaning robot to obtain the area of ​​a cleanable area. In this embodiment, obtaining the number of pixels in the cleanable area of ​​the plane map of the environment in which the cleaning robot is currently located is achieved by adopting a flooding algorithm, which specifically includes:

[0036] Obtain the centroid of the cleanable area; wherein, the method for obtaining the centroid of the cleanable area may be, but is not limited to, weighting all points in the cleanable area and taking the average value thereof, and using the average value as the centroid position.

[0037] Determine whether the centroid of the cleanable area is an obstacle point or a non-obstacle point. Specifically, the method for determining whether the centroid of the cleanable area is an obstacle point or a non-obstacle point depends on the image preprocessing method of the planar image of the environment currently located by the cleaning robot. If binarization processing is used, the grayscale value of the centroid of the cleanable area is determined to be an obstacle area or a non-obstacle area. If the grayscale value of the centroid of the cleanable area is in the obstacle area, it is an obstacle point; conversely, if the grayscale value of the centroid of the cleanable area is in the non-obstacle area, it is a non-obstacle point. Similarly, if image preprocessing is used in which different areas are covered with different colors, the color of the centroid of the cleanable area is determined to be an obstacle area or a non-obstacle area. If the color of the centroid of the cleanable area is in the obstacle area, it is an obstacle point; conversely, if the color of the centroid of the cleanable area is in the non-obstacle area, it is a non-obstacle point. It should be noted that all pixel points in the obstacle area are obstacle points, and conversely, all pixel points in the non-obstacle area are non-obstacle points.

[0038] If the centroid of the cleanable area is a non-obstacle point, the centroid of the cleanable area is selected as the trigger point of the cleanable area;

[0039] If the centroid of the cleanable area is an obstacle point, a non-obstacle point is selected within the four or eight neighborhoods of the centroid of the cleanable area as the trigger point of the cleanable area; specifically, if the centroid of the cleanable area is an obstacle point, a non-obstacle point is preferentially selected within the four neighborhoods of the centroid of the cleanable area as the trigger point of the cleanable area; if there is no non-obstacle point within the four neighborhoods of the centroid of the cleanable area, a non-obstacle point is selected within the eight neighborhoods of the centroid of the cleanable area as the trigger point of the cleanable area; similarly, if there is no non-obstacle point within the eight neighborhoods of the centroid of the cleanable area, the system expands outward with the centroid of the cleanable area as the center to select a non-obstacle point that is closest to the centroid of the cleanable area and within the cleanable area as the trigger point of the cleanable area.

[0040] With the trigger point of the reference object occupied area as the center, the pixel points around it are covered point by point until all the pixel points in the entire reference object occupied area are covered, and the number of pixel points in the cleanable area is recorded. Specifically, by taking the trigger point of the cleanable area as the center, the pixel points around it are covered point by point, so as to achieve the coverage of the pixel points in the cleanable area one by one, and the number of covered pixel points in the cleanable area can be accurately recorded, thereby obtaining the total number of pixel points in the cleanable area. It should be noted that in this embodiment, the number of pixel points in the area is counted by starting from a pixel point, expanding the filling coverage to the surrounding pixel points until the edge of the area, so as to ensure the accuracy of the pixel point count, and there is no need for the cleaning robot to traverse the area.

[0041] Based on the above embodiments, a preferred embodiment of the present invention provides a method for a cleaning robot to obtain the area of ​​a cleanable area. In this embodiment, the method for obtaining the area occupied by the unit pixel specifically includes:

[0042] A reference object of a first area is set in the environment currently located by the cleaning robot; specifically, the reference object of the first area needs to be set in the environment currently located by the cleaning robot before obtaining a plan view of the environment currently located by the cleaning robot, so that the obtained plan view of the environment currently located by the cleaning robot contains the reference object. It should be noted that the first area of ​​the reference object is a known area that does not need to be measured, and the shape of the reference object can be but is not limited to a circle, rectangle, square, ellipse or polygon, etc., and the setting position of the reference object in the environment currently located by the cleaning robot can be but is not limited to the upper right corner, lower right corner, upper left corner or lower left corner of the plan view of the largest range that the cleaning robot can obtain in the environment currently located.

[0043] Determine the reference object occupied area within the plan view of the environment in which the cleaning robot is currently located; specifically, the determination of the reference object occupied area within the plan view of the environment in which the cleaning robot is currently located is performed after the image preprocessing described in the above embodiment, so as to filter out the reference object occupied area contour lines from all contour lines of the plan view of the environment in which the cleaning robot is currently located, thereby determining the reference object occupied area.

[0044] Obtaining the number of pixels within the area occupied by the reference object within the plan view of the environment currently located by the cleaning robot; specifically, the method for obtaining the number of pixels within the area occupied by the reference object within the plan view of the environment currently located by the cleaning robot is the same as the method for obtaining the number of pixels within the cleanable area within the plan view of the environment currently located by the cleaning robot, and in this embodiment, both methods are obtained using a flooding algorithm. It should be noted that the method for obtaining the number of pixels within the area occupied by the reference object within the plan view of the environment currently located by the cleaning robot can be, but is not limited to, obtaining using a flooding algorithm.

[0045] The first area of ​​the reference object is used as the dividend, the number of pixels within the area occupied by the reference object is used as the divisor, and the quotient of the first area of ​​the reference object and the number of pixels within the area occupied by the reference object is used as the unit pixel occupied area. In this embodiment, the number of pixels within the area occupied by the reference object is obtained, and based on the known first area of ​​the reference object, the area corresponding to each pixel in the floor plan of the cleaning robot's current environment is deduced through a mathematical relationship.

[0046] Based on the above embodiments, a preferred embodiment of the present invention provides a method for a cleaning robot to obtain the area of ​​a cleanable area. In this embodiment, the method of determining the reference object occupied area within the plan view of the environment in which the cleaning robot is currently located specifically includes: selecting a contour line that meets a preset second feature from all the contour lines in the plan view of the environment in which the cleaning robot is currently located as the reference object occupied area contour line, and determining the area surrounded by the reference object occupied area contour line as the reference object occupied area within the plan view of the environment in which the cleaning robot is currently located. It should be noted that the preset second feature is a feature used to filter out the reference object occupied area contour line, and the preset second feature can be adjusted according to various factors such as the actual reference object setting position, reference object shape and / or reference object size, so as to more accurately filter out the contour line of the reference object occupied area.

[0047] Based on the above embodiments, a preferred embodiment of the present invention provides a method for a cleaning robot to obtain the area of ​​a cleanable area. In this embodiment, a flooding algorithm is used to obtain the number of pixels in the area occupied by the reference object in the floor plan of the environment in which the cleaning robot is currently located, specifically including:

[0048] Obtaining the centroid of the reference object's occupied area; specifically, obtaining the centroid of the reference object's occupied area by weighting all points within the reference object's occupied area and taking the average value, with the average value serving as the centroid. It should be noted that this step obtains the centroid of the reference object's occupied area; in actual applications, the centroid of the reference object's occupied area outline may also be obtained.

[0049] The centroid of the reference object's occupied area is used as the trigger point for the reference object's occupied area. Specifically, using the centroid of the reference object's occupied area as the trigger point is equivalent to using the centroid of the reference object's occupied area as the starting point for flood coverage. Coverage is then expanded from the centroid of the reference object's occupied area to its surrounding pixels, starting from the trigger point. Coverage is performed point by point around the trigger point of the reference object's occupied area until all pixels in the reference object's occupied area are covered. The number of pixels in the clearable area is then recorded.

[0050] Based on the above embodiments, a preferred embodiment of the present invention provides a method for a cleaning robot to obtain the area of ​​a cleanable area. In this embodiment, the method for the cleaning robot to obtain the area of ​​a cleanable area specifically includes:

[0051] Setting a reference object of a first area in the current environment of the cleaning robot;

[0052] Get the floor plan of the cleaning robot's current environment;

[0053] Performing image preprocessing on the plane map of the environment in which the cleaning robot is currently located, so that the plane map of the environment in which the cleaning robot is currently located is segmented into a binary image by a threshold value;

[0054] The findContours function based on contour detection is used to identify all the contour lines in the plane map of the cleaning robot's current environment after image preprocessing;

[0055] A contour line that meets a preset first feature is selected from all contour lines in the plan view of the environment currently located by the cleaning robot after image preprocessing as the contour line of the cleanable area, and the non-obstacle area in the area surrounded by the contour line of the cleanable area is determined as the cleanable area in the plan view of the environment currently located by the cleaning robot. The centroid point of the cleanable area is obtained and it is determined whether the centroid point of the cleanable area is an obstacle point or a non-obstacle point; if the centroid point of the cleanable area is an obstacle point, a non-obstacle point is selected from the four or eight neighborhoods of the centroid point of the cleanable area as the trigger point of the cleanable area; if the centroid point of the cleanable area is a non-obstacle point, the centroid point of the cleanable area is selected as the trigger point of the cleanable area; with the trigger point of the cleanable area as the center, the pixel points around it are covered point by point until all the pixel points in the entire cleanable area are covered, and the number of pixel points in the cleanable area is recorded.

[0056] A contour line that meets a preset second feature is selected from all contour lines in the plan view of the environment currently located by the cleaning robot after image preprocessing as the contour line of the reference object occupied area, and the area surrounded by the contour line of the reference object occupied area is determined as the reference object occupied area in the plan view of the environment currently located by the cleaning robot. The centroid point of the reference object occupied area is obtained, and the centroid point of the reference object occupied area is used as the reference object occupied area trigger point. With the reference object occupied area trigger point as the center, the pixel points around it are covered point by point until all the pixel points in the entire reference object occupied area are covered, and the number of pixel points in the cleanable area is recorded; the first area of ​​the reference object is used as the dividend, the number of pixel points in the reference object occupied area is used as the divisor, and the quotient of the first area of ​​the reference object and the number of pixel points in the reference object occupied area is used as the unit pixel occupied area.

[0057] The product of the area occupied by the unit pixel and the number of pixels in the cleanable area is used as the area of ​​the cleanable area in the plane diagram of the environment currently located by the cleaning robot.

[0058] Preferably, the order of executing the steps of determining the cleanable area and obtaining the number of pixels in the cleanable area and the steps of determining the area occupied by the reference object and obtaining the number of pixels in the area occupied by the reference object so as to obtain the area occupied by the unit pixel can be swapped, that is, the step of determining the cleanable area and obtaining the number of pixels in the cleanable area can be executed first, and then the step of determining the area occupied by the reference object and obtaining the number of pixels in the area occupied by the reference object so as to obtain the area occupied by the unit pixel can be executed; or, the step of determining the area occupied by the reference object and obtaining the number of pixels in the area occupied by the reference object so as to obtain the area occupied by the unit pixel can be executed first, and then the step of determining the cleanable area and obtaining the number of pixels in the area occupied by the reference object so as to obtain the area occupied by the unit pixel can be executed; or, the step of determining the cleanable area and obtaining the number of pixels in the cleanable area and the step of determining the area occupied by the reference object and obtaining the number of pixels in the area occupied by the reference object so as to obtain the area occupied by the unit pixel can be executed at the same time.

[0059] Obviously, the above-mentioned embodiments are only some embodiments of the present invention, rather than all embodiments, and the technical solutions between the various embodiments can be combined with each other. In the above-mentioned embodiments of the present invention, the descriptions of the various embodiments have different focuses. For the parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. In the several embodiments provided by the present invention, it should be understood that the disclosed technical contents can be implemented in other ways. It should also be noted that the various specific technical features described in the above-mentioned specific embodiments can be combined in any suitable way unless there is any contradiction. In order to avoid unnecessary repetition, the various possible combinations will not be described separately in the embodiments of the present invention.

[0060] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents, and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for a cleaning robot to obtain the area of ​​a cleanable area, characterized in that: The method for the cleaning robot to obtain the area of ​​the cleanable area specifically includes: Get the floor plan of the cleaning robot's current environment; Determine the cleanable area within the floor plan of the environment in which the cleaning robot is currently located; Get the number of pixels in the cleanable area of ​​the current environment of the cleaning robot; Calculate the cleanable area of ​​the cleaning robot within the current environment plan based on the area occupied by each pixel; The step of obtaining the number of pixels in the cleanable area of ​​the plane map of the environment in which the cleaning robot is currently located specifically includes: Obtaining the centroid of the cleanable area; Determining whether the centroid of the cleanable area is an obstacle point or a non-obstacle point; If the centroid of the cleanable area is a non-obstacle point, the centroid of the cleanable area is selected as the trigger point of the cleanable area; If the centroid of the cleanable area is an obstacle point, a non-obstacle point is selected from the four or eight neighborhoods of the centroid of the cleanable area as a trigger point of the cleanable area; With the trigger point of the cleanable area as the center, the pixels around it are covered point by point until all the pixels in the entire cleanable area are covered, and the number of pixels in the cleanable area is recorded.

2. The method for obtaining the area of ​​a cleaning robot according to claim 1, characterized in that: The method for the cleaning robot to obtain the area of ​​the cleanable area also includes, before executing the method of determining the cleanable area in the plan view of the environment in which the cleaning robot is currently located: performing image preprocessing on the plan view of the environment in which the cleaning robot is currently located to obtain all contour lines in the plan view of the environment in which the cleaning robot is currently located.

3. The method for obtaining the area of ​​a cleanable area by a cleaning robot according to claim 2, characterized in that: The image preprocessing of the plan view of the environment in which the cleaning robot is currently located refers to performing a binarization process on the plan view of the environment in which the cleaning robot is currently located, so that the plan view of the environment in which the cleaning robot is currently located is processed into a binary image.

4. The method for obtaining the area of ​​a cleanable area by a cleaning robot according to claim 3, characterized in that: The method of obtaining all contour lines in the plan view of the environment in which the cleaning robot is currently located specifically includes: using the findContours function based on contour detection to identify contour pixel points in the plan view of the environment in which the cleaning robot is currently located, which is processed into a binary image, and composing all contour lines in the plan view of the environment in which the cleaning robot is currently located based on all identified contour pixel points.

5. The method for obtaining the area of ​​a cleanable area by a cleaning robot according to claim 2, characterized in that: The image preprocessing of the plan view of the environment in which the cleaning robot is currently located refers to dividing the plan view of the environment in which the cleaning robot is currently located into a non-obstacle area and an obstacle area, and covering the non-obstacle area and the obstacle area with different colors.

6. The method for obtaining the area of ​​a cleanable area by a cleaning robot according to claim 5, characterized in that: The obtaining of all contour lines in the plan view of the environment in which the cleaning robot is currently located specifically includes: identifying boundaries of regions of different colors, and using all boundaries between regions covered by different colors as all contour lines in the plan view of the environment in which the cleaning robot is currently located.

7. The method for obtaining the area of ​​a cleanable area by a cleaning robot according to claim 2, wherein: The method of determining the cleanable area within the plan view of the environment in which the cleaning robot is currently located specifically includes: selecting a contour line that meets a preset first feature from all contour lines in the plan view of the environment in which the cleaning robot is currently located as the contour line of the cleanable area, and determining the non-obstacle area in the area surrounded by the contour line of the cleanable area as the cleanable area within the plan view of the environment in which the cleaning robot is currently located.

8. The method for obtaining the area of ​​a cleanable area by a cleaning robot according to claim 7, characterized in that: The contour line meeting the preset first feature refers to a contour line having the longest line segment and connected end to end among all contour lines.

9. The method for obtaining the area of ​​a cleanable area by a cleaning robot according to claim 2, characterized in that: The method for obtaining the area occupied by the unit pixel specifically includes: Setting a reference object of a first area in the environment currently located by the cleaning robot; Determine the reference object occupied area within the floor plan of the environment in which the cleaning robot is currently located; Obtain the number of pixels in the reference object occupied area in the floor plan of the cleaning robot's current environment; The first area of ​​the reference object is used as the dividend, the number of pixels in the reference object occupied area is used as the divisor, and the quotient of the first area of ​​the reference object and the number of pixels in the reference object occupied area is used as the unit pixel occupied area.

10. The method for obtaining the area of ​​a cleanable area by a cleaning robot according to claim 9, characterized in that: The method of determining the reference object occupied area within the plan view of the environment in which the cleaning robot is currently located specifically includes: selecting a contour line that meets a preset second feature from all the contour lines in the plan view of the environment in which the cleaning robot is currently located as the reference object occupied area contour line, and determining the area surrounded by the reference object occupied area contour line as the reference object occupied area within the plan view of the environment in which the cleaning robot is currently located.

11. The method for obtaining the area of ​​a cleanable area by a cleaning robot according to claim 9, characterized in that: The obtaining of the number of pixels in the reference object occupied area in the plan view of the environment currently located by the cleaning robot specifically includes: Obtaining the centroid of the area occupied by the reference object; The centroid point of the reference object occupied area is used as the reference object occupied area trigger point; With the trigger point of the reference object occupied area as the center, the pixel points around it are covered point by point until all the pixel points in the entire reference object occupied area are covered, and the number of pixel points in the cleanable area is recorded.

12. The method for obtaining the area of ​​a cleanable area by a cleaning robot according to claim 1, characterized in that: The calculation of the cleanable area within the plan view of the environment in which the cleaning robot is currently located based on the area occupied by unit pixels specifically includes: taking the product of the area occupied by the unit pixels and the number of pixels in the cleanable area as the cleanable area within the plan view of the environment in which the cleaning robot is currently located.

Citation Information

Patent Citations

  • Graph area calculation method and terminal, and computer readable storage medium

    CN107230228A

  • Object detection method and device and storage medium

    CN109816675A

  • Sweeping path planning method and device of sweeper and readable storage medium

    CN112180931A