Door and window hole recognition method, device and storage medium
By automatically identifying the connection status of the element in the drawing and the maximum closed area, automatic identification and correction of doors and windows is achieved, solving the problem of low manual analysis efficiency and improving the recognition efficiency and accuracy rate.
Patent Information
- Application Number
- CN202111635506.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-22
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2041-12-22
AI Technical Summary
In the prior art, manual analysis of drawings is inefficient in identifying doors and windows, and it requires learning related knowledge in advance, which consumes a lot of human resources.
By obtaining area drawings, verifying the ingredient, determining the connection status of different types of ingredients, grouping ingredients, calculating the maximum closed area, correcting the position and angle of door and window holes, and realizing the method of automatically identifying door and window holes.
It improves the efficiency of door and window recognition, reduces the need for manual analysis, enhances the accuracy of recognition, and can identify and correct wrong drawing elements.
Smart Images

Figure CN114283443B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computers, and specifically relates to a door and window hole recognition method, device and storage medium. Background Art
[0002] Before actual construction, it is necessary to confirm the door and window opening information in the drawings. At the current stage, the door and window opening information is mainly expressed through drawings. Therefore, it is necessary to identify the door and window opening information in the drawings.
[0003] Traditional methods for identifying door and window openings include: manually reading and understanding drawings, and analyzing information such as the location, angle, size, and shape of the door and window openings in the drawings.
[0004] However, the manual analysis of drawings requires personnel to learn relevant knowledge in advance, consumes a lot of human resources and has low drawing recognition efficiency. Summary of the invention
[0005] This application provides a door and window hole recognition method, device and storage medium, which can solve the problem that the manual analysis of drawings requires personnel to learn relevant knowledge in advance, consumes a lot of human resources and has low drawing recognition efficiency. This application provides the following technical solutions:
[0006] In a first aspect, a method for identifying door and window openings is provided, comprising: obtaining a regional drawing; verifying graphics elements in the regional drawing to obtain graphics elements to be identified in the regional drawing; determining a target type of door and window opening in the regional drawing based on the connectivity of graphics elements of different types in the graphics elements to be identified; obtaining a graphics element group corresponding to each graphics element to be identified; determining a maximum closed area of each graphics element group; determining the maximum closed area of the rectangle as a rectangular door and window opening; in the case where a door and window opening of the target type overlaps with the rectangular door and window opening, removing the rectangular door and window opening to obtain a door and window opening to be identified; determining a position, length and angle of the door and window opening to be identified; correcting the angle and position of the door and window opening according to the position of the door and window opening to be identified and the position of a wall to which the door and window opening to be identified belongs; and determining the width of the door and window opening to be identified according to the width of the wall to which the door and window opening to be identified belongs.
[0007] Optionally, the method of determining the target type of door and window openings in the area drawing based on the connectivity of different types of graphics elements in the graphics elements to be identified includes: when the arc-type graphics element and the straight-line graphics element are connected, or when the arc-type graphics element and the arc-type graphics element are connected, determining that the two connected graphics elements constitute an arc-type door and window opening.
[0008] Optionally, determining the position, length and angle of the door and window opening to be identified includes: determining the center line of the door and window opening to be identified to obtain the position of the door and window opening to be identified; determining the length of the center line of the door and window opening to be identified as the length of the door and window opening to be identified; and determining the angle of the center line of the door and window opening to be identified as the angle of the door and window opening to be identified.
[0009] Optionally, determining the center line of the door and window opening to be identified includes: when the door and window opening to be identified is the door and window opening of the target type, using the different types of graphic elements in the door and window opening of the target type as a complete connecting line, connecting two end points of the connecting line to obtain a base line; determining other graphic elements connected to the connecting line; determining projection points of the other graphic elements to the base line; and extending the base line to the projection point to obtain the center line.
[0010] Optionally, determining the center line of the door and window opening to be identified further includes: when the door and window opening to be identified is the rectangular door and window opening, determining the wall connected to the rectangular door and window opening; determining the projection of the rectangular door and window opening to the wall connected to the rectangular door and window opening to obtain the center line.
[0011] Optionally, the method of correcting the angle and position of the door and window opening to be identified based on the position of the door and window opening to be identified and the position of the wall to which the door and window opening to be identified belongs includes: determining the center line of the wall in the area drawing; determining the wall whose center line is connected to the center line of the door and window opening to be identified as the wall to which the door and window opening to be identified belongs; and adjusting the center line of the door and window opening to be identified to overlap with the center line of the wall to which it belongs, so as to correct the angle and position of the door and window opening to be identified.
[0012] Optionally, after determining the maximum closed area of each graphic element group, the method further includes: in the case where the maximum closed area of the rectangle has not been determined, determining that at least two of the straight line graphic elements in the area drawing are connected, and determining that the at least two connected straight line graphic elements constitute a straight door or window opening.
[0013] Optionally, the method further includes: determining a door and window hole name corresponding to the door and window hole to be identified according to a preset format, wherein the door and window hole name is parallel to the door and window hole to be identified.
[0014] In a second aspect, an electronic device is provided, comprising a memory, a controller, and a computer program stored in the memory and executable on the controller, wherein the controller implements the steps of the above-mentioned door and window opening recognition method when executing the computer program.
[0015] In a third aspect, a computer-readable storage medium is provided, wherein a program is stored in the storage medium, and when the program is executed by a processor, the method for identifying door and window openings provided in the first aspect is implemented.
[0016] The beneficial effects of the present application include at least: obtaining an area drawing; verifying the graphics elements in the area drawing to obtain the graphics elements to be identified in the area drawing; determining the door and window openings of the target type in the area drawing based on the connectivity of different types of graphics elements in the graphics elements to be identified; obtaining the graphics element group corresponding to each graphics element to be identified; determining the maximum closed area of each graphics element group; determining the maximum closed area of the rectangle as the rectangular door and window opening; when the door and window opening of the target type overlaps with the rectangular door and window opening, removing the rectangular door and window opening to obtain the door and window opening to be identified; determining the position, length and angle of the door and window opening to be identified; correcting the angle and position of the door and window opening according to the position of the door and window opening to be identified and the position of the wall to which the door and window opening to be identified belongs; determining the width of the door and window opening to be identified according to the width of the wall to which the door and window opening to be identified belongs. The present invention can solve the problem of low efficiency of manual analysis of drawings; by automatically identifying the connection between straight line graphics and arc graphics in regional drawings, door and window openings of target types are obtained, graphics connected in the regional drawings are grouped, the maximum closed local area of the graphics grouping is calculated, the maximum closed area of the rectangle is determined to be the rectangular door and window opening, and the identified door and window openings are corrected through the walls in the regional drawings, without the need for manual analysis of the drawings, and the efficiency of door and window opening recognition can be improved.
[0017] In addition, by verifying the graphics elements in the area drawings, it is possible to identify graphics elements with errors in the area drawings, thereby avoiding the influence of the graphics elements with errors on the recognition of door and window openings, and improving the accuracy of door and window opening recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 is a flow chart of a method for identifying door and window openings provided by an embodiment of the present application;
[0020] Figure 2 is a flow chart of a method for identifying door and window openings provided by an embodiment of the present application;
[0021] Figure 3 is a block diagram of a door and window hole recognition method and device provided by an embodiment of the present application;
[0022] Figure 4 It is a block diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0023] The technical solution of the present application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. The present application will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0025] In the present application, unless otherwise specified, the directional words used, such as "up, down, top, bottom", usually refer to the directions shown in the drawings, or to the components themselves in the vertical, perpendicular or gravity directions; similarly, for ease of understanding and description, "inside and outside" refer to the inside and outside relative to the outline of each component itself, but the above-mentioned directional words are not used to limit the present application.
[0026] The door and window opening recognition method provided by this application is introduced in detail below.
[0027] like Figure 1 As shown, the embodiment of the present application provides a door and window hole recognition method, the implementation of which can rely on a computer program, which can be run on a computer device such as a smart phone, a tablet computer, a personal computer, or a server, and this embodiment does not limit the operating subject of the method. The method includes at least the following steps:
[0028] Step 101, obtaining a regional drawing.
[0029] In this embodiment, the area drawing includes a wall and at least one door or window opening on the wall.
[0030] Among them, door and window holes refer to holes reserved on the wall for doors and windows.
[0031] Step 102, verifying the graphic elements in the area drawing to obtain the graphic elements to be identified in the area drawing.
[0032] Verify the graphics elements in the area drawings and check for graphics elements with drawing errors in the area drawings.
[0033] The incorrectly drawn primitives include but are not limited to incorrectly drawn line primitives and text primitives with incorrect text content, etc. For example, incorrectly drawn line primitives include line primitives that are drawn too long or too short; and text primitives with incorrect text content include text primitives with incorrect name formats.
[0034] Step 103, based on the connection between different types of graphics elements in the graphics elements to be identified, determine the door and window openings of the target type in the regional drawing.
[0035] In this embodiment, different types of graphic primitives include arc-type graphic primitives and straight-line graphic primitives.
[0036] Based on the connection between different types of graphics to be identified, the target type of door and window openings in the area drawing are determined, including: when an arc-type graphics element is connected to a straight-line graphics element, or an arc-type graphics element is connected to an arc-type graphics element, determining that the two connected graphics elements constitute an arc-type door and window opening.
[0037] Step 104: Obtain the graphic element group corresponding to each graphic element to be identified.
[0038] There is a connection relationship between different graphics elements to be identified in the graphics element group, and graphics elements to be identified that constitute the same door and window opening are in the same graphics element group.
[0039] Step 105: determine the maximum closed area of each primitive group.
[0040] In one example, determining the maximum closed area of each primitive group includes: obtaining the intersection points between the lines in the primitive group; disconnecting the lines corresponding to the intersection points according to the intersection points to obtain the boundary lines, the two ends of the boundary lines are called boundary points, and the boundary points corresponding to the same intersection point are called related points; determining the two boundary points of each boundary line; determining the boundary lines with no corresponding related points at the boundary points at both ends to obtain the ignored lines; selecting a boundary point as the current point of the maximum closed area; searching for the related points of the current point in a clockwise direction; determining the angle between the boundary line corresponding to the current point and the boundary line corresponding to the related point; using the boundary line corresponding to the maximum angle as the edge line of the maximum closed area; selecting a new boundary point as the new current point to calculate the maximum angle until the maximum closed area is obtained.
[0041] Step 106: determine the largest closed area of the rectangle as the rectangular door and window opening.
[0042] In actual implementation, there is a possibility that the maximum closed area of the rectangle cannot be determined. In this case, it is also necessary to determine the straight door and window openings in the area drawing.
[0043] Determining the linear door and window openings in the area drawing includes: when the maximum closed area of the rectangle is not determined, determining that at least two linear graphic elements in the area drawing are connected, and determining that the two connected linear graphic elements constitute the linear door and window opening.
[0044] Among them, the straight-line door and window openings include door and window openings formed by two straight-line graphic elements connected, four straight-line graphic elements connected, and two groups of parallel straight-line graphic elements connected.
[0045] Step 107: When the door and window opening of the target type overlaps with the rectangular door and window opening, the rectangular door and window opening is removed to obtain the door and window opening to be identified.
[0046] Optionally, the door and window opening of the target type may be compared with the rectangular door and window opening by using an image comparison algorithm to determine whether the door and window opening of the target type overlaps with the rectangular door and window opening.
[0047] The image comparison algorithm may be a perceptual hash algorithm (PHA) or a scale-invariant feature transform (SIFT). This embodiment does not limit the implementation method of the image comparison algorithm.
[0048] Step 108, determining the position, length and angle of the door and window openings to be identified.
[0049] In this embodiment, the position, length and angle of the door and window opening to be identified are determined by calculating the center line of the door and window opening to be identified, including: determining the center line of the door and window opening to be identified to obtain the position of the door and window opening to be identified; determining the length of the center line of the door and window opening to be identified as the length of the door and window opening to be identified; determining the angle of the center line of the door and window opening to be identified as the angle of the door and window opening to be identified.
[0050] In actual implementation, the center line can be obtained by calculating the projection of the door and window openings to be identified. Meanwhile, the door and window openings to be identified include door and window openings of target types and rectangular door and window openings.
[0051] Among them, the target types of door and window openings include arc-shaped door and window openings and straight-line door and window openings.
[0052] Optionally, determining the center line of the door and window opening to be identified includes at least one of the following situations:
[0053] The first method is to, when the door and window openings to be identified are the door and window openings of the target type, use the different types of graphics elements in the door and window openings of the target type as complete connecting lines, connect the two end points of the connecting lines to obtain a base line; determine other graphics elements connected to the connecting lines; determine the projection points of the other graphics elements to the base line; extend the base line to the projection points to obtain a center line.
[0054] There are multiple projection points from other graphic elements connected to the connecting line to the base line, and the base line is extended to the projection point farthest from the two end points of the base line.
[0055] The second method is to determine the wall connected to the rectangular door and window opening when the door and window opening to be identified is a rectangular door and window opening; determine the projection of the rectangular door and window opening to the wall connected to the rectangular door and window opening to obtain the center line.
[0056] Step 109, correcting the angle and position of the door and window opening according to the position of the door and window opening to be identified and the position of the wall to which the door and window opening to be identified belongs.
[0057] In one example, the wall to which the door and window opening to be identified belongs is determined by the center line of the door and window opening to be identified and the center line of the wall in the area drawing.
[0058] The center line of the wall is obtained by connecting the starting point and the end point of the wall.
[0059] According to the positions of the door and window openings to be identified and the positions of the walls to which the door and window openings to be identified belong, the angles and positions of the door and window openings to be identified are corrected, including: determining the center line of the wall in the area drawing; determining the wall whose center line is connected to the center line of the door and window opening to be identified as the wall to which the door and window opening to be identified belongs; adjusting the center line of the door and window opening to be identified to overlap with the center line of the wall to which it belongs, so as to correct the angle and position of the door and window opening to be identified.
[0060] Step 110, determining the width of the door or window opening to be identified according to the width of the wall to which the door or window opening to be identified belongs.
[0061] In one example, the width of the wall to which the door and window opening to be identified belongs is obtained, and the width is used as the width of the door and window opening to be identified.
[0062] In actual implementation, it is also necessary to generate a name for each door and window hole to be identified, which is used to uniquely represent the corresponding door and window hole to be identified, including: determining the door and window hole name corresponding to the door and window hole to be identified according to a preset format, and the door and window hole name is parallel to the door and window hole to be identified.
[0063] Among them, the preset format is a pre-set format, and the preset format includes a combination of letters M or C and numbers, for example, M3, C3, M1021 or C1022, etc.; alternatively, other preset formats can be preset as needed, and this embodiment does not limit the implementation method of the preset format.
[0064] In summary, the door and window opening recognition method provided in the present embodiment obtains a regional drawing; verifies the graphic elements in the regional drawing to obtain the graphic elements to be recognized in the regional drawing; determines the door and window openings of the target type in the regional drawing based on the connectivity of different types of graphic elements in the graphic elements to be recognized; obtains the graphic element group corresponding to each graphic element to be recognized; determines the maximum closed area of each graphic element group; determines the maximum closed area of the rectangle as the rectangular door and window opening; when the door and window opening of the target type overlaps with the rectangular door and window opening, removes the rectangular door and window opening to obtain the door and window opening to be recognized; determines the position, length and angle of the door and window opening to be recognized; corrects the angle and position of the door and window opening according to the position of the door and window opening to be recognized and the position of the wall to which the door and window opening to be recognized belongs; determines the width of the door and window opening to be recognized according to the width of the wall to which the door and window opening to be recognized belongs. The present invention can solve the problem of low efficiency of manual analysis of drawings; by automatically identifying the connection between straight line graphics and arc graphics in regional drawings, door and window openings of target types are obtained, graphics connected in the regional drawings are grouped, the maximum closed local area of the graphics grouping is calculated, the maximum closed area of the rectangle is determined to be the rectangular door and window opening, and the identified door and window openings are corrected through the walls in the regional drawings, without the need for manual analysis of the drawings, and the efficiency of door and window opening recognition can be improved.
[0065] In addition, by verifying the graphics elements in the area drawings, it is possible to identify graphics elements with errors in the area drawings, thereby avoiding the influence of the graphics elements with errors on the recognition of door and window openings, and improving the accuracy of door and window opening recognition.
[0066] In order to more clearly understand the door and window hole recognition method provided by the present application, this embodiment gives an example to illustrate the method. Figure 2 , the method comprises at least the following steps:
[0067] Step 201, obtaining a regional drawing;
[0068] Step 202, checking the graphic elements in the area drawing, and taking the rectangular graphic elements as door and window openings;
[0069] Step 203, determining whether there is an arc-shaped door or window hole, if there is an arc-shaped door or window hole, executing step 204, otherwise executing step 205;
[0070] Step 204, determining the connected graphic elements of the arc-shaped door and window openings;
[0071] Step 205, grouping the graphics elements in the area drawing;
[0072] Step 206, calculating the maximum closed area of each primitive group;
[0073] Step 207, determining whether there is a maximum rectangular closed area, if there is a maximum rectangular closed area, executing step 208, otherwise executing step 211;
[0074] Step 208, determining whether the rectangular maximum closed area overlaps with the previous door and window openings, if the rectangular maximum closed area overlaps with the previous door and window openings, executing step 210, otherwise executing step 209;
[0075] Step 209, taking the largest closed rectangular area as the door and window opening, and executing step 213;
[0076] Step 210, ignoring the maximum closed area of the rectangle, and executing step 213;
[0077] Step 211, determining whether there is a straight door or window hole, if there is a straight door or window hole, executing step 212, otherwise executing step 213;
[0078] Step 212, determining the connected graphic elements of the linear door and window openings;
[0079] Step 213, determining whether the number of door and window openings is greater than 0, if the number of door and window openings is greater than 0, executing step 214, otherwise executing step 220;
[0080] Step 214, determining the position, length and angle of the door and window openings;
[0081] Step 215, prioritizing the door and window openings;
[0082] Step 216, determining the names of the door and window openings;
[0083] Step 217, determining the wall to which the door and window openings are attached;
[0084] Step 218, correcting the position, width and angle of the door and window openings according to the wall;
[0085] Step 219, automatically generating models of door and window openings;
[0086] Step 220, stop door and window hole recognition.
[0087] In summary, the arc-shaped door and window openings in the regional drawings are determined; the graphics in the regional drawings are grouped, and the maximum closed area of each graphics group is calculated; when the maximum rectangular closed area is determined, the maximum rectangular closed area is used as a rectangular graphic element; when the maximum rectangular closed area is not determined, the straight-line door and window openings in the regional drawings are determined. The determined door and window openings are prioritized and named according to the priority ranking; the walls to which the door and window openings are attached are determined; the positions, widths and angles of the doors and windows are corrected according to the attached walls. The problem of low efficiency of manual analysis of drawings can be solved; the modeling of the door and window openings is automatically completed according to the corrected positions, widths, angles and lengths of the door and window openings, which can improve the modeling efficiency.
[0088] This embodiment provides a device for identifying door and window openings, such as Figure 3 The device includes at least the following modules: a drawing acquisition module 3010, a graphic element verification module 3020, a first determination module 3030, a graphic element grouping module 3040, a second determination module 3050, a third determination module 3060, a door and window comparison module 3070, a fourth determination module 3080, a first correction module 3090 and a second correction module 3110.
[0089] The drawing acquisition module 3010 is used to acquire the regional drawings.
[0090] The primitive verification module 3020 is used to verify the primitives in the regional drawing to obtain the primitives to be identified in the regional drawing.
[0091] The first determination module 3030 is used to determine the door and window openings of the target type in the regional drawing based on the connection between different types of graphics elements in the graphics elements to be identified.
[0092] The primitive grouping module 3040 is used to obtain the primitive group corresponding to each primitive to be identified.
[0093] The second determination module 3050 is used to determine the maximum closed area of each primitive group.
[0094] The third determination module 3060 is used to determine the largest closed area of the rectangle as the rectangular door or window opening.
[0095] The door and window comparison module 3070 is used to remove the rectangular door and window opening when the door and window opening of the target type overlaps with the rectangular door and window opening, so as to obtain the door and window opening to be identified.
[0096] The fourth determination module 3080 is used to determine the position, length and angle of the door and window opening to be identified.
[0097] The first correction module 3090 is used to correct the angle and position of the door and window opening according to the position of the door and window opening to be identified and the position of the wall to which the door and window opening to be identified belongs.
[0098] The second correction module 3100 is used to determine the width of the door and window opening to be identified according to the width of the wall to which the door and window opening to be identified belongs.
[0099] For relevant details, refer to the above method and device embodiments.
[0100] It should be noted that: the door and window hole recognition device provided in the above embodiment only uses the division of the above functional modules as an example to illustrate when performing door and window hole recognition. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the door and window hole recognition device is divided into different functional modules to complete all or part of the functions described above. In addition, the door and window hole recognition device provided in the above embodiment and the door and window hole recognition method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0101] This embodiment provides an electronic device, such as Figure 4 The electronic device at least includes a processor 401 and a memory 402.
[0102] The processor 401 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 401 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 401 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 401 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 401 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0103] The memory 402 may include one or more computer-readable storage media, which may be non-transitory. The memory 402 may also include a high-speed random access memory and a non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 402 is used to store at least one instruction, which is used to be executed by the processor 401 to implement the door and window hole recognition method provided in the method embodiment of the present application.
[0104] In some embodiments, the electronic device may further optionally include: a peripheral device interface and at least one peripheral device. The processor 401, the memory 402 and the peripheral device interface may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface via a bus, a signal line or a circuit board. Schematically, the peripheral devices include but are not limited to: a radio frequency circuit, a touch display screen, an audio circuit, and a power supply.
[0105] Of course, the electronic device may also include fewer or more components, which is not limited in this embodiment.
[0106] Optionally, the present application also provides a computer-readable storage medium, in which a program is stored, and the program is loaded and executed by a processor to implement the door and window opening recognition method of the above method embodiment.
[0107] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0108] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. Based on the embodiments in the present application, ordinary technicians in this field can make other different forms of changes or modifications without making creative work, which should all fall within the scope of protection of the present application.
Claims
1. A door and window hole recognition method, characterized in that: The method comprises: Acquire a regional drawing, wherein the regional drawing includes a wall and at least one door or window opening on the wall; Verifying the graphic elements in the regional drawings to obtain the graphic elements to be identified in the regional drawings; Determine the door and window openings of the target type in the regional drawing based on the connection between different types of graphic elements in the graphic elements to be identified; the different types of graphic elements include arc-type graphic elements and straight-line graphic elements; Obtaining a graphic element group corresponding to each graphic element to be identified; wherein different graphic elements to be identified in the graphic element group are connected to each other; Determine the maximum closed area of each primitive group; the determination of the maximum closed area of each primitive group includes: obtaining the intersection points between the lines in the primitive group; disconnecting the lines corresponding to the intersection points according to the intersection points to obtain the boundary line, the two ends of the boundary line are called boundary points, and the boundary points corresponding to the same intersection point are called related points; determine the two boundary points of each boundary line; determine the boundary line with no corresponding related points at the boundary points at both ends to obtain the ignored line; select a boundary point as the current point of the maximum closed area; search for the related points of the current point in a clockwise direction; determine the angle between the boundary line corresponding to the current point and the boundary line corresponding to the related point; use the boundary line corresponding to the maximum angle as the edge line of the maximum closed area; select a new boundary point as the new current point to calculate the maximum angle until the maximum closed area is obtained; The maximum closed area of the rectangle is determined as the rectangular door and window opening; When the door and window opening of the target type overlaps with the rectangular door and window opening, the rectangular door and window opening is removed to obtain the door and window opening to be identified; Determine the position, length and angle of the door and window opening to be identified; According to the position of the door and window opening to be identified and the position of the wall to which the door and window opening to be identified belongs, correcting the angle and position of the door and window opening; The width of the door and window opening to be identified is determined according to the width of the wall to which the door and window opening to be identified belongs.
2. The method according to claim 1, characterized in that The step of determining the target type of door and window openings in the regional drawing based on the connection between different types of graphic elements in the graphic elements to be identified includes: When the arc-shaped graphic element is connected to the straight-line graphic element, or the arc-shaped graphic element is connected to the arc-shaped graphic element, it is determined that the two connected graphic elements constitute an arc-shaped door or window opening.
3. The method according to claim 1, characterized in that The determining the position, length and angle of the door and window opening to be identified includes: Determine the center line of the door and window opening to be identified, and obtain the position of the door and window opening to be identified; Determine the length of the center line of the door and window opening to be identified as the length of the door and window opening to be identified; The angle of the center line of the door and window opening to be identified is determined as the angle of the door and window opening to be identified.
4. The method according to claim 3, characterized in that determining the center line of the door and window opening to be identified comprises: In the case where the door and window opening to be identified is the door and window opening of the target type, the different types of graphic elements in the door and window opening of the target type are used as a complete connecting line, and two end points of the connecting line are connected to obtain a base line; Determine other graphic elements connected to the connection line; Determine the projection points of the other graphic elements onto the base line; The base line is extended to the projection point to obtain the center line.
5. The method according to claim 3, characterized in that the step of determining the center line of the door and window opening to be identified further comprises: In the case where the door and window opening to be identified is the rectangular door and window opening, determining a wall connected to the rectangular door and window opening; The projection of the rectangular door and window opening to the wall connected to the rectangular door and window opening is determined to obtain the center line.
6. The method according to claim 1, characterized in that The step of correcting the angle and position of the door and window opening to be identified according to the position of the door and window opening to be identified and the position of the wall to which the door and window opening to be identified belongs comprises: Determine the center line of the wall in the drawings of the area; The wall whose center line is connected to the center line of the door and window hole to be identified is determined as the wall to which the door and window hole to be identified belongs; The center line of the door and window opening to be identified is adjusted to overlap with the center line of the wall to which it belongs, so as to correct the angle and position of the door and window opening to be identified.
7. The method according to claim 1, characterized in that After determining the maximum closed area of each primitive group, the method further includes: In the case where the maximum closed area of the rectangle is not determined, it is determined that at least two of the linear graphic elements in the area drawing are connected, and it is determined that the at least two connected linear graphic elements constitute a linear door and window opening.
8. The method according to claim 1, characterized in that The method further comprises: The door and window hole names corresponding to the door and window holes to be identified are determined according to a preset format, and the door and window hole names are parallel to the door and window holes to be identified.
9. An electronic device, characterized in that: The device includes a processor and a memory; a program is stored in the memory, and the program is loaded and executed by the processor to implement the door and window hole recognition method as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: The storage medium stores a program, and when the program is executed by the processor, it is used to implement the door and window hole recognition method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
CAD drawing recognition method and device, electronic equipment and storage medium
CN110889229A
Image recognition method based on deep learning
CN111797748A