A method for a mobile robot to obtain the area of a target region
By obtaining and filtering the outlines of the environmental plan in the mobile robot, determining the target area and the reference object occupancy area, and calculating the target area using mathematical relationships, the problem of mobile robots quickly and with high accuracy is solved.
Patent Information
- Application Number
- CN202111167537.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-07
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2041-10-07
AI Technical Summary
The method of mobile robots to obtain the target area is inconvenient for rapid calculation and has low accuracy.
By obtaining all the contour lines in the current environmental plan, performing feature screening to determine the target area and the reference area occupied by the reference object, and using mathematical relationships to calculate the target area area.
It realizes the high-precision calculation of the target area without traversing the target area, which improves the calculation efficiency and accuracy.
Smart Images

Figure CN113901912B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and particularly to a method for a mobile robot to obtain the area of a target region. Background Art
[0002] With the progress of technology, mobile robots are widely used in various industries. A mobile robot refers to a self-mobile device that autonomously executes preset tasks within a set enclosed indoor space. Currently, the types of mobile robots include, but are not limited to, intelligent floor sweeping robots, intelligent floor sweeping and mopping integrated robots, window cleaning robots, intelligent pet entertaining robots, nanny robots, service-type mobile robots (such as reception robots in hotels, inns, and meeting places), industrial inspection intelligent self-mobile devices, and intelligent security robots, etc.
[0003] When a mobile robot executes some preset tasks, it needs to know in advance the area of the target region for executing the preset task, so as to plan the task more efficiently. Currently, the methods for a mobile robot to obtain the area of a target region generally require the mobile robot to traverse the target region or require the user to manually measure the area of the target region and then input it into the mobile robot. Therefore, the existing methods for a mobile robot to obtain the area of a target region have the problems of inconvenient and inaccurate calculation. Summary of the Invention
[0004] To solve the above problems, the present invention provides a method for calculating the area of a target region, which solves the problems of inconvenient calculation and low calculation accuracy of the area of the target region. The specific technical solution of the present invention is as follows:
[0005] A method for a mobile robot to obtain the area of a target region, the method for the mobile robot to obtain the area of the target region specifically includes: the mobile robot obtains the current environmental floor plan with a reference object set with a preset area; the mobile robot obtains all the contour lines in the current environmental floor plan; the mobile robot performs a first feature screening on all the contour lines in the current environmental floor plan to determine the target region contour line and calculate the number of pixel points in the target region; the mobile robot performs a second feature screening on all the contour lines in the current environmental floor plan to determine the reference object occupied region contour line and calculate the number of pixel points in the reference object occupied region; the mobile robot obtains the area of the target region according to the number of pixel points in the reference object occupied region, the preset area of the reference object, and the number of pixel points in the target region.
[0006] Compared with the prior art, in this technical solution, the mobile robot determines the target region and the reference object occupied region by obtaining all the contour lines in the current environmental floor plan and performing contour line feature screening, and calculates and converts according to the mathematical relationship between the reference object occupied region and the target region, so as to obtain the area of the target region, solving the problems of inconvenient calculation and low current calculation accuracy of the area of the target region.
[0007] Further, the specific process by which the mobile robot obtains all the contour lines in the current environmental floor plan includes: the mobile robot performs image preprocessing on the current environmental floor plan and identifies all the contour lines in the current environmental floor plan after the image preprocessing. In this technical solution, the mobile robot performs image preprocessing on the current environmental floor plan to preprocess the current environmental floor plan into a form that is more convenient for identifying the contour lines in the image, thereby improving the accuracy of identifying the contour lines in the current environmental floor plan.
[0008] Further, the specific process by which the mobile robot performs image preprocessing on the current environmental floor plan includes: the mobile robot covers each area of the current environmental floor plan with three different colors according to three area division criteria of a target area, a reference object occupied area, and the remaining area; where the remaining area refers to the area that is neither the target area nor the reference object occupied area. In this technical solution, the mobile robot divides the current environmental floor plan into a target area, a reference object occupied area, and the remaining area, and covers the three areas with three different colors to better distinguish different areas and facilitate the identification of the contour lines between different areas.
[0009] Further, the specific process by which the mobile robot identifies all the contour lines in the current environmental floor plan after the image preprocessing includes: the mobile robot detects the colors in the current environmental floor plan after the image preprocessing and identifies all the contour lines in the current environmental floor plan after the image preprocessing based on the boundaries between different colors. This technical solution determines the contour lines of different areas by identifying the boundaries between different colors.
[0010] Further, the specific process by which the mobile robot performs a first feature screening on all the contour lines to determine the contour lines of the target area includes: the mobile robot screens out from all the contour lines the contour lines that can enclose and close the target area among the contour lines formed by the boundary lines between the colors represented by the target area and the colors represented by the reference object occupied area and the remaining area as the contour lines of the target area. In this technical solution, the mobile robot determines a contour line as the contour line of the target area from all the contour lines by means of feature screening, improving the accuracy of the target area range.
[0011] Further, the mobile robot performs a second feature screening on all the contour lines to determine the contour line of the reference object occupancy area, which specifically includes: The mobile robot screens out from all the contour lines the contour lines formed by the intersection lines of the colors of the reference object occupancy area with the colors represented by the target area and the remaining areas respectively, and selects the contour line that can enclose and close the reference object occupancy area as the contour line of the reference object occupancy area. In this technical solution, the mobile robot determines a contour line as the contour line of the reference object occupancy area from all the contour lines in the way of feature screening, which improves the accuracy of the range of the reference object occupancy area.
[0012] Further, the mobile robot calculates the number of pixel points in the target area, which specifically includes: The mobile robot obtains the centroid point of the target area contour line; The mobile robot determines whether the centroid point of the target area contour line is within the target area; If so, the centroid point of the target area contour line is used as the target area trigger point; If not, a point within the target area is selected from the four-neighborhood or eight-neighborhood of the centroid point of the target area contour line as the target area trigger point; With the target area trigger point as the initial center, the pixel points around it are covered point by point until all the pixel points within the entire target area are covered, and the number of pixel points within the target area is recorded. In this technical solution, the mobile robot sets the target area trigger point based on the centroid point of the target area contour line, and improves the accuracy and efficiency of the pixel point calculation within the target area by traversing point by point.
[0013] Further, the mobile robot calculates the number of pixel points in the reference object occupancy area, which specifically includes: The mobile robot obtains the centroid point of the reference object occupancy area contour line; The mobile robot determines whether the centroid point of the reference object occupancy area contour line is within the reference object occupancy area; If so, the centroid point of the reference object occupancy area contour line is used as the reference object occupancy area trigger point; If not, a point within the reference object occupancy area is selected from the four-neighborhood or eight-neighborhood of the centroid point of the reference object occupancy area contour line as the reference object occupancy area trigger point; With the reference object occupancy area trigger point as the initial center, the pixel points around it are covered point by point until all the pixel points within the entire reference object occupancy area are covered, and the number of pixel points within the reference object occupancy area is recorded. In this technical solution, the mobile robot sets the reference object occupancy area trigger point based on the centroid point of the reference object occupancy area contour line, and improves the accuracy and efficiency of the pixel point calculation within the reference object occupancy area by traversing point by point.
[0014] Further, the mobile robot obtains the area of the target area according to the number of pixel points in the area occupied by the reference object, the preset area of the reference object, and the number of pixel points in the target area. Specifically, it includes: The mobile robot uses the number of pixel points in the area occupied by the reference object as the divisor, the preset area of the reference object as the dividend, and the quotient of the dividend and the divisor as the area occupied by a single pixel point; The mobile robot determines that the area of the target area is the product of the number of pixel points in the target area and the area occupied by a single pixel point based on the number of pixel points in the target area and the area occupied by a single pixel point. In this technical solution, the mobile robot performs conversion based on the mathematical relationship between pixel points and area between the target area and the area occupied by the reference object, thereby obtaining the area of the target area, and solving the problems that the area of the target area is not easy to calculate and the current calculation accuracy is not high. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 It is a schematic flowchart of the method for the mobile robot to obtain the area of the target area according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0016] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be described and explained below in conjunction with the drawings and embodiments. It should be understood that the specific embodiments described below are only used to explain the present invention and are not used to limit the present invention. In addition, it can also be understood that for those of ordinary skill in the art, making some design, manufacturing or production changes to the technical content disclosed in the present invention is only a conventional technical means and should not be understood that the content disclosed in this application is insufficient.
[0017] Unless otherwise defined, the technical terms or scientific terms involved in the present invention should be the general meanings understood by those with ordinary skills in the technical field to which this application belongs. The terms "including", "comprising", "having" and any variations thereof involved in this application are intended to cover non-exclusive inclusion. For example, a process, method, system product or device including a series of steps or modules is not limited to the listed steps or units, but may further include steps or modules not listed, or may further include other steps or units inherent to these processes, methods, products or devices. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar correspondences and do not represent a specific order for the objects.
[0018] In an embodiment of the present invention, a method for a mobile robot to obtain the area of a target area is provided, which can obtain the area of the target area with high precision without the mobile robot traversing the target area. As Figure 1 shown, the method for the mobile robot to obtain the area of the target area specifically includes:
[0019] Step 1: The mobile robot obtains the current environmental floor plan with a reference object having a preset area. It should be noted that the preset area of the reference object refers to the floor area of the reference object in the actual environment corresponding to the reference object in the current environmental floor plan, rather than the area of the reference object in the current environmental floor plan. The preset area of the reference object can be, but is not limited to, 0.5 square meters, 1 square meter, 10 square meters, 20 square meters, etc. The specific area size is set according to the size of the current environmental floor plan that the mobile robot can obtain and the size of the current environment of the mobile robot; the current environmental floor plan includes a target area and a reference object.
[0020] Step 2: The mobile robot obtains all the contour lines in the current environmental floor plan;
[0021] Step 3: The mobile robot performs a first feature screening on all the contour lines in the current environmental floor plan to determine the target area contour line and calculate the number of pixel points in the target area; among them, the first feature is specifically set according to the specific limiting conditions of the environment where the mobile robot is located and the target area, and can be, but is not limited to, screening out the longest contour line that is connected end to end among all the contour lines as the target area contour line, or screening out the shortest contour line among the contour lines that surround the target area and are connected end to end as the target area contour line.
[0022] Step 4: The mobile robot performs a second feature screening on all the contour lines in the current environmental floor plan to determine the contour line of the area occupied by the reference object and calculate the number of pixel points in the area occupied by the reference object; among them, the second feature is specifically limited according to the specific limiting conditions of the reference object, and can be, but is not limited to, if the set position of the reference object in the environment where the mobile robot is located is known, screening out the partial contour lines among all the contour lines that are near the set position of the reference object in the environment where the mobile robot is located, and screening out the shortest contour line among the contour lines that surround the reference object and are connected end to end as the contour line of the area occupied by the reference object.
[0023] Step 5: The mobile robot obtains the target area according to the preset area of the reference object, the number of pixel points in the area occupied by the reference object, and the number of pixel points in the target area. Specifically, in this embodiment, the method for the mobile robot to obtain the target area is to set a reference object with a preset area and obtain the number of pixel points in the area occupied by the reference object, so as to obtain the number of pixel points per unit area through mathematical calculation, and then determine the target area based on the number of pixel points in the target area and the number of pixel points per unit area.
[0024] Preferably, the order of execution of step 3 and step 4 is not limited, and can be, but is not limited to, executing step 3 first and then step 4, or executing step 4 first and then step 3, or executing step 3 and step 4 simultaneously.
[0025] Another embodiment of the present invention also provides a method for a mobile robot to obtain the area of a target area. Based on the method provided in the above embodiment, before performing the above step 2, the mobile robot also performs image preprocessing on the current environmental floor plan so that all contour lines of the current environmental floor plan can be more easily recognized. Specifically, the specific means for the mobile robot to perform image preprocessing on the current environmental floor plan may be, but is not limited to, the mobile robot performing binarization processing on the current environmental floor plan, or the mobile robot performing coverage processing with different colors according to regions, etc., which are processing means that are beneficial to recognizing all contour lines in the current environmental floor plan.
[0026] Specifically, the mobile robot performing coverage processing with different colors according to regions means that the mobile robot processes the current environmental floor plan into an image covered with three different colors according to the division criteria of the target area, the area occupied by the reference object, and the remaining area in the current environmental floor plan. For example, the target area is covered with white, the area occupied by the reference object is covered with yellow, and the remaining area is covered with red, that is, different colors that are easy to distinguish are used for coverage in the three areas. It should be noted that in this embodiment, although the target area is known, the mobile robot still performs image preprocessing on the current environmental floor plan and recognizes its contour lines to re-determine the specific target area range in the current environmental floor plan, improve the accuracy of the target area range, and thus improve the accuracy of the number of pixel points in the obtained target area and the area of the target area.
[0027] Based on the method for a mobile robot to obtain the area of a target area provided in the above embodiment, in an embodiment of the present invention, the mobile robot performs image preprocessing on the current environmental floor plan before step 2 in a manner of performing coverage processing with different colors according to regions. In this embodiment, the specific method for the mobile robot in step 2 to obtain all contour lines in the current environmental floor plan includes: the mobile robot detects the color partition in the current environmental floor plan after image preprocessing, and uses the boundary line between different colors as the contour line, so as to recognize all contour lines in the current environmental floor plan after image preprocessing.
[0028] Based on the method for a mobile robot to obtain the area of a target area provided in the above embodiment, as a preferred embodiment of the present invention, in this embodiment, the mobile robot performs a first feature screening on all contour lines to determine the contour line of the target area, which specifically includes: the mobile robot screens out from all contour lines the contour lines that can enclose and close the target area among the contour lines formed by the boundary lines between the colors represented by the target area and the colors represented by the area occupied by the reference object and the remaining area as the contour line of the target area.
[0029] Based on the method for a mobile robot to obtain the area of a target region provided in the above embodiments, as a preferred embodiment of the present invention, in this embodiment, the mobile robot performs a second feature screening on all contour lines to determine the contour line of the reference object occupied area, which specifically includes: The mobile robot screens out from all contour lines the contour lines formed by the intersection lines of the colors of the reference object occupied area with the color represented by the target region and the color represented by the remaining regions, and selects the contour line that can enclose and close the reference object occupied area as the contour line of the reference object occupied area.
[0030] Based on the method for a mobile robot to obtain the area of a target region provided in the above embodiments, as a preferred embodiment of the present invention, in this embodiment, the mobile robot calculates the number of pixel points in the target region, which specifically includes: The mobile robot obtains the centroid point of the target region contour line; The mobile robot determines whether the centroid point of the target region contour line is within the target region; If the centroid point of the target region contour line is within the target region, then the centroid point of the target region contour line is used as the target region trigger point; If the centroid point of the target region contour line is not within the target region, then a point within the target region is selected from the four-neighborhood or eight-neighborhood of the centroid point of the target region contour line as the target region trigger point; Using the target region trigger point as the initial center, it performs point-by-point coverage on the pixel points around it until all pixel points within the entire target region are covered, and records the number of pixel points within the target region.
[0031] Based on the method for a mobile robot to obtain the area of a target region provided in the above embodiments, as a preferred embodiment of the present invention, in this embodiment, the mobile robot calculates the number of pixel points within the reference object occupied area, which specifically includes:
[0032] The mobile robot obtains the centroid point of the reference object occupied area contour line; Among them, the method for the mobile robot to obtain the centroid point of the reference object occupied area contour line can be but is not limited to the mobile robot weighting all the contour pixels of the reference object occupied area contour line and taking its weighted average value as the centroid point.
[0033] The mobile robot determines whether the centroid point of the reference object occupied area contour line is within the reference object occupied area; Specifically, the method for the mobile robot to determine whether the centroid point of the reference object occupied area contour line is within the reference object occupied area mainly depends on the above-mentioned image preprocessing means of the current environment floor plan. If the image preprocessing means of the mobile robot for the current environment floor plan is threshold segmentation into a binary image, then it can be determined whether it is within the reference object occupied area according to the gray value of the centroid point of the reference object occupied area contour line; If the image preprocessing means of the mobile robot for the current environment floor plan is covering different regions with different colors, then it can be determined according to whether the color of the centroid point of the reference object occupied contour line is consistent with the color of the reference object occupied area.
[0034] If the centroid of the contour line of the reference object occupied area is within the reference object occupied area, then use the centroid of the contour line of the reference object occupied area as the trigger point of the reference object occupied area;
[0035] If the centroid of the contour line of the reference object occupied area is not within the reference object occupied area, then select a pixel point within the reference object occupied area from the four-neighborhood or eight-neighborhood of the centroid of the contour line of the reference object occupied area as the trigger point of the reference object occupied area; specifically, if the centroid of the contour line of the reference object occupied area is not within the reference object occupied area, then preferentially select a pixel point within the reference object occupied area from the four-neighborhood of the centroid of the contour line of the reference object occupied area as the trigger point of the reference object occupied area. If there is no pixel point within the reference object occupied area in the four-neighborhood of the centroid of the contour line of the reference object occupied area, then select a pixel point within the reference object occupied area from the eight-neighborhood of the centroid of the contour line of the reference object occupied area as the trigger point of the reference object occupied area. Similarly, if there is no pixel point within the reference object occupied area in the eight-neighborhood of the centroid of the contour line of the reference object occupied area, then expand outward with the centroid of the cleanable area as the center to select a pixel point that is closest to the centroid of the contour line of the reference object occupied area and within the reference object occupied area as the trigger point of the reference object occupied area.
[0036] Taking the trigger point of the reference object occupied area as the initial center, perform point-by-point coverage on the pixel points around it until all pixel points within the reference object occupied area are covered, and record the number of pixel points within the reference object occupied area; specifically, by taking the trigger point of the reference object occupied area as the center and performing point-by-point coverage on the pixel points around it, all pixel points within the reference object occupied area can be covered, and the number of covered pixel points within the reference object occupied area can be accurately recorded, so as to obtain the total number of pixel points within the reference object occupied area. It should be noted that in this embodiment, starting from a pixel point, expand and fill the surrounding pixel points until the area edge is reached to achieve accurate statistics of the number of pixel points within the reference object occupied area.
[0037] As a preferred embodiment of the present invention, the mobile robot obtains the target area according to the number of pixel points within the reference object occupied area, the preset area of the reference object, and the number of pixel points within the target area, specifically including: the mobile robot takes the number of pixel points within the reference object occupied area as the divisor, takes the preset area of the reference object as the dividend, and takes the quotient of the dividend and the divisor as the area occupied by a unit pixel point; the mobile robot determines that the target area is the product of the number of pixel points within the target area and the area occupied by a unit pixel point based on the number of pixel points within the target area and the area occupied by a unit pixel point.
[0038] Obviously, the above embodiments are only a part of the 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 embodiments of the present invention, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments. In the several embodiments provided by the present invention, it should be understood that the disclosed technical content can be implemented in other ways. In addition, it should be noted that, in the above specific embodiments, the various specific technical features described can be combined in any suitable manner without conflict. To avoid unnecessary repetition, the embodiments of the present invention will not separately describe various possible combination methods.
[0039] 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 them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features, 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 various embodiments of the present invention.
Claims
1. A method for a mobile robot to obtain the area of a target region, characterized in that The method for the mobile robot to obtain the area of the target region specifically includes: The mobile robot obtains the current environmental floor plan of a reference object with a preset area; The mobile robot obtains all the contour lines in the current environmental floor plan; The mobile robot performs a first feature screening on all the contour lines in the current environmental floor plan to determine the contour lines of the target region and calculate the number of pixel points within the target region; The mobile robot performs a second feature screening on all the contour lines in the current environmental floor plan to determine the contour lines of the reference object occupied region and calculate the number of pixel points within the reference object occupied region; The mobile robot obtains the area of the target region based on the number of pixel points within the reference object occupied region, the preset area of the reference object, and the number of pixel points within the target region; Among them, the mobile robot calculates the number of pixel points within the target region, which specifically includes: The mobile robot obtains the centroid point of the contour lines of the target region. The mobile robot determines whether the centroid point of the contour lines of the target region is within the target region. If so, the centroid point of the contour lines of the target region is used as the target region trigger point. If not, a point within the target region is selected from the four-neighborhood or eight-neighborhood of the centroid point of the contour lines of the target region as the target region trigger point. Starting from the target region trigger point as the initial center, it performs point-by-point coverage on the pixel points around it until all the pixel points within the entire target region are covered, and records the number of pixel points within the target region; Among them, the mobile robot calculates the number of pixel points within the reference object occupied region, which specifically includes: The mobile robot obtains the centroid point of the contour lines of the reference object occupied region. The mobile robot determines whether the centroid point of the contour lines of the reference object occupied region is within the reference object occupied region. If so, the centroid point of the contour lines of the reference object occupied region is used as the reference object occupied region trigger point. If not, a point within the reference object occupied region is selected from the four-neighborhood or eight-neighborhood of the centroid point of the contour lines of the reference object occupied region as the reference object occupied region trigger point. Starting from the reference object occupied region trigger point as the initial center, it performs point-by-point coverage on the pixel points around it until all the pixel points within the entire reference object occupied region are covered, and records the number of pixel points within the reference object occupied region.
2. The method for a mobile robot to obtain the area of a target region according to claim 1, wherein, The mobile robot obtains all the contour lines in the current environmental floor plan specifically includes: The mobile robot performs image preprocessing on the current environmental floor plan and identifies all the contour lines in the current environmental floor plan after the image preprocessing.
3. The method for a mobile robot to obtain the area of a target region according to claim 2, wherein, The mobile robot performs image preprocessing on the current environmental floor plan, which specifically includes: The mobile robot covers each region of the current environmental floor plan with three different colors according to the three region division criteria of the target region, the reference object occupied region, and the remaining region; where the remaining region refers to the region that is neither the target region nor the reference object occupied region.
4. The method for a mobile robot to obtain the area of a target region according to claim 3, wherein, The mobile robot identifies all the contour lines in the current environmental floor plan after the image preprocessing, which specifically includes: The mobile robot detects the colors in the current environmental floor plan after the image preprocessing and identifies all the contour lines in the current environmental floor plan after the image preprocessing based on the boundaries between different colors.
5. The method for a mobile robot to obtain the area of a target region according to claim 4, wherein, The mobile robot performs a first feature screening on all contour lines to determine the contour line of the target area, which specifically includes: The mobile robot screens out from all contour lines the contour line that can enclose and close the target area from the contour lines formed by the intersection lines of the colors represented by the target area with the colors represented by the occupied area of the reference object and the colors represented by the remaining areas as the contour line of the target area.
6. The method for a mobile robot to obtain the area of a target region according to claim 4, wherein The mobile robot performs a second feature screening on all contour lines to determine the contour line of the occupied area of the reference object, which specifically includes: The mobile robot screens out from all contour lines the contour line that can enclose and close the occupied area of the reference object from the contour lines formed by the intersection lines of the colors represented by the occupied area of the reference object with the colors represented by the target area and the colors represented by the remaining areas as the contour line of the occupied area of the reference object.
7. The method for a mobile robot to obtain the area of a target region according to claim 1, wherein The mobile robot obtains the area of the target area according to the number of pixel points in the occupied area of the reference object, the preset area of the reference object, and the number of pixel points in the target area, which specifically includes: The mobile robot uses the number of pixel points in the occupied area of the reference object as the divisor, the preset area of the reference object as the dividend, and the quotient of the dividend and the divisor as the area occupied by a single pixel point; The mobile robot determines that the area of the target area is the product of the number of pixel points in the target area and the area occupied by a single pixel point based on the number of pixel points in the target area and the area occupied by a single pixel point.
Citation Information
Patent Citations
Calculation method and calculation system for actual contact area of animal adhesive contact region
CN107424157A
Method for determining boundary line in grid map and method for dividing grid map
CN111399507A