Map construction method and electronic device
By drawing and classifying key points in the virtual map, using the Tyson polygon algorithm and classification model to divide the blank areas, the problem of not being able to clearly indicate that the mobile robot can clean the living room area in the existing technology is solved, and the accuracy of cleaning and users are improved. Experience.
Patent Information
- Application Number
- CN202010709890.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-22
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2040-07-22
AI Technical Summary
The prior art cannot clearly and accurately instruct the mobile robot to clean the entire area in the living room area, because the blank areas of each room are not divided.
By drawing multiple key points representing the structural characteristics of the virtual map in the blank area of the virtual map, these key points are classified and divided using the Tyson polygon algorithm and classification model to form a closed space, thereby realizing the clean area of living rooms and other areas Dividing.
It improves the accuracy of mobile robot cleaning, enables users to clean each enclosed space individually, and enhances the identification and processing capabilities of cleaning areas.
Smart Images

Figure CN113971710B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent devices, and in particular to a map construction method and electronic equipment. Background Art
[0002] With the rapid development of intelligent mobile robots, accurate room division is of great significance for the positioning and path planning of mobile robots. Mobile robots mainly use inertial navigation, laser radar or camera for map planning to obtain a map of the indoor structure, such as Figure 1 As shown, when the user uses the robot to sweep the floor, the user will see the cleaning area division in real time on the mobile device, and the cleaning area can be arbitrarily divided into multiple areas based on the coordinate information of the cleaning area.
[0003] However, for areas where users often move around, such as the living room, users may want the mobile robot to clean only the living room area. In existing maps, since the blank areas of each room are not segmented, it is impossible to clearly and accurately instruct the mobile robot to clean the entire living room. Summary of the invention
[0004] The present invention provides a map construction method and electronic equipment, which solves the problem in the prior art that a mobile robot cannot be clearly and accurately instructed to clean the entire living room.
[0005] In a first aspect, an embodiment of the present invention provides a map construction method, comprising:
[0006] Drawing a plurality of key points representing structural features of the virtual map in a blank area of the virtual map; the virtual map is drawn according to the indoor structure;
[0007] Classifying the multiple key points to obtain types of the multiple key points;
[0008] According to the types of the multiple key points, the blank area in the virtual map is divided to obtain a divided virtual map.
[0009] The above method can make multiple key points according to the structural characteristics of the blank area in the virtual map, classify the key points, and thus divide the blank area in the virtual map to obtain closed spaces. In this way, each closed space can be processed separately, thereby improving the accuracy of cleaning.
[0010] In a possible implementation, multiple key points representing structural features of the virtual map are drawn in a blank area of the virtual map, including:
[0011] Using the Thiessen polygon algorithm, draw Thiessen polygons in the blank area of the virtual map;
[0012] The points constituting the Thiessen polygons are used as key points characterizing the structural features of the virtual map.
[0013] In the above method, since Thiessen polygons can vividly describe the structural characteristics of graphics, the present invention obtains key points that characterize the structural characteristics of the virtual map through the Thiessen polygon algorithm, so that when classifying, the key points can be fully utilized to understand the structural characteristics of the graphics, obtain the key point types, and improve the accuracy of distinguishing types.
[0014] In a possible implementation manner, classifying the multiple key points to obtain types of the multiple key points includes:
[0015] The virtual map on which the multiple key points are drawn is input into a classification model to determine the types of the multiple key points.
[0016] The above method can classify the key points according to the structural features of the virtual map represented by the key points through the classification model, obtain the types of the key points, and improve the accuracy of classification.
[0017] In a possible implementation, the classification model is obtained by:
[0018] The sample image is used as input, the type of each point constituting the Thiessen polygon in the sample image is used as output, and the basic neural network is trained multiple times to obtain the classification model.
[0019] The above method trains the basic neural network multiple times through multiple samples, thereby improving the accuracy of network classification.
[0020] In a possible implementation, the types of key points include doors, and the blank areas in the virtual map are divided according to the types of the multiple key points to obtain the divided virtual map, including:
[0021] The key points of the door type are combined and extended to the nearest virtual wall in the virtual map to obtain a dividing line, and the blank area in the virtual map is divided by the dividing line to obtain a divided virtual map.
[0022] The above method can combine key points of door type to obtain its segmentation line, thereby dividing the blank area of the virtual map into each room, so that the user can perform specific cleaning according to the room and improve the cleaning accuracy.
[0023] In a possible implementation, after obtaining the divided virtual map, the method further includes:
[0024] Each closed space in the divided virtual map is filled with color.
[0025] The above method fills each closed space with color, so that the user can quickly distinguish each closed space.
[0026] In a second aspect, an embodiment of the present invention provides an electronic device, including: a processor and a memory;
[0027] The memory is used to store program codes used when the electronic device is running;
[0028] The processor is used to execute the program code to implement the following process:
[0029] Drawing a plurality of key points representing structural features of the virtual map in a blank area of the virtual map; the virtual map is drawn according to the indoor structure;
[0030] Classifying the multiple key points to obtain types of the multiple key points;
[0031] According to the types of the multiple key points, the blank area in the virtual map is divided to obtain a divided virtual map.
[0032] In a possible implementation, the processor is specifically configured to: draw Thiessen polygons in a blank area of a virtual map using a Thiessen polygon algorithm; and use points constituting the Thiessen polygons as key points characterizing structural features of the virtual map.
[0033] In a possible implementation, the processor is specifically configured to: input the virtual map on which the multiple key points are drawn into a classification model to determine the types of the multiple key points.
[0034] In a possible implementation, the processor is specifically used to: take the sample image as input, take the type of each point constituting the Thiessen polygon in the sample image as output, train the basic neural network multiple times, and obtain the classification model.
[0035] In a possible implementation, the processor is specifically used to: when the types of key points include doors, combine the key points of the door type and extend them to the nearest virtual wall in the virtual map to obtain a dividing line, and use the dividing line to divide the blank area in the virtual map to obtain a divided virtual map.
[0036] In a possible implementation, the processor is further configured to fill each closed space in the divided virtual map with color.
[0037] In a third aspect, the present application further provides a computer storage medium on which a computer program is stored, and when the program is executed by a processing unit, the steps of the map construction method described in the first aspect are implemented.
[0038] In addition, the technical effects brought about by any implementation method in the second to third aspects can refer to the technical effects brought about by different implementation methods in the first aspect, and will not be repeated here.
[0039] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present invention, and together with the description are used to explain the principles of the present invention, and do not constitute improper limitations of the present invention.
[0041] Figure 1 is a schematic diagram of a virtual map established by a mobile robot provided by an embodiment of the present invention;
[0042] Figure 2 is a flow chart of a map construction method provided by an embodiment of the present invention;
[0043] Figure 3 It is a structural diagram of a virtual map including Thiessen polygons provided by an embodiment of the present invention;
[0044] Figure 4 It is a structural diagram of a virtual map after extracting points constituting Thiessen polygons provided by an embodiment of the present invention;
[0045] Figure 5 It is a schematic diagram of dividing a blank area in a virtual map provided by an embodiment of the present invention;
[0046] Figure 6 is a schematic diagram of a classification model training process provided by an embodiment of the present invention;
[0047] Figure 7 is a schematic diagram of dividing blank areas into key points of a door according to an embodiment of the present invention;
[0048] Figure 8 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention;
[0049] Fig. 9 The present invention is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to enable ordinary persons in the art to better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings.
[0051] The following are explanations of some of the terms that appear in the text:
[0052] 1. In the embodiments of the present invention, the term "electronic device" refers to any intelligent electronic device that can run according to a program and automatically and quickly process large amounts of data, including mobile phones, mobile robots, computers, tablets, smart terminals, multimedia devices, streaming media devices, etc.
[0053] The application scenarios described in the embodiments of the present invention are intended to more clearly illustrate the technical solutions of the embodiments of the present invention, and do not constitute a limitation on the technical solutions provided by the embodiments of the present invention. A person of ordinary skill in the art can appreciate that, with the emergence of new application scenarios, the technical solutions provided by the embodiments of the present invention are also applicable to similar technical problems.
[0054] Since the blank areas of each room in the room are not segmented when the existing mobile robot constructs the virtual map, the user cannot clearly and accurately instruct the mobile robot to clean the entire living room when cleaning a fixed room.
[0055] Based on this, an embodiment of the present invention provides a map construction method and an electronic device, which can classify the key points in each room, divide the blank areas in the virtual map without closed spaces, and obtain closed spaces, thereby improving the cleaning accuracy.
[0056] The specific situation is described in detail with reference to the following figures:
[0057] Combination Figure 2 As shown, an embodiment of the present invention provides a map construction method, including:
[0058] S200: Draw a plurality of key points representing structural features of the virtual map in a blank area of the virtual map.
[0059] Among them, the virtual map is drawn according to the indoor structure.
[0060] Taking mobile devices as an example, the lidar sensor on the mobile device can be used to explore the indoor structure, thereby obtaining the floor plan of the entire room, such as Figure 1 shown. Figure 1 The horizontal lines in the white area are virtual walls.
[0061] Combination Figure 3As shown, multiple key points representing the structural features of the virtual map are drawn in the blank area of the virtual map. As can be seen from the figure, each key point is at a different position in the blank area of the virtual map, and multiple key points describe the structural features of the virtual map.
[0062] S201: Classify multiple key points to obtain types of the multiple key points.
[0063] S202: Divide the blank area in the virtual map according to the types of the multiple key points to obtain a divided virtual map.
[0064] In the above manner, the blank areas of the virtual map can be divided into closed spaces according to type, thereby obtaining closed spaces, so that each closed space can be processed separately, thereby improving the accuracy of cleaning.
[0065] For drawing key points, the embodiment of the present invention uses the Thiessen polygon algorithm to draw Thiessen polygons in the blank area of the virtual map; the points constituting the Thiessen polygons are used as key points to characterize the structural features of the virtual map.
[0066] In order to improve the processing speed, before classification, the key points constituting the Thiessen polygons are extracted at preset intervals to re-form a virtual map containing the Thiessen polygons.
[0067] Among them, the points that make up the Thiessen polygon, combined Figure 3 As shown, it is a series of densely packed points. Taking a point at a preset interval of 10 as an example, a virtual map containing Thiessen polygons is formed, as shown in Figure 4 And classify multiple key points, and divide the virtual map according to the classified key points, as shown in Figure 5 shown.
[0068] It should be noted that the method of taking a key point from the preset interval can be a random method, or the first or second one in the fixed extraction interval, etc., and the present invention does not make specific restrictions on this. At the same time, the specific situation of determining the preset interval and the method of taking a key point from the preset interval can be determined according to actual conditions, and after being determined, the user can modify it at any time according to actual conditions.
[0069] In an embodiment of the present invention, a method for classifying multiple key points to obtain types of the multiple key points includes inputting a virtual map with multiple key points drawn into a classification model to determine the types of the multiple key points.
[0070] Among them, the types of multiple key points are the types of spaces where the key points are located. For example, if the key point is in a room, the classified type is room; if the key point is at a door, the classified type is door; if the key point is in a corridor, the classified type is corridor.
[0071] It should be noted that, in addition to the doors, corridors and rooms listed above, the key points may also be other types, and the above examples are not intended to limit the present invention.
[0072] A virtual map with multiple key points drawn on it is input into a classification model, which can identify the structural characteristics of the space where the key points are located, thereby obtaining the space type where the key points are located and classifying them.
[0073] When training the classification model, the sample image is used as input, and the type of each point that makes up the Thiessen polygon in the sample image is used as output. The basic neural network is trained multiple times to obtain the classification model.
[0074] Specifically: 1) Get sample images. Get a virtual map, and then use the Thiessen polygon algorithm to get a virtual map with key points drawn. Due to the limitations of the actual virtual map obtained, the sample images can be expanded by means of rotation, scaling, etc., and the sample images are divided into a training set and a validation set according to a preset ratio.
[0075] 2) Model training
[0076] The “one-to-one voting method” is used to perform multi-classification of the twin support vector machine. Assuming that for the m-class classification problem, the “one-to-one” classification method needs to build a two-class TWSVM sub-classifier between any two classes of samples, and m (m-1) hyperplanes need to be constructed to distinguish M types.
[0077] Combination Figure 6 As shown, the test sample is input into the classifier of the twin support vector machine, and each key point is judged separately using each binary classification. Assume that the classification function of any classifier is f ij , when f ij When f < 0, x is judged to belong to the i-th category, and the i-th category can get one vote; when f ij>0, then x is determined to belong to the jth class, and class j gets one vote. Then use each classifier to classify the input test sample. The type can be type 1, type 2, type i, type j, up to type k-1, type k. The votes of all m (m-1) sub-classifiers are accumulated, and the type with the most votes is the type of the test sample. Check whether the actual type of each key point in the input test sample is the same as the type obtained by the twin support vector machine classifier. If they are the same, do not adjust the twin support vector machine classifier. If they are not the same, adjust the twin support vector machine classifier until its actual type is the same as the type obtained by the twin support vector machine classifier, and obtain the classification model.
[0078] 3) Model Validation
[0079] The classification model obtained above is verified using a verification image. If the verification probability is greater than the preset value, it means that the classification model training is complete. If the verification probability is less than the preset value, it means that the classification model accuracy is relatively low and further training is required.
[0080] Among them, for the classification model, in addition to the twin support vector machine mentioned above, a related vector machine can also be used. In this regard, the present invention does not make any specific restrictions, and only needs to complete the classification.
[0081] Among the types of key points mentioned above, in order to obtain a closed space based on a room, the key points of the door type are combined and extended to the nearest virtual wall in the virtual map to obtain a dividing line, and the blank area in the virtual map is divided by the dividing line to obtain a divided virtual map.
[0082] Combination Figure 7 As shown, Figure 4 Take the upper left room in the video as an example. The circle is the key point at the door, and the identified type is the door. It can be seen that the key point is a dot, which is extended to both sides and delayed to the virtual wall to obtain its dividing line. In this way, the room is divided from other spaces with the door as the boundary. By analogy, the door can be used as the boundary to divide other spaces, thus obtaining the figure on the right, which divides all 5 independent spaces.
[0083] By adopting the above method, a closed space with the door as the boundary is obtained, so that when the mobile robot is cleaning, a single room is taken as the cleaning target for cleaning.
[0084] In order to help users clearly see the closed space visually, each closed space in the divided virtual map may be filled with color.
[0085] Among them, the wavefront algorithm can be used to fill the room topography with colors.
[0086] An embodiment of the present invention provides an electronic device, Figure 8 As shown, it includes: a processor 810 and a memory 820;
[0087] The memory 820 is used to store program codes used when the electronic device is running;
[0088] The processor 810 is used to execute the program code to implement the following process:
[0089] Drawing a plurality of key points representing structural features of the virtual map in a blank area of the virtual map; the virtual map is drawn according to the indoor structure;
[0090] Classifying the multiple key points to obtain types of the multiple key points;
[0091] According to the types of the multiple key points, the blank area in the virtual map is divided to obtain a divided virtual map.
[0092] For example, the electronic device may be a mobile phone, which has a control APP (Application) corresponding to the sweeping robot. Fig. 9 As shown, after the sweeping robot 900 draws the virtual map through its own laser sensor, it sends it to the mobile phone 910. The mobile phone 910 can draw multiple key points that characterize the structural features of the virtual map in the blank area of the virtual map, classify the multiple key points, obtain the types of the multiple key points, and divide the blank area in the virtual map according to the types of the multiple key points to obtain the divided virtual map. The virtual map is displayed on the display screen of the mobile phone, and the cleaning instruction triggered by the user for the closed space in the virtual map can be responded to, and the cleaning instruction is sent to the sweeping robot, and the sweeping robot can clean the closed space according to the instruction.
[0093] Exemplarily, the electronic device is a sweeping robot, which can draw a virtual map through its own laser sensor, draw multiple key points that characterize the structural features of the virtual map in the blank area of the virtual map, classify the multiple key points, obtain the types of the multiple key points, and divide the blank area in the virtual map according to the types of the multiple key points to obtain a divided virtual map. The divided virtual map is sent to a mobile phone, which displays the divided virtual map. At the same time, the mobile phone can respond to the cleaning command triggered by the user for the enclosed space in the virtual map, and send the cleaning command to the sweeping robot, which can clean the enclosed space according to the command.
[0094] Optionally, the processor 810 is specifically used to: draw Thiessen polygons in a blank area in the virtual map using a Thiessen polygon algorithm; and use the points constituting the Thiessen polygons as key points characterizing the structural features of the virtual map.
[0095] Optionally, the processor 810 is specifically configured to: input the virtual map on which the multiple key points are drawn into a classification model to determine the types of the multiple key points.
[0096] Optionally, the processor 810 is specifically used to: take the sample image as input, take the type of each point constituting the Thiessen polygon in the sample image as output, train the basic neural network multiple times, and obtain the classification model.
[0097] Optionally, the processor 810 is specifically used to: when the types of key points include doors, combine the key points of the door type and extend them to the nearest virtual wall in the virtual map to obtain a dividing line, and use the dividing line to divide the blank area in the virtual map to obtain a divided virtual map.
[0098] Optionally, the processor 810 is further configured to fill each closed space in the divided virtual map with color.
[0099] In an exemplary embodiment, a storage medium including instructions is also provided, such as a memory including instructions, and the instructions can be executed by the processor 810 of the electronic device to complete the above-mentioned map construction method. Optionally, the storage medium can be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0100] An embodiment of the present invention further provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes any one of the map construction methods described above in the embodiment of the present invention.
[0101] Those skilled in the art will readily appreciate other embodiments of the invention after considering the specification and practicing the invention invented herein. The invention is intended to cover any variations, uses or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not invented by the present invention. The description and examples are to be regarded as exemplary only, and the true scope and spirit of the invention are indicated by the following claims.
[0102] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A map construction method, characterized in that: include: Draw a plurality of key points representing structural features of the virtual map in a blank area of the virtual map; The virtual map is drawn according to the indoor structure; Classifying the multiple key points to obtain types of the multiple key points; wherein the type of the key point is the type of space where the key point is located; Dividing the blank area in the virtual map according to the types of the multiple key points to obtain a divided virtual map; Draw multiple key points representing the structural features of the virtual map in the blank area of the virtual map, including: Using the Thiessen polygon algorithm, draw Thiessen polygons in the blank area of the virtual map; The points constituting the Thiessen polygons are used as key points characterizing the structural features of the virtual map.
2. The map construction method according to claim 1, characterized in that: Classifying the multiple key points to obtain types of the multiple key points includes: The virtual map on which the multiple key points are drawn is input into a classification model to determine the types of the multiple key points.
3. The map construction method according to claim 2, characterized in that: The classification model is obtained by: The sample image is used as input, the type of each point constituting the Thiessen polygon in the sample image is used as output, and the basic neural network is trained multiple times to obtain the classification model.
4. The map construction method according to claim 1, characterized in that: The types of key points include doors. According to the types of the multiple key points, the blank areas in the virtual map are divided to obtain a divided virtual map, including: The key points of the door type are combined and extended to the nearest virtual wall in the virtual map to obtain a dividing line, and the blank area in the virtual map is divided by the dividing line to obtain a divided virtual map.
5. The map construction method according to any one of claims 1 to 4, characterized in that: After obtaining the divided virtual map, the method further includes: Each closed space in the divided virtual map is filled with color.
6. An electronic device, characterized in that: include: Processor and memory; The memory is used to store program codes used when the electronic device is running; The processor is used to execute the program code to implement the following process: Draw a plurality of key points representing structural features of the virtual map in a blank area of the virtual map; The virtual map is drawn according to the indoor structure; Classifying the multiple key points to obtain types of the multiple key points; According to the types of the multiple key points, the blank area in the virtual map is divided to obtain a divided virtual map; wherein the type of the key point is the type of space where the key point is located; The processor is specifically used to: draw Thiessen polygons in a blank area in a virtual map using a Thiessen polygon algorithm; and use the points constituting the Thiessen polygons as key points characterizing the structural features of the virtual map.
7. The electronic device according to claim 6, characterized in that: The processor is specifically used to: input the virtual map with the multiple key points drawn on it into the classification model to determine the types of the multiple key points.
8. The electronic device according to claim 7, characterized in that: The processor is specifically used to: take the sample image as input, take the type of each point constituting the Thiessen polygon in the sample image as output, train the basic neural network multiple times, and obtain the classification model.
9. The electronic device according to claim 6, characterized in that: The processor is specifically used for: when the types of key points include doors, combining the key points of the door type and extending them to the nearest virtual wall in the virtual map to obtain a dividing line, and using the dividing line to divide the blank area in the virtual map to obtain a divided virtual map.
10. The electronic device according to any one of claims 6 to 9, characterized in that: The processor is further used to fill each closed space in the divided virtual map with color.
