High-speed rail roadbed cross section design information datamation method based on primitive features
Through the method based on element characteristics, AutoCAD and Python tools are used to extract the cross-section design information of high-speed railway subgrades, solving the problem of low manual design efficiency, realizing automated data processing and information matching, and improving design accuracy and efficiency.
Patent Information
- Application Number
- CN202411321015.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2044-09-23
AI Technical Summary
The existing high-speed railway subgrade cross-section design mainly relies on manual labor, resulting in large design workloads and error-prone, lack of automated design methods, making it difficult to quickly establish standard databases and provide digital samples.
Using the method based on element features, the tiles are split by using the EXPLODE command of AutoCAD software, combined with the Python standard tool library and image recognition algorithm, the basic element information in the cross-section design of high-speed railway subgrade, including ground lines and stratigraphic lines. , roadbed surface lines, etc., save design information through database format.
It realizes the automated data processing of cross-section design information of high-speed railway subgrade, improves design efficiency and accuracy, can quickly extract and match design information, and provides basic data for further design optimization.
Smart Images

Figure CN119106485A_ABST
Abstract
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, and there are problems such as large design workload and easy errors. Therefore, it is proposed to establish a general high-speed railway subgrade cross-section design information database, and combine custom entity technology and object-oriented programming technology to perform automated forward design of high-speed railway subgrade cross-sections. 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 a 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 and matching 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 view of 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 graphics elements and their attribute information;
[0008] The elevation annotation information is obtained according to the color and layer of the basic graphic element, the connection relationship of the basic graphic element and the text information;
[0009] Match the ground line according to the color of the basic graphic element, the layer it is in, the graphic annotation and the connection relationship between the basic graphic element;
[0010] Match the stratigraphic lines and soil layers according to the basic graphic element colors, the layers they are in, the location areas they are in, the text annotations nearby, and the direct connection logic relationships between the graphic elements;
[0011] Match the roadbed surface line, slope line and roadbed filling line according to the basic graphic element color and layer, text annotation and graphic annotation, geometric features and the connection logic relationship between the graphics elements;
[0012] For side ditches, drainage ditches, gravity walls, anti-slide piles, cantilever walls, foot walls, blind ditches, and flooded slopes, image recognition algorithms are used for information matching;
[0013] The length annotation and text annotation information are obtained according to the color and layer of the basic graphic element, the geometric shape characteristics of the basic graphic element and the 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 digitization method comprising the following steps:
[0019] 1. Use the EXPLODE command in AutoCAD software to split the block into basic graphics including straight lines, polylines, and texts, 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, which 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 segment according to the endpoint coordinates of the red line, and obtain all the line combinations representing the horizontal inverted triangle; traverse all the line combinations of triangles, traverse all the horizontal red lines and red texts in the drawing except the line representing the inverted triangle, if the horizontal red line and the bottom point of the inverted triangle are on the same horizontal line, and the digital mark corresponding to the red text is near the horizontal red line, the inverted triangle and the horizontal red line are elevation graphic marks, and the digital text is the elevation, and then the elevation mark is obtained;
[0024] Mileage pile number: traverse all red texts. If the text content of the red text contains the letters "DK", this red text represents the pile number information of the drawing, which is recorded as pile number text, and the coordinate position of this pile number text is recorded; traverse all red texts again, find the text that is on the same horizontal line as the pile number text and is a number, record it as mileage information, and the pile number text and mileage information will form the mileage pile number information of the drawing;
[0025] Drawing scale: traverse all red texts. If the text content of the red text contains text information of the scale, record the position of this text, traverse the red text again, and find the text on the same horizontal line as this text and 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 annotation inverted triangle to the white polyline, find the elevation annotation inverted triangle and the corresponding white polyline when the distance is 0 and the coordinates of the bottom point of the elevation annotation inverted triangle are on a straight line of the polyline. This white polyline represents the ground line, and the elevation corresponding to this elevation annotation 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, the red polyline is the stratum line.
[0030] The specific process of determining the soil layer name is: 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 the arc and Roman numerals; 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 a whole to form 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 to 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 height difference between the shoulder and the ground line. The height difference plus the ground elevation determined in step 3.2 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 among the elevation annotations. This elevation annotation is the shoulder elevation annotation; there may be 1 or 2 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%, which is the roadbed surface line; the roadbed surface line consists of two straight lines, the line on the left is called the left roadbed surface line, and the line on the right is called the right roadbed surface line; when there is only one shoulder elevation mark, the yellow straight line connected to the roadbed surface line found in the above way and with an absolute slope of 4% is used as the other roadbed surface line;
[0035] The roadbed cross section is classified according to the roadbed surface line and the ground line. The ground line is a multi-segment line 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 and half-cutting cross section. So far, the roadbed is divided into three types: embankment, cutting, and half-embankment and half-cutting.
[0036] Determine the slope line and the roadbed fill and fill line. For the embankment, perform steps 3.5-3.6; for the cutting, perform steps 3.7-3.8; for the 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 in the form of "1:m" or "4.m%". This is the slope text, and m represents any number. In the yellow layer, find the yellow straight line with the same slope as the slope text and near the slope text as the possible slope line; classify the yellow straight lines that may be slope lines according to the positive and negative slopes. 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 straight lines in the yellow layer to 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 filling 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 as the roadbed filling;
[0043] Step 3.7, determining the side slope line of the road cut is similar to step 3.5, except that when the left side slope line 1 is found, it is necessary 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 road cut;
[0044] Step 3.8, determine the road cutting filling line and its filling: find the red oblique straight line with a slope of +1, and the red oblique straight line that intersects with the roadbed surface line is line 1; traverse all the red vertical straight lines in the red layer, and determine whether this red vertical straight line intersects with line 1 and the roadbed surface line at the same time. If they intersect, get line 2; establish list 1, traverse all the 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 the red oblique straight lines in list 1, and traverse all the yellow straight lines in the yellow layer at the same time, and determine whether this yellow straight line intersects with the red oblique straight lines in list 1 and line 2 at the same time. If so, this line is the roadbed filling line;
[0045] Create List 2, traverse all red horizontal lines, and determine whether they intersect with Line 2. If they do, add the intersection point to List 2; traverse all points in List 2, and traverse all red texts in the red layer. If the distance between the red text and the point is less than 1, the text represents the 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 according to the slope text;
[0047] If the left end point of the roadbed surface line is above the ground line and the right end point is below the ground line, follow the method of step 3.5 to traverse all possible slope lines, 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 of step 3.7 to traverse all possible slope lines, 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 end point of the roadbed surface line is below the ground line and the right end point 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-cutting sections, and follow the method in step 3.5 to find the right side slope lines of all half-embankment and half-cutting sections;
[0049] The determination method of the half-embankment half-cut filling line and its filling is the same as step 3.8;
[0050] Step 3.10, determine the main line or the left line and the right line: traverse all the green straight lines in the green layer, and the vertical line that intersects with the roadbed surface line is the main line (single track) or the left line and the right line (double track);
[0051] Step 3.11, determine the structures in the high-speed railway foundation cross-section drawing:
[0052] Eliminate the above identified and matched straight lines, traverse all the remaining straight lines, and obtain all the straight lines representing closed n-gons according to the head-to-tail connection relationship of the line segments. The n sides of the n-gon are a group of straight lines, and n is a positive integer greater than three; traverse all the straight lines of all layers except the red layer. If the straight line intersects with the above polygon, add this straight line 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 straight line and the color of the layer it is in, use the matplotlib library in python to draw, the x-axis and y-axis have the same scale and are not displayed, and save it in png image format;
[0054] Use image recognition algorithms to identify the types of structures in png images;
[0055] Step 3.12: Determine the length marking, including horizontal length marking and vertical length marking:
[0056] Determine the horizontal length mark, establish List 3, traverse all the 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, and group the lines with the same Y coordinate into a group to obtain a 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 each time in order, and determine whether the endpoints of the horizontal red lines in the red layer are at the midpoints of these two red oblique lines in turn. If so, this red horizontal line and the red oblique lines on both sides represent the horizontal length mark. Add this red horizontal straight line and two red oblique straight lines as a combination to list 4; if the number of straight lines in the group is equal to 2, determine whether the endpoints of the horizontal red straight line in the red layer are respectively at the midpoints of these two oblique straight lines. If so, this red horizontal straight line and the red oblique straight lines on both sides represent horizontal length annotations, and add the red horizontal straight line and two red oblique straight lines as a combination to list 4; traverse all combinations in list 4 to take the horizontal straight line in the combination, traverse all texts representing numbers in the red layer, determine whether the text position is near the horizontal straight line and whether the x-coordinate of the text position is simultaneously between the x-coordinates of the two end points of the horizontal straight 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, 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. Based on the x-coordinate size of the center point of the red oblique line, classify and group the red oblique lines, group those with the same x-coordinate, obtain the horizontal oblique line group, and sort them from small to large according to the y-coordinate. Create list 6, traverse all horizontal oblique straight line groups, if the number of oblique straight lines in the group is greater than 2, then take out two red oblique straight lines in order each time, and determine whether the endpoints of the vertical red straight line in the red layer are respectively at the midpoints of these two oblique straight lines. If satisfied, this red vertical straight line and the red oblique straight lines on both sides represent the vertical length marking, and the red vertical straight line and the two red oblique straight lines are added as a combination to list 4; if the number of straight lines in the group is equal to 2, determine whether the endpoints of the vertical red straight line in the red layer are respectively at the midpoints of these two red oblique straight lines. If satisfied, this red vertical straight line and the red oblique straight lines on both sides represent the vertical length marking, and the red vertical straight line and the two red oblique straight lines are added as a combination to list 6. Traverse all combinations in list 6 and take the vertical straight line in the combination, traverse all texts representing numbers in the red layer, determine whether the text position is near the vertical straight line and whether the y coordinate of the text position is between the y coordinates of the two ends of the horizontal straight line at the same time, if satisfied at the same time, this red digital text represents the marking size, and the marking size number is added to the corresponding combination to obtain the vertical length marking.
[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 straight line, traverse all the straight lines representing the structure, and determine whether the x coordinates of the two end points of the straight line of the structure are consistent with the coordinates of the two end points of the horizontal straight line. If they are consistent, this horizontal length annotation corresponds to the structure to which this straight line belongs;
[0060] For structures with vertical length annotations, traverse all combinations of vertical length annotations, 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 line of the structure 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 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 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 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;
[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 marked with the ground line elevation 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; the distance threshold is set to 1-3 according to the drawing habit.
[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 YOLOv series models, Faster R-CNN, SSD, etc.
[0069] Furthermore, the method summarizes the extracted information and saves it in a database format, wherein the database format is extraction object name-extraction object type-extraction object attribute-coordinates representing the extraction object graphic, and the information in the database is selected and used as needed.
[0070] Furthermore, the database format includes but is not limited to Microsoft spreadsheet software (Excel) and structured query language database (SQL); 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.
[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 that needs to be identified, inputting the location and name of the table whose 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] The present invention proposes a variety of information extraction and matching methods for different types of extracted object design features in the two-dimensional design drawings of high-speed railway subgrade cross sections, aiming to digitize the two-dimensional drawing information of the designed high-speed railway subgrade cross sections in DWG format. By converting the DWG file into a DXF format file to extract basic primitive information, straight line and arc information and text information are obtained and data processed, and the extracted object information that may be contained in the railway subgrade cross-section drawings is identified and matched according to the railway design specifications and the graphic features of each extracted object. Finally, the obtained extracted object information is stored in the database according to the name-type-attribute-coordinate based on the railway line position.
[0075] The present invention can analyze the digital drawings of high-speed railway subgrade cross-section design and extract the required information, can use the digitized information to check the drawing information, calculate the engineering quantities in the drawings, and 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 some embodiments of the present application, constitute a part of the present application, and do not constitute a limitation on the embodiments of the present invention.
[0077] Figure 1 The present invention is a workflow diagram of a method for digitizing information of high-speed railway subgrade cross-section design 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 Yes 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 the protection scope of the present invention is not limited thereto.
[0083] The cross-section drawings of high-speed railway subgrades 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 the AutoCAD software, the drawing files are saved, and they are converted to DXF format. The dxfgrabber library or ezdxf library in the Python standard library can be used to directly read the entity part of the DXF drawing file. For example, the steps for obtaining the straight line segment of the DXF drawing file through dxfgrabber are: read the DXF drawing file, traverse the entity part elements of the file, and if the element type is "LINE", this element represents a straight line, and the element information is saved as straight line information. The basic primitive attribute information in the drawing is obtained through a similar method, including line segment information, arc information, text information, and layer information.
[0084] In the present invention, the basic primitives are matched with the extracted objects to obtain the basic primitives representing the extracted objects: the geometric features of the edge shapes of the basic primitives are matched; the location areas where the basic primitives are located are matched; coordinates are located using text annotations and graphic annotations; the extracted objects are matched according to the logical relationship of the primitive connections; and the engineering drawings are identified and extracted using the method of artificial intelligence deep learning. Adaptation is performed according to the characteristics of the extracted objects themselves to extract the information of the extracted objects in the cross section of the high-speed railway subgrade.
[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 the cross section of the high-speed railway subgrade have a relatively fixed shape representation in the engineering drawings. For example, the cross section drawings of the subgrade often use "U"-shaped octagons to represent ditches, and quadrilaterals to represent retaining walls. The shape features of the edge of the graphics are analyzed and compared with the shape features of the extracted objects. The geometric features include but are not limited to the shape of the graphics, the area of the graphics, whether the graphics are closed, etc., to obtain the corresponding extracted object information. Applicable extraction object types include: side ditches, drainage ditches, gravity walls, cantilever walls, etc.
[0087] The objects extracted from the cross section of the high-speed railway subgrade have relatively fixed positions in the engineering drawings. For example, the line segments representing the stratigraphic lines in the cross section drawings of the high-speed railway subgrade will be below the line segments representing the ground lines, and the line segments representing the slopes will be on both sides of the line segments representing the roadbed surface. The plane area of the engineering drawing is divided, and the graphic information representing the extracted object is obtained according to the position of the graphic area and the relative position of the areas where other known extracted object graphics are located. Applicable extraction object types include: stratigraphic lines and soil layers.
[0088] Some of the extracted object graphics of the high-speed railway subgrade cross-section engineering drawings are represented by annotations. For example, the type of slope is marked by a lead line and text indicating the slope type, and the elevation information of the extracted object is represented by an inverted triangle graphic annotation and digital text. Annotations include text annotations and graphic annotations. If it is a text annotation, the text content of the text information is analyzed to obtain the text position that may represent the extracted object, and the corresponding extracted object graphic information is obtained based on the lead line and position coordinate information. If it is a graphic annotation, the graphic features are analyzed to find the graphic annotation, and the corresponding extracted object graphic information is obtained based on the connection and position of the graphic annotation. Applicable types include: subgrade surface line, slope line, etc.
[0089] Some of the extracted object graphics in the high-speed railway subgrade cross-section engineering drawings are interconnected and have potential logical relationships, such as the embankment slope line is connected to the ground line, and some line segments of the drainage ditch are connected to the ground line. According to the logical relationship of the graphics and the known connection of the extracted objects, the corresponding extracted object information is obtained.
[0090] For structures, a large number of existing high-speed railway subgrade cross-section design drawings are marked to obtain a database of image samples of the structure, and an artificial intelligence image recognition algorithm is used for training to obtain a model that can identify the structure on the existing high-speed railway subgrade cross-section design drawings, and further match the identified structure type with the graphic element information. Applicable structure types include: side ditches, drainage ditches, gravity walls, cantilevered buttress walls, etc.
[0091] The artificial intelligence image recognition algorithm may adopt at least one of the YOLO series models, Faster R-CNN, SSD, etc. One model may be used for each structure, or one model may be used to identify different types of structures through big data training.
[0092] The two-dimensional design digital drawing of the high-speed railway subgrade cross section involved in the method of the present invention refers to a drawing drawn by a computer-aided design (CAD) tool. The drawing format generally defaults to DWG. The format conversion refers to converting the DWG format drawing file into a DXF format file. The DXF format is an open graphic exchange format that contains graphic vector data, from which basic graphic element information can be extracted.
[0093] The ASCII format of DXF files mainly consists of five parts: HEADER, CALSSES, TABLES, ENTITIES and OBJECTS. The main part is the ENTITIES segment, which records the primitive information of each drawing entity in the drawing. Basic primitive information is extracted from this part.
[0094] The basic primitive information of the high-speed railway subgrade cross-section DXF format drawing includes line segment information, arc information, text information and layer information. In order to facilitate the subsequent matching of basic primitives with extracted object information, the basic primitives are preliminarily screened according to the basic primitive attributes (type, color, layer).
[0095] The objects extracted from the high-speed railway subgrade cross-section design are summarized with the matching information of the graphics elements. The summarized information includes but is not limited to: ground lines, ground markings, stratum lines, stratum filling, subgrade surfaces, filling lines, slope lines, side ditches, drainage ditches, gravity walls, anti-slide piles, cantilever buttress 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 high-speed rail line is used as a reference, and the intersection of the ground line elevation mark and the ground line is used as the coordinate origin to recalculate the coordinate information of all extracted objects.
[0097] The method of the present invention finally saves the corresponding graphic element information of the extracted objects in the digital drawing of the high-speed railway subgrade cross-section design in the format of a database. The database format is the name of the extracted object-the type of the extracted object-the attribute of the extracted object-the coordinates representing the graphics of the extracted object, and the information in the database is selected and used as needed. The database format includes but is not limited to Microsoft spreadsheet software (Excel), structured query language database (SQL), etc.
[0098] This database information can be used to check 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 Provide high-speed railway subgrade cross-section design drawings in DWG format that need to be digitized.
[0102] Step 1. Use the EXPLODE command in AutoCAD software to split the block into basic primitives such as straight lines, polylines, and text, save the drawing file, and save it in DXF format. It is complicated to obtain the basic primitive information in the block. Splitting the block can directly obtain the basic primitives of the split block in the entity part, which is convenient for subsequent extraction of basic primitive information.
[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, traverse the ENTITIES entity elements of the file, if the element type is "LINE", this element represents a straight line, and the element information is saved as line segment information; if the element type is "LWPOLYLINE", this element represents a straight line, and this element is saved as line segment information; if the element type is "TEXT", this element represents a single line of text, and this element is saved as text information; if the element type is "MTEXT", this element represents multi-line text, and this element is saved as text information; if the element type is "CIRCLE", this element represents an arc, and this element is saved as arc information. The 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 straight line, the color of the straight line 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 color of the polyline 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 to which it belongs; 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 to which it belongs.
[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 colors.
[0110] There are four main colors for lines and texts representing subgrade extraction objects in the cross section of a high-speed railway subgrade: white lines represent ground lines, red lines represent stratum lines and various text and graphic annotations, yellow lines represent design lines, and green lines represent positive lines (left lines, right lines). According to the color attributes of the layers, the layers are divided into four categories: white layers, yellow layers, green layers, and red layers. White layers contain white lines, yellow layers contain yellow lines, green layers contain green lines, and red layers contain red lines. The color of the lines 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 foundation, the elevation is represented by 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 according to the coordinates of the endpoints of the red line, and obtain all the line combinations representing the horizontal inverted triangle. Traverse all the triangle line combinations, and traverse all the 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 this 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 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 the distance threshold (according to the drawing habits, the distance threshold can be set to 1-3), and the one within the threshold range is nearby), this inverted triangle and horizontal red line are elevation graphic annotations, and the digital text is the elevation, and then the elevation annotation is obtained.
[0113] Mileage pile number. Traverse all red texts. If the text content of the red text contains the letters "DK", this red text represents the pile number information of the drawing, which is recorded as the pile number text, and the coordinate position of this pile number text is recorded; traverse all red texts again, find the text that is on the same horizontal line as the pile number text and is a number, record it as the mileage information, and the pile number text and mileage information will form the mileage pile number information of the drawing.
[0114] Drawing scale. Traverse all red texts. If the red texts contain texts such as "scale" or "proportion" that indicate scale, record the position of this text, traverse the red texts again, and find texts 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] The cross section of the high-speed railway foundation uses white polylines to represent the ground line. Traverse all the white polylines in the white layer of the drawing, and calculate the distance from the bottom point of any elevation mark inverted triangle to the white polyline (the distance definition refers to the minimum distance from the bottom point to all lines in the white polyline). If the distance is 0, and the coordinates of the bottom point of the elevation mark inverted triangle are on a straight line of the polyline, it means that the bottom point of the elevation mark inverted triangle is on this polyline, and this white polyline represents the ground line. The elevation corresponding to this elevation mark inverted triangle is the ground elevation. There is only one ground elevation on the entire drawing.
[0117] Step 7: Determine the stratum line and soil layer based on the ground line.
[0118] The cross section of the high-speed railway bed uses red polylines to represent the stratum line. Traverse all the red polylines in the red layer. If the red polyline is completely 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, this red polyline is the stratum line;
[0119] The specific process of determining the soil layer name is: 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, if so, save the text combination of the arc and Roman numerals, then traverse all text combinations, traverse the red text, 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 to obtain the red text containing the letter "h", traverse the red text again to 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. 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 the subgrade surface line is connected to the bottom point of the inverted triangle representing the shoulder elevation. If there is a shoulder elevation mark, traverse all yellow lines in the yellow layer to determine whether the bottom point of the inverted triangle representing the shoulder elevation mark is on the end point 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; traverse all yellow lines except subgrade surface line 1 in the yellow layer to determine whether this yellow line is connected to subgrade surface line 1 and the absolute value of the slope 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 represent subgrade surface lines.
[0124] If there are two shoulder elevation annotations, the shoulder elevation annotations are on both sides of the roadbed surface line. For the first elevation annotation, traverse all yellow lines in the yellow layer to determine whether the bottom point of the inverted triangle representing the shoulder elevation annotation is on the end point of the yellow line or the yellow line, and the absolute value of the slope of the yellow line is 4%. If both conditions are met, the yellow line represents the roadbed surface line and is named roadbed surface line 1. For the second elevation annotation, traverse all yellow lines in the yellow layer to determine whether the bottom point of the inverted triangle representing the shoulder elevation annotation is on the end point of the yellow line or the yellow line, and the absolute value of the slope of the yellow line is 4%. If both conditions are met, the yellow line represents the roadbed surface line and is named roadbed surface line 2. Roadbed surface line 1 and roadbed surface line 2 represent roadbed surface lines. The roadbed surface line consists of two straight lines, the line on the left is called the left roadbed surface line, and the line on the right is called the right roadbed surface line.
[0125] The roadbed cross section is classified according to the roadbed surface line and the ground line. The ground line is a multi-segment line 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 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 the AB line segment in the polyline, and the AB line segment is the adjacent line segment), then calculate 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. 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 and half-cutting cross section. So far, the roadbed is divided into three types: embankment, cutting, and half-embankment and 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 straight line whose coordinates of the 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 straight 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 endpoint of this roadbed surface line 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, if the left and right endpoints of this straight 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 straight line is A and the right endpoint is B, calculate the cross product of vectors AB and AP. If the calculation result is less than zero, it means that the roadbed surface line endpoint is below this line. If the left and right endpoints of the roadbed surface line both meet the requirements, this roadbed cross section is a road cutting cross section;
[0128] If the ground line intersects with 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, traverse the multiple straight lines mentioned above, if the left and right endpoints of this straight 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 straight 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 result is less than zero, it means that the roadbed surface line endpoint is below this line. If the calculation results of the left and right endpoints of the roadbed surface line are one positive and one negative, the 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 to determine whether their slopes are the same as the slopes represented by the slope text and whether the slope text is near this straight 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 slope, and a negative slope indicates a possible slope line for the right slope. Traverse the possible slope lines of the left slope and determine whether they are connected to the left roadbed surface line. If connected, this straight line is the left slope line 1. The possible slope lines of the left side slope are traversed after removing the left side slope line 1 to determine whether they are connected to the left side slope line 1. If they are connected, this straight line is the left side slope line 2. The possible slope lines of the left side slope are traversed after removing the left side slope line 1 and the left side slope line 2 to determine whether they are connected to the left side slope line 2. If they are connected, 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.
[0131] Step 10, determine the embankment subgrade filling line and subgrade filling. The subgrade filling line is represented by a yellow straight line. The subgrade filling line is below the subgrade surface line and connected to the slope line. Traverse all yellow straight 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 slope line. If they meet the requirements, they are subgrade filling lines;
[0132] Roadbed filling is a text annotation near the roadbed filling line. Traverse all red texts in the red layer, determine whether the horizontal coordinate of this red text is between the horizontal coordinates of the left and right endpoints of the roadbed filling line, and determine whether the vertical distance to the roadbed filling line closest to this red text is less than 20. If so, it is determined that this red text represents roadbed filling.
[0133] Step 11, determine the slope line of the road cut. The slope is represented by a yellow straight line. Traverse all the red texts in the red layer and find the text with the text 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 according to the slope text. Traverse all the yellow straight lines in the yellow layer to determine whether their slopes are the same as the slopes represented by the slope text and whether the slope text is near this straight line to obtain the possible slope line. The yellow straight lines that may be slope lines obtained above are classified according to the positive and negative slopes. Those with negative slopes represent possible slope lines for the left side slope, and those with positive slopes represent possible slope lines for the right side slope. Traverse the possible slope lines of the left side slope mentioned above to determine whether they are connected to the ground line. If connected, this straight line is the left side slope line 1. The possible slope lines of the left side slope are traversed after removing the left side slope line 1 to determine whether they are connected to the left side slope line 1. If they are connected, this straight line is the left side slope line 2. The possible slope lines of the left side slope are traversed after removing the left side slope line 1 and the left side slope line 2 to determine whether they are connected to the left side slope line 2. If they are connected, this straight line is the left side slope line 3... Repeat this process until there is no straight line that satisfies the connection, and all the left side slope lines can be 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.
[0134] Step 12: Determine the cutting fill line and its fill. Traverse all the red straight lines in the red layer to obtain a red oblique straight line with a slope of +1. Traverse the above red oblique straight lines to determine whether this red oblique straight line intersects with the roadbed surface line. If so, obtain straight line 1.
[0135] Traverse all the red vertical lines in the red layer to determine whether this red vertical line intersects with line 1 and the roadbed surface line at the same time. If they intersect, get line 2. Create list 1, traverse all the red oblique 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 the red oblique lines in list 1, and traverse all the yellow lines in the yellow layer at the same time to determine whether this yellow line intersects with the red oblique lines and line 2 at the same time. If so, this line is the roadbed filling line.
[0136] Create List 2, traverse all red horizontal lines, and determine whether they intersect with Line 2. If they intersect, add the intersection point to List 2. Traverse all points in List 2 and all red texts in the red layer. If the distance between the red text and the point is less than 1, the text represents the 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 straight line. 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 (m represents any number). According to the slope text, the possible slope of the slope line is obtained. Traverse all yellow straight lines in the yellow layer to determine whether their slope is the same as the slope represented by the slope text and the slope text is near this line to obtain the possible slope line.
[0138] If the left end point of the roadbed surface line is above the ground line, and the right end point is below the ground line, the slopes of the left and right sides are both positive. Traverse the above possible slope lines to determine whether they are connected to the left roadbed surface line. If connected, this straight line is the left slope line 1. Remove the left slope line 1 from the above possible slope lines and continue to traverse to determine whether they are connected to the left slope line 1. If connected, this straight line is the left slope line 2. Remove the left slope line 1 and the left slope line 2 from the above possible slope lines and traverse to determine whether they are connected to the left slope line 2. If connected, this straight line is the left slope line 3... Repeat this process until there are no straight lines that meet the connection requirements, and all the left slope lines can be obtained. Traverse the above possible slope lines to determine whether they are connected to the ground line. If connected, this straight line is the right slope line 1. The above possible slope lines are traversed after removing the right side slope line 1 to determine whether it is connected to the right side slope line 1. If connected, this straight line is the right side slope line 2. The above possible slope lines are traversed after removing the right side slope line 1 and the right side slope line 2 to determine whether it is connected to the right side slope line 2. If connected, 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 end point of the roadbed surface line is below the ground line and the right end point is above the ground line, the slopes of the left and right sides are both negative. Traverse the above possible slope lines to determine whether they are connected to the ground line. If connected, this straight line is the left side slope line 1. Remove the left side slope line 1 from the above possible slope lines and continue to traverse to determine whether they are connected to the left side slope line 1. If connected, 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 above possible slope lines and traverse to determine whether they are connected to the left side slope line 2. If connected, this straight line is the left side slope line 3... Repeat this process until there are no straight lines that meet the connection requirements, and all the left side slope lines can be obtained. Traverse the above possible slope lines to determine whether they are connected to the roadbed surface line. If connected, this straight line is the right side slope line 1. The above possible slope lines are traversed after removing the right slope line 1 to determine whether it is connected to the right slope line 1. If connected, this straight line is the right slope line 2. The above possible slope lines of the right slope are traversed after removing the right slope line 1 and the right slope line 2 to determine whether it is connected to the right slope line 2. If connected, this straight line is the right slope line 3... Repeat this process until there is no straight line that satisfies the connection, that is, all the right slope lines can be obtained. The slope corresponding to the slope line is the slope gradient.
[0140] Step 14: Determine the half-embankment and half-cut filling line and its filling material. 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. It is represented by a green dotted line. Traverse all green straight lines in the green layer, and the vertical line that intersects with the subgrade surface line is the main line (single track) or the left line and the right line (double track).
[0142] Step 16: Identify the structures in the cross-section drawing of the high-speed railway foundation, including side ditches, drainage ditches, gutters, blind ditches, gravity walls, cantilever walls, buttress walls, foot walls, flooded slopes, and ground markings. Use artificial intelligence image recognition algorithms for matching, taking the side ditch as an example.
[0143] Get all the straight line information mentioned in step 3. Eliminate the straight lines that have been identified and matched above, traverse all the remaining straight lines, and according to the head-to-tail connection relationship of the line segments, obtain all the straight lines representing closed n-gons, which means that the n sides of the n-gon are a group of straight lines (n is a positive integer greater than three). Traverse all the straight lines of all layers except the red layer. If the straight line intersects with the above polygon, add this straight line 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 straight 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 in png image format.
[0145] A large number of side ditch images were captured, and labelimg was used to mark the side ditch in all images to form a high-speed railway subgrade cross-section side ditch dataset. The yolov8s of the official yolov8 was used as the initial model, and the model was trained using the side ditch dataset to obtain the best training model generated in this training.
[0146] The generated model is used to identify all the images drawn using the matplotlib library in python, and the recognition results of the images are obtained, including the category name of the predicted result and the corresponding category score. If the image contains a side ditch category and the category score is greater than 0.8, the line drawn in the image is considered to be a straight line representing the side 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 length marking and vertical length marking.
[0149] Determine the horizontal length mark, establish List 3, traverse all the 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. Based on the y coordinate size of the center point of the red oblique line, classify and group the red oblique lines. The ones with the same Y coordinate are grouped together to 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 in order each time, and determine whether the endpoints of the horizontal red lines in the red layer are respectively at the midpoints 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, and this red horizontal line and the two red oblique lines are added to List 4 as a combination; if the number of lines in the group is equal to 2, determine whether the endpoints of the horizontal red lines 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 mark, and add the red horizontal line and the two red oblique lines as a combination to List 4. Traverse all the combinations in List 4 and take the horizontal lines in the combination. Traverse all the texts 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, the 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, 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. Based on the x-coordinate size of the center point of the red oblique line, classify and group the red oblique lines, group those with the same x-coordinate, obtain the horizontal oblique line group, and sort them from small to large according to the y-coordinate. Create list 6, traverse all horizontal oblique straight line groups, if the number of oblique straight lines in the group is greater than 2, then take out two red oblique straight lines in order each time, and determine whether the endpoints of the vertical red straight line in the red layer are respectively at the midpoints of these two oblique straight lines. If satisfied, this red vertical straight line and the red oblique straight lines on both sides represent the vertical length marking, and the red vertical straight line and the two red oblique straight lines are added as a combination to list 4; if the number of straight lines in the group is equal to 2, determine whether the endpoints of the vertical red straight line in the red layer are respectively at the midpoints of these two red oblique straight lines. If satisfied, this red vertical straight line and the red oblique straight lines on both sides represent the vertical length marking, and the red vertical straight line and the two red oblique straight lines are added as a combination to list 6. Traverse all combinations in list 6 and take the vertical straight line in the combination, traverse all texts representing numbers in the red layer, determine whether the text position is near the vertical straight line and whether the y coordinate of the text position is between the y coordinates of the two ends of the horizontal straight line at the same time, if satisfied at the same time, this red digital text represents the marking size, and the marking size number is added to the corresponding combination to obtain the vertical length marking.
[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 straight line, traverse all the straight lines representing the structure, and determine whether the x coordinates of the two end points of the structure's straight line are consistent with the coordinates of the two end points of the horizontal straight line. If they are consistent, this horizontal length annotation corresponds to the structure to which this straight 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 ends. 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 structure. Traverse the red text of all red layers to determine whether the text content contains the text content of the above foundation treatment method. If it does, this treatment 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 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 in that: Includes the following: Use the EXPLODE command in AutoCAD software to split the blocks and obtain all basic graphics elements and their attribute information; The elevation annotation information is obtained according to the color and layer of the basic graphic element, the connection relationship of the basic graphic element and the text information; Match the ground line according to the color of the basic graphic element, the layer it is in, the graphic annotation and the connection relationship between the basic graphic element; Match the stratigraphic lines and soil layers according to the basic graphic element colors, the layers they are in, the location areas they are in, the text annotations nearby, and the direct connection logic relationships between the graphic elements; Match the roadbed surface line, slope line and roadbed filling line according to the basic graphic element color and layer, text annotation and graphic annotation, geometric features and the connection logic relationship between the graphics elements; For side ditches, drainage ditches, gravity walls, anti-slide piles, cantilever walls, foot walls, blind ditches, and flooded slopes, image recognition algorithms are used for information matching; The length annotation and text annotation information are obtained according to the color and layer of the basic graphic element, the geometric shape characteristics of the basic graphic element and the 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 in that: The data method comprises the following steps:
1. Use the EXPLODE command in AutoCAD software to split the block into basic graphics including straight lines, polylines, and texts, 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, which 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 segment according to the endpoint coordinates of the red line, and obtain all the line combinations representing the horizontal inverted triangle; traverse all the line combinations of triangles, traverse all the horizontal red lines and red texts in the drawing except the line representing the inverted triangle, if the horizontal red line and the bottom point of the inverted triangle are on the same horizontal line, and the digital mark corresponding to the red text is near the horizontal red line, the inverted triangle and the horizontal red line are elevation graphic marks, and the digital text is the elevation, and then the elevation mark is obtained; Mileage pile number: traverse all red texts. If the text content of the red text contains the letters "DK", this red text represents the pile number information of the drawing, which is recorded as pile number text, and the coordinate position of this pile number text is recorded; traverse all red texts again, find the text that is on the same horizontal line as the pile number text and is a number, record it as the mileage information, and the pile number text and mileage information will form the mileage pile number information of the drawing; Drawing scale: traverse all red texts. If the text content of the red text contains text information of the scale, record the position of this text, traverse the red text again, and find the text on the same horizontal line as this text and in the form 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 annotation inverted triangle to the white polyline, find the elevation annotation inverted triangle and the corresponding white polyline when the distance is 0 and the coordinates of the bottom point of the elevation annotation inverted triangle are on a straight line of the polyline. This white polyline represents the ground line, and the elevation corresponding to this elevation annotation 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, the red polyline is the stratum line. The specific process of determining the soil layer name is: 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 the arc and Roman numerals; 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 a whole to form 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 to 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 height difference between the shoulder and the ground line. The height difference plus the ground elevation determined in step 3.2 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; 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%, which is the roadbed surface line; the roadbed surface line consists of two straight lines, the line on the left is called the left roadbed surface line, and the line on the right is called the right roadbed surface line; when there is only one shoulder elevation mark, the yellow straight line connected to the roadbed surface line found in the above way and with an absolute slope of 4% is used as the other roadbed surface line; The roadbed cross section is classified according to the roadbed surface line and the ground line. The ground line is a multi-segment line 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 and half-cutting cross section. So far, the roadbed is divided into three types: embankment, cutting, and half-embankment and half-cutting. Determine the slope line and the roadbed fill and fill line. For the embankment, perform steps 3.5-3.6; for the cutting, perform steps 3.7-3.8; for the half embankment and half cutting, perform steps 3.9-3.10; Step 3.5: Determine the embankment slope line: Traverse all red texts in the red layer and find text with the content in the form of "1:m" or "4.m%". This is the slope text, where m represents any number. In the yellow layer, find the yellow straight line with the same slope as the slope text and near the slope text as the possible slope line; classify the yellow straight lines that may be slope lines according to the positive and negative slopes. 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. 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; Step 3.6, determine the embankment subgrade filling line and subgrade filling: Traverse all yellow straight lines in the yellow layer to 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 filling 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 as the roadbed filling; Step 3.7, determining the side slope line of the road cut is similar to step 3.5, except that when the left side slope line 1 is found, it is necessary 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 road cut; Step 3.8, determine the road cutting filling line and its filling: find the red oblique straight line with a slope of +1, and the red oblique straight line that intersects with the roadbed surface line is line 1; traverse all the red vertical straight lines in the red layer, and determine whether this red vertical straight line intersects with line 1 and the roadbed surface line at the same time. If they intersect, get line 2; establish list 1, traverse all the 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 the red oblique straight lines in list 1, and traverse all the yellow straight lines in the yellow layer at the same time, and determine whether this yellow straight line intersects with the red oblique straight lines in list 1 and line 2 at the same time. If so, this line is the roadbed filling line; Create List 2, traverse all red horizontal lines, and determine whether they intersect with Line 2. If they do, add the intersection point to List 2; traverse all points in List 2, and traverse all red texts in the red layer. If the distance between the red text and the point is less than 1, the text represents the 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 according to the slope text; If the left end point of the roadbed surface line is above the ground line and the right end point is below the ground line, follow the method of step 3.5 to traverse all possible slope lines, 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 of step 3.7 to traverse all possible slope lines, 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 end point of the roadbed surface line is below the ground line and the right end point 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-cutting sections, and follow the method in step 3.5 to find the right side slope lines of all half-embankment and half-cutting sections; The determination method of the half-embankment half-cut filling line and its filling is the same as step 3.8; Step 3.10, determine the main line or the left line and the right line: traverse all the green straight lines in the green layer, and the vertical line that intersects with the roadbed surface line is the main line or the left line and the right line; Step 3.11, determine the structures in the high-speed railway foundation cross-section drawing: Eliminate the above identified and matched straight lines, traverse all the remaining straight lines, and obtain all the straight lines representing closed n-gons according to the head-to-tail connection relationship of the line segments. The n sides of the n-gon are a group of straight lines, and n is a positive integer greater than three; traverse all the straight lines of all layers except the red layer. If the straight line intersects with the above polygon, add this straight line 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 straight line and the color of the layer it is in, use the matplotlib library in python to draw, the x-axis and y-axis have the same scale and are not displayed, and save it in png image format; Use image recognition algorithms to identify the types of structures in png images; Step 3.12: Determine the length marking, including horizontal length marking and vertical length marking: Determine the horizontal length mark, establish List 3, traverse all the 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, and group the lines with the same Y coordinate into a group to obtain a 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 each time in order, and determine whether the endpoints of the horizontal red lines in the red layer are at the midpoints of these two red oblique lines in turn. If so, this red horizontal line and the red oblique lines on both sides represent the horizontal length mark. Add this red horizontal straight line and two red oblique straight lines as a combination to list 4; if the number of straight lines in the group is equal to 2, determine whether the endpoints of the horizontal red straight line in the red layer are respectively at the midpoints of these two oblique straight lines. If so, this red horizontal straight line and the red oblique straight lines on both sides represent horizontal length annotations, and add the red horizontal straight line and two red oblique straight lines as a combination to list 4; traverse all combinations in list 4 to take the horizontal straight line in the combination, traverse all texts representing numbers in the red layer, determine whether the text position is near the horizontal straight line and whether the x-coordinate of the text position is simultaneously between the x-coordinates of the two end points of the horizontal straight 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, create 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. Based on the x-coordinate size of the center point of the red oblique line, classify and group the red oblique lines, group those with the same x-coordinate, obtain the horizontal oblique line group, and sort them from small to large according to the y-coordinate. Create list 6, traverse all horizontal oblique straight line groups, if the number of oblique straight lines in the group is greater than 2, then take out two red oblique straight lines in order each time, and determine whether the endpoints of the vertical red straight line in the red layer are respectively at the midpoints of these two oblique straight lines. If satisfied, this red vertical straight line and the red oblique straight lines on both sides represent the vertical length marking, and the red vertical straight line and the two red oblique straight lines are added as a combination to list 4; if the number of straight lines in the group is equal to 2, determine whether the endpoints of the vertical red straight line in the red layer are respectively at the midpoints of these two red oblique straight lines. If satisfied, this red vertical straight line and the red oblique straight lines on both sides represent the vertical length marking, and the red vertical straight line and the two red oblique straight lines are added as a combination to list 6. Traverse all combinations in list 6 and take the vertical straight line in the combination, traverse all texts representing numbers in the red layer, determine whether the text position is near the vertical straight line and whether the y coordinate of the text position is between the y coordinates of the two ends of the horizontal straight line at the same time, if satisfied at the same time, this red digital text represents the marking size, and the marking size number is added to the corresponding combination to obtain the vertical length marking. 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 straight line, traverse all the straight lines representing the structure, and determine whether the x coordinates of the two end points of the straight line of the structure are consistent with the coordinates of the two end points of the horizontal straight line. If they are consistent, this horizontal length annotation corresponds to the structure to which this straight line belongs; For structures with vertical length annotations, traverse all combinations of vertical length annotations, 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 line of the structure 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 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 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 line 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 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 certain line, the text annotates the line; if the annotation point is inside a certain figure, the text annotates the figure; 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 marked with the ground line elevation and the ground line as the coordinate origin, and recalculate the coordinate information of all extracted objects.
3. The method according to claim 1, characterized in that The number corresponding to the red text is marked near the horizontal red straight line, which means: a distance threshold is set, and the distance between the red text and the horizontal red straight line is calculated. If the distance is not greater than the distance threshold, it is considered that the number is marked near the horizontal red straight line; the distance threshold is set to 1-3 according to drawing habits.
4. The method according to claim 1, characterized in that: The structures include side ditches, drainage ditches, gutters, blind ditches, gravity walls, cantilever walls, buttress walls, foot walls, flooded slopes and ground markings.
5. The method according to claim 1, 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 Yolov series model, Faster R-CNN, and SSD.
7. The method according to claim 1, characterized in that The method summarizes the extracted information and saves it in a database format, wherein the database format is extraction object name-extraction object type-extraction object attribute-coordinates representing the extraction object graphic, 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 but is not limited to 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, input 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
Parametric modeling and design optimization method for railway engineering construction shortcut
CN110569538A
Drawing text information extraction method, device and equipment
CN115995092A
Cited By
Road drawing intelligent analysis and three-dimensional modeling method and system
CN121330195A
Image-based data matching method, electronic device, storage medium and program
CN121582616A
