Wiring relation identification method for electrical main wiring diagram fusing CAD (Computer Aided Design) data and image
Through the electrical main wiring diagram recognition method that integrates CAD data and images, the Canny edge detection and object detection algorithm are used to identify electrical equipment elements, and the wiring data is integrated with the width priority search algorithm, which solves the problems of low electrical drawing recognition efficiency and identification error in the prior art, and achieves the effect of efficiently identifying the connection relationship of electrical equipment.
Patent Information
- Application Number
- CN202411754473.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-12-02
AI Technical Summary
The prior art is inefficient in the identification and verification of electrical drawings, with manual subjectivity and identification errors, which affect the safe operation of the substation.
The wiring relationship recognition method of the main electrical wiring diagram fusing CAD data and images is adopted. The electrical equipment element and text labeling frame are identified through the Canny edge detection algorithm and the target detection algorithm. The complete wiring data is integrated with the width priority search algorithm, interfering line segments are removed, busbars and loop starting points are identified, and connection relationships are defined to identify wiring relationships.
It improves the efficiency of identifying the connection relationship of electrical equipment in the main electrical wiring diagram, reduces the workload of manual verification, improves the efficiency of drawing verification, and accurately recognizes the wiring relationship and the topological structure of electrical elements in complex drawings.
Smart Images

Figure CN119785375A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent recognition of electrical design drawings, and in particular to a method for identifying wiring relationships of electrical main wiring diagrams by integrating CAD data and images. Background Art
[0002] The main electrical wiring diagram is an important part of substation design, and its accuracy is directly related to the safe operation of the substation. When designing the electrical drawings of the substation, it is necessary to read the main electrical wiring diagram and verify its internal wiring relationship to ensure the correctness of the drawing.
[0003] At present, the identification and verification of electrical drawings are all done manually, which is inefficient and wastes human resources. In addition, manual verification is subjective and prone to verification errors, which in turn affects the safe operation of the substation.
[0004] The prior art CN103514303B electrical component wiring diagram recognition method and system discloses parsing entity objects in CAD drawings through depth-first traversal technology, automatically identifying legend and non-legend graphics, and matching related text based on the calculation results of the bounding box of the graphics to improve the quality and standardization of electrical drawing design.
[0005] In the prior art, this method can identify objects such as electrical poles and towers, and conduct quality assessment and rectification suggestions on drawings, aiming to improve the maintenance efficiency and reliability of the power supply system. However, it may have limitations in the recognition of some elements in complex drawings, and is overly dependent on the legends in the drawings. It cannot accurately identify the wiring of drawings that do not contain legends. Summary of the invention
[0006] In order to solve the above problems existing in the prior art, the present invention proposes a method for identifying the wiring relationship of an electrical main wiring diagram by integrating CAD data and images.
[0007] The technical solution of the present invention is as follows:
[0008] On the one hand, the present invention provides a method for identifying the wiring relationship of an electrical main wiring diagram by integrating CAD data and an image, and the specific steps include:
[0009] Convert the collected DWG format electrical main wiring diagram into a high-resolution JPG format drawing, use the Canny edge detection algorithm to clip the outline of the drawing, and then use the target detection algorithm to identify the relative coordinates and categories of the electrical equipment graphics and text annotation boxes in the drawing, and number each electrical equipment graphics;
[0010] Traverse the entity space of the original DWG drawing, parse out the data of all straight line entities and polyline entities, record the endpoint coordinates and line type of each line segment entity, and convert the endpoint coordinate data into normalized coordinates in the same format as the target detection algorithm according to the drawing range;
[0011] Identify busbars and circuit starting points in the physical space of the original DWG drawing;
[0012] Integrate the complete wiring original data according to the straight line and polyline entity data, remove the straight line in the primitive frame and the line segments in the rectangular area near the busbar step by step, obtain the complete wiring segment and primitive frame, and record the corresponding number, endpoint and linear data of the wiring segment and primitive frame;
[0013] Predefine the connection relationship, traverse all the wiring segments and primitive frames, and obtain a list of connection relationships between the wiring segment and the primitive frame or between two wiring segments according to the connection relationship;
[0014] Based on the breadth-first search algorithm, all connection relationship lists are searched to obtain the list of connected graphic element wiring ids, and then the corresponding wiring id is found by traversing the position of the line segment at the starting point of the loop. Finally, the wiring id is added to each loop starting point according to its position in the connection id list.
[0015] As a preferred implementation, the step of identifying the busbar and the loop starting point in the physical space in the original DWG drawing is specifically as follows:
[0016] The busbar data of the electrical main line diagram is generally stored in the multi-line entity in the entity space of the DWG drawing. All the polyline data are traversed, the corresponding length threshold is set and whether it is horizontal is determined, and the corresponding horizontal line is found to record its endpoint coordinates and the corresponding line type as the busbar;
[0017] According to the busbar data, short line segments intersecting with it are selected from the straight line data, and the coordinates are recorded as the starting points of each loop.
[0018] As a preferred implementation, the step of integrating the complete original connection data according to the straight line and polyline entity data is specifically as follows:
[0019] The polyline data is divided into multiple short straight lines according to whether it is closed, and then all the straight line data are merged into the original wiring data. After the polyline data is split, it is divided into straight line segments according to vertices as new wiring, and then merged with the straight line entity data previously extracted from the original DWG entity space to form complete original wiring data.
[0020] As a preferred implementation, the step of removing the straight lines in the primitive frame is specifically as follows:
[0021] According to the coordinates of the primitive target detection frame in the primitive target detection algorithm, all connected entities are traversed. If any edge of the primitive detection frame intersects with the wire segment, the wire segment is divided into two segments according to the position of the intersection, and the wire segment whose two endpoints belong to the same primitive target detection frame is deleted.
[0022] As a preferred implementation, the step of removing the line segments of the rectangular area near the busbar is specifically as follows:
[0023] A certain threshold is set to remove the line segments in a small rectangular area near the busbar by removing the straight lines in the primitive box.
[0024] As a preferred implementation, the predefined connection relationship is specifically:
[0025] The three situations that a straight line endpoint intersects with multiple straight line endpoints, a straight line endpoint intersects with a graphics primitive frame, and a straight line endpoint is on another straight line are preset as being connected to other parts. Among them, since in actual drawing there may be situations where straight line endpoints are not connected, they actually represent being connected together, it is defined here that the distance between two straight line endpoints or the distance between a straight line endpoint and the edge of the graphics primitive frame and the vertical distance from the endpoint to the straight line are also determined to be connected when they are less than a very small threshold.
[0026] As a preferred implementation, the target detection algorithm is the YOLO v8 target detection algorithm.
[0027] As a preferred implementation, the step of searching all connection relationship lists based on the breadth-first search algorithm to obtain the connected primitive wiring ID list is specifically as follows:
[0028] The first step is to initialize a queue and add a line segment L0 into the queue;
[0029] The second step is to remove the current line segment from the queue and mark it as L. i Has been visited;
[0030] The third step is to find the line segment L i In all connected line segments and primitives in the connection list, queue the unvisited line segments or primitives;
[0031] Repeat steps 2 and 3 until the queue is empty and output the complete connection path.
[0032] On the other hand, the present invention proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements a method for identifying wiring relationships of an electrical main wiring diagram that integrates CAD data and images as described in any embodiment of the present invention.
[0033] On the other hand, the present invention proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for identifying wiring relationships of an electrical main wiring diagram that integrates CAD data and images as described in any embodiment of the present invention.
[0034] The present invention has the following beneficial effects:
[0035] 1. The present invention integrates the results of CAD data and image data, making the identification process of the connection relationship of electrical equipment in the electrical main wiring diagram more efficient, greatly reducing the workload of manual verification, and improving the efficiency of drawing verification.
[0036] 2. The present invention can effectively adapt to wiring diagrams of various complex structures by processing original wiring data and using segmentation and fusion technology, improve the adaptability of verifying the connection relationship of complex drawings, and at the same time accurately identify the wiring relationship and the topological structure of electrical diagram elements, reducing recognition errors in drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is a schematic diagram of the steps of the present invention;
[0038] Figure 2 A schematic diagram of the recognized electrical equipment elements and text annotation boxes;
[0039] Figure 3 This is a schematic diagram of the resolved straight line entity;
[0040] Figure 4 Schematic diagram of the multi-fold real body obtained by analysis;
[0041] Figure 5 It is a schematic diagram of the busbar and the starting point of the loop;
[0042] Figure 6 It is a schematic diagram of the original data of the connection of the fusion of multiple polylines and straight lines;
[0043] Figure 7 It is a schematic diagram of all detected primitive frames and the wiring segments between them (except busbars);
[0044] Figure 8 To remove all the graphic element frames, only the wiring segment schematic diagram (except the busbar) is retained;
[0045] Fig. 9 It is the wiring structure diagram between each graphic element;
[0046] Fig.10 It is a schematic diagram of the step flow chart of the present invention. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] It should be understood that the step numbers used in this document are only for convenience of description and are not intended to limit the order in which the steps are executed.
[0049] It should be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0050] The terms “include” and “comprising” indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0051] The term "and / or" means and includes any and all possible combinations of one or more of the associated listed items.
[0052] Embodiment 1:
[0053] See also Figure 1 , a method for identifying wiring relationships of an electrical main wiring diagram by integrating CAD data and images, the specific steps include:
[0054] Convert the collected DWG format electrical main wiring diagram into a high-resolution JPG format drawing, use the Canny edge detection algorithm to clip the outline of the drawing, and then use the target detection algorithm to identify the relative coordinates and categories of the electrical equipment graphics and text annotation boxes in the drawing, and number each electrical equipment graphics;
[0055] In this embodiment, the main electrical wiring diagram in DWG format provided by the design institute is obtained and converted into a high-resolution JPG image. The morphological algorithm is used to increase the edges and the edge contour of the drawing is extracted and cropped according to the Canny edge detection algorithm (the threshold is set to 30, 100). The cropped image is further divided into sub-images with a pixel value of 1024x1024. Each sub-image is input into the YOLO V8 target detection model (using weights fine-tuned according to the corresponding electrical drawing data set) to identify the electrical equipment primitives and text annotation boxes. The relative coordinates and category of each primitive and text box will be recorded, and the primitives will be numbered in the order of detection. Among them, the identified electrical equipment primitives and text annotation boxes are as follows: Figure 2 shown.
[0056] Traverse the entity space of the original DWG drawing, parse out the data of all straight line entities and polyline entities, record the endpoint coordinates and line type of each line segment entity, and convert the endpoint coordinate data into normalized coordinates in the same format as the target detection algorithm according to the drawing range;
[0057] In this embodiment, the dzdxf library is used to parse the DWG file, and all the line (LINE) and polyline (LWPLOYLINE) entity records in the entity space (MODELSPACE) are traversed to obtain the drawing boundary coordinates from the header file (HEADS), and the coordinate data is normalized to align with the primitive result. The normalization formula is as follows:
[0058]
[0059] where x min 、x max ,y min ,y max are the boundary values of the drawings respectively.
[0060] Among them, the resolved straight line entity and multi-fold solid are as follows: Figure 3 and Figure 4 shown.
[0061] Identify busbars and circuit starting points in the physical space of the original DWG drawing;
[0062] In this embodiment, the identified busbar and the starting point of the loop are as follows: Figure 5 As shown in the figure, the busbar identification steps are as follows:
[0063] In the extracted polyline data, the main line is usually a long horizontal straight line. Set the line segment length threshold l busbar (According to experience, it is set to 0.05, and the total length is 1) Screen out the straight lines that meet the length condition and whose inclination angle is close to the horizontal, and the inclination angle satisfies the following formula:
[0064]
[0065] Where (x1, y1) and (x2, y2) represent the coordinates of the two endpoints of the line, ε bus b ar is the small angle threshold set, in which ε busbar =5,l busbar =0.05.
[0066] The specific steps for identifying the starting point of the loop are:
[0067] After the busbar is identified, the short line segments intersecting with the busbar are selected from the straight line entity data, and the intersection coordinate data is recorded. The identified busbar and the starting point of the loop are as follows: Figure 6 shown.
[0068] Integrate the complete wiring original data according to the straight line and polyline entity data, remove the straight line in the primitive frame and the line segments in the rectangular area near the busbar step by step, obtain the complete wiring segment and primitive frame, and record the corresponding number, endpoint and linear data of the wiring segment and primitive frame;
[0069] In this embodiment, the specific steps of this step are as follows:
[0070] First, remove the interference of the text annotation box: Use the detection results of YOLOv8 to remove the coordinate range of the text annotation box detected in the drawing from the wiring data. The specific operation is: for each straight line or polyline, if its endpoint is within the range of a text annotation box, determine whether it is an interference line segment, and if it is an interference line segment, delete it. The specific judgment conditions are as follows: (x i ,y i )∈bbox text for any i∈{1,2} where bbox text Indicates the coordinate range of the text annotation box.
[0071] Second, multi-polyline segmentation and fusion: For the multi-polyline data in the drawing, it is segmented into several short straight line segments according to the vertex. The segmentation formula is: i=1,2,3,...,n-1where n represents the number of vertices of the polyline, (x i ,y i ) represents the i-th vertex. After that, these short line segments are merged with the straight line data extracted previously to construct a complete wiring data set. Figure 6 It is the connection data for fusing polylines and straight lines.
[0072] Third, remove the straight lines in the primitive box: by detecting the coordinates of the primitive annotation box in the result, for each straight line, determine whether it intersects with a primitive box.
[0073] If both endpoints of the line segment are within the primitive frame, the line segment is deleted; if only part of the line segment is within the primitive frame, the line segment is split into two parts according to the intersection point, and the part outside the frame is retained as a new connection. Figure 7 As shown in the figure, the schematic diagram of removing the primitive frame and leaving only the wiring segment is as follows Figure 8 shown.
[0074] Fourth, remove the straight lines near the bus area and split the loop: In order to avoid the influence of the miscellaneous lines near the bus area on the wiring relationship identification, first define the influence area of the bus, usually set a vertical distance threshold d busbar , the threshold is set according to the drawing scale. For each straight line, determine its vertical distance from the busbar. If the following conditions are met, the straight line is determined as a miscellaneous line and the wiring relationship identification is removed.
[0075]
[0076] Where (x busbar1 ,y busbar1 )、(x busbar2 ,y busbar2 ) are the two endpoints of the busbar, (x line ,y line ) is the endpoint of the straight line. If d ⊥ <d busbar , then the straight line is regarded as an interfering line segment of the busbar attachment and is removed.
[0077] Predefine the connection relationship, traverse all the wiring segments and primitive frames, and obtain a list of connection relationships between the wiring segment and the primitive frame or between two wiring segments according to the connection relationship;
[0078] In this embodiment, a connection relationship is defined: each line segment (including short line segments separated from the busbar) may be connected to a certain primitive or other line segment in the drawing. In order to define the connection relationship, we introduce a primitive identifier and a line segment identifier. The basic definition of the connection relationship is: if the endpoint of a line segment falls within a certain primitive annotation box, or a line segment intersects with another line segment, then there is a connection between them.
[0079] Then, according to the coordinates of the endpoints of each connection, determine its connection relationship with the primitive. If the connection endpoint falls within the range of a certain primitive frame, the connection is attributed to the primitive and the connection relationship is recorded. The judgment condition is: (x end ,y end )∈bbox obj Where bbox obj The coordinate range of the primitive.
[0080] Get the connection list: By traversing all line segments and primitives, determine whether the endpoints of each line segment are connected to other line segments or primitives, and generate a connection list. The form of the connection list is: connection_list = [(L i ,[L j ,L k ,...,obj n ])]Where L i Represents the current line segment, [L j ,L k ,...,obj n ] represents the line segment or graphic element connected to it.
[0081] Based on the breadth-first search algorithm, all connection relationship lists are searched to obtain the list of connected graphic element wiring ids, and then the corresponding wiring id is found by traversing the position of the line segment at the starting point of the loop. Finally, the wiring id is added to each loop starting point according to its position in the connection id list.
[0082] In this embodiment, a complete primitive connection list is obtained by using a breadth-first search: a breadth-first search (BFS) algorithm is used to traverse the generated connection list, starting from a line segment or primitive, and gradually searching for all line segments and primitives connected to it until all connection items are traversed. The specific steps are as follows:
[0083] The first step is to initialize a queue and add a line segment L0 to the queue.
[0084] The second step is to remove the current line segment from the queue and mark it as L. i Has been visited.
[0085] The third step is to find the line segment L i In the connection list of all connected segments and primitives, queue the unvisited segments or primitives.
[0086] Repeat steps 2 and 3 until the queue is empty and output the complete connection path.
[0087] Based on busbar topology identification: the busbar and all its connected loops are regarded as a tree structure, and each busbar and its connected primitives are traversed based on BFS or DFS to identify their topology. Finally, a topological relationship diagram between the busbar and the primitives is constructed.
[0088] Loop segmentation based on the complete list of graphic element connections: Based on the location of the loop starting point, the wiring data is segmented into different loops according to the wiring relationship. By analyzing the starting and ending coordinates of each loop and the connected graphic elements, the connection order of each component in the loop is finally determined. Fig. 9 It is the connected graphic elements and wiring diagram.
[0089] Based on the above method, the implementation steps of the present invention are shown in the following figure: Fig.10 shown.
[0090] As a preferred implementation of this embodiment, the steps of identifying the busbar and the loop starting point in the physical space in the original DWG drawing are specifically as follows:
[0091] The busbar data of the electrical main line diagram is generally stored in the multi-line entity in the entity space of the DWG drawing. All the polyline data are traversed, the corresponding length threshold is set and whether it is horizontal is determined, and the corresponding horizontal line is found to record its endpoint coordinates and the corresponding line type as the busbar;
[0092] According to the busbar data, short line segments intersecting with it are selected from the straight line data, and the coordinates are recorded as the starting points of each loop.
[0093] As a preferred implementation of this embodiment, the step of integrating the complete connection original data according to the straight line and polyline entity data is specifically as follows:
[0094] The polyline data is divided into multiple short straight lines according to whether it is closed, and then all the straight line data are merged into the original wiring data. After the polyline data is split, it is divided into straight line segments according to vertices as new wiring, and then merged with the straight line entity data previously extracted from the original DWG entity space to form complete original wiring data.
[0095] As a preferred implementation of this embodiment, the step of removing the straight line in the primitive frame is specifically as follows:
[0096] According to the coordinates of the primitive target detection frame in the primitive target detection algorithm, all connected entities are traversed. If any edge of the primitive detection frame intersects with the wire segment, the wire segment is divided into two segments according to the position of the intersection, and the wire segment whose two endpoints belong to the same primitive target detection frame is deleted.
[0097] As a preferred implementation of this embodiment, the step of removing the line segments of the rectangular area near the busbar is specifically as follows:
[0098] A certain threshold is set to remove the line segments in a small rectangular area near the busbar by removing the straight lines in the primitive box.
[0099] As a preferred implementation of this embodiment, the predefined connection relationship is specifically:
[0100] The three situations that a straight line endpoint intersects with multiple straight line endpoints, a straight line endpoint intersects with a graphics primitive frame, and a straight line endpoint is on another straight line are preset as being connected to other parts. Among them, since in actual drawing there may be situations where straight line endpoints are not connected, they actually represent being connected together, it is defined here that the distance between two straight line endpoints or the distance between a straight line endpoint and the edge of the graphics primitive frame and the vertical distance from the endpoint to the straight line are also determined to be connected when they are less than a very small threshold.
[0101] As a preferred implementation of this embodiment, the target detection algorithm is the YOLO v8 target detection algorithm.
[0102] As a preferred implementation of this embodiment, the step of searching all connection relationship lists based on the breadth-first search algorithm to obtain the connected primitive wiring ID list is specifically as follows:
[0103] The first step is to initialize a queue and add a line segment L0 into the queue;
[0104] The second step is to remove the current line segment from the queue and mark it as L. i Has been visited;
[0105] The third step is to find the line segment L i In all connected line segments and primitives in the connection list, queue the unvisited line segments or primitives;
[0106] Repeat steps 2 and 3 until the queue is empty and output the complete connection path.
[0107] Embodiment 2:
[0108] The present embodiment provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, a method for identifying wiring relationships of an electrical main wiring diagram that integrates CAD data and images as described in any embodiment of the present invention is implemented.
[0109] Embodiment three:
[0110] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements a method for identifying wiring relationships of an electrical main wiring diagram that integrates CAD data and images as described in any embodiment of the present invention.
[0111] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for identifying wiring relationships of an electrical main wiring diagram by integrating CAD data and images, characterized in that: The specific steps include: Convert the collected DWG format electrical main wiring diagram into a high-resolution JPG format drawing, use the Canny edge detection algorithm to clip the outline of the drawing, and then use the target detection algorithm to identify the relative coordinates and categories of the electrical equipment graphics and text annotation boxes in the drawing, and number each electrical equipment graphics; Traverse the entity space of the original DWG drawing, parse out the data of all straight line entities and polyline entities, record the endpoint coordinates and line type of each line segment entity, and convert the endpoint coordinate data into normalized coordinates in the same format as the target detection algorithm according to the drawing range; Identify busbars and circuit starting points in the physical space of the original DWG drawing; Integrate the complete wiring original data according to the straight line and polyline entity data, remove the straight line in the primitive frame and the line segments in the rectangular area near the busbar step by step, obtain the complete wiring segment and primitive frame, and record the corresponding number, endpoint and linear data of the wiring segment and primitive frame; Predefine the connection relationship, traverse all the wiring segments and primitive frames, and obtain a list of connection relationships between the wiring segment and the primitive frame or between two wiring segments according to the connection relationship; Based on the breadth-first search algorithm, all connection relationship lists are searched to obtain the list of connected graphic element wiring ids, and then the corresponding wiring id is found by traversing the position of the line segment at the starting point of the loop. Finally, the wiring id is added to each loop starting point according to its position in the connection id list.
2. The method for identifying the wiring relationship of an electrical main wiring diagram by integrating CAD data and images according to claim 1, characterized in that: The steps of identifying the busbar and the loop starting point in the physical space in the original DWG drawing are as follows: The busbar data of the electrical main line diagram is generally stored in the multi-line entity in the entity space of the DWG drawing. All the polyline data are traversed, the corresponding length threshold is set and whether it is horizontal is determined, and the corresponding horizontal line is found to record its endpoint coordinates and the corresponding line type as the busbar; According to the busbar data, short line segments intersecting with it are selected from the straight line data, and the coordinates are recorded as the starting points of each loop.
3. The method for identifying the wiring relationship of an electrical main wiring diagram by integrating CAD data and images according to claim 2, characterized in that: The steps of integrating the complete wiring original data according to the straight line and polyline entity data are specifically as follows: The polyline data is divided into multiple short straight lines according to whether it is closed, and then all the straight line data are merged into the original wiring data. After the polyline data is split, it is divided into straight line segments according to vertices as new wiring, and then merged with the straight line entity data previously extracted from the original DWG entity space to form complete original wiring data.
4. The method for identifying the wiring relationship of an electrical main wiring diagram by integrating CAD data and images according to claim 1, characterized in that: The specific steps of removing the straight line in the primitive frame are: According to the coordinates of the primitive target detection frame in the primitive target detection algorithm, all connected entities are traversed. If any edge of the primitive detection frame intersects with the wire segment, the wire segment is divided into two segments according to the position of the intersection, and the wire segment whose two endpoints belong to the same primitive target detection frame is deleted.
5. The method for identifying the wiring relationship of an electrical main wiring diagram by integrating CAD data and images according to claim 4, characterized in that: The step of removing the line segments of the rectangular area near the busbar is specifically as follows: A certain threshold is set to remove the line segments in a small rectangular area near the busbar by removing the straight lines in the primitive box.
6. The method for identifying the wiring relationship of an electrical main wiring diagram by integrating CAD data and images according to claim 1, characterized in that: The predefined connection relationship is specifically: The three situations that a straight line endpoint intersects with multiple straight line endpoints, a straight line endpoint intersects with a graphics primitive frame, and a straight line endpoint is on another straight line are preset as being connected to other parts. Among them, since in actual drawing there may be situations where straight line endpoints are not connected, they actually represent being connected together, it is defined here that the distance between two straight line endpoints or the distance between a straight line endpoint and the edge of the graphics primitive frame and the vertical distance from the endpoint to the straight line are also determined to be connected when they are less than a very small threshold.
7. The method for identifying the wiring relationship of an electrical main wiring diagram by integrating CAD data and images according to claim 1, characterized in that: The target detection algorithm is the YOLO v8 target detection algorithm.
8. The method for identifying the wiring relationship of an electrical main wiring diagram by integrating CAD data and images according to claim 1, characterized in that: The step of searching all connection relationship lists based on the breadth-first search algorithm to obtain the connected element wiring ID list is specifically as follows: The first step is to initialize a queue and add a line segment L0 into the queue; The second step is to remove the current line segment from the queue and mark it as L. i Has been visited; The third step is to find the line segment L i In all connected line segments and primitives in the connection list, queue the unvisited line segments or primitives; Repeat steps 2 and 3 until the queue is empty and output the complete connection path.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, a method for identifying wiring relationships of an electrical main wiring diagram that integrates CAD data and images as described in any one of claims 1 to 8 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a method for identifying wiring relationships of an electrical main wiring diagram that integrates CAD data and images as described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Electrical component wiring diagram recognition method and system
CN103514303B
Method for identifying topological relation of main wiring diagram of power grid plant station
CN115457591A
Method for generating wiring diagram in CIM-G format
CN116756896A
Element identification and connection relation analysis method and system for electrical drawing
CN118568904A
Cited By
Digital thread detection method for low-code platform
CN121029152A