A method and device for identifying axis networks in architectural drawings
The automated axis net recognition in architectural drawings uses DBSCAN clustering and greedy matching to enhance efficiency, addressing the low efficiency of manual methods.
Patent Information
- Application Number
- CN202510630298.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2045-05-16
AI Technical Summary
In the prior art, the identification efficiency of the axis grid of the architectural drawings is low, and the manual identification efficiency is low, making it difficult to adapt to the identification needs of complex drawings.
The DBSCAN clustering algorithm is used to cluster the axis number element, and the collision relationship between the axis number cluster is detected by combining linear equations and parameterized linear equations. The axis network area is identified through the greedy matching algorithm, and the number of elements is reduced to improve the recognition efficiency.
It improves the identification efficiency of the axis grid in the architectural drawings, reduces the calculation complexity and feature loss, and adapts to the identification needs of large and complex drawings.
Smart Images

Figure CN120148064B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of building drawing recognition, and in particular, to a method and device for recognizing axis networks in building drawings. Background Art
[0002] With the development of automation and intelligence becoming an increasingly prevalent trend in various social industries, the field of construction engineering is no exception. The design and construction processes rely on detailed drawings.
[0003] In building drawings, the recognition and extraction of axis networks are very important core items. However, the existing axis network recognition is completed manually, which has the technical problem of relatively low recognition efficiency. Summary of the Invention
[0004] (I) Technical Problems to be Solved
[0005] In view of the above-mentioned disadvantages and deficiencies of the prior art, the present invention provides a method and device for recognizing axis networks in building drawings, which solves the technical problem of relatively low recognition efficiency existing in the prior art.
[0006] (II) Technical Solutions
[0007] To achieve the above object, the main technical solutions adopted by the present invention include:
[0008] In a first aspect, an embodiment of the present invention provides a method for recognizing axis networks in building drawings, including: parsing all axis number elements from a building drawing, and determining the direction angle of the axis corresponding to each axis number element among all axis number elements as the direction angle of the corresponding axis number element; performing DBSCAN clustering on all axis number elements based on the direction angles of all axis number elements to obtain a plurality of axis number clusters; detecting the collision relationship between the plurality of axis number clusters to obtain a collision relationship detection result, and based on the collision relationship detection result, connecting and drawing all connection line segments in a mask image including connection line segments to obtain a drawn mask image; wherein, the connection line segments are used to connect the centers of all axis number elements in the corresponding axis number cluster; performing binarization processing on the drawn mask image to obtain a binarized mask image, determining the connected domain division result of the binarized mask image, and using a greedy matching algorithm to match the drawing names in the text elements parsed from the building drawing with the connected domain division result to obtain the recognition result of the axis network area in the building drawing.
[0009] In a possible embodiment, the collision relationship includes the point-to-point collision relationship between the rectangular centers of the minimum circumscribed rectangles corresponding to each axis number cluster among the plurality of axis number clusters; the collision relationship detection result includes the detection result of the point-to-point collision relationship;
[0010] And, the point-to-point collision relationship is obtained by solving the following linear equation:
[0011] ;
[0012] In the formula, represents the direction vector of the cluster center point of the i th axis number cluster, and the cluster center point of the i th axis number cluster is the rectangular center of the i th axis number cluster; represents the point-to-point collision encounter time corresponding to the i th axis number cluster; represents the cluster center point of the j th axis number cluster, and the cluster center point of the j th axis number cluster is the rectangular center of the j th axis number cluster; represents the cluster center point of the i th axis number cluster; represents the direction vector of the cluster center point of the j th axis number cluster; represents the point-to-point collision encounter time corresponding to the j th axis number cluster.
[0013] In a possible embodiment, the collision relationship includes the point-line collision relationship between the rectangular centers of the minimum circumscribed rectangles corresponding to each axis number cluster in multiple axis number clusters and the connecting line segments corresponding to other axis number clusters; the collision relationship detection result includes the detection result of the point-line collision relationship;
[0014] And, the point-line collision relationship is obtained by solving the following parametric linear equation:
[0015] ;
[0016] In the formula, pt represents the collision starting point of the point-line collision relationship; t represents the point-line collision encounter time; represents the direction vector of the collision starting point of the point-line collision relationship; p 1 and p 2 represent the two endpoints of the connecting line segment to be collided; u represents the point-line collision position.
[0017] In a possible embodiment, based on the collision relationship detection result, all connection line segments in the mask image including connection line segments are connected and drawn to obtain the drawn mask image, including: determining the minimum point-to-point collision encounter time among all point-to-point collision encounter times corresponding to each axis number cluster, and screening all point-to-line collision encounter times to obtain the screened point-to-line collision encounter times, and determining the minimum screened point-to-line collision encounter time among all the screened point-to-line collision encounter times corresponding to each axis number cluster; connecting and drawing the line segment centers of the two axis number clusters corresponding to the minimum point-to-point collision encounter time in the mask image, and based on the point-to-line collision position corresponding to the minimum screened point-to-line collision encounter time, connecting and drawing the collision starting points of the two axis number clusters corresponding to the minimum screened point-to-line collision encounter time and their point-to-line collision positions to obtain the drawn mask image.
[0018] In a possible embodiment, screening all point-to-line collision encounter times to obtain the screened point-to-line collision encounter times includes: calculating the angle difference between the direction angles of the two axis number clusters corresponding to each point-to-line collision encounter time among all point-to-line collision encounter times; screening out the point-to-line collision encounter times corresponding to an angle difference less than 90 degrees to obtain the screened point-to-line collision encounter times.
[0019] In a second aspect, an identification device for an axis network in an architectural drawing according to an embodiment of the present invention includes:
[0020] An analysis and determination module, configured to analyze all axis number primitives from the architectural drawing and determine the direction angle of the axis connected to each axis number primitive among all axis number primitives as the direction angle of the corresponding axis number primitive;
[0021] A clustering module, configured to perform DBSCAN clustering on all axis number primitives based on the direction angles of all axis number primitives to obtain multiple axis number clusters;
[0022] A detection and drawing module, configured to detect the collision relationship between multiple axis number clusters to obtain a collision relationship detection result, and based on the collision relationship detection result, connect and draw all connection line segments in the mask image including connection line segments to obtain the drawn mask image; wherein, the connection line segment is used to connect the centers of all axis number primitives in its corresponding axis number cluster;
[0023] A matching module, configured to perform binarization processing on the drawn mask image to obtain the binarized mask image, determine the connected domain division result of the binarized mask image, and use a greedy matching algorithm to match the drawing name in the text primitives parsed from the architectural drawing with the connected domain division result to obtain the identification result of the axis network area in the architectural drawing.
[0024] In a possible embodiment, the collision relationship includes a point-to-point collision relationship between the rectangular centers of the minimum circumscribed rectangles corresponding to each axis number cluster among multiple axis number clusters and the rectangular centers of other axis number clusters; the collision relationship detection result includes the detection result of the point-to-point collision relationship;
[0025] And, the point-to-point collision relationship is obtained by solving the following linear equation:
[0026] ;
[0027] In the formula, represents the direction vector of the cluster center point of the i th axis number cluster, and the cluster center point of the i th axis number cluster is the rectangular center of the i th axis number cluster; represents the point-to-point collision encounter time corresponding to the i th axis number cluster; represents the cluster center point of the j th axis number cluster, and the cluster center point of the j th axis number cluster is the rectangular center of the j th axis number cluster; represents the cluster center point of the i th axis number cluster; represents the direction vector of the cluster center point of the j th axis number cluster; represents the point-to-point collision encounter time corresponding to the j th axis number cluster.
[0028] In a possible embodiment, the collision relationship includes a point-to-line collision relationship between the rectangular center of the minimum circumscribed rectangle corresponding to each axis number cluster among multiple axis number clusters and the connecting line segment corresponding to other axis number clusters; the collision relationship detection result includes the detection result of the point-to-line collision relationship;
[0029] And, the point-to-line collision relationship is obtained by solving the following parametric line equation:
[0030] ;
[0031] In the formula, pt represents the collision starting point of the point-to-line collision relationship; t represents the point-to-line collision encounter time; represents the direction vector of the collision starting point of the point-to-line collision relationship; p 1 and p 2 represent the two endpoints of the connecting line segment to be collided; u represents the point-to-line collision position.
[0032] In a possible embodiment, the detection and drawing module is specifically configured to: determine the minimum point-to-point collision encounter time among all the point-to-point collision encounter times corresponding to each axis number cluster, and screen all the point-to-line collision encounter times to obtain the screened point-to-line collision encounter times, and determine the minimum screened point-to-line collision encounter time among all the screened point-to-line collision encounter times corresponding to each axis number cluster; connect and draw the line segment centers of the two axis number clusters corresponding to the minimum point-to-point collision encounter time in the mask image, and based on the point-to-line collision position corresponding to the minimum screened point-to-line collision encounter time, connect and draw the collision starting points and their point-to-line collision positions of the two axis number clusters corresponding to the minimum screened point-to-line collision encounter time in the mask image to obtain the drawn mask image.
[0033] In a possible embodiment, the detection and drawing module is specifically configured to: calculate the angular difference between the direction angles of the two axis number clusters corresponding to each point-to-line collision encounter time among all the point-to-line collision encounter times; screen out the point-to-line collision encounter times corresponding to an angular difference less than 90 degrees to obtain the screened point-to-line collision encounter times.
[0034] In a third aspect, an embodiment of the present application provides a storage medium on which a computer program is stored. When the computer program is run by a processor, it executes the method described in the first aspect or any optional implementation manner of the first aspect.
[0035] In a fourth aspect, an embodiment of the present application provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device runs, the processor communicates with the memory through the bus. When the machine-readable instructions are executed by the processor, they execute the method described in the first aspect or any optional implementation manner of the first aspect.
[0036] In a fifth aspect, the present application provides a computer program product. When the computer program product runs on a computer, it causes the computer to execute the method in the first aspect or any possible implementation manner of the first aspect.
[0037] (3) Beneficial effects
[0038] The beneficial effects of the present invention are:
[0039] An embodiment of the present application provides a method and device for identifying axis networks in architectural drawings. By parsing all axis number primitives from the architectural drawings, determining the direction angle of the axis connected to each axis number primitive among all axis number primitives as the direction angle of the corresponding axis number primitive, clustering all axis number primitives based on the direction angles of all axis number primitives using DBSCAN to obtain multiple axis number clusters, detecting the collision relationships between the multiple axis number clusters to obtain a collision relationship detection result, and based on the collision relationship detection result, connecting and drawing all connection lines in the mask image including connection lines to obtain a drawn mask image, where the connection lines are used to connect the centers of all axis number primitives in their corresponding axis number clusters, and performing binarization processing on the drawn mask image to obtain a binarized mask image, determining the connected component partition result of the binarized mask image, and using a greedy matching algorithm to match the drawing names in the text primitives parsed from the architectural drawings with the connected component partition result to obtain the identification result of the axis network area in the architectural drawings. Compared with the existing manual identification scheme, it can improve the identification efficiency.
[0040] To make the above objects, features, and advantages to be achieved by the embodiments of the present application more obvious and understandable, the following specifically lists preferred embodiments and, in conjunction with the accompanying drawings, makes detailed descriptions as follows. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the accompanying drawings required to be used in the embodiments of the present application. It should be understood that the following drawings only show some embodiments of the present application and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.
[0042] Figure 1 Shows a flowchart of a method for identifying axis networks in architectural drawings provided by an embodiment of the present application;
[0043] Figure 2 Shows a structural block diagram of a device for identifying axis networks in architectural drawings provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0044] To better explain the present invention for easy understanding, the following will make a detailed description of the present invention through specific embodiments in conjunction with the accompanying drawings.
[0045] Currently, the design of construction design construction drawings is mainly carried out using computer software (such as CAD software). In the intelligent drawing review system, dividing the image in the drawing frame and matching it to the corresponding drawing name is an essential step in the drawing recognition scenario. The axis network in the floor plan is an important basis for dividing a single image. Detecting the axis network can be used as a benchmark for sub-drawing frame division.
[0046] In the intelligent drawing review system for construction design construction drawings, axis network positioning is a key step in dividing the drawing frame and matching the drawing name, and there are mainly the following two solutions:
[0047] One of the solutions is achieved by analyzing the connected domain, and it has the advantage of high computing efficiency and is suitable for simple scenarios. However, it has the problems of poor robustness to miscellaneous line interference, threshold selection relying on manual experience, and difficulty in adapting to complex drawing frame nesting scenarios;
[0048] Another solution is achieved through deep learning segmentation (such as, SegNet network, DeepLab network), and it has the advantage of relatively high local scene segmentation accuracy. However, it requires a large amount of labeled data, has poor interpretability, and has low computing efficiency in large and complex drawings (such as underground garage floor plans) due to the huge number of graphic elements (>100,000) and the extremely large drawing frame size (>100,000 pixels).
[0049] That is to say, in the existing solutions, the division of specific regions in the image is usually carried out by using connected domain solving or deep learning semantic segmentation methods. Common semantic segmentation networks include the SegNet network, DeepLab network, etc. Although the semantic segmentation method usually has good effects for local specific scenarios, in fact, for larger drawings such as residential buildings, especially underground garages, the segmentation effect is not ideal, requires a large amount of data for support, and there are also problems with the interpretability of confidence levels.
[0050] Based on this, the embodiments of the present application provide a method and device for identifying axis networks in architectural drawings. By parsing out all axis number primitives from the architectural drawings, determining the direction angle of the axis connected to each axis number primitive among all axis number primitives as the direction angle of the corresponding axis number primitive, clustering all axis number primitives based on the direction angles of all axis number primitives using DBSCAN (Density-Based Spatial Clustering of Applications with Noise, i.e., density-based clustering algorithm) to obtain multiple axis number clusters, detecting the collision relationships between multiple axis number clusters to obtain the collision relationship detection results, and based on the collision relationship detection results, connecting and drawing all connection lines in the mask image including connection lines to obtain the drawn mask image, where the connection lines are used to connect the centers of all axis number primitives in their corresponding axis number clusters, performing binarization processing on the drawn mask image to obtain the binarized mask image, determining the connected domain division result of the binarized mask image, and using a greedy matching algorithm to match the drawing names in the text primitives parsed from the architectural drawings with the connected domain division result to obtain the identification result of the axis network area in the architectural drawing. Compared with the existing manual identification scheme, it can improve the identification efficiency.
[0051] In addition, the present application uses a linear method to solve point-line collisions to replace the traditional image recognition method. While effectively locating the positions of axis numbers and axis networks, it reduces the number of input primitives, greatly reducing the time complexity. This end-to-end detection method also reduces the feature loss generated during the conversion between primitives and images.
[0052] To better understand the above technical solutions, the exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more clear and thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0053] Please refer to Figure 1 , Figure 1 which shows a flowchart of a method for identifying axis networks in architectural drawings provided by the embodiments of the present application. It should be understood that this identification method can be executed by a device for identifying axis networks in architectural drawings, and the specific device of this identification device can be set according to actual needs, and the embodiments of the present application are not limited thereto. For example, this identification device can be a computer or a server, etc. Specifically, this identification method includes:
[0054] Step S110: Parse all axis number primitives from the architectural drawing, and determine the direction angle of the axis connected to each axis number primitive among all axis number primitives as the direction angle of the corresponding axis number primitive.
[0055] Specifically, in this application, the architectural drawing can be exported through the DATAEXTRACTION (i.e., data extraction) function in CAD software to obtain the primitive data in the architectural drawing. Among them, the primitive data includes axis number primitives and text primitives, etc. The axis number primitive is composed of a circle primitive and the characters enclosed by the circle primitive, and the characters can be numbers, letters, or a combination of numbers and letters, etc.
[0056] In addition, this application can also determine the direction angle of the axis connected to each axis number primitive. For example, for a certain axis network area in the architectural drawing, if the axis number primitives on its left side are vertically distributed, the direction angle of the axis connected to each axis number primitive on its left side can be 0°; if the axis number primitives on its upper side are horizontally distributed, the direction angle of the axis connected to the axis number primitives on its upper side can be 270°; if the axis number primitives on its right side are vertically distributed, the direction angle of the axis connected to the axis number primitives on its right side can be 180°; if the axis number primitives on its lower side are horizontally distributed, the direction angle of the axis connected to the axis number primitives on its lower side can be 90°.
[0057] Furthermore, the direction angle of the axis connected to each axis number primitive can be determined as the direction angle of the corresponding axis number primitive. For example, when the direction angle of the axis connected to a certain axis number primitive is 0°, the direction angle of this axis number primitive is also 0°.
[0058] Step S120: Perform DBSCAN clustering on all axis number primitives based on the direction angles of all axis number primitives to obtain multiple axis number clusters.
[0059] Specifically, the DBSCAN clustering algorithm can be used to cluster the direction angles of all axis number primitives to obtain multiple axis number clusters. For example, for a certain axis network area in the architectural drawing, if the direction angles of multiple axis number primitives on its left side are all 0°, then the multiple axis number primitives on its left side can be one axis number cluster, and the direction angle of this axis number cluster is 0°.
[0060] Step S130: Detect the collision relationship between multiple axis number clusters to obtain the collision relationship detection result, and based on the collision relationship detection result, connect and draw all connection lines in the mask image including connection lines to obtain the drawn mask image. The connection lines are used to connect the centers of all axis number primitives in their corresponding axis number clusters.
[0061] Specifically, the collision relationship includes the point-to-point collision relationship between the rectangular centers of the minimum circumscribed rectangles corresponding to each of the multiple axis number clusters and the rectangular centers of other axis number clusters; the collision relationship detection result includes the detection result of the point-to-point collision relationship;
[0062] Moreover, the point-to-point collision relationship is obtained by solving the following linear equations:
[0063] ;
[0064] In the formula, represents the direction vector of the cluster center point of the i th axis number cluster, and the cluster center point of the i th axis number cluster is the rectangular center of the i th axis number cluster. Moreover, this direction vector can be represented by (cos(angle i ), sin(angle i )), and this angle i represents the direction angle of the i th axis number cluster. Regarding the direction vector hereafter, it will not be elaborated one by one. For details, please refer to the description here; represents the point-to-point collision encounter time corresponding to the i th axis number cluster; represents the cluster center point of the j th axis number cluster, and the cluster center point of the j th axis number cluster is the rectangular center of the j th axis number cluster; represents the cluster center point of the i th axis number cluster; represents the direction vector of the cluster center point of the j th axis number cluster; represents the point-to-point collision encounter time corresponding to the j th axis number cluster.
[0065] It should be noted here that for point-to-point collision, for each axis number cluster, it can be abstracted as a collision problem where the cluster center point of the axis number cluster emits at its direction angle (for example, 0°, 90°, etc.). Moreover, if there is a solution, it is determined that the two axis number clusters collide, and it can generate a connecting line segment for point-to-point collision in the mask image.
[0066] Furthermore, to avoid the situation where two clusters are far apart in the drawing of "axis number clusters", the point-to-line collision method is used to solve another connection relationship, that is, the collision relationship includes the point-to-line collision relationship between the rectangular center of the minimum circumscribed rectangle corresponding to each of the multiple axis number clusters and the connecting line segments corresponding to other axis number clusters; the collision relationship detection result includes the detection result of the point-to-line collision relationship;
[0067] And, the point-line collision relationship is obtained by solving the following parametric line equation:
[0068] ;
[0069] In the formula, pt represents the collision starting point of the point-line collision relationship; t represents the collision encounter time of the point-line collision; represents the direction vector of the collision starting point of the point-line collision relationship, and this direction vector can be represented by cos(angle1) or sin(angle1). This angle1 represents the direction angle of the axis number cluster and is also the direction angle of the point departure; p 1 and p 2 represent the two endpoints of the connecting line segment to be collided in other axis number clusters; u represents the point-line collision position, and it can be represented by a position percentage, that is, it represents the specific position of the point-line collision position in the connecting line segment.
[0070] Here it should be noted that for point-line collision, taking the cluster center point of each axial cluster as the collision starting point, collision solution is carried out on the connecting line segments connecting all axis number elements in other axis number clusters.
[0071] In addition, considering the situation where the starting directions of points and lines are the same when there are multiple sub-drawing frames (or multiple axis network areas) in an architectural drawing, the direction difference between the point and the axis number cluster is judged. Specifically:
[0072] Calculate the angle difference between the direction angles of the two axis number clusters corresponding to each point-line collision encounter time among all point-line collision encounter times, and filter out the point-line collision encounter times corresponding to the angle difference less than 90 degrees to obtain the filtered point-line collision encounter times, that is, filter out the point-line collision encounter times related to back-to-back collisions.
[0073] Here, the forward and back-to-back distinctions of point-line collision are considered. When the angle difference is less than 90 degrees, it is considered that the point passes through the line back-to-back, resulting in a back-to-back collision. Here, only the case of forward collision is considered. After screening, the collision equation is solved to obtain the encounter time of point-line collision.
[0074] Furthermore, determine the minimum point-to-point collision encounter time among all point-to-point collision encounter times corresponding to each axis number cluster, and determine the minimum filtered point-to-line collision encounter time among all filtered point-to-line collision encounter times corresponding to each axis number cluster.
[0075] Also, the line centers of the two axis number clusters corresponding to the minimum point-to-point collision encounter time in the mask image are connected and drawn. For example, if the minimum point-to-point collision encounter time of a certain axial cluster is the collision encounter time with the cluster center point of the first axial cluster, then in the mask image, the center point of the connection line segment of this axial cluster and the center point of the connection line segment of the first axial cluster are connected and drawn;
[0076] Also, based on the point-to-line collision position corresponding to the minimum filtered point-to-line collision encounter time, the collision starting points of the two axis number clusters corresponding to the minimum filtered point-to-line collision encounter time in the mask image and their point-to-line collision positions are connected and drawn to obtain the drawn mask image. For example, if the minimum filtered point-to-line collision encounter time of a certain axial cluster is the collision encounter time with the connection line segment of the second axial cluster, then in the mask image, the center point of the connection line segment of this axial cluster is connected to the point-to-line collision position in the second axial cluster.
[0077] Step S140: Perform binarization processing on the drawn mask image to obtain the binarized mask image, determine the connected component partitioning result of the binarized mask image, and use the greedy matching algorithm to match the drawing names in the text primitives parsed from the architectural drawing with the connected component partitioning result to obtain the recognition result of the axis network area in the architectural drawing.
[0078] Specifically, convert the drawn mask image into a binary image, and use the connected components solving function connectedComponents in the open-source computer vision library OpenCV to process the binary image to obtain the connected component partitioning result of the binarized mask image. Then, through the drawing name in the text primitive, perform greedy nearest matching on the drawing name and the connected component area to obtain the final sub-graph frame positioning result, that is, the recognition result of the axis network area in the architectural drawing. For example, the recognition result may include each axis network area and its drawing name.
[0079] Therefore, by means of the above technical solution, the present application uses a linear method to solve point-line collisions to replace the traditional image recognition method. While effectively positioning the axis numbers and the positions of the axis networks, the number of input primitives is reduced, greatly reducing the time complexity. This end-to-end detection method also reduces the feature loss generated during the conversion between primitives and images.
[0080] It should be understood that the above method for recognizing the axis network in the architectural drawing is only exemplary, and those skilled in the art can make various deformations according to the above method, and the deformed solutions also fall within the protection scope of the present application.
[0081] Please refer to Figure 2 , Figure 2The structural block diagram of a device 200 for identifying an axis network in a building drawing provided in an embodiment of the present application is shown. It should be understood that the identification device 200 can perform each step in the above method embodiment. The specific functions of the identification device 200 can be found in the description above. To avoid repetition, the detailed description is appropriately omitted here. The identification device 200 includes at least one software function module that can be stored in a memory in the form of software or firmware or solidified in the operating system (OS) of the identification device 200. Specifically, the identification device 200 includes:
[0082] The parsing and determining module 210 is used to parse all the axis number primitives from the architectural drawings, and determine the direction angle of the axis connected to each of the axis number primitives as the direction angle of the corresponding axis number primitive;
[0083] A clustering module 220 is used to perform DBSCAN clustering on all axis number primitives based on their direction angles to obtain multiple axis number clusters;
[0084] The detection and drawing module 230 is used to detect the collision relationship between multiple axis number clusters to obtain the collision relationship detection result, and based on the collision relationship detection result, connect and draw all the connecting line segments in the mask image including the connecting line segments to obtain the drawn mask image; wherein the connecting line segments are used to connect the centers of all the axis number primitives in the corresponding axis number cluster;
[0085] The matching module 240 is used to perform binarization processing on the drawn mask image to obtain the binarized mask image, determine the connected domain division result of the binarized mask image, and use a greedy matching algorithm to match the image name in the text primitive parsed from the architectural drawing with the connected domain division result to obtain the recognition result of the axis network area in the architectural drawing.
[0086] In a possible embodiment, the collision relationship includes a point-to-point collision relationship between the rectangular center of the minimum circumscribed rectangle corresponding to each axis number cluster in the plurality of axis number clusters and the rectangular center of other axis number clusters; the collision relationship detection result includes a point-to-point collision relationship detection result;
[0087] And, the point-to-point collision relationship is obtained by solving the following linear equation:
[0088] ;
[0089] In the formula, Indicates i The direction vector of the cluster center point of the axis number cluster, and the i The cluster center point of the axis number cluster is i The rectangular center of the axis number cluster; Indicates the point-to-point collision encounter time corresponding to the i th axis number cluster; Indicates the cluster center point of the j th axis number cluster, and the cluster center point of the j th axis number cluster is the rectangle center of the j th axis number cluster; Indicates the cluster center point of the i th axis number cluster; Indicates the direction vector of the cluster center point of the j th axis number cluster; Indicates the point-to-point collision encounter time corresponding to the j th axis number cluster.
[0090] In a possible embodiment, the collision relationship includes the point-line collision relationship between the rectangle centers of the minimum circumscribed rectangles corresponding to each axis number cluster in a plurality of axis number clusters and the connecting line segments corresponding to other axis number clusters; the collision relationship detection result includes the detection result of the point-line collision relationship;
[0091] And, the point-line collision relationship is obtained by solving the following parametric line equation:
[0092] ;
[0093] In the formula, pt represents the collision starting point of the point-line collision relationship; t represents the point-line collision encounter time; represents the direction vector of the collision starting point of the point-line collision relationship; p 1 and p 2 represent the two end points of the connecting line segment to be collided; u represents the point-line collision position.
[0094] In a possible embodiment, the detection and drawing module 230 is specifically configured to: determine the minimum point-to-point collision encounter time among all the point-to-point collision encounter times corresponding to each axis number cluster, and screen all the point-line collision encounter times to obtain the screened point-line collision encounter times, and determine the minimum screened point-line collision encounter time among all the screened point-line collision encounter times corresponding to each axis number cluster; connect and draw the line segment centers of the two axis number clusters corresponding to the minimum point-to-point collision encounter time in the mask image, and based on the point-line collision position corresponding to the minimum screened point-line collision encounter time, connect and draw the collision starting points of the two axis number clusters corresponding to the minimum screened point-line collision encounter time in the mask image and their point-line collision positions, to obtain the drawn mask image.
[0095] In a possible embodiment, the detection and drawing module 230 is specifically configured to: calculate the angular difference between the direction angles of two axis number clusters corresponding to each point-line collision encounter time among all the point-line collision encounter times; and filter out the point-line collision encounter times corresponding to an angular difference less than 90 degrees to obtain the filtered point-line collision encounter times.
[0096] Since the device described in the above embodiments of the present invention is the device adopted for implementing the method in the above embodiments of the present invention, based on the method described in the above embodiments of the present invention, those skilled in the art can understand the specific structure and variations of the device, and thus will not be elaborated herein. Any device adopted for the method in the above embodiments of the present invention falls within the scope of protection of the present invention.
[0097] This application provides a storage medium on which a computer program is stored, and when the computer program is run by a processor, it executes the method described in the embodiments.
[0098] This application also provides a computer program product, and when the computer program product runs on a computer, it causes the computer to execute the method described in the method embodiments.
[0099] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can be implemented in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can be implemented in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.
[0100] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions.
[0101] It should be noted that the words "a" or "an" preceding a component do not exclude the existence of a plurality of such components. The present invention can be implemented by means of hardware including several different components and by means of a suitably programmed computer. Among the several apparatuses listed, several of these apparatuses can be embodied by the same piece of hardware. The use of the words first, second, third, etc. is only for the convenience of expression and does not represent any order. These words can be understood as part of the component names.
[0102] In addition, it should be noted that in the description of this specification, the descriptions of terms such as "one embodiment", "some embodiments", "embodiment", "example", "specific example" or "some examples" mean that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0103] Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications after learning the basic creative concepts. Therefore, the technical solutions should be construed as including the preferred embodiments and all changes and modifications falling within the scope of the present invention.
[0104] Obviously, those skilled in the art can make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the technical solutions of the present invention and their equivalent technologies, the present invention should also include these modifications and variations.
Claims
1. A method for identifying the axis network in architectural drawings, characterized in that, Including: Parsing all axis number elements from the building drawings, and determining the direction angle of the axis connected to each axis number element among all the axis number elements as the direction angle of the corresponding axis number element; Performing DBSCAN clustering on all the axis number elements based on the direction angles of all the axis number elements to obtain multiple axis number clusters; Detecting the collision relationships among the multiple axis number clusters to obtain a collision relationship detection result, and based on the collision relationship detection result, connecting and drawing all the connecting line segments in the mask image including the connecting line segments to obtain a drawn mask image; wherein, the connecting line segments are used to connect the centers of all the axis number elements in their corresponding axis number clusters; Performing binarization processing on the drawn mask image to obtain a binarized mask image, determining the connected domain division result of the binarized mask image, and using a greedy matching algorithm to match the drawing name in the text elements parsed from the building drawings with the connected domain division result to obtain the recognition result of the axis network area in the building drawings; The collision relationships include the point-to-point collision relationships between the rectangular centers of the minimum circumscribed rectangles corresponding to each axis number cluster among the multiple axis number clusters and the rectangular centers of other axis number clusters; the collision relationship detection result includes the detection result of the point-to-point collision relationship; And, obtaining the point-to-point collision relationship by solving the following linear equation: ; In the formula, represents the direction vector of the cluster center point of the i th axis number cluster, and the cluster center point of the i th axis number cluster is the rectangular center of the i th axis number cluster; represents the point-to-point collision encounter time corresponding to the i th axis number cluster; represents the cluster center point of the j th axis number cluster, and the cluster center point of the j th axis number cluster is the rectangular center of the j th axis number cluster; represents the cluster center point of the i th axis number cluster; represents the direction vector of the cluster center point of the j th axis number cluster; represents the point-to-point collision encounter time corresponding to the j th axis number cluster; The collision relationships include the point-to-line collision relationships between the rectangular centers of the minimum circumscribed rectangles corresponding to each axis number cluster among the multiple axis number clusters and the connecting line segments corresponding to the other axis number clusters; the collision relationship detection result includes the detection result of the point-to-line collision relationship; And, obtaining the point-to-line collision relationship by solving the following parametric line equation: ; Wherein, pt The collision starting point representing the point-line collision relationship; t The collision encounter time representing the point-line collision; The direction vector of the collision starting point representing the point-line collision relationship; p 1 and p 2 represent the two endpoints of the connecting line segment to be collided; u The point-line collision position.
2. The recognition method according to claim 1, wherein The connecting and drawing all the connecting line segments in the mask image including the connecting line segments based on the collision relationship detection result to obtain a drawn mask image includes: Determining the minimum point-to-point collision encounter time among all the point-to-point collision encounter times corresponding to each axis number cluster, and screening all the point-to-line collision encounter times to obtain the screened point-to-line collision encounter times, and determining the minimum screened point-to-line collision encounter time among all the screened point-to-line collision encounter times corresponding to each axis number cluster; Connecting and drawing the line segment centers of the two axis number clusters corresponding to the minimum point-to-point collision encounter time in the mask image, and based on the point-to-line collision position corresponding to the minimum screened point-to-line collision encounter time, connecting and drawing the collision starting points of the two axis number clusters corresponding to the minimum screened point-to-line collision encounter time and their point-to-line collision positions in the mask image to obtain the drawn mask image.
3. The recognition method according to claim 2, characterized in that, The screening all the point-to-line collision encounter times to obtain the screened point-to-line collision encounter times includes: Calculating the angle difference between the direction angles of the two axis number clusters corresponding to each point-to-line collision encounter time among all the point-to-line collision encounter times; Filter out the point-line collision encounter times corresponding to the angle differences less than 90 degrees to obtain the filtered point-line collision encounter times.
4. An identification device for axis networks in architectural drawings, characterized in that, Including: An analysis and determination module for parsing all axis number elements from the building drawing and determining the direction angle of the axis connected to each axis number element among all the axis number elements as the direction angle of the corresponding axis number element; A clustering module for performing DBSCAN clustering on all the axis number elements based on the direction angles of all the axis number elements to obtain multiple axis number clusters; A detection and drawing module for detecting the collision relationships among the multiple axis number clusters to obtain a collision relationship detection result, and based on the collision relationship detection result, connecting and drawing all the connecting line segments in the mask image including the connecting line segments to obtain a drawn mask image; wherein the connecting line segments are used to connect the centers of all the axis number elements in their corresponding axis number clusters; A matching module for performing binarization processing on the drawn mask image to obtain a binarized mask image, determining the connected domain division result of the binarized mask image, and using a greedy matching algorithm to match the drawing names in the text elements parsed from the building drawing with the connected domain division result to obtain the recognition result of the axis network area in the building drawing; The collision relationships include the point-to-point collision relationships between the rectangular centers of the minimum circumscribed rectangles corresponding to each axis number cluster among the multiple axis number clusters and the rectangular centers of other axis number clusters; the collision relationship detection result includes the detection result of the point-to-point collision relationship; And, obtaining the point-to-point collision relationship by solving the following linear equation: ; wherein, represents the direction vector of the cluster center point of the i th axis number cluster, and the cluster center point of the i th axis number cluster is the rectangular center of the i th axis number cluster; represents the point-to-point collision encounter time corresponding to the i th axis number cluster; represents the cluster center point of the j th axis number cluster, and the cluster center point of the j th axis number cluster is the rectangular center of the j th axis number cluster; represents the cluster center point of the i th axis number cluster; represents the direction vector of the cluster center point of the j th axis number cluster; represents the point-to-point collision encounter time corresponding to the j th axis number cluster; The collision relationships include the point-line collision relationships between the rectangular centers of the minimum circumscribed rectangles corresponding to each axis number cluster among the multiple axis number clusters and the connecting line segments corresponding to the other axis number clusters; the collision relationship detection result includes the detection result of the point-line collision relationship; And, obtaining the point-line collision relationship by solving the following parametric line equation: ; In the formula, pt represents the collision starting point of the point-line collision relationship; t represents the collision encounter time of the point-line collision; represents the direction vector of the collision starting point of the point-line collision relationship; p 1 and p 2 represent the two endpoints of the connecting line segment to be collided; u represents the point-line collision position.
5. The identification device according to claim 4, wherein The detection and drawing module is specifically configured to: determine the minimum point-to-point collision encounter time among all the point-to-point collision encounter times corresponding to each axis number cluster, and screen all the point-line collision encounter times to obtain the filtered point-line collision encounter times, and determine the minimum filtered point-line collision encounter time among all the filtered point-line collision encounter times corresponding to each axis number cluster; connect and draw the line segment centers of the two axis number clusters corresponding to the minimum point-to-point collision encounter time in the mask image, and based on the point-line collision position corresponding to the minimum filtered point-line collision encounter time, connect and draw the collision starting points of the two axis number clusters corresponding to the minimum filtered point-line collision encounter time and their point-line collision positions in the mask image to obtain the drawn mask image.
6. The identification device according to claim 5, characterized in that, The detection and drawing module is specifically configured to: calculate the angular difference between the direction angles of the two axis number clusters corresponding to each point-line collision encounter time among all the point-line collision encounter times; filter out the point-line collision encounter times corresponding to the angular differences less than 90 degrees to obtain the filtered point-line collision encounter times.
Citation Information
Patent Citations
Collision correction method for real-time hair motion simulation
CN103942376A
AI-based axis network identification method and system, terminal and medium
CN119418361A