Room enclosed area identification method and device, electronic equipment and storage medium

By calculating the contour intersection points and cutting line segments of building components, the room enclosure area is automatically identified, which solves the time-consuming problem of manual labeling in the existing technology and improves labeling efficiency.

CN118711209APending Publication Date: 2024-09-27深圳市万翼数字技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410749790.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2024-02-28
Filing Date
2024-06-11
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

In the existing technology, labeling of room enclosure areas requires manual operation, which results in long time consumption and low efficiency.

Method used

By calculating the intersection points of the contour lines of each building component in the house plan to be identified, cutting line segments are obtained, and based on these line segments, the ring is searched to determine the initial ring and rotation direction, and identify the ring to which the cutting line segment belongs, thereby automatically determining the room enclosure area.

Benefits of technology

It improves the efficiency of the annotation process, reduces the time overhead of manual operations, and realizes automated room enclosure area recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118711209A
    Figure CN118711209A
Patent Text Reader

Abstract

The invention relates to a room enclosed area identification method and device, electronic equipment and a storage medium, and is applied to the technical field of computers, and the method comprises the steps: calculating the intersection point of the contour lines of all building components in a to-be-identified house type image; cutting the contour line based on the intersection point to obtain a cut line segment; performing ring searching on the to-be-identified house type image based on the cutting line segments to obtain a plurality of initial rings and a rotation direction of each initial ring; identifying each cutting line segment based on the rotation direction to obtain a ring identifier to which the cutting line segment belongs; and determining a room enclosure area from the initial ring based on the ring identifier to which the room enclosure area belongs. The method and the device are used for solving the problems that in the prior art, a room enclosure area often needs to be manually marked, so that consumed time is long, and the efficiency of the marking process is low.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for identifying an enclosed area of ​​a room. Background Art

[0002] In building BIM software, architects and designers often need to identify rooms, areas, floors and other areas. Components are used to count objects in the area, area range, range identification, engineering quantity calculation and other business tasks. In more detailed business scenarios, taking rooms as an example, designers also need to identify indoor area, building area and common area.

[0003] In the related art, the room enclosure area in the drawing often needs to be manually marked, which takes a long time and leads to low efficiency of the marking process. Summary of the invention

[0004] The present application provides a room enclosure area recognition method, device, electronic device and storage medium to solve the problem in the prior art that room enclosure areas often need to be manually labeled, resulting in a long time consumption and low efficiency of the labeling process.

[0005] In a first aspect, an embodiment of the present application provides a method for identifying a room enclosure area, comprising:

[0006] Calculate the intersection of the outlines of each building component in the floor plan to be identified;

[0007] Cutting the contour line based on the intersection point to obtain a cutting line segment;

[0008] Searching for a ring on the floor plan to be identified based on the cutting line segment to obtain a plurality of initial rings and a rotation direction of each initial ring;

[0009] Identify each cutting line segment based on the rotation direction to obtain an identification of the ring to which the cutting line segment belongs;

[0010] A room enclosed area is determined from the initial ring based on the ring identifier.

[0011] Optionally, searching the to-be-identified floor plan for a ring based on the cutting line segment to obtain a plurality of initial rings and a rotation direction of each initial ring includes:

[0012] Assigning a line segment direction to each of the cutting line segments, wherein the line segment directions include two opposite directions;

[0013] Taking any of the intersection points as a starting point, determining a first initial ring formed by the cutting line segment in a first rotation direction;

[0014] Based on the line segment direction and the first rotation direction, filtering the cut line segments to obtain remaining line segments;

[0015] determining a second initial loop based on the remaining line segments, and determining a second rotation direction of the second initial loop based on the line segment directions of the remaining line segments;

[0016] The first initial ring and the second initial ring are determined to be the initial rings, and the first rotation direction and the second rotation direction are rotation directions of the initial rings.

[0017] Optionally, the determining a first initial ring formed by the cutting line segments in the first rotation direction with any of the intersection points as a starting point includes:

[0018] The determination process is as follows: determining a target cutting line segment whose line segment direction is the first rotation direction and includes a target point, wherein the target point includes the starting point; determining another intersection point of the target cutting line segment other than the target point as the next intersection point of the target point in the first rotation direction, and performing the determination process again with the next intersection point as the target point, wherein the target cutting line segment is not colinear with the target cutting line segment determined most recently;

[0019] When the target point is determined as the starting point again, the area formed by the target cutting line segments is determined as the first initial ring.

[0020] Optionally, based on the line segment direction and the first rotation direction, filtering the cut line segments to obtain remaining line segments includes:

[0021] The cutting line segments in the first initial ring whose line segment directions are the same as the first rotation direction are filtered to obtain the remaining line segments.

[0022] Optionally, determining a second initial ring based on the remaining line segments includes:

[0023] Determining whether the remaining line segments can form a closed area;

[0024] If so, determine that the closed area is the second initial ring.

[0025] Optionally, the step of identifying each cutting line segment based on the rotation direction to obtain an identification of a ring to which the cutting line segment belongs includes:

[0026] Marking a cutting line segment on the initial ring whose rotation direction is the first rotation direction as a first mark;

[0027] Marking a cutting line segment on the initial ring whose rotation direction is a second rotation direction as a second mark, wherein the first rotation direction and the second rotation direction are opposite directions;

[0028] The first identifier and the second identifier are identifiers of corresponding rings.

[0029] Optionally, determining the room enclosed area from the initial ring based on the ring identifier includes:

[0030] Determine whether the belonging ring identifier of the cutting line segment in the initial ring includes a designated identifier, wherein the designated identifier is a belonging ring identifier corresponding to an initial ring whose rotation direction is opposite to that of other initial rings;

[0031] If not included, it is determined to be the enclosed area of ​​the room.

[0032] Optionally, after determining the room enclosed area from the first initial ring and the second initial ring based on the line segment direction, the method further includes:

[0033] Calculating the area of ​​the enclosed area of ​​the room based on the apartment type data of the enclosed area of ​​the room;

[0034] The area is marked at the location of the room enclosed area in the floor plan to be identified.

[0035] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0036] The memory is used to store computer programs;

[0037] The processor is used to execute the program stored in the memory to implement the room enclosed area recognition method described in the first aspect.

[0038] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the room enclosure area recognition method described in the first aspect.

[0039] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application calculates the intersection of the outline of each building component in the floor plan to be identified; cuts the outline based on the intersection to obtain a cutting line segment; searches the floor plan to be identified based on the cutting line segment to obtain multiple initial rings and the rotation direction of each initial ring; identifies each cutting line segment based on the rotation direction to obtain the ring identifier to which the cutting line segment belongs; determines the room enclosure area from the initial ring based on the ring identifier. In this way, there is no need to use a complex algorithm. By identifying the cutting line segment and using the identifier to determine the labeling of the room enclosure area in the floor plan, the efficiency of the labeling process can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0042] Figure 1 This is an application scenario diagram of the room enclosure area recognition method provided in one embodiment of the present application;

[0043] Figure 2 A flow chart of a method for identifying a room enclosed area provided in an embodiment of the present application;

[0044] Figure 3 A schematic diagram of a floor plan provided in an embodiment of the present application;

[0045] Figure 4 A schematic diagram of a process for determining a room enclosure area provided by an embodiment of the present application;

[0046] Figure 5 A schematic diagram of a process for determining a room enclosed area provided in an embodiment of the present application;

[0047] Figure 6 A schematic diagram of a room enclosed area obtained according to an embodiment of the present application;

[0048] Figure 7 A schematic diagram of the intersection between components obtained according to an embodiment of the present application;

[0049] Figure 8 A structural diagram of a room enclosed area recognition device provided in one embodiment of the present application;

[0050] Fig. 9 A structural diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are 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 this application.

[0052] According to an embodiment of the present application, a room enclosure area recognition method is provided. Optionally, in the embodiment of the present application, the room enclosure area recognition method can be applied to Figure 1 In the hardware environment composed of the terminal 101 and the server 102 shown in FIG. Figure 1 As shown, the server 102 is connected to the terminal 101 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 102. The above-mentioned network includes but is not limited to: a wide area network, a metropolitan area network or a local area network, and the terminal 101 is not limited to a PC, a mobile phone, a tablet computer, etc.

[0053] The room enclosed area recognition method of the embodiment of the present application may be executed by the server 102, or by the terminal 101, or by both the server 102 and the terminal 101. The room enclosed area recognition method of the embodiment of the present application may be executed by the terminal 101, or by a client installed thereon.

[0054] Taking the case where a terminal executes the room enclosed area recognition method of the embodiment of the present application as an example, Figure 2 is a flow chart of an optional room enclosure area identification method according to an embodiment of the present application, such as Figure 2 As shown, the process of the method may include the following steps:

[0055] Step 201: Calculate the intersection points of the outlines of each building component in the floor plan to be identified.

[0056] In some embodiments, there are usually multiple types of building components in the drawings, such as standard walls, parapets, railings, countersills, columns, room dividing lines, etc.

[0057] By determining the line segments corresponding to the contour lines included in each building component and judging whether the line segments intersect, the intersection points between the intersecting line segments are calculated, wherein the intersection points include the first intersection points of the contour lines of the building component itself and the second intersection points obtained by the intersection of the contour lines of each building component.

[0058] Step 202: Cut the contour line based on the intersection point to obtain a cutting line segment.

[0059] In some embodiments, since the contours of different building components may intersect, there will be at least three intersection points on one contour line after the intersection. The contour line can be cut by the intersection points by sorting the intersection points on one contour line and taking the line segment formed by two adjacent intersection points as the cutting line segment according to the order of the intersection points.

[0060] Step 203: Search the to-be-identified floor plan for a ring based on the cutting line segment to obtain a plurality of initial rings and a rotation direction of each initial ring.

[0061] In some embodiments, the process of identifying a ring in a floor plan can be understood as a process of identifying a closed figure in a drawing. After the cutting line segments intersect, a large closed figure may be cut into multiple small closed figures, or a new closed figure may be generated.

[0062] In an optional embodiment, searching for a ring on the floor plan to be identified based on the cutting line segment to obtain a plurality of initial rings and a rotation direction of each initial ring includes:

[0063] Assigning a line segment direction to each of the cutting line segments, wherein the line segment directions include two opposite directions;

[0064] Taking any of the intersection points as a starting point, determining a first initial ring formed by the cutting line segment in a first rotation direction;

[0065] Based on the line segment direction and the first rotation direction, filtering the cut line segments to obtain remaining line segments;

[0066] determining a second initial loop based on the remaining line segments, and determining a second rotation direction of the second initial loop based on the line segment directions of the remaining line segments;

[0067] The first initial ring and the second initial ring are determined to be the initial rings, and the first rotation direction and the second rotation direction are rotation directions of the initial rings.

[0068] In some embodiments, the floor plan to be identified includes Figure 3 The figure shown is the result of the intersection of four wall components. Figure 3In the example, the four wall components are [9, 12, 13, 16], [1, 2, 11, 12], [4, 5, 8, 1], [9, 10, 3, 4], and each wall is composed of 4 line segments. In the process of finding the intersection of lines, there are 16 intersection points in total and the line segments of the wall are divided into 24 small line segments according to the intersection points, and the direction is consistent with the original. Taking the wall [9, 12, 13, 16] as an example, the small cutting line segments after the segmentation are: 9→10, 10→11, 11→12, 12→13, 13→14, 14→15, 15→16, 16→9.

[0069] When searching for a ring, first configure the direction of each cutting line segment. For example, the direction of the line segment formed by 9 and 10 includes 9→10 and 10→9, and the two directions are opposite directions. When starting to search for a ring, take the intersection as the starting point and start searching for the minimum closed figure in the first rotation direction. Among them, the first rotation direction can be clockwise or counterclockwise. In this embodiment, clockwise is used as an example for explanation. Through the above-mentioned ring search process, a total of 9 clockwise initial rings can be obtained, namely the first initial ring, including [9,10,15,16], [10,11,14,15], [11,12,13,14], [16,15,6,5], [15,14,7,6], [14,13,7,8], [5,6,4,3], [6,7,2,3], and [7,8,2,1]. In the above ring search process, taking the cutting line segment composed of 14 and 15 as an example, in [10, 11, 14, 15], the direction of the cutting line segment is 14→15, and in [15, 14, 7, 6], the direction of the cutting line segment is 15→14. Therefore, the cutting line segments in both directions are used, and so on. After searching 9 initial rings, there are 12→11, 11→10, 10→9, 9→16...13→12 left, that is, the counterclockwise cutting line segments of the outermost circle. Therefore, the second initial ring is obtained from the remaining segments, and the rotation direction of the second initial ring is exactly opposite to that of the first initial ring, that is, counterclockwise.

[0070] In an optional embodiment, taking any of the intersection points as a starting point, determining a first initial ring formed by the cutting line segments in the first rotation direction includes:

[0071] The determination process is as follows: determining a target cutting line segment whose line segment direction is the first rotation direction and includes a target point, wherein the target point includes the starting point; determining another intersection point of the target cutting line segment other than the target point as the next intersection point of the target point in the first rotation direction, and performing the determination process again with the next intersection point as the target point, wherein the target cutting line segment is not colinear with the target cutting line segment determined most recently;

[0072] When the target point is determined as the starting point again, the area formed by the target cutting line segments is determined as the first initial ring.

[0073] See also Figure 3 , taking the intersection 9 as the starting point as an example, the cutting line segment starting from 9 in the clockwise direction is 9→10. Therefore, the intersection 10 can be determined as the next intersection point, and the cutting line segments starting from the intersection 10 include 10→15 and 10→11. Since 9→10 and 10→11 are collinear, the intersection 15 is selected as the next intersection point. By analogy, the initial ring [9,10,15,16] is obtained.

[0074] In an optional embodiment, based on the line segment direction and the first rotation direction, filtering the cut line segments to obtain remaining line segments includes:

[0075] The cutting line segments in the first initial ring whose line segment directions are the same as the first rotation direction are filtered to obtain the remaining line segments.

[0076] In an optional embodiment, determining a second initial ring based on the remaining line segments includes:

[0077] Determining whether the remaining line segments can form a closed area;

[0078] If so, determine that the closed area is the second initial ring.

[0079] Taking the cutting line segment composed of 14 and 15 as an example, in [10,11,14,15], the direction of the cutting line segment is 14→15, and in [15,14,7,6], the direction of the cutting line segment is 15→14. Therefore, the cutting line segments in both directions are used, so they need to be filtered.

[0080] After filtering, the remaining line segments include 12→11, 11→10, 10→9, 9→16...13→12, that is, the counterclockwise cutting line segments of the outermost circle. Therefore, the above remaining line segments are connected end to end to form a closed area, thereby obtaining the second initial ring.

[0081] Step 204: Identify each cutting line segment based on the rotation direction to obtain an identification of the ring to which the cutting line segment belongs.

[0082] Based on the above-mentioned related embodiments, a total of 10 initial rings are obtained through ring search, including 9 clockwise first initial rings and 1 counterclockwise second initial ring. Based on the different rotation directions of the initial rings, corresponding cutting line segments with line segment directions are assigned identifiers.

[0083] In an optional embodiment, each cutting line segment is identified based on the rotation direction to obtain the ring identification to which the cutting line segment belongs, including:

[0084] Marking a cutting line segment on the initial ring whose rotation direction is the first rotation direction as a first mark;

[0085] Marking a cutting line segment on the initial ring whose rotation direction is a second rotation direction as a second mark, wherein the first rotation direction and the second rotation direction are opposite directions;

[0086] The first identifier and the second identifier are identifiers of corresponding rings.

[0087] Based on the above-mentioned related embodiments, the first rotation direction is clockwise, and the cutting line segment with line segment direction on the first initial ring in the clockwise direction is marked as innerNode. The second rotation direction is counterclockwise, and the cutting line segment with line segment direction on the second initial ring in the counterclockwise direction is marked as outerNode.

[0088] Step 205: Determine the room enclosed area from the initial ring based on the ring identifier.

[0089] In some embodiments, the room enclosure area generally refers to the area surrounded by the wall, and therefore, the wall should not be included in the room enclosure area. Based on the above related embodiments, for the cutting line segment marked as outerNode, it belongs to the outermost line segment on the wall, and therefore, the initial ring of outerNode is included, so it is excluded as the room enclosure area.

[0090] In an optional embodiment, determining the room enclosed area from the initial ring based on the ring identifier includes:

[0091] Determine whether the belonging ring identifier of the cutting line segment in the initial ring includes a designated identifier, wherein the designated identifier is a belonging ring identifier corresponding to an initial ring whose rotation direction is opposite to that of other initial rings;

[0092] If not included, it is determined to be the enclosed area of ​​the room.

[0093] In some embodiments, the cutting line segment on the first initial ring is marked as innerNode, and the cutting line segment on the second initial ring is marked as outerNode. The designated identifier is outerNode.

[0094] Based on this, see Figure 3 ,For the 10 initial rings determined above, only [15,14,7,6] includes the cutting line segment marked by outerNode, so this area is determined to be the room enclosure area.

[0095] In another embodiment, the previously generated segmentation line segments may be generated into segmentNodes, the rule being that the original clockwise direction is the outerNode, and the counterclockwise direction after reversal is the innerNode, and then the line segments with the same starting point (same starting point, regardless of direction) are added to a map array _pointOuterNode.

[0096] Save all outerNodes in LeftSegmentNode, and first take an outerNode from it to find the loop.

[0097] First, consider the contour as being composed entirely of outerNodes. Starting from 9→10, look for the leftmost line segment of the next point in a clockwise direction (find the convex hull). You can find the outermost border (the entire outerNode loop), record them as used nodes, and delete them from leftSegmentNode. The remaining outerNodes are as follows: Figure 4 shown.

[0098] Continue to take an outerNode to find the loop. Because the line segment _pointOuterNode with the same starting point also contains the innerNode, the outerNode that has been used is excluded. For example, taking 7→2 as the initial outerNode, the loop found is [7,2,3,6], of which 2→3 and 6→7 are innerNodes. The outerNode in the found loop is still deleted from the leftSegmentNode. In this way, the outerNodes left in the leftSegmentNode are as follows: Figure 5 shown.

[0099] Repeat the above steps to find the four outer loops, and then get the remaining outerNode, such as Figure 6 shown.

[0100] Each of these four loops contains innerNode. For the loops at the four corners, the outerNodes have been used when finding the outer contour, so they will be filtered out. Finally, the middle loop is composed entirely of outerNodes. At this time, the outerNodes in LeftSegmentNode have been used up, and the loop terminates.

[0101] Judgment of room and wall: as long as there is innerNode in the loop, it is a wall, and all are outerNode are rooms.

[0102] In an optional embodiment, after determining the room enclosed area from the first initial ring and the second initial ring based on the line segment direction, the method further includes:

[0103] Calculating the area of ​​the enclosed area of ​​the room based on the apartment type data of the enclosed area of ​​the room;

[0104] The area is marked at the location of the room enclosed area in the floor plan to be identified.

[0105] In some embodiments, after the room enclosed area is determined, since the apartment data of each component is included in the drawing, the area of ​​the room enclosed area can be calculated based on the line segment data of the room enclosed area.

[0106] Specifically, the two-dimensional contour line of the desired building element can be input and compared with the determined room enclosure area data to find the corresponding building components on each edge, and the building area and other data can be calculated by offsetting the edge line.

[0107] By marking the area on the floor plan, it is convenient for relevant personnel to check.

[0108] In an optional embodiment, there may be a situation where a new component is added to the floor plan. Figure 7 , after wall 2 is added, the endpoints ① and ② of wall 1 have changed. Therefore, the data generated by wall 1 before must also be changed accordingly. In this application, whenever a new wall is added, the affected walls that intersect with it will be put into the update function and regenerated, which is equivalent to deleting first and then adding. That is, if the contour line of a wall completely overlaps with the contour line of another wall, the shorter contour line of the two contour lines will be deleted.

[0109] The room enclosure area recognition method provided in this application includes:

[0110] Input the 2D outlines of all building elements (excluding the centerline of building components);

[0111] Calculate the intersection points of the input two-dimensional contour lines;

[0112] Cut line segments through intersection points;

[0113] Package the cut segments into Node nodes and record the nodes with the same starting point;

[0114] Add outerNode to record the counterclockwise loop, add innerNode to record the clockwise loop, loop outerNode, and find the loop through the common nodes;

[0115] Determine whether there is an innerNode in the Loop. If so, it is the building element components such as walls and railings. If not, it is the room area we are looking for;

[0116] By comparing the two-dimensional contour line of the building element we input with the room area data we found, we can find the corresponding building components on each edge;

[0117] Similarly, data such as building area can be calculated by offsetting the edge lines.

[0118] The above recognition method is fast, avoids high-frequency two-dimensional Boolean operations, and significantly improves performance. It is highly accurate, and each Segment data can find its original data involved in the calculation. After we find all possible loops, it is easy to eliminate those loops composed of components. Then the remaining loops that are not composed of component loops are the room areas we want. Directed line segments are converted into directed loops. Based on the dual graph retrieval principle, the derivative index of each data can be found, and the data utilization rate is significantly improved.

[0119] Based on the same concept, a room enclosed area recognition device is provided in the embodiment of the present application. The specific implementation of the device can be found in the description of the method embodiment part, and the repeated parts will not be repeated. Figure 8 As shown, the device mainly includes:

[0120] A calculation module 801 is used to calculate the intersection of the outlines of each building component in the floor plan to be identified;

[0121] A cutting module 802, configured to cut the contour line based on the intersection point to obtain a cutting line segment;

[0122] A search module 803 is used to search for a ring on the floor plan to be identified based on the cutting line segment to obtain a plurality of initial rings and a rotation direction of each initial ring;

[0123] An identification module 804 is used to identify each cutting line segment based on the rotation direction to obtain an identification of the ring to which the cutting line segment belongs;

[0124] The determination module 805 is configured to determine a room enclosed area from the initial ring based on the ring identifier.

[0125] Based on the same concept, an electronic device is also provided in the embodiment of the present application, such as Fig. 9As shown, the electronic device mainly includes: a processor 901, a memory 902 and a communication bus 903, wherein the processor 901 and the memory 902 communicate with each other through the communication bus 903. The memory 902 stores a program executable by the processor 901, and the processor 901 executes the program stored in the memory 902 to implement the following steps:

[0126] Calculate the intersection of the outlines of each building component in the floor plan to be identified;

[0127] Cutting the contour line based on the intersection point to obtain a cutting line segment;

[0128] Searching for a ring on the floor plan to be identified based on the cutting line segment to obtain a plurality of initial rings and a rotation direction of each initial ring;

[0129] Identify each cutting line segment based on the rotation direction to obtain an identification of the ring to which the cutting line segment belongs;

[0130] A room enclosed area is determined from the initial ring based on the ring identifier.

[0131] The communication bus 903 mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 903 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0132] The memory 902 may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Alternatively, the memory may also be at least one storage device located away from the processor 901.

[0133] The above-mentioned processor 901 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc., and can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0134] In another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed on a computer, the computer executes the room enclosure area recognition method described in the above embodiment.

[0135] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instruction can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instruction is transmitted from a website site, a computer, a server or a data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integration. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape, etc.), an optical medium (such as a DVD) or a semiconductor medium (such as a solid-state hard disk), etc.

[0136] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0137] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for identifying a room enclosure area, characterized in that: include: Calculate the intersection of the outlines of each building component in the floor plan to be identified; Cutting the contour line based on the intersection point to obtain a cutting line segment; Searching for a ring on the floor plan to be identified based on the cutting line segment to obtain a plurality of initial rings and a rotation direction of each initial ring; Identify each cutting line segment based on the rotation direction to obtain an identification of the ring to which the cutting line segment belongs; A room enclosed area is determined from the initial ring based on the ring identifier.

2. The room enclosed area recognition method according to claim 1, characterized in that: The step of searching the to-be-identified floor plan for a ring based on the cutting line segment to obtain a plurality of initial rings and a rotation direction of each initial ring includes: Assigning a line segment direction to each of the cutting line segments, wherein the line segment directions include two opposite directions; Taking any of the intersection points as a starting point, determining a first initial ring formed by the cutting line segment in a first rotation direction; Based on the line segment direction and the first rotation direction, filtering the cut line segments to obtain remaining line segments; determining a second initial loop based on the remaining line segments, and determining a second rotation direction of the second initial loop based on the line segment directions of the remaining line segments; The first initial ring and the second initial ring are determined to be the initial rings, and the first rotation direction and the second rotation direction are rotation directions of the initial rings.

3. The room enclosed area recognition method according to claim 2, characterized in that: The step of determining a first initial ring formed by the cutting line segments in the first rotation direction with any of the intersection points as a starting point includes: The determination process is as follows: determining a target cutting line segment whose line segment direction is the first rotation direction and includes a target point, wherein the target point includes the starting point; determining another intersection point of the target cutting line segment other than the target point as the next intersection point of the target point in the first rotation direction, and performing the determination process again with the next intersection point as the target point, wherein the target cutting line segment is not colinear with the target cutting line segment determined most recently; When the target point is determined as the starting point again, the area formed by the target cutting line segments is determined as the first initial ring.

4. The room enclosure area recognition method according to claim 2, characterized in that: Based on the line segment direction and the first rotation direction, the cut line segments are filtered to obtain remaining line segments, including: The cutting line segments in the first initial ring whose line segment directions are the same as the first rotation direction are filtered to obtain the remaining line segments.

5. The room enclosed area recognition method according to claim 2, characterized in that: Determining a second initial ring based on the remaining line segments includes: Determining whether the remaining line segments can form a closed area; If so, determine that the closed area is the second initial ring.

6. The room enclosure area recognition method according to claim 1, characterized in that: The step of identifying each cutting line segment based on the rotation direction to obtain the ring identification to which the cutting line segment belongs includes: Marking a cutting line segment on the initial ring whose rotation direction is the first rotation direction as a first mark; Marking a cutting line segment on the initial ring whose rotation direction is a second rotation direction as a second mark, wherein the first rotation direction and the second rotation direction are opposite directions; The first identifier and the second identifier are identifiers of corresponding rings.

7. The room enclosure area recognition method according to claim 6, characterized in that: Determining a room enclosed area from the initial ring based on the ring identifier includes: Determine whether the belonging ring identifier of the cutting line segment in the initial ring includes a specified identifier, where the specified identifier is a belonging ring identifier corresponding to an initial ring whose rotation direction is opposite to that of other initial rings; If not included, it is determined to be the enclosed area of ​​the room.

8. The room enclosure area recognition method according to claim 1, characterized in that: After determining the room enclosed area from the first initial ring and the second initial ring based on the line segment direction, the method further includes: Calculate the area of ​​the enclosed area of ​​the room based on the apartment type data of the enclosed area of ​​the room; The area is marked at the location of the room enclosed area in the floor plan to be identified.

9. A room enclosure area recognition device, characterized in that: include: A calculation module, used to calculate the intersection points of the outlines of each building component in the floor plan to be identified; A cutting module, used for cutting the contour line based on the intersection point to obtain a cutting line segment; A search module, configured to search for a ring on the floor plan to be identified based on the cutting line segment, and obtain a plurality of initial rings and a rotation direction of each initial ring; an identification module, used for identifying each cutting line segment based on the rotation direction to obtain an identification of the ring to which the cutting line segment belongs; The determination module is used to determine the room enclosure area from the initial ring based on the ring identifier.

10. An electronic device, characterized in that: include: A processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; The memory is used to store computer programs; The processor is used to execute the program stored in the memory to implement the room enclosure area recognition method described in any one of claims 1-8.

11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for identifying a room enclosure area according to any one of claims 1 to 8 is implemented.