Method for identifying table structure of electrical drawing
By combining YOLO and DeepLSD algorithms, the electrical diagram information and table column information in electrical drawing tables are identified, and the problems of inefficient table structure recognition accuracy and inefficiency in the prior art are solved, and a more efficient and interpretable table recognition process is achieved.
Patent Information
- Application Number
- CN202411497932.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-02-18
AI Technical Summary
The prior art has accuracy and inefficiency in table structure recognition, especially when dealing with complex tables and spreadsheets, and deep learning-based methods require a large amount of annotation of data and are difficult to interpret the model decision process.
The YOLO algorithm is used to split the electrical drawing information part and the table part of the electrical drawing table, and the DeepLSD algorithm is used to segment the table column structure, combining short-line segment filters and key point merging technology to identify the electrical drawing information in the electrical drawing table. and table column information.
It improves the accuracy and efficiency of table structure recognition, reduces the need for manual annotation, enhances the interpretability of the recognition process, and adapts to complex and diverse table layouts.
Smart Images

Figure CN119478997A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence algorithm technology, and in particular to a method for identifying a table structure of an electrical drawing. Background Art
[0002] For the convenience of transmission and reading, there are a lot of tabular data stored in unstructured formats, such as image files and PDF files. In order to effectively perform downstream table understanding tasks on such tabular data, it is necessary to restore its structured information, that is, to restore its structured information through table structure recognition.
[0003] The goal of table structure recognition is to convert the visual information of the table into structured descriptive information, so as to reconstruct the layout structure, hierarchy and other related features of the table. The focus of this task is to reveal the constituent elements of the table, such as cells, rows and columns, and to determine their specific locations, mutual connections and hierarchical organization, etc. This table structure information is crucial for understanding the content and structure of the table, and helps to better analyze and utilize the table data.
[0004] At present, the commonly used methods for table structure recognition can be mainly divided into traditional methods and methods based on deep learning; among them,
[0005] (1) Traditional algorithms mainly include rule-based methods (such as edge detection, connected domain analysis, morphological operations, etc.) and machine learning methods (such as SVM (support vector machine), decision tree, etc.), among which:
[0006] Rule-based methods mainly rely on manually defined rules and heuristic algorithms to identify table structures; for example, they determine cell positions and relationships by analyzing features such as table lines, spaces, and text alignment. This method is simple and easy to use, but lacks versatility and robustness, and is difficult to adapt to complex tables and tables of different styles.
[0007] The machine learning-based method uses traditional machine learning algorithms to identify table structures, such as support vector machines, conditional random fields, and decision trees. These algorithms can learn the characteristics and patterns of table structures and automatically identify constituent elements such as cells, rows, and columns. However, these methods usually require a large amount of manually annotated data to train the model, and have difficulty processing complex tables and cross-page tables.
[0008] (2) Table structure recognition methods based on deep learning mainly include methods based on convolutional neural networks (CNN), recurrent neural networks (RNN) and attention mechanisms; these methods have powerful feature learning capabilities and can automatically learn complex patterns and features of table structures;
[0009] However, the table structure recognition method based on deep learning also has some disadvantages. For example, it requires a large amount of labeled data to train the model, and it is difficult to handle complex tables and cross-page tables. In addition, the method has poor interpretability and it is difficult to understand the decision-making process of the model, which may be a limiting factor in some application scenarios. Summary of the invention
[0010] The purpose of the present invention is to provide a method for identifying the table structure of an electrical drawing to solve the above-mentioned technical problems existing in the above-mentioned prior art and effectively improve the accuracy and efficiency of table structure recognition.
[0011] The objective of the present invention is achieved through the following technical solutions:
[0012] A method for identifying a table structure of an electrical drawing, comprising:
[0013] Using the target detection YOLO algorithm to split the electrical diagram information part and the table part of the electrical drawing table, and using the depth-based line segment detection DeepLSD algorithm to segment the column structure of the electrical drawing table, and identifying the electrical diagram information and the table column information in the electrical drawing table based on the splitting and segmentation results;
[0014] In the process of segmentation using the DeepLSD algorithm, a short line segment filter is also used to filter the short line segments in the segmentation process, and the short line segment refers to a line segment with a length less than a predetermined length.
[0015] Preferably, the process of splitting the electrical drawing information part and the table part of the electrical drawing table includes:
[0016] The electrical diagram information part and the table part in the electrical drawing table are divided by the positioning splitting model created based on the YOLO algorithm, and the electrical image part and the table part in the table are distinguished and determined.
[0017] Preferably, the process of creating the positioning split model includes:
[0018] The collected electrical drawing tables are labeled with the labels circuit and table, where circuit means it is the electrical diagram information in the electrical drawing table, and table means it is the table information in the electrical drawing table;
[0019] A data set is constructed by dividing the training set and the validation set in a predetermined ratio, and the constructed data set is used to adjust the YOLO pre-training model to obtain a positioning splitting model for positioning and splitting the electrical information part; the predetermined ratio is that the ratio of the training set is greater than the ratio of the validation set.
[0020] Preferably, the step of segmenting the column structure of the electrical drawing table includes:
[0021] After the line segment detection and recognition processing based on the DeepLSD algorithm, the identified line segments are filtered using a short line segment filter;
[0022] Saving the starting and ending points of the filtered line segments and merging adjacent points to obtain key points in the electrical drawing table;
[0023] Column segmentation points are determined for the electrical drawing table based on the obtained key points, and a final segmentation boundary box of the electrical drawing table is determined based on the column segmentation points.
[0024] Preferably, the process of determining the column segmentation points includes:
[0025] Sort all key points according to the X coordinate in a two-dimensional coordinate system including an X axis and a Y axis, determine the upper left key point among the key points as an anchor point, and find a first set of all points whose X coordinates differ from the anchor point by a first predetermined threshold, thereby respectively obtaining two key points with the largest Y coordinate values and two key points with the smallest Y coordinate values in the first set of all points;
[0026] Under the two-dimensional coordinates, a second set of all points whose Y-axis coordinates differ from the two points with the largest Y value and the two points with the smallest Y value by a second predetermined threshold are searched horizontally, that is, all intersection points of the first straight line, the second straight line, the penultimate straight line and the penultimate straight line in the electrical drawing table obtained by line segment detection and identification are used as the second set of all points;
[0027] The column segmentation points are determined in the second set of all points.
[0028] Preferably, the process of determining the column segmentation point in the second set of all points includes:
[0029] Compare all the split points of the first horizontal straight line and the second horizontal straight line, obtain all the split points on the straight line where the split points are more evenly distributed along the X-axis, and record them as L1; and compare all the split points of the penultimate horizontal straight line and the penultimate horizontal straight line, obtain all the split points on the straight line where the split points are more evenly distributed along the X-axis, and record them as L2;
[0030] Determine whether there is a point in L2 whose X-axis coordinate differs from that of the split point in L1 by a first predetermined threshold value. If not, delete the split point in L1; otherwise, retain the split point;
[0031] The splitting points contained in L1 finally obtained are the column segmentation points.
[0032] Preferably, the electrical diagram information portion includes at least one of a loop diagram, a circuit connection and an equipment layout diagram.
[0033] Compared with the prior art, the present invention provides a method for identifying the table structure of an electrical drawing, which realizes accurate identification and segmentation of the table structure by splitting the electrical diagram information part and the table part based on the YOLO algorithm, and segmenting the table column structure based on the DeepLSD algorithm. The identification and segmentation process can reduce the recognition error and improve the recognition accuracy. And the implementation of the present invention makes it unnecessary to have a large amount of manual annotation in the corresponding table recognition process, greatly reduces manual intervention, and improves the efficiency of table recognition processing. In short, the technical solution provided by the present invention has significant advantages in improving recognition accuracy, recognition efficiency and adaptability, thereby providing strong support for downstream task table text extraction and automated processing of engineering drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0035] Figure 1 A flow chart of a method for identifying an electrical drawing table structure provided by an embodiment of the present invention;
[0036] Figure 2 A schematic diagram of the recognition result of the recognition table column structure provided by the prior art 1;
[0037] Figure 3 A schematic diagram of the recognition result of the recognition table column structure provided by the second prior art;
[0038] Figure 4 A schematic diagram of a recognition result of a recognition table column structure provided by an embodiment of the present invention;
[0039] Figure 5 A process 1 for identifying a table column structure provided by an embodiment of the present invention;
[0040] Figure 6 The second process of identifying the table column structure provided by the embodiment of the present invention;
[0041] Figure 7 Process 3 of identifying table column structure provided by an embodiment of the present invention;
[0042] Figure 8 Process 4 of identifying table column structure provided by an embodiment of the present invention;
[0043] Fig. 9 Process 5 for identifying table column structure provided by an embodiment of the present invention;
[0044] Fig.10 This is process six of identifying the table column structure provided by the embodiment of the present invention. DETAILED DESCRIPTION
[0045] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in combination with the specific content of the present invention; it is obvious that the described embodiments are only part of the embodiments of the present invention, not all of the embodiments, which does not constitute a limitation of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of the present invention.
[0046] First, the terms that may be used in this article are explained as follows:
[0047] The term “and / or” means that either or both of them can be realized at the same time. For example, X and / or Y means both “X” or “Y” and “X and Y”.
[0048] The terms "include", "comprises", "contains", "has" or other descriptions with similar semantics should be interpreted as non-exclusive inclusion. For example, including certain technical feature elements (such as raw materials, components, ingredients, carriers, dosage forms, materials, dimensions, parts, components, mechanisms, devices, steps, procedures, methods, reaction conditions, processing conditions, parameters, algorithms, signals, data, products or products, etc.) should be interpreted as including not only certain technical feature elements explicitly listed, but also other technical feature elements known in the art that are not explicitly listed.
[0049] The term "consisting of..." means excluding any technical feature elements not explicitly listed. If this term is used in a claim, it will make the claim closed, so that it does not contain technical feature elements other than the technical feature elements explicitly listed, except for the conventional impurities related to them. If this term only appears in a clause of a claim, it only limits the elements explicitly listed in the clause, and the elements recorded in other clauses are not excluded from the overall claim.
[0050] Unless otherwise specified or limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in this article can be understood according to specific circumstances.
[0051] When concentration, temperature, pressure, size or other parameters are expressed in the form of a numerical range, the numerical range should be understood to specifically disclose all ranges formed by the pairing of any upper limit, lower limit, and preferred value in the numerical range, regardless of whether the range is explicitly stated; for example, if a numerical range of "2 to 8" is stated, the numerical range should be interpreted as including ranges such as "2 to 7", "2 to 6", "5 to 7", "3 to 4 and 6 to 7", "3 to 5 and 7", "2 and 5 to 7", etc. Unless otherwise specified, the numerical ranges stated herein include both their end values and all integers and fractions within the numerical range.
[0052] The orientation or position relationship indicated by terms such as "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", etc. are based on the orientation or position relationship shown in the drawings and are only for the convenience and simplification of description, and do not explicitly or implicitly indicate that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation of this document.
[0053] The purpose of the present invention is to provide a method for recognizing the table structure of electrical drawings. In the field of electrical engineering, tables in design drawings (i.e., electrical drawing tables) usually contain a large amount of text information, which is usually used to describe parameters, components, specifications, etc. of the electrical system. In addition to text information, these tables may also contain complex graphic elements, such as circuit diagrams, circuit connections, equipment layout diagrams, and other electrical diagram information. For this type of table structure recovery, the task becomes more complicated and challenging.
[0054] Based on the above challenges, the recognition method of the table structure of electrical drawings provided by the present invention is implemented based on the target detection algorithm and the straight line detection algorithm. Specifically, the implementation of the present invention requires segmenting the table columns in the drawing according to the electrical design drawings provided by the user, extracting the electrical diagram information such as the circuit diagram, and its corresponding table attribute columns, thereby reducing the difficulty of subsequent text extraction.
[0055] To facilitate understanding of the present invention, the implementation process of the present invention will be described in detail below with reference to the accompanying drawings.
[0056] The present invention proposes a method for identifying the table structure of an electrical drawing, which can mainly include two processing processes: one processing process is the process of splitting the electrical drawing information part and the table part based on a target detection algorithm (i.e., the YOLO algorithm); the other processing process is the process of segmenting the table column structure based on a straight line detection algorithm (i.e., the DeepLSD algorithm).
[0057] Furthermore, the specific implementation process of the method for identifying the table structure of an electrical drawing provided by the embodiment of the present invention is as follows: Figure 1 As shown, the following steps may be included:
[0058] Step 1, obtaining an original table image, that is, obtaining an electrical drawing table image to be recognized;
[0059] Step 2: splitting the electrical diagram information part and the table part based on the YOLO algorithm;
[0060] The electrical diagram information part includes: at least one of a circuit diagram, a circuit connection and an equipment layout diagram; it should be noted that in some scenarios in the attached drawings and subsequent descriptions, only the circuit diagram is used as an example of electrical diagram information, but this does not mean that it is only applicable to the circuit diagram in the corresponding scenario, and it should also be applicable to other electrical diagram information;
[0061] In the splitting process of step 2, it is necessary to locate and split the electrical diagram information part such as the loop diagram in the electrical drawing table; the corresponding positioning and splitting process may specifically include: using the trained positioning and splitting model to locate and split the electrical diagram information part in the electrical drawing table; specifically, using the positioning and splitting model created in the YOLO target detection module to divide the boundary between the electrical diagram information (or loop for short) part and the table part in the electrical drawing table, so as to determine the electrical diagram information (such as loop, etc.) part and the table part in the table;
[0062] The process of creating the positioning splitting model used in the above splitting process may include:
[0063] First, the collected electrical drawing tables are labeled with circuit and table, and can be saved as .xml files and finally saved in txt files. Circuit means that it is the electrical diagram information in the electrical drawing table, and table means that it is the table information in the electrical drawing table.
[0064] Afterwards, the training set and the validation set are divided into a predetermined ratio (such as 9:1, etc., or other ratios, such as 8:1 or 10:1, etc.) to construct a corresponding data set, and the constructed data set is used to fine-tune the yolov5x.pt pre-trained model to obtain a positioning splitting model for locating and splitting the electrical information part; wherein the predetermined ratio is that the ratio of the training set is greater than the ratio of the validation set.
[0065] Step 3: Segmentation of table column structure based on DeepLSD algorithm;
[0066] In this step, the lines in the table need to be detected to perform the corresponding table column structure segmentation;
[0067] Specifically, the table column structure segmentation process can be implemented by using the pre-trained model provided by DeepLSD to perform line segment detection on the original image (i.e., the electrical drawing table image), that is, performing line segment detection through the DeepLSD straight line detection module;
[0068] Since a large number of short straight lines of text parts will be detected in the implementation process of this implementation method, a short line segment filter is also used to filter the short line segments in the segmentation process in the process of using the DeepLSD algorithm for segmentation. The short line segment refers to a line segment whose length is less than a predetermined length. The corresponding predetermined length can be set according to the usual length value of the short straight line of the text part. Specifically, in the short line segment filtering process, the line segments identified in the line segment detection process need to be filtered by the short line segment filter to filter the short straight line segments corresponding to the text part, that is, the filtering process of the short line segments corresponding to the text part is performed;
[0069] After completing the above short line segment filtering, the starting point and the end point of the filtered line segment are saved, and the adjacent points are merged to obtain all the required key points in the electrical drawing table image, that is, to obtain the key points in the electrical drawing table.
[0070] In order to split the columns of the table, it is necessary to retain the key points and then determine the corresponding final dividing points, that is, determine the final column splitting points; the process of determining the final column splitting points can mainly include: determining the upper left point, that is, using the upper left point as an anchor point, finding the splitting position of the first straight line and the last straight line of the table, and then determining the corresponding column splitting point;
[0071] Specifically, the corresponding implementation of the process of determining the final column segmentation point may include:
[0072] (1) Determine the intersection points S1, S2, S3, and S4 of the top and bottom lines of the table;
[0073] First, all key points are sorted according to the X coordinate in the two-dimensional coordinates including the X axis and the Y axis. After finding the upper left key point among the key points as the anchor point, all key points whose X coordinates differ from the anchor point within a certain threshold (such as a first predetermined threshold) are found. These points represent the set of all row boundary points of the leftmost frame line in the table as the first set of all points; the two key points with the largest y value and the two key points with the smallest y value in the first set of all points are retained respectively, a total of four key points P1, P2, P3, and P4;
[0074] Afterwards, all point sets S1, S2, S3, S4 whose Y-axis coordinates differ from those of P1, P2, P3, P4 by a certain threshold value (such as a second predetermined threshold value) are searched horizontally under the two-dimensional coordinates, that is, all intersection points obtained by the line detection model among the first straight line, the second straight line, the penultimate straight line and the penultimate straight line in the table are used as the second all point set;
[0075] (2) determining the final dividing point, that is, determining the column segmentation point;
[0076] Compare all the split points in the first straight line and the second straight line, that is, S1 and S2. When the split points of one of the lines are more evenly distributed along the X-axis, retain the set of all the split points on the line, which is recorded as L1.
[0077] The same is true for the penultimate and second to last lines. That is, compare all the split points in the penultimate and second to last lines, that is, S3 and S4. When the split points of one of the lines are more evenly distributed along the X-axis, retain the set of all split points on the line, and the corresponding split point set is recorded as L2.
[0078] Check whether there is a split point in the above set L2 whose X-axis coordinate is different from that of the midpoint in the set L1 by a certain threshold (such as a first predetermined threshold, etc.), if not, delete the split point in L1, otherwise keep the split point;
[0079] After the above processing, the remaining split points in the set L1 are the final column split points.
[0080] Step 4, based on the splitting result of the above step 2 and the segmentation result of step 3, the electrical diagram information and the corresponding table column information in the recognized electrical drawing table are obtained, that is, the electrical diagram information such as the circuit diagram and the table column information in the electrical drawing table are determined as the recognition result of the electrical drawing table structure;
[0081] In summary, the YOLO algorithm is used to identify the upper and lower boundaries of the circuit part (i.e. the electrical diagram part) and the table part in the electrical drawing table. Combined with the coordinates of the segmentation point, the bounding box of the circuit diagram part (i.e. the electrical diagram part) and the bounding box of the corresponding table can be obtained, and then the table column information in the electrical drawing table can be determined.
[0082] It can be seen from the electrical drawing table structure recognition method provided by the present invention that it has significant advantages and positive effects. Specifically, it can achieve accurate segmentation of the table structure by splitting the loop part and the table part based on YOLO, and segmenting the table column structure based on DeepLSD, thereby reducing the error of table structure recognition and improving the accuracy of table structure recognition. In addition, the present invention does not require a large amount of manual annotation during the application process, which can greatly reduce manual intervention and improve the processing efficiency of table structure recognition. The present invention combines two powerful detection algorithms, YOLO and DeepLSD, in the implementation process, so that the system can maintain good performance in complex backgrounds and diversified table layouts. On this basis, a short line segment filter is further used to effectively filter out the short straight lines corresponding to the text part, reduce noise, retain key line segments, and improve the accuracy of column table segmentation. And through the fine processing and threshold judgment of the point set, the accuracy of the column segmentation point is ensured, the existence of redundant points is avoided, and the table structure restoration accuracy in the electrical drawing table recognition process is improved.
[0083] In summary, the technical solution provided by the present invention has significant advantages in improving recognition accuracy, efficiency and adaptability, and provides strong support for downstream tasks such as table text extraction and automated processing of engineering drawings.
[0084] In the process of implementation of the present invention, the technical effect produced by the present invention is also compared with the effect produced by using tabletransformer and yolov5 algorithm. For specific comparison results, see Figure 2 , Figure 3 and Figure 4 As shown, Figure 2 It shows the effect of using the pre-trained tabletransformer model for column recognition. Figure 3 The recognition effect of using the fine-tuned yolov5 pre-trained model is shown. Figure 4 The effect of using the method of the present invention for column recognition is shown. It can be clearly seen that the first two methods will have the problem of too much segmentation in the process of table structure recognition, and the boundary box division is not accurate. In contrast, the technical solution provided by the present invention can achieve a better segmentation effect without additional annotation information to fine-tune the deepLSD model.
[0085] In summary, it can be seen from the above comparison that in the process of end-to-end column segmentation, the implementation method provided by the present invention refers to Figure 4 It can be seen that it has higher accuracy.
[0086] In order to facilitate further understanding of the technical effects of the technical solution provided by the present invention, the structural recognition results of each processing stage in the specific application process of the present invention are respectively visualized and illustrated below.
[0087] In the process of applying the present invention, a picture of an electrical drawing table to be identified is uploaded, and the final table column segmentation results of each stage are obtained by the algorithm processing flow described in the specific embodiment of the present invention. Figures 5 to 10 As shown, Figure 5 The visualization of DeepLSD recognition results is shown. Figure 6 The visualization results of short line segment filtering are shown. Figure 7 The visualization result of merging neighboring points is shown. Figure 8 The visualization results after key point preservation are shown. Fig. 9 The visualization results of column split point determination are shown. Fig.10 The final segmentation bounding box visualization is shown. Figures 5 to 10 It can be seen that the electrical drawing table recognition processing solution provided by the present invention has a clear and concise implementation process, which can not only improve the processing efficiency of the recognition process, but also ensure the accuracy of the recognition process. Moreover, after a series of table structure recognition processes, the electrical drawing table recognition processing results finally obtained by the present invention can provide strong support for the subsequent extraction and understanding of table text.
[0088] In summary, in the specific implementation process, the present invention combines two powerful detection algorithms, the YOLO algorithm and the DeepLSD algorithm, so that it can maintain good performance in complex backgrounds and diversified table layouts, that is, to achieve accurate segmentation of the table structure, reduce the error of table structure recognition, and improve the accuracy of table structure recognition. In addition, the present invention also uses a short line segment filter to effectively filter out the short straight lines in the text part, reduce noise, retain key segments, and further improve the accuracy of column segmentation. At the same time, through the fine processing of the point set and threshold judgment, the accuracy of the column segmentation point is ensured, the existence of redundant points is avoided, and the accuracy of table structure restoration is improved. In short, the implementation of the present invention not only eliminates the need for a large amount of manual annotation in the corresponding table recognition process, greatly reduces manual intervention, and improves processing efficiency; at the same time, it also has significant advantages in improving recognition accuracy, efficiency and adaptability, and provides strong support for downstream task table text extraction and automated processing of engineering drawings.
[0089] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with the technical field within the technical scope disclosed in the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims. The information disclosed in the background technology section of this article is only intended to deepen the understanding of the overall background technology of the present invention, and should not be regarded as an admission or in any form that the information constitutes prior art known to those skilled in the art.
Claims
1. A method for identifying the table structure of an electrical drawing, characterized in that: include: Using the target detection YOLO algorithm to split the electrical diagram information part and the table part of the electrical drawing table, and using the depth-based line segment detection DeepLSD algorithm to segment the column structure of the electrical drawing table, and identifying the electrical diagram information and the table column information in the electrical drawing table based on the splitting and segmentation results; In the process of segmentation using the DeepLSD algorithm, a short line segment filter is also used to filter the short line segments in the segmentation process, and the short line segment refers to a line segment with a length less than a predetermined length.
2. The method according to claim 1, characterized in that The process of splitting the electrical drawing information part and the table part of the electrical drawing table includes: The electrical diagram information part and the table part in the electrical drawing table are divided by the positioning splitting model created based on the YOLO algorithm, and the electrical image part and the table part in the table are distinguished and determined.
3. The method according to claim 2, characterized in that The process of creating the positioning split model includes: The collected electrical drawing tables are labeled with the labels circuit and table, where circuit means it is the electrical diagram information in the electrical drawing table, and table means it is the table information in the electrical drawing table; A data set is constructed by dividing the training set and the validation set in a predetermined ratio, and the constructed data set is used to adjust the YOLO pre-training model to obtain a positioning splitting model for positioning and splitting the electrical information part; the predetermined ratio is that the ratio of the training set is greater than the ratio of the validation set.
4. The method according to claim 1, 2 or 3, characterized in that: The step of segmenting the column structure of the electrical drawing table includes: After the line segment detection and recognition processing based on the DeepLSD algorithm, the identified line segments are filtered using a short line segment filter; Saving the starting point and the end point of the filtered line segment, and merging adjacent points to obtain key points in the electrical drawing table; Column segmentation points are determined for the electrical drawing table based on the obtained key points, and a final segmentation boundary box of the electrical drawing table is determined based on the column segmentation points.
5. The method according to claim 4, characterized in that The process of determining the column segmentation point includes: Sort all key points according to the X coordinate in a two-dimensional coordinate system including an X axis and a Y axis, determine the upper left key point among the key points as an anchor point, and find a first set of all points whose X coordinates differ from the anchor point by a first predetermined threshold, thereby respectively obtaining two key points with the largest Y coordinate values and two key points with the smallest Y coordinate values in the first set of all points; Under the two-dimensional coordinates, a second set of all points whose Y-axis coordinates differ from the two points with the largest Y value and the two points with the smallest Y value by a second predetermined threshold are searched horizontally, that is, all intersection points of the first straight line, the second straight line, the penultimate straight line and the penultimate straight line in the electrical drawing table obtained by line segment detection and identification are used as the second set of all points; The column segmentation points are determined in the second set of all points.
6. The method according to claim 5, characterized in that The process of determining the column segmentation point in the second set of all points includes: Compare all the split points of the first horizontal straight line and the second horizontal straight line, obtain all the split points on the straight line where the split points are more evenly distributed along the X-axis, and record them as L1; and compare all the split points of the penultimate horizontal straight line and the penultimate horizontal straight line, obtain all the split points on the straight line where the split points are more evenly distributed along the X-axis, and record them as L2; Determine whether there is a point in L2 whose X-axis coordinate differs from that of the split point in L1 by a first predetermined threshold. If not, delete the split point in L1; otherwise, retain the split point; The splitting points contained in L1 finally obtained are the column segmentation points.
7. The method according to claim 4, characterized in that The electrical diagram information portion includes at least one of a loop diagram, a circuit connection and an equipment layout diagram.
Citation Information
Patent Citations
Method and device for recognizing table cells in scanned image
CN101676930A
Deep learning-based voting statistical method
CN110377640A
Communication engineering drawing identification method and device
CN116110070A
General table recognition method and device combining semantic segmentation and sequence prediction
CN116311310A
Spreadsheet identification method and device, electronic equipment and storage medium
CN116580415A