A method for digitizing high-speed railway subgrade cross-section design information based on graphic element features

By using a method based on graphic features, AutoCAD and Python to process DWG format drawings, the high-speed railway subgrade cross-section design information was identified and matched, solving the problems of heavy design workload and prone to errors, and realizing the automated digitization of information and efficient design.

CN119106485BActive Publication Date: 2025-09-09HEBEI UNIV OF TECH

Patent Information

Application Number
CN202411321015.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2025-09-09
Estimated Expiration
2044-09-23

AI Technical Summary

Technical Problem

The design of high-speed railway subgrade cross sections is labor-intensive and error-prone, and existing technologies make it difficult to achieve automation and information digitization.

Method used

A method based on primitive features is adopted, and AutoCAD and Python are used to process DWG format drawings. The blocks are split using the EXPLODE command. The ground lines, stratum lines, roadbed surface lines and other features are identified and matched by combining layer colors, connection relationships and text information. The structures are processed using image recognition algorithms, and finally the information is saved in a database format.

Benefits of technology

It realizes the automated digitization of high-speed railway subgrade cross-section design information, improves design efficiency, reduces human errors, and provides reliable basic data for design verification and calculation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119106485B_ABST
    Figure CN119106485B_ABST
Patent Text Reader

Abstract

The present invention provides a method for digitizing high-speed railway subgrade cross-section design information based on graphic element features. By converting DWG files into DXF format files, basic graphic element information is extracted, and line and arc information and text information are obtained and processed. The extracted object information that may be included in the railway subgrade cross-section drawings is identified and matched based on railway design specifications and the graphic features of each extracted object. Finally, the extracted object information is stored in a database based on the name, type, attribute, and coordinates of the railway line position. The present invention can parse digital drawings of high-speed railway subgrade cross-section designs and extract the required information. The digitized information can be used to verify the drawing information and calculate the engineering quantities in the drawings. It can also provide basic data for further design.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of railway engineering design, and in particular to a method for digitizing high-speed railway subgrade cross-section design information based on graphic element features. Background Art

[0002] High-speed railway subgrade cross-section design is one of the important parts of high-speed railway design. At present, the design work is mainly done manually, which has problems such as large design workload and easy errors. Therefore, a method of establishing a general high-speed railway subgrade cross-section design information database and combining custom entity technology and object-oriented programming technology to automatically forward design the high-speed railway subgrade cross-section is proposed. Chinese patent CN202011162421.6 discloses a method for batch design of roadbed cross-section slope measures based on a database. This method performs batch design of roadbed cross-section slope measures by establishing a slope database. The establishment of the database requires a large amount of high-speed railway subgrade cross-section data information. Therefore, realizing the automation of existing high-speed railway subgrade cross-section design information extraction, matching and other work is the primary prerequisite for ensuring the above goals. The core lies in refining important work point design information, quickly digitizing the design information to establish a standard database, and providing digital samples of basic data.

[0003] In response to the above engineering background and technical requirements, the present invention provides a method for digitizing high-speed railway subgrade cross-section design information based on graphic element features. Summary of the Invention

[0004] The purpose of the present invention is to propose a method for digitizing high-speed railway subgrade cross-section information based on graphic element features, and to digitize the high-speed railway subgrade cross-section drawing information in DWG format.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0006] In a first aspect, the present invention provides a method for digitizing high-speed railway subgrade cross-section design information based on graphic element features, comprising the following contents:

[0007] Use the EXPLODE command in AutoCAD software to split the blocks and obtain all basic elements and their attribute information;

[0008] Get elevation annotation information based on the color and layer of the basic graphic element, the connection relationship of the basic graphic element and the text information;

[0009] Match ground lines based on the color of basic elements, their layers, graphic annotations, and the connection between basic elements;

[0010] Match stratum lines and soil layers based on the basic element color, layer, location, nearby text annotations, and the direct connection logic relationship between the elements;

[0011] Match the roadbed surface line, slope line, and roadbed filling line based on the basic element color and layer, text annotation and graphic annotation, geometric features, and the connection logic relationship between elements;

[0012] For side ditches, drainage ditches, gravity walls, anti-slide piles, cantilever walls, foot walls, blind ditches, and submerged slopes, image recognition algorithms are used for information matching;

[0013] Obtain length and text annotation information based on the color and layer of the basic graphic element, the geometric shape characteristics of the basic graphic element, and text information;

[0014] Obtain mileage pile number information, scale information and foundation treatment information based on text annotation information;

[0015] According to the connection logic relationship between the annotation information and the structure or basic graphic element, the annotation information of the structure or basic graphic element is obtained;

[0016] Define the intersection of the ground line elevation mark and the ground line as the coordinate origin, and recalculate the coordinate information of all structures obtained;

[0017] The structural information with calculated coordinates is summarized and saved in a database format.

[0018] In a second aspect, the present invention provides a method for digitizing high-speed railway subgrade cross-section design information based on graphic element features, the method comprising the following steps:

[0019] 1. Use the EXPLODE command in AutoCAD software to split the block into basic graphics elements including straight lines, polylines, and text, save the drawing file, and save it in DXF format;

[0020] Second, use the dxfgrabber library in the Python standard tool library to read the entity part of the DXF drawing file and obtain the basic primitive attribute information in the drawing. The basic primitive attribute information includes coordinates, layer information, text content, and text type;

[0021] 3. Data processing based on layer color:

[0022] Step 3.1: Determine the elevation mark, mileage pile number and scale in the red layer

[0023] Traverse all the red lines in the red layer of the drawing, determine the head-to-tail connection relationship of the line segments based on the endpoint coordinates of the red lines, and obtain all combinations of lines representing horizontal inverted triangles; traverse all combinations of lines representing triangles, and traverse all horizontal red lines and red texts in the drawing except the line representing the inverted triangle. If the horizontal red line and the base point of the inverted triangle are on the same horizontal line, and the number corresponding to the red text is near the horizontal red line, then the inverted triangle and the horizontal red line are elevation graphic annotations, and the number text is the elevation, and thus the elevation annotation is obtained;

[0024] Mileage pile number: traverse all red texts. If the red text contains the letters "DK", this red text represents the drawing pile number information, record it as pile number text, and record the coordinate position of this pile number text; traverse all red texts again, find the text with numbers on the same horizontal line as the pile number text, record it as mileage information, and then the pile number text and mileage information will form the drawing mileage pile number information;

[0025] Drawing scale: traverse all red texts. If the red text contains scale text information, record the position of this text. Traverse the red text again and find the text on the same horizontal line as this text in the form of "1:xxx". This text represents the scale information of the drawing.

[0026] Step 3.2: Determine the ground line in the white layer

[0027] Traverse all white polylines in the white layer, calculate the distance from the bottom point of any elevation inverted triangle to the white polyline, and find the elevation inverted triangle and the corresponding white polyline when the distance is 0 and the coordinates of the bottom point of the elevation inverted triangle are on a straight line of the polyline. This white polyline represents the ground line, and the elevation corresponding to this elevation inverted triangle is the ground elevation. There is only one ground elevation on the entire drawing;

[0028] Step 3.3: Determine the stratigraphic line and soil layer based on the ground line

[0029] Traverse all the red polylines in the red layer. If the entire red polyline is below the white polyline representing the ground line and the x-coordinate of the starting point of the red polyline is consistent with that of the white polyline representing the ground line, then this red polyline is the ground line.

[0030] The specific process of determining the soil layer name is as follows: traverse all arc information in the red layer, find the arc with a radius of 2, traverse the red text, find the text representing Roman numerals, determine whether the text coordinates are within the arc, and if so, save the text combination of arc and Roman numeral; find the corresponding red text on the same horizontal line as the coordinates of each text combination, and use the red text and text combination as the soil layer information;

[0031] Find all stratigraphic lines and soil layers, sort them, and determine the corresponding soil layers between adjacent stratigraphic lines;

[0032] Step 3.4: Determine the roadbed surface line

[0033] Traverse the red text in the red layer and obtain the red text containing the letter "h". Traverse the red text again and find the digital text with positive and negative signs on the same horizontal line as the red text containing the letter "h". This digital text is the elevation difference between the shoulder and the ground line. Add this elevation difference and the ground elevation determined in step 3.2 to get the shoulder elevation value. Traverse all the elevation annotations determined in step 5 and find the elevation annotation with the same elevation value as the shoulder elevation. This elevation annotation is the shoulder elevation annotation. There may be one or two shoulder elevation annotations.

[0034] In the yellow layer, find the yellow straight line that passes through the coordinates of the bottom point of the inverted triangle marked by the shoulder elevation and has an absolute slope of 4%. This is the subgrade surface line. The subgrade surface line consists of two straight lines: the line on the left is called the left subgrade surface line, and the line on the right is called the right subgrade surface line. If there is only one shoulder elevation mark, use the yellow straight line connected to the subgrade surface line found in the above method and with an absolute slope of 4% as the other subgrade surface line.

[0035] The roadbed cross section is classified according to the roadbed surface line and the ground line. The ground line is a polyline composed of multiple line segments connected end to end. The left and right endpoints of the roadbed surface line are found, and the relationship between the x-coordinates of the two endpoints of the roadbed surface line and the left and right endpoints of the line segment adjacent to the ground line is determined. If the x-coordinate of a certain endpoint of the roadbed surface line is between the x-coordinates of the left and right endpoints of a certain line segment of the ground line, the cross product of the vector AP composed of the left endpoint A of the line segment and the endpoint P of the roadbed surface line and the vector AB composed of the left endpoint A and the right endpoint B of the line segment is calculated. If the cross product results of the two endpoints of the roadbed surface line are both greater than 0, the roadbed cross section is an embankment cross section. If the cross product results of the two endpoints of the roadbed surface line are both less than 0, the roadbed cross section is a cutting cross section. If the cross product results of the two endpoints of the roadbed surface line are one positive and the other negative, the roadbed cross section is a half-embankment half-cutting cross section. At this point, the roadbed is divided into three types: embankment, cutting, and half-embankment half-cutting.

[0036] Determine the slope line and the roadbed fill and fill line. For embankment, perform steps 3.5-3.6; for cutting, perform steps 3.7-3.8; for half embankment and half cutting, perform steps 3.9-3.10;

[0037] Step 3.5: Determine the embankment slope line:

[0038] Traverse all red texts in the red layer and find text with the content of "1:m" or "4.m%". This is the slope text, where m represents any number. In the yellow layer, find the yellow straight lines with the same slope as the slope text and near the slope text as possible slope lines; classify the yellow straight lines that may be slope lines according to the positive or negative slope. The positive slope indicates the possible slope line of the left slope, and the negative slope indicates the possible slope line of the right slope.

[0039] Traverse the possible slope lines of the left side slope to determine whether they are connected to the left roadbed surface line. If so, this straight line is the left side slope line 1. Remove the left side slope line 1 from the possible slope lines of the left side slope and continue traversing to determine whether they are connected to the left side slope line 1. If so, this straight line is the left side slope line 2. Remove the left side slope line 1 and the left side slope line 2 from the possible slope lines of the left side slope and traverse to determine whether they are connected to the left side slope line 2. If so, this straight line is the left side slope line 3... Repeat this process until there are no straight lines that meet the connection requirement, that is, all the left side slope lines are obtained; the process of determining whether the possible slope line of the right side slope is the right side slope line is the same; the slope corresponding to the slope line is the slope gradient;

[0040] Step 3.6, determine the embankment subgrade filling line and subgrade filling:

[0041] Traverse all yellow lines in the yellow layer and determine whether they are below the roadbed surface line, have the same slope as the roadbed surface line, and are connected to the slope line. If they meet the requirements, they are roadbed fill lines.

[0042] In the red layer, find the red text whose text coordinates are between the horizontal coordinates of the left and right endpoints of the roadbed filling line and whose vertical distance to the roadbed filling line is less than 20 and use it as the roadbed filling;

[0043] Step 3.7: Determine the cutting side slope line. This is similar to step 3.5, except that after finding the left side slope line 1, you need to determine whether the possible side slope line of the left side slope is connected to the ground line. Determine the left and right side slope lines and slope gradients of the cutting.

[0044] Step 3.8. Determine the cutting fill line and its filler: Find the red oblique straight line with a slope of +1 that intersects the roadbed surface line as Line 1; traverse all red vertical lines in the red layer to determine whether this red vertical line intersects both Line 1 and the roadbed surface line. If so, obtain Line 2; create List 1, traverse all red oblique straight lines with a slope of +1 except Line 1, and determine whether they intersect with Line 2. If the intersection condition is met, add this line to List 1; traverse all red oblique straight lines in List 1, and simultaneously traverse all yellow lines in the yellow layer to determine whether this yellow line intersects both the red oblique straight lines in List 1 and Line 2. If so, this line is the roadbed fill line;

[0045] Create List 2, traverse all red horizontal lines, and determine whether they intersect with Line 2. If so, add the intersection point to List 2. Traverse all points in List 2 and all red text in the red layer. If the distance between the red text and the point is less than 1, the text represents roadbed filler, and all filler information is obtained.

[0046] Step 3.9, determine the half-embankment half-cut slope line: find all possible slope lines in the yellow layer based on the slope text;

[0047] If the left endpoint of the roadbed surface line is above the ground line and the right endpoint is below the ground line, follow the method in step 3.5 to traverse all possible slope lines and determine whether they are connected to the left roadbed surface line, and find all the left side slope lines of the half-embankment and half-cut. Follow the method in step 3.7 to traverse all possible slope lines and determine whether they are connected to the ground line, and find all the right side slope lines of the half-embankment and half-cut.

[0048] If the left endpoint of the roadbed surface line is below the ground line and the right endpoint is above the ground line, follow the method in step 3.7 to find the left side slope lines of all half-embankment and half-cut sections, and follow the method in step 3.5 to find the right side slope lines of all half-embankment and half-cut sections.

[0049] The method for determining the filling line and filling material of the half-embankment and half-cut is the same as step 3.8;

[0050] Step 3.10, determine the main line or left and right lines: traverse all green lines in the green layer, and the vertical line that intersects the roadbed surface line is the main line (single track) or left and right lines (double track);

[0051] Step 3.11: Determine the structures in the high-speed railway subgrade cross-section drawing:

[0052] Eliminate the previously identified and matched lines, and traverse all remaining lines. Based on the head-to-tail connection of the line segments, obtain all lines representing closed n-gons, where the n sides of an n-gon are a set of lines, where n is a positive integer greater than three. Traverse all lines in all layers except the red layer. If a line intersects the above polygon, add it to the polygon combination to form a structure combination.

[0053] Traverse all structural combinations, traverse all straight lines in the structural combinations, obtain the starting and ending coordinates of each line and the color of the layer it is in, use the Matplotlib library in Python to draw it, make the x-axis and y-axis have the same scale and are not displayed, and save it as a PNG image format;

[0054] Use image recognition algorithms to identify the types of structures in PNG images;

[0055] Step 3.12: Determine the length markings, including horizontal and vertical length markings:

[0056] Determine the horizontal length mark, establish List 3, traverse all red oblique lines with a slope of +1 in the red layer, and determine whether there is a red vertical line intersecting with it. If so, add the red oblique line to List 3; classify and group the red oblique lines based on the y-coordinate size of the center point of the red oblique line, group those with the same Y coordinate into one group, obtain the vertical oblique line group, and sort them from small to large according to the x-coordinate; establish List 4, traverse all the vertical oblique line groups obtained above, if the number of red oblique lines in the group is greater than 2, then take out two red oblique lines at a time in order, and determine whether the endpoints of the horizontal red lines in the red layer are at the midpoint of these two red oblique lines. If so, this red horizontal line and the red oblique lines on both sides represent the horizontal length mark. Add this red horizontal line and two red oblique lines as a combination to List 4; if the number of lines in the group is equal to 2, determine whether the endpoints of the horizontal red line in the red layer are respectively at the midpoints of these two oblique lines. If so, this red horizontal line and the red oblique lines on both sides represent the horizontal length annotation, and add the red horizontal line and the two red oblique lines as a combination to List 4; traverse all combinations in List 4 and select the horizontal line in the combination, traverse all text representing numbers in the red layer, and determine whether the text position is near the horizontal line and whether the x-coordinate of the text position is simultaneously between the x-coordinates of the two end points of the horizontal line. If both are satisfied, this red digital text represents the annotation size, and the annotation size number is added to the corresponding combination to obtain the horizontal length annotation;

[0057] Determine the vertical length mark, create List 5, and iterate over all red oblique lines with a slope of -1 in the red layer to determine if there is a red vertical line intersecting with it. If so, add the red oblique line to List 5. Classify and group the red oblique lines based on the x-coordinate of their center point, grouping those with the same x-coordinate. Obtain the horizontal oblique line groups and sort them in ascending order of y-coordinate. Create List 6 and iterate through all horizontal oblique line groups. If the number of oblique lines in a group is greater than 2, then sequentially select two red oblique lines at a time and determine if any vertical red lines in the red layer have endpoints at the midpoints of these two oblique lines. If so, this red vertical line and the two red oblique lines on either side represent vertical length labels. Add the red vertical line and the two red oblique lines as a combination to List 6. Iterate through all combinations in List 6 and select the vertical lines in the combination. Iterate through all text representing numbers in the red layer and determine if the text position is near the vertical line and if the y coordinate of the text position is between the y coordinates of the two ends of the horizontal line. If both conditions are met, the red digital text represents the label size. Add the label size number to the corresponding combination to obtain the vertical length label.

[0058] Step 3.13: Length marking matches the corresponding structure:

[0059] For structures with horizontal length annotations, traverse all combinations of horizontal length annotations, obtain the coordinates of the two end points of the horizontal line, traverse all lines representing the structure, and determine whether the x-coordinates of the two end points of the structure's line are consistent with the coordinates of the two end points of the horizontal line. If they are consistent, this horizontal length annotation corresponds to the structure to which this line belongs;

[0060] For structures with vertical length annotations, traverse all vertical length annotation combinations, take the coordinates of the two end points of the vertical line, traverse all lines representing the structure, and determine whether the y coordinates of the two end points of the structure's line are consistent with the coordinates of the two end points of the horizontal line. If they are consistent, this vertical length annotation corresponds to the structure to which this line belongs;

[0061] Step 3.14, confirm the text annotation:

[0062] Create a new list 7, traverse all the red text in the red layer, traverse all the red horizontal lines in the red layer, if the smaller value of the distance between the red text and the two ends of the red horizontal line is less than 3, add the red text and the red horizontal line as a combination to list 7; traverse all elements in list 7, traverse all the red lines in the red layer (excluding the horizontal lines in list 7), and determine whether the line contained in the element is connected to the red line. If so, add this line to this combination until the traversal is completed. The combination represents the text annotation, and the endpoint of the second unconnected line in the combination is the annotation point of this text annotation; if this annotation point is on a line, the text annotation is on the line; if the annotation point is inside a shape, the text annotation is on the shape;

[0063] Step 3.15, determine the foundation treatment: traverse the red text of all red layers and determine whether the text content contains the text content of the foundation treatment method. If it does, then this treatment method is the foundation treatment method for this roadbed cross section;

[0064] 4. Define the intersection of the bottom point of the inverted triangle of the ground line elevation mark and the ground line as the coordinate origin, and recalculate the coordinate information of all extracted objects.

[0065] Furthermore, the digital marking corresponding to the red text is near the horizontal red straight line, which means: setting a distance threshold, calculating the distance between the red text and the horizontal red straight line, and if the distance is not greater than the distance threshold, it is considered that the digital marking is near the horizontal red straight line; according to the drawing habit, the distance threshold is set to 1-3.

[0066] Furthermore, the structure includes side ditches, drainage ditches, gutters, blind ditches, gravity walls, cantilever walls, buttress walls, foot walls, submerged slopes and ground markings.

[0067] Furthermore, the image recognition algorithm processing process is: obtaining PNG format images of structures on different types of high-speed railway subgrade cross-section drawings, forming a structure data set, and training a target recognition model with the structure data set.

[0068] Furthermore, the target recognition model is at least one of the YOLO series model, Faster R-CNN, SSD, etc.

[0069] Furthermore, the method summarizes the extracted information and saves it in a database format. The database format is extracted object name - extracted object type - extracted object attributes - coordinates representing the extracted object graphics. The information in the database is selected and used as needed.

[0070] Furthermore, the database format includes but is not limited to Microsoft Excel and Structured Query Language database (SQL); it is saved in an Excel table, and the extracted object name, object type, attribute information, and point coordinate information are presented in the Excel table; the attribute information is obtained through further processing based on the extracted object.

[0071] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the method can be implemented when the program is executed by a processor.

[0072] Furthermore, the computer-readable storage medium has a program interface. By selecting the high-speed railway subgrade cross-section drawing to be identified, entering the location and name of the table from which information needs to be exported, and running the program, the identified drawing information can be obtained.

[0073] Compared with the prior art, the present invention has the following beneficial effects:

[0074] This paper proposes multiple information extraction and matching methods for the design features of different types of extracted objects in two-dimensional high-speed railway subgrade cross-section drawings. The goal is to digitize the information of completed two-dimensional DWG-formatted high-speed railway subgrade cross-section drawings. By converting DWG files into DXF format, basic primitive information is extracted, including line and arc information and text information. This data is then processed. Based on railway design specifications and the graphical features of each extracted object, the extracted object information that may be included in the railway subgrade cross-section drawings is identified and matched. Finally, the extracted object information is stored in a database using the name, type, attribute, and coordinates based on the railway alignment.

[0075] The present invention can analyze the digital drawings of high-speed railway subgrade cross-section design and extract the required information. It can use the digitized information to verify the drawing information and calculate the engineering quantities in the drawings. It can also provide basic data for further design. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] In order to more clearly illustrate the technical solutions of some embodiments of the present application, the drawings required by some embodiments of the present application are briefly introduced below. The following drawings only show certain embodiments of the present application, constitute part of the present application, and do not constitute a limitation on the embodiments of the present invention.

[0077] Figure 1 It is a workflow diagram of a method for digitizing high-speed railway subgrade cross-section design information based on graphic element features.

[0078] Figure 2 It is the digital format of the extracted high-speed railway subgrade cross-section design information, which only contains header information but no specific data.

[0079] Figure 3 It is an example of a high-speed railway subgrade cross-section design drawing.

[0080] Figure 4 is identification Figure 3 Data information saved in Excel format.

[0081] Figure 5 Schematic diagram of the relationship between the endpoints of the roadbed surface line and the ground line. DETAILED DESCRIPTION

[0082] In order to further describe the technical means and process for achieving the predetermined purpose of the invention, the technical solution of the present invention is further described below in conjunction with the accompanying drawings and preferred embodiments, but this does not limit the scope of protection of the present invention.

[0083] High-speed railway subgrade cross-section drawings are generally in DWG format. Since the block content in the drawings cannot be directly extracted, the blocks are split using the EXPLODE command in AutoCAD software. The drawing file is saved and converted to DXF format. The entity portion of the DXF drawing file can be directly read using the dxfgrabber library or ezdxf library in the Python standard library. For example, the steps for obtaining a straight line segment in a DXF drawing file using dxfgrabber are as follows: read the DXF drawing file, traverse the entity elements of the file, and if the element type is "LINE", this element represents a straight line, and the element information is saved as line information. A similar method is used to obtain basic element attribute information in the drawing, including line segment information, arc information, text information, and layer information.

[0084] In this method, basic primitives are matched with the extracted objects to obtain the basic primitives representing the extracted objects. The basic primitive edge shape and geometric features are matched; the location of the basic primitives is matched; coordinates are located using text and graphic annotations; the extracted objects are matched based on the logical connections between the primitives; and information is extracted from engineering drawings using artificial intelligence deep learning. The extracted objects are then adapted based on their characteristics to extract information from the high-speed railway subgrade cross section.

[0085] The structural information in the present invention includes but is not limited to side ditches, drainage ditches, gravity walls, anti-slide piles, cantilever walls, foot walls, blind ditches, submerged slopes, etc.

[0086] The objects extracted from high-speed railroad subgrade cross sections often have relatively fixed shapes in engineering drawings. For example, U-shaped octagons are often used to represent ditches, and quadrilaterals are often used to represent retaining walls. This method analyzes the edge shape characteristics of the drawing and compares them with the shape characteristics of the extracted object. Geometric features include, but are not limited to, shape, area, and whether the figure is closed, to obtain the corresponding extracted object information. Applicable extraction objects include side ditches, drainage ditches, gravity walls, and cantilevered walls.

[0087] Objects extracted from a high-speed railway subgrade cross section have relatively fixed positions in engineering drawings. For example, the line representing the stratigraphic line in a high-speed railway subgrade cross section drawing will appear below the line representing the ground line, and the line representing the slope will appear on both sides of the line representing the subgrade surface. The drawing plane is divided into sections, and the graphic information representing the extracted object is obtained based on the position of the area where the figure is located and the relative position of other known extraction object figures. Applicable extraction object types include stratigraphic lines and soil layers.

[0088] Some extracted objects in high-speed railroad subgrade cross-section drawings are represented by annotations. For example, slope types are indicated by leader lines and text indicating the slope type, and elevation information for extracted objects is indicated by inverted triangles and digital text. Annotations include both text and graphic annotations. For text annotations, the text content is analyzed to determine the location of text that may represent the extracted object. Based on the leader lines and location coordinates, the corresponding extracted object graphic information is obtained. For graphic annotations, the graphic features are analyzed to identify the graphic annotations, and the corresponding extracted object graphic information is obtained based on the connection and position of the graphic annotations. Applicable types include: subgrade surface lines, slope lines, etc.

[0089] Some extracted objects in high-speed railway subgrade cross-section drawings are interconnected and have underlying logical relationships. For example, embankment slope lines are connected to ground lines, and sections of drainage ditch lines are connected to ground lines. Based on the logical relationships of the graphics and the known connections between the extracted objects, the corresponding extracted object information is obtained.

[0090] For structures, we mark them in a large number of existing high-speed railway subgrade cross-section design drawings to obtain a database of structure image samples. We then train an artificial intelligence image recognition algorithm to obtain a model capable of identifying these structures on existing high-speed railway subgrade cross-section design drawings. We then match the identified structure type with the image element information. Applicable structure types include side ditches, drainage ditches, gravity walls, and cantilevered buttresses.

[0091] The artificial intelligence image recognition algorithm can adopt at least one of the YOLO series model, Faster R-CNN, SSD, etc. A model can be used for each structure, or a single model can be used to identify different types of structures through big data training.

[0092] The two-dimensional digital drawing of the high-speed railway subgrade cross-section involved in the method of the present invention is drawn by a computer-aided design (CAD) tool. The drawing format generally defaults to DWG. Format conversion refers to converting the DWG format drawing file into a DXF format file. The DXF format is an open graphics exchange format that contains graphic vector data, from which basic graphic element information can be extracted.

[0093] The ASCII format of a DXF file consists of five main sections: HEADER, CALSSES, TABLES, ENTITIES, and OBJECTS. The main section is the ENTITIES section, which records the primitive information of each drawing entity in the drawing. Basic primitive information is extracted from this section.

[0094] The basic element information in the DXF format of the high-speed railway subgrade cross-section drawing includes line segments, arcs, text, and layer information. To facilitate the subsequent matching of basic elements with the extracted object information, the basic elements are initially screened according to their attributes (type, color, and layer).

[0095] The objects extracted from the high-speed railway subgrade cross-section design are summarized with the matching information of the graphic elements. The summarized information includes but is not limited to: ground lines, ground markings, stratum lines, stratum filling, subgrade surface, filling lines, slope lines, side ditches, drainage ditches, gravity walls, anti-slip piles, cantilever walls, foot walls, blind ditches, submerged slopes, foundation treatment, elevation markings, length markings, text marking information, etc.

[0096] In order to avoid inconsistency in the extracted drawing coordinate information due to different coordinate origins, the coordinate information of all extracted objects is recalculated based on the high-speed rail line position and the intersection of the ground line elevation mark and the ground line as the coordinate origin.

[0097] The method of the present invention ultimately stores the corresponding primitive information of the extracted objects in the digital drawings of the high-speed railway subgrade cross-section design in a database format. The database format consists of the extracted object name, extracted object type, extracted object attributes, and coordinates representing the extracted object graphics. The information in the database can be selected and utilized as needed. The database formats include, but are not limited to, Microsoft Excel and Structured Query Language (SQL) databases.

[0098] This database information can be used to verify drawing information, calculate engineering quantities, and serve as a data basis for further design optimization.

[0099] The embodiments described below are only some embodiments of the present application, rather than all embodiments.

[0100] Example 1

[0101] The following is combined with Figure 3 and attached Figure 4 The implementation process of a high-speed railway subgrade cross-section design information data method is described in detail. Figure 3 Design drawings of high-speed railway subgrade cross sections in DWG format that need to be digitized.

[0102] Step 1: Use the EXPLODE command in AutoCAD to split the block into basic entities such as lines, polylines, and text. Save the drawing file as a DXF file. Obtaining basic entity information from a block is complex. Splitting the block allows you to directly obtain the basic entity information from the entity, making it easier to extract basic entity information later.

[0103] Step 2: Use the dxfgrabber library in the Python standard tool library to read the entity part of the DXF drawing file and obtain the basic element attribute information in the drawing.

[0104] Step 3: Read the DXF drawing file and traverse the ENTITIES elements in the file. If the element type is "LINE," this element represents a line, and the element information is saved as line segment information. If the element type is "LWPOLYLINE," this element represents a line, and the element information is saved as line segment information. If the element type is "TEXT," this element represents a single line of text, and the element information is saved as text information. If the element type is "MTEXT," this element represents multi-line text, and the element information is saved as text information. If the element type is "CIRCLE," this element represents an arc, and the element information is saved as arc information. Line information, text information, and arc information contain the layer information of the basic primitives.

[0105] The line segment information includes straight lines and polylines: straight line information includes the coordinates of the first and last endpoints of the line, the line color, and the layer to which it belongs; polyline information includes the coordinates of all endpoints of the polyline, whether the polyline is a closed polyline, the polyline color, and the layer to which it belongs.

[0106] The arc information includes circle information and arc line information: the circle information includes the coordinates of the center of the circle, the radius of the circle, the color of the circle and the layer it belongs to; the arc line information includes the coordinates of the center of the arc, the radius of the arc, the angle of the arc, the color of the arc and the layer it belongs to.

[0107] The text information includes text content, text type, text location coordinates and the layer to which it belongs.

[0108] The layer information includes layer color and layer name.

[0109] Step 4: Classify basic graphics elements according to layer color.

[0110] There are four main colors for lines and text representing subgrade extraction objects in a high-speed rail subgrade cross section: white lines represent ground lines, red represents stratum lines and various text and graphic annotations, yellow represents design lines, and green represents the main lines (left and right lines). Layers are divided into four categories based on their color properties: white, yellow, green, and red. White layers contain white lines, yellow layers contain yellow lines, green layers contain green lines, and red layers contain red lines. The line color is determined by the layer color.

[0111] Step 5. Determine the elevation marking, mileage pile number and scale in the red layer.

[0112] In the cross section of the high-speed railway subgrade, the elevation is represented by a graphic of a horizontal inverted triangle plus a horizontal extension line plus an elevation number. Traverse all the red lines in the red layer of the drawing, determine the head-to-tail connection relationship of the line segment based on the coordinates of the endpoints of the red lines, and obtain all combinations of lines representing horizontal inverted triangles. Traverse all combinations of triangle lines, and traverse all horizontal red lines and red texts in the drawing except the line representing this inverted triangle. If the horizontal red line and the bottom point of the inverted triangle are on the same horizontal line (the vertical coordinates of the red line and the bottom point are the same), and the number corresponding to the red text is marked near the horizontal red line (according to the distance between the red text (including coordinates, text content, text color) and the horizontal red line, set a distance threshold (according to drawing habits, the distance threshold can be set to 1-3), and the distance within the threshold range is nearby), the inverted triangle and the horizontal red line are elevation graphic annotations, and the digital text is the elevation, and the elevation annotation is obtained.

[0113] Mileage pile number. Traverse all red text. If the red text contains the letters "DK", this red text represents the drawing pile number information. Record it as pile number text and record the coordinate position of this pile number text. Traverse all red text again and find the text that is on the same horizontal line as the pile number text and is a number. Record it as mileage information. The pile number text and mileage information constitute the drawing mileage pile number information.

[0114] Drawing scale. Traverse all red text. If any red text contains text indicating scale, such as "scale" or "proportion," record the location of this text. Traverse the red text again and find text on the same horizontal line as this text in the form of "1:xxx." This text indicates the scale information of the drawing.

[0115] Step 6. Determine the ground line in the white layer.

[0116] High-speed rail subgrade cross sections use white polylines to represent ground lines. Traverse all white polylines in the white layer of the drawing and calculate the distance from the base point of any elevation annotation inverted triangle to the white polyline (distance is defined as the minimum distance from the base point to all lines in the white polyline). If the distance is 0, and the coordinates of the base point of the elevation annotation inverted triangle are on a straight line of the polyline, then the base point of the elevation annotation inverted triangle is on this polyline, and this white polyline represents the ground line. The elevation corresponding to this elevation annotation inverted triangle is the ground elevation. There is only one ground elevation on the entire drawing.

[0117] Step 7: Determine the stratigraphic line and soil layer based on the ground line.

[0118] The high-speed railway subgrade cross section uses red polylines to represent the stratigraphic line. Traverse all the red polylines in the red layer. If the red polyline is entirely below the white polyline representing the ground line and the x-coordinate of the starting point of the red polyline is the same as that of the white polyline representing the ground line, then this red polyline is the stratigraphic line.

[0119] The specific process of determining the soil layer name is as follows: traverse all arc information (radius, center coordinates, color) in the red layer, find the arc with a radius of 2, traverse the red text, find the text representing Roman numerals, determine whether the text coordinates are within the arc, and if so, save the text combination of the arc and Roman numerals, then traverse all text combinations, traverse the red text, and determine whether the coordinates of the red text and the text combination are on the same horizontal line. If so, the red text and the text combination constitute the soil layer information as a whole;

[0120] Find all stratigraphic lines and soil layers, sort them, and determine the corresponding soil layers between adjacent stratigraphic lines;

[0121] Step 8: Determine the roadbed surface line.

[0122] Traverse the red text in the red layer and get the red text containing the letter "h". Traverse the red text again and find the digital text with positive and negative signs on the same horizontal line as the red text containing the letter "h". This digital text is the elevation difference between the shoulder and the ground line. The elevation difference plus the ground elevation determined in step 6 is the shoulder elevation value; traverse all the elevation annotations determined in step 5 and find the elevation annotation with the same elevation value as the shoulder elevation. This elevation annotation is the shoulder elevation annotation; there may be 1 or 2 shoulder elevation annotations.

[0123] The subgrade surface line is represented by a yellow design line and is connected to the base of the inverted triangle representing the shoulder elevation. If a shoulder elevation annotation exists, traverse all yellow lines in the yellow layer to determine whether the base of the inverted triangle representing the shoulder elevation annotation is on the endpoint of this yellow line or on the yellow line, and whether the absolute value of the slope of this yellow line is 4%. If both conditions are met, this yellow line represents the subgrade surface line and is named Subgrade Surface Line 1. Traverse all yellow lines in the yellow layer except Subgrade Surface Line 1 to determine whether this yellow line is connected to Subgrade Surface Line 1 and has an absolute value of the slope of 4%. If both conditions are met, this yellow line represents the subgrade surface line and is named Subgrade Surface Line 2. Subgrade Surface Line 1 and Subgrade Surface Line 2 are the subgrade surface lines.

[0124] If there are two shoulder elevation labels, one on each side of the subgrade surface line, for the first elevation label, traverse all yellow lines in the yellow layer to determine whether the bottom point of the inverted triangle representing the shoulder elevation label is on the endpoint of this yellow line or the yellow line, and the absolute value of the slope of this yellow line is 4%. If both conditions are met, this yellow line represents the subgrade surface line and is named Subgrade Surface Line 1. For the second elevation label, traverse all yellow lines in the yellow layer to determine whether the bottom point of the inverted triangle representing the shoulder elevation label is on the endpoint of this yellow line or the yellow line, and the absolute value of the slope of this yellow line is 4%. If both conditions are met, this yellow line represents the subgrade surface line and is named Subgrade Surface Line 2. Subgrade Surface Line 1 and Subgrade Surface Line 2 are subgrade surface lines. The subgrade surface line consists of two lines: the left line is called the left subgrade surface line, and the right line is called the right subgrade surface line.

[0125] The roadbed cross section is classified according to the roadbed surface line and the ground line. The ground line is a polyline composed of multiple line segments connected end to end. The left and right endpoints of the roadbed surface line are found, and the relationship between the two endpoints of the roadbed surface line and the left and right endpoints of the line segment adjacent to the ground line is determined. If the x coordinate of an endpoint of the roadbed surface line is between the x coordinates of the left and right endpoints of a line segment of the ground line (see Figure 5 , Figure 5The x-coordinate of point P in the middle is within the x-coordinate range of the two endpoints of segment AB in the polyline, where segment AB is the adjacent segment. Then calculate the cross product of the vector AP formed by the left endpoint A of the segment and the endpoint P of the roadbed surface line, and the vector AB formed by the left endpoint A and the right endpoint B of the segment. If the cross product results of the two endpoints of the roadbed surface line are both greater than 0, the roadbed cross section is an embankment cross section. If the cross product results of the two endpoints of the roadbed surface line are both less than 0, the roadbed cross section is a cutting cross section. If the cross product results of the two endpoints of the roadbed surface line are one positive and the other negative, the roadbed cross section is a half-embankment half-cutting cross section. So far, the roadbed is divided into three types: embankment, cutting, and half-embankment half-cutting:

[0126] If the roadbed surface line is above the ground line. The ground line is a polyline composed of multiple line segments connected end to end. Split it into multiple straight lines, traverse the multiple straight lines mentioned above, and find the line whose left and right endpoints are on both sides of the coordinates of the roadbed surface line endpoint. Assuming that the roadbed surface line endpoint is P and the left endpoint of this line is A and the right endpoint is B, calculate the cross product of vectors AB and AP. If the calculation result is greater than zero, it means that the roadbed surface line endpoint is above this line. If the calculation results of the left and right endpoints of the roadbed surface line are both greater than zero, this roadbed cross section is an embankment cross section.

[0127] If the roadbed surface line is below the ground line. Split the polyline representing the ground line into multiple straight lines, traverse the multiple straight lines mentioned above, and if the left and right endpoints of this line are on both sides of the roadbed surface line endpoint, assuming that the roadbed surface line endpoint is P and the left endpoint of this line is A and the right endpoint is B, calculate the cross product of vectors AB and AP. If the calculated result is less than zero, it means that the roadbed surface line endpoint is below this line. If both the left and right endpoints of the roadbed surface line meet the requirements, this roadbed cross section is a cutting cross section;

[0128] If the ground line intersects the roadbed surface line, part of the roadbed surface line is above the ground line, and part is below the ground line. Split the polyline representing the ground line into multiple straight lines, and traverse the multiple straight lines mentioned above. If the left and right endpoints of this line are on both sides of the roadbed surface line endpoint, assuming that the roadbed surface line endpoint is P and the left endpoint of this line is A and the right endpoint is B, calculate the cross product of vectors AB and AP. If the calculated result is greater than zero, it means that the roadbed surface line endpoint is above this line. If the calculated result is less than zero, it means that the roadbed surface line endpoint is below this line. If the calculated results of the left and right endpoints of the roadbed surface line are one positive and one negative, this roadbed cross section is a half-embankment and half-cut cross section.

[0129] Determine the slope line and the roadbed fill and fill line. For embankment, perform steps 9-10; for cutting, perform steps 11-12; for half embankment and half cutting, perform steps 13-14;

[0130] Step 9. Determine the embankment slope line. The slope is represented by a yellow straight line. Traverse all the red texts in the red layer and find the text with the content in the form of "1:m" or "4.m%". This is the slope text (m represents any number). The possible slope of the slope line is obtained based on the slope text. Traverse all the yellow straight lines in the yellow layer and determine whether their slope is the same as the slope represented by the slope text and whether the slope text is near this line to obtain the possible slope line. The yellow straight lines that may be slope lines are classified according to the positive and negative slopes. A positive slope indicates a possible slope line for the left side slope, and a negative slope indicates a possible slope line for the right side slope. Traverse the possible slope line of the left side slope and determine whether it is connected to the left roadbed surface line. If connected, this line is the left side slope line 1. After removing Left Slope Line 1 from the possible slope lines on the left side, continue traversing to determine if it connects to Left Slope Line 1. If so, this line is Left Slope Line 2. After removing Left Slope Line 1 and Left Slope Line 2 from the possible slope lines on the left side, continue traversing to determine if it connects to Left Slope Line 2. If so, this line is Left Slope Line 3. Repeat this process until no more lines are found to be connected, thus obtaining all the left side slope lines. The same process is used to determine if the possible slope lines on the right side are the right side slope lines. The slope corresponding to the slope line is the slope gradient.

[0131] Step 10: Determine the embankment subgrade fill line and subgrade fill. The subgrade fill line is represented by a yellow straight line. The subgrade fill line is below the subgrade surface line and connected to the side slope line. Traverse all yellow lines in the yellow layer to determine whether they are below the subgrade surface line, have the same slope as the subgrade surface line, and are connected to the side slope line. If they meet these requirements, they are subgrade fill lines.

[0132] Roadbed fill is text near the roadbed fill line. Traverse all red text in the red layer and determine whether the horizontal coordinate of the red text is between the horizontal coordinates of the left and right endpoints of the roadbed fill line. Also, determine whether the vertical distance to the roadbed fill line closest to the red text is less than 20. If so, the red text is considered to represent roadbed fill.

[0133] Step 11. Determine the slope line of the cutting. The slope is represented by a yellow straight line. Traverse all the red texts in the red layer and find the text with the content in the form of "1:m" or "4.m%". This is the slope text (m represents any number). The possible slope of the slope line is obtained based on the slope text. Traverse all the yellow straight lines in the yellow layer and determine whether their slope is the same as the slope represented by the slope text and whether the slope text is near this line to obtain the possible slope line. The yellow straight lines that may be slope lines are classified according to the positive or negative slope. The one with a negative slope represents the possible slope line of the left slope, and the one with a positive slope represents the possible slope line of the right slope. Traverse the possible slope line of the left slope and determine whether it is connected to the ground line. If connected, this line is the left slope line 1. After removing left slope line 1 from the possible slope lines on the left side, continue traversing to determine if it connects to left slope line 1. If so, this line is left slope line 2. After removing left slope line 1 and left slope line 2 from the possible slope lines on the left side, continue traversing to determine if it connects to left slope line 2. If so, this line is left slope line 3. Repeat this process until no straight lines are found that meet the requirement for connection. All left slope lines have been obtained. The same process is used to determine if a possible slope line on the right side is the right slope line. The slope corresponding to the slope line is the slope gradient.

[0134] Step 12: Determine the cutting fill line and its fill. Traverse all the red lines in the red layer to obtain a red oblique line with a slope of +1. Traverse these red oblique lines to determine whether this red oblique line intersects with the roadbed surface line. If so, obtain line 1.

[0135] Traverse all red vertical lines in the red layer to determine whether this red vertical line intersects with both Line 1 and the roadbed surface line. If so, obtain Line 2. Create List 1 and traverse all red oblique lines with a slope of +1, except Line 1, to determine whether they intersect with Line 2. If they do, add this line to List 1. Traverse all red oblique lines in List 1 and all yellow lines in the yellow layer to determine whether this yellow line intersects with both the red oblique lines and Line 2. If so, this line is the roadbed fill line.

[0136] Create List 2 and iterate over all red horizontal lines to determine if they intersect with Line 2. If so, add the intersection point to List 2. Iterate over all points in List 2 and all red text in the red layer. If the distance between the red text and the point is less than 1, the text represents roadbed filler, and all filler information is obtained.

[0137] Step 13: Determine the half-embankment half-cut slope line. The slope is represented by a yellow line. Traverse all red text in the red layer and find text with the form "1:m" or "4.m%." This is the slope text (m represents any number). Based on the slope text, determine the possible slope of the slope line. Traverse all yellow lines in the yellow layer and determine whether their slope is the same as the slope indicated by the slope text and whether the slope text is near this line to determine the possible slope line.

[0138] If the left endpoint of the roadbed surface line is above the ground line and the right endpoint is below the ground line, the slopes on both sides are positive. Traverse the above possible slope lines to determine whether they are connected to the left roadbed surface line. If so, this line is left slope line 1. Remove left slope line 1 from the above possible slope lines and continue traversing to determine whether they are connected to left slope line 1. If so, this line is left slope line 2. Remove left slope line 1 and left slope line 2 from the above possible slope lines and traverse to determine whether they are connected to left slope line 2. If so, this line is left slope line 3. Repeat this process until there are no more connected lines. All left slope lines have been obtained. Traverse the above possible slope lines to determine whether they are connected to the ground line. If so, this line is right slope line 1. After removing the right side slope line 1 from the possible slope lines, continue traversing to determine whether it is connected to the right side slope line 1. If so, this straight line is the right side slope line 2. After removing the right side slope line 1 and the right side slope line 2 from the possible slope lines, continue traversing to determine whether it is connected to the right side slope line 2. If so, this straight line is the right side slope line 3. Repeat this process until there are no straight lines that meet the connection requirement, and all the right side slope lines can be obtained.

[0139] If the left endpoint of the roadbed surface line is below the ground line and the right endpoint is above the ground line, the slopes on both sides are negative. Traverse the above possible slope lines to determine whether they are connected to the ground line. If so, this line is left slope line 1. Remove left slope line 1 from the above possible slope lines and continue traversing to determine whether they are connected to left slope line 1. If so, this line is left slope line 2. Remove left slope line 1 and left slope line 2 from the above possible slope lines on the left side and traverse to determine whether they are connected to left slope line 2. If so, this line is left slope line 3. Repeat this process until there are no more connected lines. All left slope lines have been obtained. Traverse the above possible slope lines to determine whether they are connected to the roadbed surface line. If so, this line is right slope line 1. After removing right side slope line 1 from the possible side slope lines, continue traversing to determine whether it is connected to right side slope line 1. If so, this line is right side slope line 2. After removing right side slope line 1 and right side slope line 2 from the possible side slope lines, traverse to determine whether it is connected to right side slope line 2. If so, this line is right side slope line 3. Repeat this process until there are no more connected lines. In this way, all right side slope lines can be obtained. The slope corresponding to the slope line is the slope gradient.

[0140] Step 14: Determine the filling line and filling material of the half-embankment and half-cut. Same as step 12.

[0141] Step 15: Determine the main line (left line, right line). The high-speed railway subgrade has a main line or a left line and a right line. These are represented by green dashed lines. Traverse all green lines in the green layer. The lines that are vertical and intersect the subgrade surface line are the main line (single track) or the left line and right line (double track).

[0142] Step 16: Identify structures in the high-speed railway subgrade cross-section drawings, including side ditches, drainage ditches, gutters, blind ditches, gravity walls, cantilever walls, buttresses, foot walls, submerged slopes, and ground markings. Use an AI image recognition algorithm to perform matching, using the side ditch as an example.

[0143] Obtain all the line information mentioned in step 3. Eliminate the previously identified and matched lines and traverse all remaining lines. Based on the end-to-end connection of the line segments, obtain all lines representing closed n-gons. Each n-gon has n sides, representing a set of lines (n is a positive integer greater than three). Traverse all lines in all layers except the red layer. If a line intersects the polygon, add it to the polygon combination to form a structure combination.

[0144] Traverse all structural combinations, traverse all straight lines in the structural combinations, obtain the starting and ending coordinates of each line and the color of the layer it is in, use the matplotlib library in Python to draw it, the x-axis and y-axis have the same scale and are not displayed, and save it as a png image format.

[0145] We captured a large number of side ditch images and labeled them using labelimg to construct a dataset of high-speed railway subgrade cross-section side ditch images. We used the official yolov8s library from yolov8 as the initial model and trained the model using the side ditch dataset to obtain the best training model.

[0146] The generated model is used to identify all images drawn using the Matplotlib library in Python. The image recognition results are obtained, including the predicted category name and the corresponding category score. If the image contains a lateral ditch category and the category score is greater than 0.8, the line drawn in the image is considered to represent a lateral ditch.

[0147] This method is used to identify and match drainage ditches, gutters, blind ditches, gravity walls, cantilever walls, buttress walls, foot walls, submerged slopes, and ground signs in the cross section of the high-speed railway subgrade.

[0148] Step 17: Determine the length marking, including horizontal and vertical length markings.

[0149] To determine the horizontal length mark, create List 3. Iterate over all red oblique lines with a slope of +1 in the red layer and determine if a red vertical line intersects them. If so, add the red oblique line to List 3. Classify and group the red oblique lines based on the y-coordinates of their center points. Group those with the same y-coordinate to obtain vertical oblique line groups, and sort them by x-coordinate from smallest to largest. Create List 4. Iterate over all vertical oblique line groups obtained above. If the number of red oblique lines in a group is greater than two, extract two red oblique lines at a time and determine if any horizontal red line in the red layer has its endpoints at the midpoint of these two lines. If so, this horizontal red line and the two red oblique lines on either side represent the horizontal length mark. This red horizontal line and the two red oblique lines are added as a group to List 4. If the number of lines in a group is equal to two, determine if any horizontal red line in the red layer has its endpoints at the midpoint of these two lines. If so, this horizontal red line and the two red oblique lines on either side represent the horizontal length mark. This red horizontal line and the two red oblique lines are added as a group to List 4. Traverse all combinations in List 4 and select the horizontal line in the combination. Traverse all text representing numbers in the red layer to determine whether the text position is near the horizontal line and whether the x-coordinate of the text position is between the x-coordinates of the two end points of the horizontal line. If both conditions are met, this red digital text represents the annotation size. Add the annotation size number to the corresponding combination to obtain the horizontal length annotation.

[0150] Determine the vertical length mark, create List 5, and iterate over all red oblique lines with a slope of -1 in the red layer to determine if there is a red vertical line intersecting with it. If so, add the red oblique line to List 5. Classify and group the red oblique lines based on the x-coordinate of their center point, grouping those with the same x-coordinate. Obtain the horizontal oblique line groups and sort them in ascending order of y-coordinate. Create List 6 and iterate through all horizontal oblique line groups. If the number of oblique lines in a group is greater than 2, then sequentially select two red oblique lines at a time and determine if any vertical red lines in the red layer have endpoints at the midpoints of these two oblique lines. If so, this red vertical line and the two red oblique lines on either side represent vertical length labels. Add the red vertical line and the two red oblique lines as a combination to List 6. Iterate through all combinations in List 6 and select the vertical lines in the combination. Iterate through all text representing numbers in the red layer and determine if the text position is near the vertical line and if the y coordinate of the text position is between the y coordinates of the two ends of the horizontal line. If both conditions are met, the red digital text represents the label size. Add the label size number to the corresponding combination to obtain the vertical length label.

[0151] Step 18: Length marking matches the corresponding structure.

[0152] For structures with horizontal length annotations, traverse all combinations of horizontal length annotations, take the coordinates of the two end points of the horizontal line, traverse all lines representing the structure, and determine whether the x-coordinates of the two end points of the structure's line are consistent with the coordinates of the two end points of the horizontal line. If they are consistent, this horizontal length annotation corresponds to the structure to which this line belongs.

[0153] For structures with vertical length annotations, traverse all vertical length annotation combinations, take the coordinates of the two end points of the vertical line, traverse all the lines representing the structure, and determine whether the y coordinates of the two end points of the structure's line are consistent with the coordinates of the two end points of the horizontal line. If they are consistent, this vertical length annotation corresponds to the structure to which this line belongs.

[0154] Step 19, determine the text annotation. Create a new list 7, traverse all the red texts in the red layer, traverse all the red horizontal lines in the red layer, if the smaller value of the distance between the red text and the two end points of the red horizontal line is less than 3, add the red text and the red horizontal line as a combination to list 7. Traverse all elements in list 7, traverse all the red lines in the red layer (excluding the horizontal lines in list 7), and determine whether the line contained in the element is connected to the red line. If connected, add this line to this combination until the traversal is completed. The combination represents the text annotation, and the endpoint of the second unconnected line in the combination is the annotation point of this text annotation. If this annotation point is on a line, the text annotates the line; if the annotation point is inside a figure, the text annotates the figure.

[0155] Step 20: Determine the foundation treatment. Common foundation treatment methods include shallow treatment, drainage consolidation, compaction, replacement, grouting, and structural elements. Traverse the red text in all red layers to determine if the text contains the aforementioned foundation treatment method. If so, the method is the foundation treatment method for this roadbed cross section.

[0156] Step 21: define the intersection of the bottom point of the inverted triangle marked with the ground line elevation and the ground line as the coordinate origin, and recalculate the obtained coordinate information of all extracted objects.

[0157] Summarize the extracted information and save it in Excel in database format, see Figure 3 .

[0158] Any matters not described in the present invention are applicable to the prior art.

Claims

1. A method for digitizing high-speed railway subgrade cross-section design information based on graphic element features, characterized by: Includes the following: Use the EXPLODE command in AutoCAD software to split the blocks and obtain all basic elements and their attribute information; Get elevation annotation information based on the color and layer of the basic graphic element, the connection relationship of the basic graphic element and the text information; Match ground lines based on the color of basic elements, their layers, graphic annotations, and the connection between basic elements; Match stratum lines and soil layers based on the basic element color, layer, location, nearby text annotations, and the direct connection logic relationship between the elements; Match the roadbed surface line, slope line, and roadbed filling line based on the basic element color and layer, text annotation and graphic annotation, geometric features, and the connection logic relationship between elements; For side ditches, drainage ditches, gravity walls, anti-slide piles, cantilever walls, foot walls, blind ditches, and submerged slopes, image recognition algorithms are used for information matching; Obtain length and text annotation information based on the color and layer of the basic graphic element, the geometric shape characteristics of the basic graphic element, and text information; Obtain mileage pile number information, scale information and foundation treatment information based on text annotation information; According to the connection logic relationship between the annotation information and the structure or basic graphic element, the annotation information of the structure or basic graphic element is obtained; Define the intersection of the ground line elevation mark and the ground line as the coordinate origin, and recalculate the coordinate information of all structures obtained; The structural information with calculated coordinates is summarized and saved in a database format.

2. A method for digitizing high-speed railway subgrade cross-section design information based on graphic element features, characterized by: The dataization method comprises the following steps:

1. Use the EXPLODE command in AutoCAD software to split the block into basic graphics elements including straight lines, polylines, and text, save the drawing file, and save it in DXF format; Second, use the dxfgrabber library in the Python standard tool library to read the entity part of the DXF drawing file and obtain the basic primitive attribute information in the drawing. The basic primitive attribute information includes coordinates, layer information, text content, and text type; 3. Data processing based on layer color: Step 3.1: Determine the elevation mark, mileage pile number and scale in the red layer Traverse all the red lines in the red layer of the drawing, determine the head-to-tail connection relationship of the line segments based on the endpoint coordinates of the red lines, and obtain all combinations of lines representing horizontal inverted triangles; traverse all combinations of lines representing triangles, and traverse all horizontal red lines and red texts in the drawing except the line representing the inverted triangle. If the horizontal red line and the base point of the inverted triangle are on the same horizontal line, and the number corresponding to the red text is near the horizontal red line, then the inverted triangle and the horizontal red line are elevation graphic annotations, and the number text is the elevation, and thus the elevation annotation is obtained; Mileage pile number: traverse all red texts. If the red text contains the letters "DK", this red text represents the drawing pile number information, record it as pile number text, and record the coordinate position of this pile number text; traverse all red texts again, find the text with numbers on the same horizontal line as the pile number text, record it as mileage information, and then the pile number text and mileage information will form the drawing mileage pile number information; Drawing scale: Traverse all red text. If any red text contains scale text information, record the location of this text. Traverse the red text again and find the text on the same horizontal line as this text in the format of "1:xxx". This text represents the scale information of the drawing. Step 3.2: Determine the ground line in the white layer Traverse all white polylines in the white layer, calculate the distance from the bottom point of any elevation inverted triangle to the white polyline, and find the elevation inverted triangle and the corresponding white polyline when the distance is 0 and the coordinates of the bottom point of the elevation inverted triangle are on a straight line of the polyline. This white polyline represents the ground line, and the elevation corresponding to this elevation inverted triangle is the ground elevation. There is only one ground elevation on the entire drawing; Step 3.3: Determine the stratigraphic line and soil layer based on the ground line Traverse all the red polylines in the red layer. If the entire red polyline is below the white polyline representing the ground line and the x-coordinate of the starting point of the red polyline is consistent with that of the white polyline representing the ground line, then this red polyline is the ground line. The specific process of determining the soil layer name is as follows: traverse all arc information in the red layer, find the arc with a radius of 2, traverse the red text, find the text representing Roman numerals, determine whether the text coordinates are within the arc, and if so, save the text combination of arc and Roman numeral; find the corresponding red text on the same horizontal line as the coordinates of each text combination, and use the red text and text combination as the soil layer information; Find all stratigraphic lines and soil layers, sort them, and determine the corresponding soil layers between adjacent stratigraphic lines; Step 3.4: Determine the roadbed surface line Traverse the red text in the red layer and obtain the red text containing the letter "h". Traverse the red text again and find the digital text with positive and negative signs on the same horizontal line as the red text containing the letter "h". This digital text is the elevation difference between the shoulder and the ground line. Add this elevation difference and the ground elevation determined in step 3.2 to get the shoulder elevation value. Traverse all the elevation annotations determined in step 5 and find the elevation annotation with the same elevation value as the shoulder elevation. This elevation annotation is the shoulder elevation annotation. There may be one or two shoulder elevation annotations. In the yellow layer, find the yellow straight line that passes through the coordinates of the bottom point of the inverted triangle marked by the shoulder elevation and has an absolute slope of 4%. This is the subgrade surface line. The subgrade surface line consists of two straight lines: the line on the left is called the left subgrade surface line, and the line on the right is called the right subgrade surface line. If there is only one shoulder elevation mark, use the yellow straight line connected to the subgrade surface line found in the above method and with an absolute slope of 4% as the other subgrade surface line. The roadbed cross section is classified according to the roadbed surface line and the ground line. The ground line is a polyline composed of multiple line segments connected end to end. The left and right endpoints of the roadbed surface line are found, and the relationship between the x-coordinates of the two endpoints of the roadbed surface line and the left and right endpoints of the line segment adjacent to the ground line is determined. If the x-coordinate of a certain endpoint of the roadbed surface line is between the x-coordinates of the left and right endpoints of a certain line segment of the ground line, the cross product of the vector AP composed of the left endpoint A of the line segment and the endpoint P of the roadbed surface line and the vector AB composed of the left endpoint A and the right endpoint B of the line segment is calculated. If the cross product results of the two endpoints of the roadbed surface line are both greater than 0, the roadbed cross section is an embankment cross section. If the cross product results of the two endpoints of the roadbed surface line are both less than 0, the roadbed cross section is a cutting cross section. If the cross product results of the two endpoints of the roadbed surface line are one positive and the other negative, the roadbed cross section is a half-embankment half-cutting cross section. At this point, the roadbed is divided into three types: embankment, cutting, and half-embankment half-cutting. Determine the slope line and the roadbed fill and fill line. For embankment, perform steps 3.5-3.6; for cutting, perform steps 3.7-3.8; for half embankment and half cutting, perform steps 3.9-3.10; Step 3.5: Determine the embankment slope line: Traverse all red text in the red layer and find text with the content of "1:m" or "4.m%". This is the slope text, where m represents any number. In the yellow layer, find yellow straight lines with the same slope as the slope text and near the slope text as possible slope lines. Classify the yellow straight lines that may be slope lines according to the positive or negative slope. A positive slope indicates a possible slope line on the left side, and a negative slope indicates a possible slope line on the right side. Traverse the possible slope lines of the left side slope to determine whether they are connected to the left roadbed surface line. If so, this straight line is the left side slope line 1; remove the left side slope line 1 from the possible slope lines of the left side slope and continue traversing to determine whether they are connected to the left side slope line 1. If so, this straight line is the left side slope line 2; remove the left side slope line 1 and the left side slope line 2 from the possible slope lines of the left side slope and traverse to determine whether they are connected to the left side slope line 2. If so, this straight line is the left side slope line 3... Repeat this process until there is no straight line that satisfies the connection, that is, all the left side slope lines are obtained; the process of determining whether the possible slope line of the right side slope is the right side slope line is the same; the slope corresponding to the slope line is the slope gradient; Step 3.6, determine the embankment subgrade filling line and subgrade filling: Traverse all yellow lines in the yellow layer and determine whether they are below the roadbed surface line, have the same slope as the roadbed surface line, and are connected to the slope line. If they meet the requirements, they are roadbed fill lines. In the red layer, find the red text whose text coordinates are between the horizontal coordinates of the left and right endpoints of the roadbed filling line and whose vertical distance to the roadbed filling line is less than 20 and use it as the roadbed filling; Step 3.7: Determine the cutting side slope line. This is similar to step 3.5, except that after finding the left side slope line 1, you need to determine whether the possible side slope line of the left side slope is connected to the ground line. Determine the left and right side slope lines and slope gradients of the cutting. Step 3.

8. Determine the cutting fill line and its filler: Find the red oblique straight line with a slope of +1 that intersects the roadbed surface line as Line 1; traverse all red vertical lines in the red layer to determine whether this red vertical line intersects both Line 1 and the roadbed surface line. If so, obtain Line 2; create List 1, traverse all red oblique straight lines with a slope of +1 except Line 1, and determine whether they intersect with Line 2. If the intersection condition is met, add this line to List 1; traverse all red oblique straight lines in List 1, and simultaneously traverse all yellow lines in the yellow layer to determine whether this yellow line intersects both the red oblique straight lines in List 1 and Line 2. If so, this line is the roadbed fill line; Create List 2, traverse all red horizontal lines, and determine whether they intersect with Line 2. If so, add the intersection point to List 2. Traverse all points in List 2 and all red text in the red layer. If the distance between the red text and the point is less than 1, the text represents roadbed filler, and all filler information is obtained. Step 3.9, determine the half-embankment half-cut slope line: find all possible slope lines in the yellow layer based on the slope text; If the left endpoint of the roadbed surface line is above the ground line and the right endpoint is below the ground line, follow the method in step 3.5 to traverse all possible slope lines and determine whether they are connected to the left roadbed surface line, and find all the left side slope lines of the half-embankment and half-cut. Follow the method in step 3.7 to traverse all possible slope lines and determine whether they are connected to the ground line, and find all the right side slope lines of the half-embankment and half-cut. If the left endpoint of the roadbed surface line is below the ground line and the right endpoint is above the ground line, follow the method in step 3.7 to find the left side slope lines of all half-embankment and half-cut sections, and follow the method in step 3.5 to find the right side slope lines of all half-embankment and half-cut sections. The method for determining the filling line and filling material of the half-embankment and half-cut is the same as step 3.8; Step 3.10, determine the main line or left line and right line: traverse all green straight lines in the green layer, and the vertical line that intersects the roadbed surface line is the main line or left line and right line; Step 3.11: Determine the structures in the high-speed railway subgrade cross-section drawing: Eliminate the previously identified and matched lines, and traverse all remaining lines. Based on the head-to-tail connection of the line segments, obtain all lines representing closed n-gons. The n sides of an n-gon are a set of lines, where n is a positive integer greater than three. Traverse all lines in all layers except the red layer. If a line intersects a polygon, add it to the polygon combination to form a structure combination. Traverse all structural combinations, traverse all straight lines in the structural combinations, obtain the starting and ending coordinates of each line and the color of the layer it is in, use the Matplotlib library in Python to draw it, make the x-axis and y-axis have the same scale and are not displayed, and save it as a PNG image format; Use image recognition algorithms to identify the types of structures in PNG images; Step 3.12: Determine the length markings, including horizontal and vertical length markings: Determine the horizontal length mark, establish List 3, traverse all red oblique lines with a slope of +1 in the red layer, and determine whether there is a red vertical line intersecting with it. If so, add the red oblique line to List 3; classify and group the red oblique lines based on the y-coordinate size of the center point of the red oblique line, group those with the same Y coordinate into one group, obtain the vertical oblique line group, and sort them from small to large according to the x-coordinate; establish List 4, traverse all the vertical oblique line groups obtained above, if the number of red oblique lines in the group is greater than 2, then take out two red oblique lines at a time in order, and determine whether the endpoints of the horizontal red lines in the red layer are at the midpoint of these two red oblique lines. If so, this red horizontal line and the red oblique lines on both sides represent the horizontal length mark. Add this red horizontal line and two red oblique lines as a combination to List 4; if the number of lines in the group is equal to 2, determine whether the endpoints of the horizontal red line in the red layer are respectively at the midpoints of these two oblique lines. If so, this red horizontal line and the red oblique lines on both sides represent the horizontal length annotation, and add the red horizontal line and the two red oblique lines as a combination to List 4; traverse all combinations in List 4 and select the horizontal line in the combination, traverse all text representing numbers in the red layer, and determine whether the text position is near the horizontal line and whether the x-coordinate of the text position is simultaneously between the x-coordinates of the two end points of the horizontal line. If both are satisfied, this red digital text represents the annotation size, and the annotation size number is added to the corresponding combination to obtain the horizontal length annotation; Determine the vertical length mark, establish List 5, traverse all red oblique lines with a slope of -1 in the red layer, and determine whether there is a red vertical line intersecting with it. If so, add the red oblique line to List 5; classify and group the red oblique lines based on the x-coordinate size of the center point of the red oblique line, group those with the same x-coordinate, obtain horizontal oblique line groups, and sort them from small to large according to the y-coordinate; establish List 6, traverse all horizontal oblique line groups, if the number of oblique lines in the group is greater than 2, take out two red oblique lines each time in order, and determine whether there is a vertical red line in the red layer whose endpoints are at the midpoint of these two oblique lines. If so, this red vertical line and the red oblique lines on both sides represent the vertical length mark, and add the red vertical line. The straight line and the two red oblique lines are added to List 6 as a combination; if the number of lines in the group is equal to 2, determine whether the endpoints of the vertical red line in the red layer are respectively at the midpoints of the two red oblique lines. If so, this red vertical line and the red oblique lines on both sides represent the vertical length annotation, and the red vertical line and the two red oblique lines are added to List 6 as a combination; traverse all combinations in List 6 and take the vertical line in the combination, traverse all text representing numbers in the red layer, and determine whether the text position is near the vertical line and whether the y coordinate of the text position is between the y coordinates of the two end points of the horizontal line. If both conditions are met, the red digital text represents the annotation size, and the annotation size number is added to the corresponding combination to obtain the vertical length annotation; Step 3.13: Length marking matches the corresponding structure: For structures with horizontal length annotations, traverse all combinations of horizontal length annotations, obtain the coordinates of the two end points of the horizontal line, traverse all lines representing the structure, and determine whether the x-coordinates of the two end points of the structure's line are consistent with the coordinates of the two end points of the horizontal line. If they are consistent, this horizontal length annotation corresponds to the structure to which this line belongs; For structures with vertical length annotations, traverse all vertical length annotation combinations, take the coordinates of the two end points of the vertical line, traverse all lines representing the structure, and determine whether the y coordinates of the two end points of the structure's line are consistent with the coordinates of the two end points of the horizontal line. If they are consistent, this vertical length annotation corresponds to the structure to which this line belongs; Step 3.14, confirm the text annotation: Create a new list 7, traverse all the red text in the red layer, traverse all the red horizontal lines in the red layer, and if the smaller value of the distance between the red text and the two endpoints of the red horizontal line is less than 3, add the red text and the red horizontal line as a combination to list 7; traverse all elements in list 7, traverse all the red lines in the red layer excluding the horizontal lines in list 7, and determine whether the lines contained in the elements are connected to the red lines. If so, add this line to this combination until the traversal is completed. The combination represents the text annotation, and the endpoint of the second unconnected line in the combination is the annotation point of this text annotation; if this annotation point is on a line, the text annotation is on the line; if the annotation point is inside a shape, the text annotation is on the shape; Step 3.15, determine the foundation treatment: traverse the red text of all red layers and determine whether the text content contains the text content of the foundation treatment method. If it does, then this treatment method is the foundation treatment method for this roadbed cross section; 4. Define the intersection of the bottom point of the inverted triangle of the ground line elevation mark and the ground line as the coordinate origin, and recalculate the coordinate information of all extracted objects.

3. The method according to claim 2, characterized in that The number corresponding to the red text is marked near the horizontal red line. This means that: a distance threshold is set, and the distance between the red text and the horizontal red line is calculated. If the distance is not greater than the distance threshold, the number is considered to be near the horizontal red line. The distance threshold is set to 1-3 according to drawing habits.

4. The method according to claim 2, characterized in that The structures include side ditches, drainage ditches, gutters, blind ditches, gravity walls, cantilever walls, buttress walls, foot walls, submerged slopes and ground markings.

5. The method according to claim 2, characterized in that The image recognition algorithm processing process is: obtaining PNG format images of structures on different types of high-speed railway subgrade cross-section drawings, forming a structure data set, and training a target recognition model with the structure data set.

6. The method according to claim 5, characterized in that The target recognition model is at least one of the YOLO series model, Faster R-CNN, and SSD.

7. The method according to claim 2, characterized in that The method summarizes the extracted information and saves it in a database format. The database format is extracted object name-extracted object type-extracted object attributes-coordinates representing the extracted object graphics, and the information in the database is selected and used as needed.

8. The method according to claim 7, characterized in that The database format includes Microsoft spreadsheet software and structured query language database; it is saved in an Excel table, and the Excel table presents the extracted object name, object type, attribute information, and point coordinate information; the attribute information is obtained through further processing based on the extracted object.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method described in any one of claims 1 to 8 can be implemented.

10. The computer-readable storage medium according to claim 9, wherein It has a program interface. Select the high-speed railway subgrade cross-section drawing that needs to be identified, enter the location and name of the table whose information needs to be exported, run the program, and you can get the identified drawing information.

Citation Information

Patent Citations

  • Database-based roadbed cross section slope measure batch design method

    CN112270026A

  • Parametric modeling and design optimization method for railway engineering construction shortcut

    CN110569538A

  • Drawing text information extraction method, device and equipment

    CN115995092A

Cited By

  • Automatic calculation system and method for using amount of steel bars of column component based on DXF drawing

    CN122049938A