Map room contour optimization method

By splitting the outline of the map room into doors and walls and optimizing them separately, the problem of straightening distortion of the inclined doors in the existing technology is solved, and the concise, beauty and authenticity of the map outline are improved.

CN119831903APending Publication Date: 2025-04-15HONGYANG HOME APPLIANCES
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311313163.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-10
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

The prior art is difficult to effectively optimize the outline of the map room, especially when the tilted door edge is directly straightened, it will cause distortion and position offset, affecting the authenticity of the map and user experience.

Method used

By splitting the initial room profile into the initial door profile and the initial wall profile, and straightening optimization is performed separately, the corrected door profile and the corrected wall profile are obtained, and the optimized room profile is finally formed through polygon approximation fitting.

Benefits of technology

It realizes effective beautification and simplification of the room profile, avoids distortion problems of tilted doors, and makes the map more realistic and user-friendly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119831903A_ABST
    Figure CN119831903A_ABST
Patent Text Reader

Abstract

The invention discloses a map room contour optimization method. The method comprises the steps of obtaining an initial room contour of a target room; dividing the initial room contour into an initial door contour and an initial wall contour; performing first straightening optimization on the initial door contour to obtain a corrected door contour; performing second straightening optimization on the initial wall contour to obtain a corrected wall contour; and according to the corrected door contour and the corrected wall contour, obtaining a corrected room contour of the target room. Through the thought of splitting the map room outline into the door and the wall body and executing different beautifying strategies respectively, the whole map partition is simple and attractive.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of contour optimization, and in particular to a method for optimizing the contour of a map room. Background Art

[0002] Based on laser SLAM, a two-dimensional grid map can be established to divide the map room into zones. For example, if the house structure is three bedrooms and one living room, the generated map room zone is ideally divided into four zones. However, the generated map room zone has messy, curved, discontinuous lines, and contains a large number of noise points, which is somewhat different from the real room outline. Directly presenting such a room zone map to the user will greatly reduce the user's experience of the product. Therefore, before presenting the grid map to the user, the grid map needs to be processed by algorithm to make it concise and beautiful.

[0003] At present, some technical solutions simply perform polygon fitting and edge adjustment on the grid map outline. However, the existing technology does not distinguish the partitions of the room, nor does it consider the particularity and difference between the straightening of the inclined door edge and the wall edge. When the door edge of the room outline is inclined, directly straightening the entire outline will straighten the inclined door to be parallel or vertical, thereby causing the door position to shift, seriously affecting the authenticity of the map. Summary of the invention

[0004] In order to solve the above problems, this application proposes a map room outline optimization method, including:

[0005] Acquire an initial room outline of a target room; divide the initial room outline into an initial door outline and an initial wall outline; straighten and optimize the initial door outline to obtain a modified door outline, and straighten and optimize the initial wall outline to obtain a modified wall outline; obtain a modified room outline of the target room according to the modified door outline and the modified wall outline.

[0006] In one example, dividing the initial room outline into an initial door outline and an initial wall outline includes: determining room door endpoints in the initial room outline, the room door endpoints including a first room door endpoint and a second room door endpoint; determining the initial door outline and / or initial wall outline in the initial room outline according to the first room door endpoint and the second room door endpoint.

[0007] In one example, the first room door endpoint and the second room door endpoint determine the initial door outline and the initial wall outline in the initial room outline, including: dividing the initial room outline into a first outline and a second outline according to the first room door endpoint and the second room door endpoint; determining the number of first outline points included in the first outline and the number of second outline points included in the second outline; and determining the initial door outline and the initial wall outline according to the size relationship between the number of the first outline points and the number of the second outline points.

[0008] In one example, performing a first straightening optimization on the initial door outline to obtain a revised door outline includes: calculating the average distance between all outline points in the initial door outline and the straight line where the first room door endpoint and the second room door endpoint are located; if the average distance is less than a third preset distance, taking the middle door outline between the first room door endpoint and the second room door endpoint as the revised door outline, the middle door outline being obtained by connecting the first room door endpoint and the second room door endpoint in a straight line; if the average distance is greater than or equal to the third preset distance, taking the initial door outline as the revised door outline.

[0009] In one example, it also includes: determining the distance between the first room door endpoint and the second room door endpoint; if the distance is lower than a first preset distance, the modified door outline is considered invalid; if the distance is higher than a second preset threshold, the modified door outline is retracted by a preset multiple.

[0010] In one example, performing a second straightening optimization on the initial wall contour to obtain a revised wall contour includes: generating a minimum circumscribed rectangle of the initial wall contour; determining the wall contour points to be revised in the initial wall contour; and translating the wall contour points to be revised in the initial wall contour to the edges of the minimum circumscribed rectangle to obtain a revised wall contour.

[0011] In one example, determining the positive contour point of the wall to be repaired in the initial wall contour includes: determining the target wall contour point in the initial wall contour based on the angles between the contour point vector and the positive directions of the horizontal and vertical coordinate axes respectively; the contour point vector is a vector composed of any two adjacent contour points in the initial wall contour; determining the distances between the target wall contour point and the four sides of the minimum circumscribed rectangle respectively; if the distance between the target wall contour point and any side of the minimum circumscribed rectangle is lower than a preset distance threshold, the target wall contour point is used as the wall contour point to be corrected.

[0012] In one example, determining the target wall contour point in the initial wall contour based on the angles between the contour point vector and the positive directions of the horizontal and vertical coordinate axes respectively includes: selecting any first wall contour point and second wall contour point in the initial wall contour, the first wall contour point being adjacent to the second wall contour point; generating the contour point vector with the first wall contour point as the origin and pointing in the direction of the second wall contour point; determining a first angle between the contour point vector and the positive direction of the horizontal axis of the coordinate, and a second angle between the contour point vector and the positive direction of the vertical axis of the coordinate; if the first angle is less than a first angle threshold, or the first angle is greater than a second angle threshold, or the second angle is less than a third angle threshold, or the second angle is greater than a fourth angle threshold, then the first wall contour point is the target wall contour point.

[0013] In one example, before obtaining the initial contour point cluster of the target room, the method also includes: obtaining a first contour point cluster of the target room; determining the horizontal and vertical coordinate values ​​of each contour point in the first contour point cluster; determining outlier points in the first contour point cluster based on the horizontal and vertical coordinate values; and deleting the outlier points in the first contour point cluster to obtain the initial contour point cluster.

[0014] In one example, obtaining the modified room outline of the target room according to the modified door outline and the modified wall outline includes: fitting the modified door outline and the modified wall outline by polygonal approximation so that the modified door outline and the modified wall outline are connected to obtain the modified room outline of the target room.

[0015] The method proposed in this application can bring the following beneficial effects: by splitting the room outline into doors and walls and implementing different beautification strategies respectively, the tilted door is prevented from being straightened and distorted, making the optimized room map more concise and beautiful. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0017] Figure 1 A schematic diagram showing the effect of an existing map room outline optimization method in an embodiment of the present application;

[0018] Figure 2 A schematic diagram of a flow chart of a method for optimizing a map room outline in an embodiment of the present application;

[0019] Figure 3a This is a schematic diagram of a room outline point cluster in an embodiment of the present application;

[0020] Figure 3b This is a schematic diagram of an initial wall contour point cluster in an embodiment of the present application;

[0021] Figure 3c This is a schematic diagram of an initial wall contour point cluster in an embodiment of the present application;

[0022] Figure 4 This is a schematic diagram of an initial door profile optimization in an embodiment of the present application;

[0023] Figure 5 This is a schematic diagram of the angle between a vector and the positive direction of the coordinate axis in an embodiment of the present application;

[0024] Figure 6 This is a schematic diagram of a polygonal approximation effect in an embodiment of the present application;

[0025] Figure 7 This is a schematic diagram of a room outline optimization effect in an embodiment of the present application. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0027] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0028] At present, some technical solutions have simply processed the outline of the raster map by polygon fitting and edge adjustment. However, the existing technology does not distinguish the partitions of the room, nor does it consider the particularity and difference of the straightening of the inclined door edge and the wall edge. Figure 1 As shown, Figure 1 The left side of the figure shows the unprocessed map room outline, where 101 is the door edge and 102 is the wall. The right side shows the optimization result of the map room outline by the prior art. Figure 1 As shown on the left, a room has a door with a certain inclination angle (that is, the door is not parallel or perpendicular to the wall). Since the existing technology processes the map room outline by directly straightening it, the processing result will optimize and remove the inclination angle of the inclined door, resulting in serious distortion and offset problems.

[0029] Figure 2A flowchart of a method for optimizing a map room outline is provided for one or more embodiments of this specification. The method can be applied to optimize a room partition map. The implementation of the analysis method involved in the embodiments of the present application can be a terminal device or a server, and the present application does not impose any special restrictions on this. For the convenience of understanding and description, the following embodiments are described in detail using a server as an example.

[0030] It should be noted that the server can be a single device or a system composed of multiple devices, that is, a distributed server, and this application does not make any specific limitations on this.

[0031] like Figure 2 As shown, the embodiment of the present application provides a method for optimizing a map room outline, comprising:

[0032] S201: Obtaining an initial room outline of the target room;

[0033] S202: Divide the initial room outline into an initial door outline and an initial wall outline;

[0034] In order to avoid the map distortion caused by changing the tilted door to horizontal or vertical when the room outline is straightened, the initial room outline of the target room is split into the initial door outline and the initial wall outline, and different optimization strategies are adopted.

[0035] The above-mentioned initial room outline can be pre-stored in a storage device of the computer device. When the map room outline needs to be optimized, the computer device can select the initial room outline from the storage device. Of course, the computer device can also obtain the initial room outline from other external devices. For example, the initial room outline is stored in the cloud. When the map room outline needs to be optimized, the computer device can obtain the initial room outline from the cloud. This embodiment does not limit the method for obtaining the initial room outline.

[0036] In one embodiment, when splitting the initial room outline, the room outline point clusters in the initial room outline and the room door endpoints in the room outline point clusters must first be determined. It should be noted that the algorithm for determining the door endpoints can be implemented using existing technology, and this application does not limit this. The room door endpoints here include a first room door endpoint and a second room door endpoint. The initial door outline and / or initial wall outline in the initial room outline are determined based on the first room door endpoint and the second room door endpoint.

[0037] In one embodiment, according to the first room door endpoint and the second room door endpoint, the initial room contour is divided into a first contour and a second contour; the number of first contour points included in the first contour and the number of second contour points included in the second contour are determined; according to the magnitude relationship between the number of first contour points and the number of second contour points, the initial door contour and the initial wall contour are determined.

[0038] According to the first room door endpoint and the second room door endpoint, the room contour point cluster can be divided into a first contour point cluster and a second contour point cluster. Here, the first contour point cluster and the second contour point cluster are respectively obtained by searching for the second room door endpoint along other contour points in the clockwise and counterclockwise directions from the first room door endpoint. After obtaining the first contour point cluster and the second contour point cluster, it is also necessary to determine which of the first contour point cluster and the second contour point cluster is the initial door contour or the initial wall contour. Therefore, it is necessary to determine the number of first contour points included in the first contour point cluster and the number of second contour points included in the second contour point cluster; according to the magnitude relationship between the number of first contour points and the number of second contour points, the initial door contour and the initial wall contour are determined. If the number of first contour points is less than twice the number of second contour points, the first contour point cluster is used as the initial door contour, and the second contour point cluster is used as the initial wall contour; otherwise, the first contour point cluster is used as the initial wall contour, and the second contour point cluster is used as the initial door contour.

[0039] Specifically, Figure 3a is a schematic diagram of a room contour point cluster in an embodiment of the present application, Figure 3b is a schematic diagram of an initial wall contour point cluster in an embodiment of the present application, Figure 3c is a schematic diagram of an initial wall contour point cluster in an embodiment of the present application. As Figure 3a shown, the obtained room contour point cluster Ω{p1, p2, ……, p n} is recorded, where n is a positive integer, the first room door endpoint and the second room door endpoint are respectively p i , p j , and i < j < n. To avoid distorting the map when straightening the room contour and turning an inclined door into a horizontal or vertical one, the room contour is split into two. The steps are as follows: First step, taking the first room door endpoint p i as the starting point, searching for the second room door endpoint p j along other contour points in the clockwise / counterclockwise direction, then the obtained first contour point cluster is recorded as A{p i , p2 ……, p j}, and the second contour point cluster is B = Ω - A. Second step, the number of points included in the contours A and B is their contour lengths g and w. If the length of contour A is at least shorter than twice the length of contour B, that is: then A is divided into the initial door contour, as Figure 3c As shown; B is the initial wall outline, such as Figure 3b shown.

[0040] S203: performing a first straightening optimization on the initial door profile to obtain a modified door profile;

[0041] S204: performing a second straightening optimization on the initial wall contour to obtain a modified wall contour.

[0042] After the initial room outline is divided into the initial door outline and the initial wall outline, different optimization strategies are adopted for the initial door outline and the initial wall outline, and straightening optimization is performed respectively. As for the optimization order of the initial door outline and the initial wall outline, the initial door outline and the initial wall outline can be optimized at the same time, or the initial door outline can be straightened and optimized first to obtain the modified door outline, and then the initial wall outline can be straightened and optimized to obtain the modified wall outline; or the initial wall outline can be straightened and optimized first to obtain the modified wall outline, and then the initial door outline can be straightened and optimized to obtain the modified door outline, and the present application does not limit this.

[0043] In one embodiment, performing a first straightening optimization on the initial door outline to obtain a revised door outline includes: calculating the average distance between all outline points in the initial door outline and the straight line where the first room door endpoint and the second room door endpoint are located; if the average distance is less than a third preset distance, taking the middle door outline between the first room door endpoint and the second room door endpoint as the revised door outline, the middle door outline being obtained by connecting the first room door endpoint and the second room door endpoint in a straight line.

[0044] When straightening and optimizing the initial door contour, the first room door endpoint and the second room door endpoint can be connected by a straight line to obtain an intermediate door contour point cluster. The average Euclidean distance between all contour points in the initial door contour and the straight line where the intermediate door contour point cluster is located is calculated. If the average Euclidean distance is less than the third preset distance, the intermediate door contour point cluster is used as the revised door contour; if the average Euclidean distance is greater than or equal to the third preset distance, the initial door contour is used as the revised door contour. Specifically, Figure 4 Schematic diagram of an initial door profile optimization in an embodiment of the present application, such as Figure 4 As shown, a straight line connects the gate endpoints p i ,p j , to obtain the middle door contour point cluster C{p i ,z1,z2……,z j-1 ,p j}, where z1,z2,…,z j-1It is the straight-line contour of the door. Then traverse and calculate the Euclidean distance between the pixel point p inside the initial door contour A and the door straight line z. If the average distance from the pixel point p to the straight line z is less than the threshold v, then replace A with the intermediate door contour point cluster C.

[0045] Furthermore, in addition to determining whether to replace the initial door contour with the intermediate door contour point cluster, it is also necessary to judge the validity of the door contour. After using the intermediate door contour point cluster as the corrected door contour, it is necessary to determine the pixel distance between the first room door endpoint and the second room door endpoint; determine the pixel distance between the first room door endpoint and the second room door endpoint; if the pixel distance is lower than the first preset distance, then the corrected door contour is considered invalid; if the pixel distance is higher than the second preset threshold, then the corrected door contour is shrunk by a preset multiple, and the corrected room contour is determined according to the shrunk corrected door contour.

[0046] Specifically, if the pixel distance is lower than the first preset distance, then convert the initial door contour into an initial wall contour; if the pixel distance is higher than the first preset threshold and lower than the second preset threshold, then do not adjust the first room door endpoint and the second room door endpoint; if the pixel distance is higher than the second preset threshold, then move the first room door endpoint and the second room door endpoint along the straight line connecting the first room door endpoint and the second room door endpoint, so that the pixel distance is shrunk by a preset multiple to obtain the corrected door contour. For example, according to the condition setting that one pixel is equal to 0.05m, an ordinary door approximately occupies between 10 pixels and 30 pixels, then calculate the pixel distance r between the first room door endpoint and the second room door endpoint p i ,p j . If r < 10, then the door is not considered valid. At this time, convert the initial door contour into an initial wall contour, no longer process the door contour, and use the optimization strategy for processing the wall contour to process the point cluster corresponding to the initial door contour. If 10 < r < 30, then keep the endpoints unchanged; if r > 30, then shrink 0.25*r to 0.75*r pixels along the direction of the straight line p i ,p j to obtain the corrected door contour.

[0047] In one embodiment, performing a second straightening optimization on the initial wall contour to obtain a corrected wall contour includes: generating the minimum bounding rectangle of the initial wall contour; determining the wall contour points to be corrected in the initial wall contour; translating the wall contour points to be corrected in the initial wall contour to the sides of the minimum bounding rectangle to obtain the corrected wall contour.

[0048] When optimizing the wall contour, firstly, the target wall contour point in the initial wall contour is determined based on the angles between the contour point vector and the positive directions of the horizontal and vertical coordinate axes; the contour point vector is a vector composed of any two adjacent contour points in the initial wall contour, and then the distances between the target wall contour point and the four sides of the minimum circumscribed rectangle are determined; if the distance between the target wall contour point and any side of the minimum circumscribed rectangle is lower than a preset distance threshold, the target wall contour point is used as the wall contour point to be corrected.

[0049] Furthermore, when determining the target wall contour point, it is necessary to select any first wall contour point and second wall contour point in the initial wall contour, the first wall contour point is adjacent to the second wall contour point, and then the contour point vector is generated with the first wall contour point as the origin to point in the direction of the second wall contour point. Then determine the first angle between the contour point vector and the positive direction of the horizontal axis of the coordinate, and the second angle between the contour point vector and the positive direction of the vertical axis of the coordinate. If the first angle is within the first angle threshold, or the second angle is within the second angle threshold, then the first wall contour point is the target wall contour point. Specifically, Figure 5 Schematic diagram of the angle between a vector and the positive direction of the coordinate axis in the embodiment of the present application, such as Figure 5 As shown, the wall contour is B{b1,b2,...,b k}, then when selecting the target wall contour points that need to be straightened, it is necessary to randomly select two adjacent contour points b of the wall contour i ,b i+1 , according to the inverse tangent function, we can calculate b i is the origin, vector The angle α with the positive direction of the horizontal axis of the coordinate i,i+1 , if α is satisfied i,i+1 <20° or α i,i+1 >160°, or 80°<α with respect to the positive direction of the longitudinal axis i,i+1 <100°, then b i ∈{b i ,b i+1 ,……,b j},j <k。{b i ,b i+1 ,……,b j} are the selected target wall contour points that need to be straightened.

[0050] Furthermore, after determining the target wall contour points, it is necessary to perform a straightening operation on the target wall contour points, generate the minimum circumscribed rectangle of the initial wall contour, and then determine the pixel distances between the target wall contour points and the four sides of the minimum circumscribed rectangle. If the pixel distance is higher than a preset pixel threshold, the target wall contour points are not adjusted. If the pixel distance is lower than the preset pixel threshold, the target wall contour points are translated to the edge of the minimum circumscribed rectangle to obtain a corrected wall contour.

[0051] S204: Obtain a corrected room outline of the target room according to the corrected door outline and the corrected wall outline.

[0052] Because the endpoint position of the connection between the optimized door and the straightened wall outline has changed, in order to make the reorganized new room partition outline continuous and eliminate breakpoints, polygonal approximation is used to fit the new door outline and wall outline, which can produce a continuous new room outline with only 1 pixel error. The process is as follows: Figure 6 shown.

[0053] In one embodiment, when the robot performs SLAM rapid mapping, a large number of noise points will be generated when the laser scans the floor-standing mirror and transparent glass. These noise points cannot be completely eliminated through image filtering operations and will eventually be integrated into the room outline. Therefore, it is necessary to denoise the room outline before splitting the room outline into the initial door outline and the initial wall outline. During denoising, it is necessary to determine the horizontal and vertical coordinate values ​​of each initial contour point in the first contour point cluster, and based on the horizontal and vertical coordinate values, determine the outlier points in the first contour point cluster, and delete the outlier points in the first contour point cluster to obtain the initial contour point cluster.

[0054] Furthermore, when determining outliers in the first contour point cluster, it is necessary to select the first contour point, the second contour point and the third contour point in the first contour point cluster; the first contour point, the second contour point and the third contour point are adjacent. Then determine the horizontal and vertical coordinates of the first contour point, the second contour point and the third contour point. If the difference between the horizontal coordinates of the first contour point and the third contour point is greater than the first preset distance, and the difference between the horizontal coordinates of the first contour point and the second contour point is less than the second preset distance, then the third contour point is an outlier. If the difference between the vertical coordinates of the first contour point and the third contour point is greater than the first preset distance, and the difference between the vertical coordinates of the first contour point and the second contour point is less than the second preset distance, then the third contour point is the outlier. For example, take three adjacent contour points p1, p2, p3, and p3 is identified as an outlier if it meets one of the following conditions: p1.x-p3.x>d, p1.x-p2.x<s;p1.y-p3.y> d, p1.y-p2.y <s。

[0055] This application first splits the initial room outline of the target room into an initial door outline and an initial wall outline according to the outline length ratio, and then performs different straightening and beautification strategies for the initial door outline and the initial wall outline respectively.

[0056] In an actual home environment, the outline of a room door is usually a flat straight line, and in the subsequent map processing process, a rectangular block is usually needed to cover the door outline to display the location of the door to the user in the map. Therefore, the endpoints of the initial door outline are connected to form an intermediate door outline, and then the intermediate door outline is indented or expanded according to the pixel unit corresponding to the actual size of the door to form a corrected door outline, so as to correct the door outline to a straight line; for the wall, due to the existence of obstacles on the wall, the wall outline is not necessarily a rectangle composed of straight lines, and there may be a certain degree of bending. Directly correcting the wall outline to a straight line may cause it to not match the actual outline. Therefore, for the initial wall outline, two adjacent outline points are randomly selected to determine whether the angle between their connecting line and the positive direction of the X-axis and the Y-axis meets the conditions. If the angle conditions are met, they are selected, and the wall outline is fitted with the minimum circumscribed regular rectangle. The degree of fit between the selected points and the four sides of the minimum circumscribed regular rectangle is calculated. If the fit is high, the selected points are moved to straighten the wall to form a corrected wall outline. Finally, the corrected door outline is combined with the corrected wall outline, and the overall outline is fitted using polygonal approximation to eliminate breakpoints, thus forming a beautified and straightened room partition outline.

[0057] It will be understood by those skilled in the art that Figure 1 As shown on the left, when optimizing a room with a door that has a certain tilt angle (i.e., the door is not parallel or perpendicular to the wall), if there is a room outline optimization solution, the door of the optimized map room outline is not parallel or perpendicular to the wall outline, but is parallel to the wall outline. Figure 7 The room outline optimization effect diagram shown is similar to that shown in the figure, that is, the inclined door edge still maintains its original inclination angle. It can be considered that the room outline optimization scheme of this map adopts the same room outline optimization scheme as this scheme, which is to split the door and the wall and optimize them separately and then merge them, which can be considered as infringement.

[0058] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0059] The devices and media provided in the embodiments of the present application correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.

[0060] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0061] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0062] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0063] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0064] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0065] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0066] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0067] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0068] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A method for optimizing a map room outline, characterized in that: The method comprises: Get the initial room outline of the target room; Dividing the initial room outline into an initial door outline and an initial wall outline; Performing a first straightening optimization on the initial door profile to obtain a modified door profile; Performing a second straightening optimization on the initial wall contour to obtain a modified wall contour; A corrected room outline of the target room is obtained according to the corrected door outline and the corrected wall outline.

2. A method for optimizing a map room outline according to claim 1, characterized in that: The step of dividing the initial room outline into an initial door outline and an initial wall outline comprises: Determine room door endpoints in the initial room outline, the room door endpoints including a first room door endpoint and a second room door endpoint; An initial door outline and / or an initial wall outline in the initial room outline is determined according to the first room door endpoint and the second room door endpoint.

3. A method for optimizing a map room outline according to claim 2, characterized in that: The first room door endpoint and the second room door endpoint determine the initial door outline and the initial wall outline in the initial room outline, including: According to the first room door endpoint and the second room door endpoint, the initial room outline is divided into a first outline and a second outline; Determine the number of first contour points included in the first contour and the number of second contour points included in the second contour; An initial door contour and an initial wall contour are determined according to a magnitude relationship between the number of the first contour points and the number of the second contour points.

4. A method for optimizing a map room outline according to claim 2, characterized in that: The performing a first straightening optimization on the initial door profile to obtain a modified door profile comprises: Calculate the average distance between all contour points in the initial door contour and the straight line where the first room door endpoint and the second room door endpoint are located; If the average distance is less than a third preset distance, a middle door outline between the first room door endpoint and the second room door endpoint is used as a corrected door outline, wherein the middle door outline is obtained by connecting the first room door endpoint and the second room door endpoint in a straight line; If the average distance is greater than or equal to the third preset distance, the initial door profile is used as a modified door profile.

5. A method for optimizing a map room outline according to claim 4, characterized in that: The method further comprises: Determine the distance between the first room door endpoint and the second room door endpoint; If the distance is lower than a first preset distance, the modified door profile is deemed invalid; If the distance is higher than a second preset threshold, the modified door outline is retracted by a preset multiple.

6. A method for optimizing a map room outline according to claim 1, characterized in that: The performing a second straightening optimization on the initial wall contour to obtain a modified wall contour comprises: Generate a minimum circumscribed rectangle of the initial wall outline; Determine the wall contour points to be corrected in the initial wall contour; The wall contour points to be corrected in the initial wall contour are translated to the edges of the minimum circumscribed rectangle to obtain a corrected wall contour.

7. A method for optimizing a map room outline according to claim 6, characterized in that: The step of determining the positive contour point of the wall to be repaired in the initial wall contour comprises: Determine the target wall contour point in the initial wall contour based on the angles between the contour point vector and the positive directions of the horizontal and vertical coordinate axes respectively; the contour point vector is a vector formed by any two adjacent contour points in the initial wall contour; Determine the distances between the target wall contour points and the four sides of the minimum circumscribed rectangle respectively; If the distance between the target wall contour point and any side of the minimum circumscribed rectangle is lower than a preset distance threshold, the target wall contour point is used as the wall contour point to be corrected.

8. A method for optimizing a map room outline according to claim 7, characterized in that: The determining of the target wall contour point in the initial wall contour based on the angles between the contour point vector and the positive directions of the horizontal and vertical coordinate axes respectively comprises: Selecting any first wall contour point and a second wall contour point in the initial wall contour, wherein the first wall contour point is adjacent to the second wall contour point; Taking the first wall contour point as the origin and pointing in the direction of the second wall contour point, the contour point vector is generated; Determine a first angle between the contour point vector and the positive direction of the coordinate horizontal axis, and a second angle between the contour point vector and the positive direction of the coordinate vertical axis; If the first angle is smaller than a first angle threshold, or the first angle is larger than a second angle threshold, or the second angle is smaller than a third angle threshold, or the second angle is larger than a fourth angle threshold, then the first wall contour point is a target wall contour point.

9. A method for optimizing a map room outline according to claim 1, characterized in that: Before obtaining the initial contour point cluster of the target room, the method further includes: Acquire a first contour point cluster of the target room; Determine the horizontal and vertical coordinate values ​​of each contour point in the first contour point cluster; Based on the horizontal and vertical coordinate values, determining outlier points in the first contour point cluster; The outlier points are deleted from the first contour point cluster to obtain the initial contour point cluster.

10. A method for optimizing a map room outline according to claim 1, characterized in that: The obtaining the corrected room outline of the target room according to the corrected door outline and the corrected wall outline comprises: The modified door contour and the modified wall contour are fitted by polygonal approximation so as to connect the modified door contour and the modified wall contour to obtain the modified room contour of the target room.