Method for identifying connection relation between elements in drawing

By combining rule-based reasoning with probabilistic supplementation, the connection relationships between components in drawings are identified, solving the problem of high misjudgment rate in dense areas by traditional methods, and achieving high accuracy and robustness in connection relationship identification.

CN121963238APending Publication Date: 2026-05-01CHINA NUCLEAR POWER OPERATION TECH CORP +2
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA NUCLEAR POWER OPERATION TECH CORP
Filing Date
2025-11-28
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Traditional line detection algorithms are easily interfered with in densely packed areas of drawings, resulting in a high rate of false positives and low accuracy in identifying connections.

Method used

By combining rule-based reasoning with probabilistic supplementation, the connection relationships between components in the drawing are identified through steps such as initializing the connection relationship matrix, iterative reasoning for deterministic connections, calculating overlap and connection ratio, and corner feature detection.

Benefits of technology

It significantly improves the accuracy of identifying connections in dense areas, reduces interference from intersecting lines and noise, and enhances the integrity and robustness of identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121963238A_ABST
    Figure CN121963238A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of drawing element connection relation identification, and discloses a method for identifying a connection relation between elements in a drawing, which comprises the following steps: identifying elements and acquiring positions and types, extracting connection point information and calculating absolute coordinates of the connection point information, initializing a connection relation matrix, and detecting line segments between candidate connection points. Iteratively reasoning and updating deterministic connections in the connection matrix based on the length ratio of the line segments and the number constraint of the connection points, for candidate pairs of non-deterministic connections, calculating the ratio of the overlap ratio to the connection lines, weighting to obtain probability scores, sorting according to the scores, and selecting possibility connections to update the matrix according to the number of the remaining connection points; the method comprises the following steps: refining a drawing, detecting angular point and right angle characteristics, searching nearest element connection points along two sides of a right angle, establishing corner connection relations after no blocking is verified, integrating all the connection relations, detecting bidirectional consistency, marking abnormities, and generating a standard format report. According to the invention, the recognition accuracy of the dense region connection relation can be improved, and cross lines and noise interference are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

A method for identifying the connection relationships between components in a drawing. Technical Field

[0001] This application belongs to the field of technical field of identification of connection relationships between components in drawings, and particularly relates to a method for identifying the connection relationships between components in drawings. Background Technology

[0002] With the advancement of digitalization, a large number of paper drawings in engineering projects need to be converted into digital formats for archiving, storage, and secondary development. Utilizing artificial intelligence technology to identify components, text, and connections in drawings has become an important means of improving efficiency and reducing labor costs.

[0003] Traditional methods typically employ line detection algorithms such as Hough transform, least squares method, LSD, and EDLines to identify line segments, and then infer the connection relationship by analyzing the components connecting the two ends of the line segment. However, in complex scenarios such as crowded drawings, numerous intersecting lines, and interference from non-connecting line segments, these methods are easily affected by noise, leading to a high misjudgment rate of connection relationships and a significant decrease in recognition accuracy. Summary of the Invention

[0004] The purpose of this application is to provide a method for identifying the connection relationship between components in a drawing, and to solve the problems of traditional line detection algorithms being easily interfered with in dense areas of the drawing, having a high misjudgment rate of intersecting line segments, and having a low accuracy rate in identifying connection relationships.

[0005] To achieve the above objectives, this application provides the following technical solution:

[0006] A method for identifying the connection relationships between components in a drawing includes:

[0007] Step 1: Input the drawing image, preprocess it to identify the components and obtain their positions and types, extract the connection point information and calculate their absolute coordinates, and initialize the connection relationship matrix;

[0008] Step 2: Within the preset direction search range of each element, detect line segments between candidate connection points. Based on the line segment length ratio and the number of connection points, iteratively reason and update the deterministic connections in the connection matrix.

[0009] Step 3: For candidate pairs with uncertain connections, calculate the overlap and connection ratio, weight them to obtain probability scores, sort them by score, and select the probability connection update matrix based on the number of remaining connection points;

[0010] Step 4: After refining the drawing, check the corner points and right angle features, search for the nearest component connection points along both sides of the right angle, and establish the corner connection relationship after verifying that there are no obstructions.

[0011] Step 5: Integrate all connections, verify bidirectional consistency and mark anomalies, and generate a standardized report containing confidence levels and anomaly alerts.

[0012] As one feasible approach, step 1 includes:

[0013] Step 1.1: Preprocess the input engineering drawing image to eliminate noise points and discontinuous line segments generated during the scanning process;

[0014] Step 1.2: Use an object detection algorithm to identify various components in the drawing and obtain the bounding box coordinates, center point position, and component type label for each component;

[0015] Step 1.3: Extract the corresponding connection point information from the predefined component attribute library according to the component type;

[0016] Step 1.4: Calculate the absolute coordinates of the connection points of each component in the four directions and establish a coordinate table of component connection points;

[0017] Step 1.5: Initialize the connection relationship matrix and store the connection status between elements.

[0018] As one feasible approach, in step 1.1, preprocessing includes image denoising, binarization, and morphological operations.

[0019] As one feasible approach, in step 1.3, the connection point information includes the number of connection points, the direction of the connection points relative to the center of the component, and the positional offset of the connection points.

[0020] As one feasible approach, step 2 includes:

[0021] Step 2.1: For each element, set the search range in its four directions;

[0022] Step 2.2: Within the search range in each direction, find the connection points of other elements and establish a list of candidate connection elements;

[0023] Step 2.3: For each pair of candidate connection elements, detect straight line segments between their connection points;

[0024] Step 2.4: Calculate the ratio of the detected straight line segment length to the actual distance between the component connection points to determine whether the connection is a deterministic connection;

[0025] Step 2.5: Apply the uniqueness constraint rule. If the number of candidate elements for a certain element in a certain direction is equal to the number of connection points defined in that direction, then all candidate connections in that direction are confirmed as deterministic connections.

[0026] Step 2.6: Apply attribute constraint rules. If the number of deterministic connections of a component in a certain direction has reached the upper limit of the number of connection points defined in that direction, then delete other possible connections in that direction.

[0027] Step 2.7: Repeat steps 2.5 and 2.6 until the connection relationship no longer changes, thus achieving iterative reasoning.

[0028] As an implementable approach, in step 2.3, the LSD algorithm is used to detect straight line segments between its connection points.

[0029] As one feasible approach, step 3 includes:

[0030] Step 3.1: Traverse all candidate element pairs that have not established deterministic connections and calculate the overlap parameter D;

[0031] Step 3.2: Calculate the connection ratio parameter G, G = length of detected straight line segment / actual distance between components. When no straight line is detected, G = 0.

[0032] Step 3.3: Calculate the overall probability score P;

[0033] Step 3.4: For each component in each direction, sort the candidate connections in descending order according to the probability score P;

[0034] Step 3.5: Based on the number of remaining connection points of the element in this direction, select the top N candidate connections from the sorted list as possible connections and update the connection relationship matrix.

[0035] As an feasible approach, the overlap degree D is calculated as follows:

[0036] Let the projection interval of element A in a certain direction be [a1,a2], and the corresponding projection interval of element B be [b1,b2]. Then the overlap length is max(0,min(a2,b2)-max(a1,b1)), and the overlap degree D = overlap length / min(a2-a1,b2-b1).

[0037] As an feasible approach, the overall probability score is P = 0.6 × D + 0.4 × G.

[0038] As one feasible approach, step 4 includes:

[0039] Step 4.1: Refine the preprocessed drawing image, unifying straight lines of different thicknesses to a single pixel width;

[0040] Step 4.2: Apply the Harris corner detection algorithm to the thinned image, with the detection parameters set as follows: corner response threshold 0.01, non-maximum suppression window size 3×3;

[0041] Step 4.3: For each detected corner point, construct a 7×7 local detection window centered on the corner point;

[0042] Step 4.4: Within the local detection window, detect straight lines and set the minimum line length;

[0043] Step 4.5: Calculate the angle between the detected pairs of lines. When the angle is within the range of 85° to 95°, it is determined to be a right angle feature.

[0044] Step 4.6: For the identified right-angle connections, determine the direction of the connected components based on the extension directions of the two sides of the right angle;

[0045] Step 4.7: Search for the nearest component connection points along both right-angle directions to establish connections through the corners;

[0046] Step 4.8: Check if there are any other components blocking the connection path. If there are any obstructions, cancel the connection.

[0047] As one feasible approach, step 5 includes:

[0048] Step 5.1: Generate a complete connection matrix based on all the obtained connections;

[0049] Step 5.2: Perform a consistency check on the connection relationship. If component A is connected to component B, then component B should also be connected to component A to ensure the bidirectionality of the connection relationship.

[0050] Step 5.3: Count the actual number of connections for each component, compare it with the defined number of connection points, and mark abnormal components;

[0051] Step 5.4: Generate a connectivity report, including a component list, connectivity list, confidence score, and abnormal connectivity alerts;

[0052] Step 5.5: Output the connection results.

[0053] Compared with the prior art, the method for identifying the connection relationships between components in drawings provided in this application has the following advantages:

[0054] This application presents a high-accuracy connection relationship recognition method that combines rule-based reasoning with probabilistic supplementation. Rule-based reasoning significantly improves the accuracy of identifying connection relationships in dense regions while reducing interference from intersecting lines and noise.

[0055] This application effectively supplements the problem of missed identification caused by incomplete line detection or dashed line annotation by using a probabilistic model.

[0056] The inflection point detection mechanism in this application can identify multiple broken line connections, enhancing the completeness and robustness of recognition in complex scenarios.

[0057] The overall method of this application takes into account both deterministic and probabilistic reasoning, and has higher recognition accuracy and efficiency. Attached Figure Description

[0058] To more clearly illustrate the technical solution of this application, the accompanying drawings used in the technical description will be briefly introduced below.

[0059] Figure 1 is a flowchart of the method for identifying the connection relationship between components in a drawing provided in this application;

[0060] Figure 2 is a schematic diagram of step 1 of the method for identifying the connection relationship between components in a drawing provided in this application;

[0061] Figure 3 is a schematic diagram of step 2 of the method for identifying the connection relationship between components in a drawing provided in this application;

[0062] Figure 4 is a schematic diagram of step 3 of the method for identifying the connection relationship between components in a drawing provided in this application;

[0063] Figure 5 is a schematic diagram of step 4 of the method for identifying the connection relationship between components in a drawing provided in this application;

[0064] Figure 6 is a schematic diagram of step 5 of the method for identifying the connection relationship between components in the drawings provided in this application. Detailed Implementation

[0065] The following detailed description provides further details on specific implementation methods.

[0066] As shown in Figures 1 to 6, this application provides a method for identifying the connection relationships between components in a drawing, comprising the following steps:

[0067] Step 1: Input the preprocessed engineering drawing image and extract the components and their attribute information. Input the drawing image, preprocess it to identify the components and obtain their positions and types, extract the connection point information and calculate their absolute coordinates, and finally initialize the connection relationship matrix.

[0068] Step 2: Identify deterministic connections based on rule-based reasoning. Within the preset directional search range of each element, detect line segments between candidate connection points. Based on the line segment length ratio and the number of connection points, iteratively reason and update the deterministic connections in the connection matrix.

[0069] Step 3: Supplement possible connections based on the probabilistic model. For candidate pairs with uncertain connections, calculate the overlap and connection ratio, weight them to obtain probability scores, sort them by score, and select the possible connection update matrix based on the number of remaining connection points.

[0070] Step 4: Identify complex connection relationships based on inflection point detection. After refining the drawing, detect corner points and right angle features, search for the nearest component connection points along both sides of the right angle, and establish corner connection relationships after verifying that there are no obstructions.

[0071] Step 5: Output the complete results of component connection relationships. Integrate all connection relationships, verify bidirectional consistency, mark anomalies, and finally generate a standardized format report including confidence levels and anomaly warnings.

[0072] Step 1 specifically includes:

[0073] Step 1.1: Preprocess the input engineering drawing image, including image denoising, binarization and morphological operations, to eliminate noise points and discontinuous line segments generated during the scanning process.

[0074] Step 1.2: Use an object detection algorithm to identify various components in the drawing and obtain the bounding box coordinates, center point position, and component type label for each component.

[0075] Step 1.3: Extract the corresponding connection point information from the predefined component attribute library according to the component type, including the number of connection points, the direction (up, down, left, right) of the connection point relative to the component center, and the position offset.

[0076] Step 1.4: Calculate the absolute coordinates of the connection points of each component in the four directions and establish a coordinate table of component connection points.

[0077] Step 1.5: Initialize the connection relationship matrix to store the connection status between components. The initial value of the matrix elements is set to 0, indicating an unconnected state.

[0078] Step 2 specifically includes:

[0079] Step 2.1: For each component, set the search range in its four directions. For example, set the width of the search range to 1.2 times the width of the component and the length to half the size of the drawing.

[0080] Step 2.2: Within the search range in each direction, find the connection points of other elements and establish a list of candidate connection elements.

[0081] Step 2.3: For each pair of candidate connection elements, use the LSD (Line Segment Detector) algorithm to detect line segments between their connection points.

[0082] Step 2.4: Calculate the ratio R = L_line / L_actual between the detected line segment length L_line and the actual distance L_actual between the component connection points. For example, when R ≥ 0.9, the connection is determined to be a deterministic connection, and the corresponding position in the connection relationship matrix is ​​set to 1.

[0083] Step 2.5: Apply the uniqueness constraint rule: If the number of candidate elements for a certain element in a certain direction is equal to the number of connection points defined in that direction, then all candidate connections in that direction are confirmed as deterministic connections.

[0084] Step 2.6: Apply attribute constraint rules: If the number of deterministic connections of a component in a certain direction has reached the upper limit of the number of connection points defined in that direction, then delete other possible connections in that direction.

[0085] Step 2.7: Repeat steps 2.5 and 2.6 until the connection relationship no longer changes, thus achieving iterative reasoning.

[0086] Step 3 specifically includes:

[0087] Step 3.1: Traverse all candidate element pairs that have not established deterministic connections and calculate the overlap parameter D.

[0088] The calculation method for the overlap parameter D is as follows: Let the projection interval of element A in a certain direction be [a1,a2], and the corresponding projection interval of element B be [b1,b2]. Then the overlap length is max(0,min(a2,b2)-max(a1,b1)), and the overlap degree D = overlap length / min(a2-a1,b2-b1).

[0089] Step 3.2: Calculate the connection ratio parameter G, G = length of detected straight line segment / actual distance between components. When no straight line is detected, G = 0.

[0090] Step 3.3: Calculate the comprehensive probability score P = 0.6 × D + 0.4 × G, where the weighting coefficients can be adjusted according to the actual application scenario.

[0091] Step 3.4: For each component in each direction, sort the candidate connections in descending order according to the probability score P.

[0092] Step 3.5: Based on the number of remaining connection points of the element in this direction, select the top N candidate connections from the sorted list as possible connections and update the connection relationship matrix.

[0093] Step 4 specifically includes:

[0094] Step 4.1: The preprocessed drawing image is thinned by using the Zhang-Suen thinning algorithm to unify straight lines of different thicknesses into a single pixel width.

[0095] Step 4.2: Apply the Harris corner detection algorithm to the thinned image. The detection parameters are set as follows: corner response threshold 0.01, non-maximum suppression window size 3×3.

[0096] Step 4.3: For each detected corner point, construct a 7×7 local detection window centered on the corner point.

[0097] Step 4.4: Within the local detection window, use Hough transform to detect straight lines, and set the minimum line length to 3 pixels.

[0098] Step 4.5: Calculate the angle between the detected pairs of lines. When the angle is within the range of 85° to 95°, it is determined to be a right angle feature.

[0099] Step 4.6: For the identified right-angle connections, determine the direction of the connected components based on the extension direction of the two sides of the right angle: horizontal line segments correspond to left-right connections, and vertical line segments correspond to up-down connections.

[0100] Step 4.7: Search for the nearest component connection points along the two right-angle directions respectively, and establish the connection relationship through the corner.

[0101] Step 4.8: Verify the rationality of the corner connection: Check if there are other components blocking the connection path. If there are obstructions, cancel the connection.

[0102] Step 5 specifically includes:

[0103] Step 5.1: Integrate all the connection relationships obtained in Steps 2, 3, and 4 to generate a complete connection relationship matrix.

[0104] Step 5.2: Perform a consistency check on the connection relationship: If component A is connected to component B, then component B should also be connected to component A to ensure the bidirectionality of the connection relationship.

[0105] Step 5.3: Count the actual number of connections for each component, compare it with the defined number of connection points, and mark abnormal components.

[0106] Step 5.4: Generate a connection relationship report, including: component list, connection relationship list, confidence score, and abnormal connection alerts.

[0107] Step 5.5: Output the connection results in JSON or XML format for easy subsequent digital processing and system integration applications.

[0108] In this application, the deterministic connection relationship identification based on rule-based reasoning is as follows:

[0109] Orientation constraints: The connection points of components are limited to four directions: up, down, left, and right, which serves as an initial screening of potential target components for connection;

[0110] Line verification: Detect the existence of a straight line between candidate components. If the length of the straight line is equal to the distance between the components, it is determined to be a deterministic connection.

[0111] Uniqueness constraint: If the number of candidate elements in a certain direction is the same as the number of connection points in that direction, then all of them are confirmed as deterministic connections;

[0112] Attribute constraint: If the number of deterministic connections in a certain direction meets the number of connection points defined in the element definition, delete the remaining possible connections;

[0113] Iterative reasoning: Repeat the above process to achieve automatic reasoning and confirmation of connection relationships.

[0114] In this application, the probability connection based on the probabilistic model is supplemented as follows:

[0115] Calculate the overlap ratio (D): Evaluate the proportion of overlapping surfaces between components; the higher the proportion, the greater the likelihood of connection.

[0116] Calculate the connection ratio (G): Evaluate the ratio of the straight line length to the actual spacing; the higher the ratio, the greater the likelihood of a connection.

[0117] Probability sorting: When the number of possible connections in a certain direction exceeds the defined number of connection points, sort by the combined value of D and G, and prioritize retaining high probability connections.

[0118] In this application, inflection point detection is introduced to identify complex connectivity relationships, as follows:

[0119] Image thinning: unifies lines of different thicknesses to a single pixel width, eliminating line width interference;

[0120] Corner detection: Identifying turning points in an image;

[0121] Right angle recognition: Construct a local grid in the inflection point region and detect whether there is a combination of straight lines that meet the right angle characteristics;

[0122] Connection direction recognition: Determine the connection direction based on the area where the right-angled side is located, and complete the connection relationship through the corner.

[0123] This application can be integrated into a drawing digitization software system and is applicable to the automatic recognition and conversion of various engineering drawings, such as electrical, piping, and architectural drawings.

[0124] The above description is only a specific embodiment of this application, but the protection scope of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the protection scope of this application.

Claims

1. A method for identifying the connection relationships between components in a drawing, characterized in that, Including: Step 1: Input drawing image, preprocess and identify components and obtain their position and type, extract connection point information and calculate their absolute coordinates, initialize connection relationship matrix; Step 2: Within the preset search range of each component, detect line segments between candidate connection points. Based on the line segment length ratio and the number of connection points, iteratively reason and update the deterministic connections in the connection matrix. Step 3: For candidate pairs of uncertain connections, calculate the overlap and connection ratio, weight them to obtain probability scores, sort them by score, and select possible connections to update the matrix based on the remaining number of connection points. Step 4: After refining the drawing, detect corner points and right angle features, search for the nearest component connection points along both sides of the right angle, and establish corner connection relationships after verifying that there are no obstructions. Step 5: Integrate all connection relationships, check bidirectional consistency and mark anomalies, and generate a standardized format report containing confidence level and anomaly prompts.

2. The method for identifying the connection relationships between components in a drawing according to claim 1, characterized in that, Step 1 includes: Step 1.1: Preprocessing the input engineering drawing image to eliminate noise points and discontinuous line segments generated during scanning; Step 1.2: Using a target detection algorithm to identify various components in the drawing and obtaining the bounding box coordinates, center point position, and component type label for each component; Step 1.3: Extracting the corresponding connection point information from a predefined component attribute library according to the component type; Step 1.4: Calculating the absolute coordinates of the connection points of each component in four directions and establishing a component connection point coordinate table; Step 1.5: Initializing the connection relationship matrix and storing the connection status between components.

3. The method for identifying the connection relationships between components in a drawing according to claim 2, characterized in that, In step 1.1, preprocessing includes image denoising, binarization, and morphological operations.

4. The method for identifying the connection relationships between components in a drawing according to claim 2, characterized in that, In step 1.3, the connection point information includes the number of connection points, the direction of the connection points relative to the center of the component, and the positional offset of the connection points.

5. The method for identifying the connection relationships between components in a drawing according to claim 1, characterized in that, Step 2 includes: Step 2.1: For each element, set the search range in its four directions; Step 2.2: Within the search range in each direction, find the connection points of other elements and establish a list of candidate connection elements; Step 2.3: For each pair of candidate connection elements, detect straight line segments between their connection points; Step 2.4: Calculate the ratio of the length of the detected straight line segment to the actual distance between the element connection points to determine whether the connection is a deterministic connection; Step 2.5: Apply the uniqueness constraint rule: if the number of candidate elements of an element in a certain direction is equal to the number of connection points defined in that direction, then all candidate connections in that direction are confirmed as deterministic connections; Step 2.6: Apply the attribute constraint rule: if the number of deterministic connections of an element in a certain direction has reached the upper limit of the number of connection points defined in that direction, then delete other possible connections in that direction; Step 2.7: Repeat steps 2.5 and 2.6 until the connection relationship no longer changes, thus achieving iterative reasoning.

6. The method for identifying the connection relationships between components in a drawing according to claim 1, characterized in that, Step 3 includes: Step 3.1: Traverse all candidate element pairs that have not established deterministic connections and calculate the overlap parameter D; Step 3.2: Calculate the connection ratio parameter G, G = length of detected straight line segments / actual distance between elements, G = 0 when no straight line is detected; Step 3.3: Calculate the comprehensive probability score P; Step 3.4: For each direction of each element, sort the candidate connections in descending order according to the probability score P; Step 3.5: Based on the number of remaining connection points of the element in that direction, select the top N candidate connections from the sorted list as possible connections and update the connection relationship matrix.

7. The method for identifying the connection relationships between components in a drawing according to claim 6, characterized in that, The calculation method for the overlap degree D is as follows: Let the projection interval of element A in a certain direction be [a1,a2], and the corresponding projection interval of element B be [b1,b2]. Then the overlap length is max(0,min(a2,b2)-max(a1,b1)), and the overlap degree D = overlap length / min(a2-a1,b2-b1).

8. The method for identifying the connection relationships between components in a drawing according to claim 6, characterized in that, The overall probability score is P = 0.6 × D + 0.4 × G.

9. The method for identifying the connection relationships between components in a drawing according to claim 1, characterized in that, Step 4 includes: Step 4.1: Refine the preprocessed drawing image, unifying lines of different thicknesses to a single pixel width; Step 4.2: Apply the Harris corner detection algorithm to the refined image, with detection parameters set as follows: corner response threshold 0.01, non-maximum suppression window size 3×3; Step 4.3: For each detected corner, construct a 7×7 local detection window centered on the corner; Step 4.4: Detect lines within the local detection window, setting a minimum line length; Step 4.5: Calculate the angle between detected line pairs, identifying right angles when the angle is between 85° and 95°; Step 4.6: For identified right-angle connections, determine the direction of the connected components based on the extension directions of the two sides of the right angle; Step 4.7: Search for the nearest component connection points along both directions of the right angle, establishing a connection relationship through the corner; Step 4.8: Check if there are other components obstructing the connection path, canceling the connection relationship if obstruction exists.

10. The method for identifying the connection relationships between components in a drawing according to claim 1, characterized in that, Step 5 includes: Step 5.1: Generate a complete connection matrix based on all obtained connections; Step 5.2: Perform a consistency check on the connections. If component A is connected to component B, then component B should also be connected to component A to ensure the bidirectionality of the connections; Step 5.3: Count the actual number of connections for each component and compare it with the defined number of connection points, marking abnormal components; Step 5.4: Generate a connection report, including a component list, a connection list, a confidence score, and abnormal connection alerts; Step 5.5: Output the connection results.