Map drawing method and device, medium and electronic apparatus
Provided are a map drawing method, a map drawing device, a computer-readable storage medium and an electronic apparatus. The map drawing method comprises scanning a boundary of a surface medium region to generate an initialized region; merging boundary coordinates of the initialized region to obtain a merged region; dividing the merged region into a plurality of sub-regions according to a preset shape; and drawing the boundary of the surface medium region based on the sub-regions and the merged region to obtain a map of the surface medium region. The method can improve the detailedness of the drawn map of the surface medium region.
1 . A map drawing method performed by a robotic cleaning device, comprising:
scanning a boundary of a surface medium region to generate an initialized region;
merging boundary coordinates of the initialized region to obtain a merged region;
forming a plurality of sub-regions from the merged region according to a preset shape;
generating the boundary of the surface medium region from the sub-regions and the merged region to obtain a map of the surface medium region; and
controlling movement of the robotic cleaning device based on the generated map,
wherein the initialized region comprises a plurality of initial boundary coordinates, and the merged region comprises a plurality of merged boundary coordinates; and
wherein generating the boundary of the surface medium region from the sub-regions and the merged region comprises: deleting the merged boundary coordinates located outside the sub-regions and close to the sub-regions, and connecting the remaining merged boundary coordinates in sequence to generate the boundary of the surface medium region.
2 . The map drawing method according to claim 1 , wherein after the boundary of the surface medium region is generated, the method further comprises: filling a surface medium mark within the boundary of the surface medium region to obtain the map of the surface medium region.
3 . The map drawing method according to claim 1 , wherein merging the boundary coordinates of the initialized region to obtain the merged region comprises: merging adjacent boundary coordinates in the initialized region to obtain the merged region.
4 . The map drawing method according to claim 1 , wherein the method further comprises: after the map of the surface medium region is obtained, storing the map of the surface medium region in an automatic cleaning apparatus and sending the map of the surface medium region to a user terminal through the automatic cleaning apparatus.
5 . The map drawing method according to claim 1 , wherein the preset shape is one of a square shape, a circular shape, and a rhombic shape.
6 . A non-transitory computer-readable storage medium having stored thereon a computer program, wherein the computer program, when executed by at least one hardware processor, implements a map drawing method performed by a robotic cleaning device, comprising:
scanning a boundary of a surface medium region to generate an initialized region;
merging boundary coordinates of the initialized region to obtain a merged region;
forming a plurality of sub-regions from the merged region according to a preset shape, and generating the boundary of the surface medium region from the sub-regions and the merged region to obtain a map of the surface medium region; and
controlling movement of the robotic cleaning device based on the generated map,
wherein the initialized region comprises a plurality of initial boundary coordinates, and the merged region comprises a plurality of merged boundary coordinates; and
wherein generating the boundary of the surface medium region from the sub-regions and the merged region comprises: deleting the merged boundary coordinates located outside the sub-regions and close to the sub-regions, and connecting the remaining merged boundary coordinates in sequence to generate the boundary of the surface medium region.
7 . The non-transitory computer-readable storage medium according to claim 6 , wherein merging the boundary coordinates of the initialized region to obtain the merged region comprises: merging adjacent boundary coordinates in the initialized region to obtain the merged region.
8 . The non-transitory computer-readable storage medium according to claim 6 , wherein the method further comprises: after the map of the surface medium region is obtained, storing the map of the surface medium region in an automatic cleaning apparatus and sending the map of the surface medium region to a user terminal through the automatic cleaning apparatus.
9 . The non-transitory computer-readable storage medium according to claim 6 , wherein the preset shape is one of a square shape, a circular shape, and a rhombic shape.
10 . An electronic apparatus, wherein the electronic apparatus is a robotic cleaning device or comprised in the robotic cleaning device, the electronic apparatus comprising:
at least one hardware processor; and
a memory having processor-executable instructions stored thereon that, when executed, direct the at least one hardware processor to perform a map drawing method, comprising:
scanning a boundary of a surface medium region to generate an initialized region;
merging boundary coordinates of the initialized region to obtain a merged region;
forming a plurality of sub-regions from the merged region according to a preset shape, and generating the boundary of the surface medium region from the sub-regions and the merged region to obtain a map of the surface medium region; and
controlling movement of the robotic cleaning device based on the generated map,
wherein the initialized region comprises a plurality of initial boundary coordinates, and the merged region comprises a plurality of merged boundary coordinates; and
wherein generating the boundary of the surface medium region from the sub-regions and the merged region comprises:
deleting the merged boundary coordinates located outside the sub-regions and close to the sub-regions, and connecting the remaining merged boundary coordinates in sequence to generate the boundary of the surface medium region.
11 . The electronic apparatus according to claim 10 , wherein after the boundary of the surface medium region is generated, the map drawing method further comprises: filling a surface medium mark within the boundary of the surface medium region to obtain the map of the surface medium region.
12 . The electronic apparatus according to claim 10 , wherein merging the boundary coordinates of the initialized region to obtain the merged region comprises: merging adjacent boundary coordinates in the initialized region to obtain the merged region.
13 . The electronic apparatus according to claim 10 , wherein the map drawing method further comprises: after the map of the surface medium region is obtained, storing the map of the surface medium region in an automatic cleaning apparatus and sending the map of the surface medium region to a user terminal through the automatic cleaning apparatus.
14 . The electronic apparatus according to claim 10 , wherein the preset shape is one of a square shape, a circular shape, and a rhombic shape.