A method and system for automatically discovering mirror images of a symmetrical symbol recognition drawing

CN122967304APending Publication Date: 2026-10-23JINRUNFANGZHOU SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611129291.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-28
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

[0004]本发明提供一种对称符号识别图纸镜像自动发现方法及其系统,解决相关技术中工程图纸对称结构需人工识别对称标注并手动补全镜像图元、效率低且易引入几何误差的技术问题

Benefits of technology

其一,通过将基于图元属性规则匹配与卷积神经网络目标检测、霍夫变换检测相结合,分别针对矢量格式图纸和光栅图像格式图纸建立对应的识别路径,并通过融合公式 综合两路检测结果,其中为卷积神经网络目标检测的置信度分数, 为霍夫变换检测的置信度分数, 为融合置信度,克服了单一识别方法对多种对称符号表达形式覆盖不足的问题,提升了对称符号识别对不同制图标准和表达方式的适应能力。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122967304A_ABST
    Figure CN122967304A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of digital processing of engineering drawings, and discloses a symmetrical symbol recognition drawing mirror image automatic discovery method and system, wherein the method comprises the following steps: analyzing an engineering drawing file to generate a structured drawing metadata set; adopting drawing attribute rule matching for a vector format drawing, adopting a combination of a convolutional neural network target detection and a Hough transform detection for a raster image format drawing, recognizing symmetrical symbols, and generating a detection result list; determining an original drawing side and a to-be-mirrored drawing element set based on a comprehensive density ratio index; performing mirror image geometric transformation on each type of drawing element and synchronously performing directional attribute; adopting a two-stage conflict detection strategy to perform hierarchical processing on the mirror image drawing element; and outputting a completed drawing after supplement and a processing report.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of engineering drawing digitization technology, specifically to a method and system for automatically discovering mirror images of drawings to identify symmetrical symbols. Background Technology

[0002] In the field of engineering drawing, when drafters create symmetrical engineering drawings, they typically only draw one side of the symmetrical figure and express the mirror relationship of the other side through annotations such as symmetry lines, symmetry symbols, or mirror description text. In application scenarios such as drawing digitization, component information extraction, and 3D model reconstruction, downstream systems need to acquire drawing data containing complete geometric figures.

[0003] Existing technologies typically employ single-form symmetry symbol recognition methods, capable of handling only one type from line attribute annotations, block references, or text descriptions. This fails to cover the diverse expressions of symmetry annotations in engineering drawings, resulting in insufficient recall for symmetry symbol recognition. After identifying symmetry symbols, existing methods lack the ability to automatically and quantitatively determine the mirroring area and the range of elements to be completed. Furthermore, the lack of synchronous adjustment for angle-type annotations and directional symbols during mirroring leads to attribute errors in mirrored elements; geometric conflicts may exist between mirrored elements and existing elements, and existing methods also lack automatic detection and hierarchical processing capabilities. These problems collectively make it difficult for existing technologies to achieve automatic discovery and reliable completion of mirrored graphics in engineering drawings. Summary of the Invention

[0004] This invention provides a method and system for automatically discovering mirror images in symmetrical drawings, which solves the technical problems in related technologies where symmetrical structures in engineering drawings require manual identification of symmetrical annotations and manual completion of mirrored elements, resulting in low efficiency and easy introduction of geometric errors.

[0005] This invention discloses a method for automatically discovering mirror images in drawings by recognizing symmetry symbols, comprising: parsing engineering drawing files and generating a structured set of drawing data or a preprocessed image; Based on the structured graph data set or preprocessed image, symmetric annotation information is identified by matching graph attribute rules or matching based on geometric graph element combinations, and a list of symmetric symbol detection results is generated. Based on the list of symmetry symbol detection results, establish the mathematical expression of the symmetry axis, calculate the comprehensive density ratio index on both sides of the symmetry line to determine the original drawing side and the side to be mirrored and completed, and extract the set of primitives to be mirrored; Perform mirror geometric transformations on each type of primitive in the set of primitives to be mirrored based on the symmetry axis parameter to generate a set of mirrored primitives; The attribute information of the original primitives is synchronized to the mirror primitives, and the directional attributes are adjusted by angle mirroring. A two-stage conflict detection process, consisting of bounding box filtering and precise geometric intersection calculation, is performed on the mirrored primitive set and the existing primitive set, and the results are classified into three levels: complete overlap, partial overlap, and no conflict.

[0006] Furthermore, for vector format drawings, the identification of symmetrical annotation information through matching primitive attribute rules includes: filtering line segment primitives from the structured primitive data set according to any one of three conditions: the line type name belongs to the set of dotted line type names, the layer name contains the keyword of the center line layer, and the color attribute is the center line color value, to generate a candidate symmetrical line set; for each line segment in the candidate symmetrical line set, calculating the number of primitives within a set distance range on both sides of the line segment. and ,when or The line segment is then identified as a valid candidate symmetry line, in which and These represent the number of primitives on the left and right sides of the line segment, respectively. Set a threshold for the number of primitives; traverse all text primitives, perform symmetric keyword regular expression matching on the text content, and record the successfully matched text primitives as text-class symmetric symbols; traverse all block reference primitives, and compare the similarity between the block name matching and the block geometric feature hash value with the standard symmetric symbol block feature library, and record the block reference primitives with similarity exceeding the preset threshold as block-class symmetric symbols.

[0007] Furthermore, for raster image format drawings, the identification of symmetrical annotation information through geometric primitive combination matching includes: According to the average radius of the axis ring in the drawing. It adaptively calculates all tolerance parameters, including short line length threshold, axis length threshold, search range, and angle tolerance; when the axis ring is not present in the drawing, it is replaced by a preset proportional value of the short side length of the drawing area bounding box. Perform calculations; From the vector primitives obtained by converting the preprocessed image, straight line segments are filtered according to conditions such as length not less than a length threshold, line type or layer conforming to centerline characteristics, to generate a set of candidate symmetry axis centerlines; For each median in the set of candidate symmetry axis medians, at each of its two ends Search for short line segments within the length range, and filter them step by step according to length constraints, perpendicular relationship constraints with the midline, midpoint near the extension of the midline, and pairing constraints. Short line segment pairs that satisfy all constraints are retained as the end marks of the axis of symmetry. Check the intersection of the above short line segments with irrelevant line segments such as table lines and grid extension lines in the drawing, eliminate candidates with intersections, and confirm the remaining candidate axis of symmetry centerlines as valid axes of symmetry; Retrieve text primitives within a defined search range near the endpoints of each valid axis of symmetry, associate and bind the retrieved text annotations with the corresponding axis of symmetry objects, and store them in the symmetry symbol detection result list.

[0008] Furthermore, the adaptive calculation tolerance parameters include: Short line length threshold The axis length threshold is taken as The search range at the end is taken as the length of the centerline. The vertical relationship tolerance angle is set to a preset angle threshold; where , This is a preset scaling factor; when using the short side of the bounding box as a substitute... At this time, the calculation method of each parameter remains unchanged, and the substitute value is substituted into the corresponding formula.

[0009] Furthermore, the step of calculating the comprehensive density ratio on both sides of the symmetry line to determine the original drawing side and the side to be mirrored and completed includes: counting the number of graphic elements in each half-plane on both sides of the symmetry line. and Total area of ​​graphic elements and and graphical complexity index and Calculate the comprehensive density ratio index :

[0010] in, , Measured by the product of the number of primitives and the average number of vertices of the primitives; when When determining that the first side is the original drawing side, when The opposite is true when; If both sides of the image are deemed complete, the mirror completion process is not triggered. To determine the tolerance threshold.

[0011] Furthermore, the step of performing mirror geometric transformations on each type of primitive based on the symmetry axis parameter includes: for each control point in the primitive... Calculate its symmetry about the axis of symmetry. mirror point :

[0012]

[0013] in, , , The parameters of the general form equation for the axis of symmetry; the starting angle for the circular arc primitive. and termination angle according to Perform an angle mirror transformation, where The direction angle of the axis of symmetry is taken as the starting angle of the mirrored arc. The termination angle is taken Apply the reflection transformation matrix to the tangent direction vector of the spline curve. deal with:

[0014] Furthermore, the step of performing angular mirroring adjustment on the directional attribute includes: for the directional attribute stored as an angle value, setting the angle attribute value of the original primitive to be... The direction angle of the axis of symmetry is Calculate the angle attribute value after mirroring. And the calculation results are standardized to Within the scope; for text-type primitives, after coordinate mirror transformation, the text rotation angle attribute is detected to determine whether the text is reversed after mirroring. If it is reversed, the text rotation angle is compensated and adjusted to restore the text to the correct orientation for readability; for graphic symbols with inherent directionality, the symbol type is determined by matching the block name or identifying geometric features, and a reflection transformation is performed on the direction vector to generate a mirrored symbol with the correct direction.

[0015] Furthermore, the two-stage conflict detection includes: In the first stage, calculating the axis-aligned bounding box for each mirrored primitive, performing an intersection condition check on the bounding box pairs of the mirrored primitive and existing primitives, and filtering out primitive pairs whose bounding boxes intersect; In the second stage, performing a precise geometric intersection judgment on the primitive pairs filtered in the first stage: if the mirrored primitive and existing primitive have completely identical geometry and their coordinate differences are within tolerance... Within a certain range, redundant elements are marked and not written to the drawing; if there is partial geometric overlap but not complete overlap, they are marked as potentially conflicting elements and recorded in the list of projects pending review; if there is no spatial overlap, mirrored elements are written to the drawing data.

[0016] Furthermore, geometric consistency verification is included after the two-stage conflict detection: for each pair of original primitive control points and its corresponding mirror point Calculate the signed distance from two points to the axis of symmetry. and ,verify Among them, there is signed distance , , , The parameter is the axis of symmetry. For the coordinates of the control points, For accuracy tolerance; if there are control points that exceed the tolerance, the transformation calculation of the corresponding graphic element is re-executed.

[0017] This invention discloses an automatic discovery system for symmetrical symbol recognition drawing mirrors, used to execute the above-mentioned automatic discovery method for symmetrical symbol recognition drawing mirrors, including: a drawing preprocessing module, used to acquire engineering drawing files, perform parsing processing according to the file format, and generate a structured drawing data set or a preprocessed image; The symmetry symbol recognition module is used to identify symmetry annotation information based on the structured graphic data set or preprocessed image by matching graphic attribute rules and geometric graphic element combination matching, and generate a list of symmetry symbol detection results. The symmetry relationship analysis module is used to establish a mathematical expression of the symmetry axis based on the list of symmetry symbol detection results, calculate the comprehensive density ratio index to determine the original drawing side and the side to be mirrored and completed, and extract the set of primitives to be mirrored; The mirror transformation module is used to perform mirror geometric transformations on each type of primitive in the set of primitives to be mirrored based on the symmetry axis parameter, and generate a set of mirrored primitives. The attribute synchronization module is used to synchronize the attribute information of the original primitives to the mirror primitives and to perform angle mirroring adjustments on directional attributes. The mirror verification module is used to perform a two-stage conflict detection on the mirror primitive set and the existing primitive set, which involves bounding box filtering and precise geometric intersection calculation. It is classified into three levels: complete overlap, partial overlap and no conflict, and performs geometric consistency verification. The drawing output module is used to output complete drawings, including completed graphics, in a specified format, and also output a structured processing report.

[0018] The present invention has the following beneficial effects: Firstly, by combining primitive attribute-based rule matching with convolutional neural network object detection and Hough transform detection, corresponding recognition paths are established for vector format drawings and raster image format drawings, respectively, and a fusion formula is used. Combining the results of the two tests, among which This represents the confidence score for object detection using a convolutional neural network. The confidence score for the Hough transform detection. To integrate confidence levels, this method overcomes the problem of insufficient coverage of multiple symmetry symbol representations by a single recognition method, and improves the adaptability of symmetry symbol recognition to different cartographic standards and representation methods.

[0019] Secondly, by introducing the comprehensive density ratio index A quantitative comparison of the two sides of the symmetry line is conducted using three indicators: the number of primitives, the area of ​​primitives, and the complexity of the graphics. , , These represent the number of graphic elements on both sides. , These represent the total area of ​​the graphic elements on both sides. , These are the graphic complexity indices for both sides, overcoming the problem of misjudging the original drawing side in scenarios with uneven primitive distribution when relying on only a single index, thus providing an objective calculation basis for determining the mirror effect area.

[0020] Third, by applying geometric transformation rules to different primitive types such as line segments, arcs, polylines, spline curves, and filling patterns, and by performing corresponding attribute synchronization processing on angle-type attributes, directional graphic symbols, and text-type primitives, the problem of incomplete primitive type processing leading to incorrect geometric parameters or attribute annotations of mirrored graphics is overcome. This ensures that the generated mirrored primitives maintain the correct symmetry with the original primitives in both geometric shape and attribute information.

[0021] Fourth, by adopting a two-stage conflict detection strategy of fast bounding box screening and accurate geometric intersection calculation, and classifying the detection results into three levels of complete overlap, partial overlap and no conflict, the problem of the inability to automatically detect and classify geometric conflicts between mirror primitives and existing primitives is overcome. While automatically completing the data, graphic overlap and data redundancy are avoided, and users are provided with a structured basis for conflict handling. Attached Figure Description

[0022] Figure 1 This is a flowchart of the automatic discovery method for symmetry symbol recognition drawing mirror provided in an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the ratio of the number of primitives on both sides of the symmetry line to the overall density provided in an embodiment of the present invention; Figure 3 This is a schematic diagram comparing the statistical indicators of the graphs on both sides of the line of symmetry provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the primitive distribution of the collision detection results provided in an embodiment of the present invention; Figure 5 This is a schematic diagram comparing the changes in the horizontal coordinates of the core graphic elements before and after mirroring, as provided in an embodiment of the present invention. Figure 6 This is a schematic diagram comparing the angle attributes of core graphic elements before and after mirroring, as provided in an embodiment of the present invention. Figure 7 This is a schematic diagram of the distribution density of primitives on both sides in the symmetry symbol recognition stage provided by an embodiment of the present invention; Figure 8 This is a schematic diagram illustrating the flow statistics of the number of graphic elements in each processing stage provided in the embodiments of the present invention; Figure 9This is a schematic diagram of the tile similarity comparison and symmetry symbol determination threshold provided in the embodiments of the present invention. Detailed Implementation

[0023] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, some features described in the examples may be combined in other examples.

[0024] At least one embodiment of the present invention discloses a method for automatically detecting mirrored drawings of symmetry symbols, see [link to relevant documentation]. Figure 1 This includes the following steps: Step S1: Drawing analysis and data extraction.

[0025] The system retrieves the input engineering drawing file, performs parsing processing based on the file format, and generates a structured set of drawing and data elements.

[0026] For vector format drawings, the corresponding format parsing library is invoked to extract all geometric and text elements from the drawing file. Geometric elements include line segments, arcs, polylines, splines, fill patterns, and block references. Each element object records the following attributes: element type, geometric parameters, layer name, linetype name, color, and line width. Vector format drawings include DWG, DXF, and SVG formats.

[0027] For PDF format drawings, distinguish between vector PDFs and scanned PDFs. Vector PDFs are processed using the vector format drawing workflow to extract the drawing data. Scanned PDFs are converted to raster images and then processed using the raster image workflow.

[0028] For raster image format drawings, the input image is sequentially processed by grayscale conversion, binarization, noise reduction, and resolution normalization, adjusting the resolution to a uniform 300 DPI to generate a preprocessed image. Raster image formats include TIFF, PNG, and JPEG.

[0029] For vector format drawings, elements are grouped by layer based on layer name. Elements whose layer names contain keywords for centerline, annotation, and symbol layers are extracted first, forming a candidate set of symmetry symbols. Centerline layer keywords include CEN, CENTER, CL, etc. Annotation layer keywords include DIM, TEXT, ANNO, etc. Symbol layer keywords include SYM, SYMBOL, etc.

[0030] It should be noted that each primitive object in the aforementioned structured metadata set refers to a primitive record stored using a unified data structure. The primitive record contains a primitive type field, a geometric parameter field, and an attribute field. The primitive type field is an enumeration of values, including line segments, arcs, polylines, splines, fill patterns, block references, and text primitives. The geometric parameter field stores the corresponding coordinates, radius, and angle parameters based on the primitive type. The attribute field stores attribute values ​​such as layer name, linetype name, color index, and line width.

[0031] Step S2: Symmetry symbol recognition.

[0032] Based on structured image data sets or preprocessed images, this system identifies symmetrical annotation information expressed in various forms in drawings and generates a list of symmetrical symbol detection results. Each record includes the symmetrical symbol type, position coordinates, and orientation angle. and overall confidence score .in, The direction angle of the symmetrical symbol. The overall confidence score is given.

[0033] For vector format drawings, a rule-based matching method based on element attributes is used. Step S2 may specifically include: Step S201: From the structured graphic data set, filter line segment primitives according to the following conditions to generate a candidate symmetry line set. Condition 1: The line type name belongs to the preset dotted-dash line type name set. Condition 2: The layer name contains the preset centerline layer keyword. Condition 3: The color attribute is the preset centerline color value. Line segment primitives that meet any of the above conditions are included in the candidate symmetry line set. The dotted-dash line type name set includes CENTER, DASHDOT, ISO04W100, and CENTER2, etc.

[0034] Step S202: For each line segment in the candidate set of symmetrical lines, calculate the segment length and filter out short line segments whose length is less than 5% of the minimum drawing size. Calculate the number of elements within a set distance range on both sides of the line segment. and When satisfied or When the line segment is confirmed as a valid candidate line of symmetry, its endpoint coordinates and direction angle are recorded. .in, and These represent the number of primitives on the left and right sides of the line segment, respectively. This is the threshold for the number of primitives, with a default value of 3.0. The direction angle of the line segment.

[0035] Step S203: Traverse all text primitives in the structured graph data set, and perform regular expression matching on the text content of each text primitive. The matching pattern is a pre-defined set of symmetry keyword regular expressions, covering Chinese keywords such as "mirror", "symmetry", and "axis of symmetry", as well as English keywords such as "MIRROR", "SYM", "SYMMETRY", and "SYMMETRIC". Text primitive types include TEXT, MTEXT, and ATTDEF. Successfully matched text primitive records are text-type symmetry symbols, and their insertion point coordinates are extracted as a reference for the symmetry symbol position.

[0036] Step S204: Traverse all block-referenced primitives in the structured graph data set, performing a two-level identification for each block-referenced primitive. The first level is primitive name matching, comparing the primitive name with a pre-defined list of keywords for symmetric primitive names. The second level is primitive geometric feature comparison, extracting the geometric features of all primitives in the primitive definition, calculating their feature hash values, and comparing their similarity with a pre-defined standard symmetric symbol primitive feature library. Geometric features include primitive type sequences, normalized coordinates of each primitive, and angles. Block-referenced primitives with a similarity greater than 0.85 are recorded as symmetric symbols of the primitive class.

[0037] It should be noted that the above feature hash value is calculated as follows: the type sequence, normalized coordinate sequence, and angle sequence of all primitives in the tile definition are concatenated into a byte string, and an MD5 or SHA-1 hash operation is performed on the byte string to obtain a fixed-length feature hash value. Normalized coordinates refer to the coordinate values ​​of each primitive within the tile after translation to a bounding box with the tile insertion point as the origin. The similarity between two feature hash values ​​is calculated using normalized similarity based on edit distance, i.e., the similarity score is obtained by subtracting the ratio of the edit distance to the maximum string length from 1.

[0038] For raster image format drawings, a method combining convolutional neural network object detection and Hough transform detection is used. Step S2 may specifically include: Step S211: Adaptive parameter calculation. Extract the average radius of the grid lines in the drawing. ,by Based on this, the tolerance parameters required for each subsequent recognition step are adaptively calculated, including: the minimum length threshold of the candidate symmetry axis midline. Search range of short lines at both ends Short line length range Vertical relationship determination angle tolerance Midpoint position offset tolerance and short line spacing threshold Each tolerance parameter and The proportional relationships are preset in the parameter configuration table to ensure that the recognition logic automatically adapts to different drawing scales. Among them, The average radius of the shaft ring. , , , , , , All are based on The tolerance parameters obtained through adaptive calculation.

[0039] Step S212: Extraction of candidate symmetry axis medians. Traverse all line segment primitives in the vector primitive set and filter them according to the following conditions to generate a candidate symmetry axis median set: the line segment length is not less than The line segment must be a layer whose line type properties meet the characteristics of a dashed line or centerline, or whose layer name contains the keyword "centerline layer". Line segments meeting these conditions are included in the candidate symmetry axis centerline set, and their endpoint coordinates and direction angles are recorded. .in, The direction angle of the line segment.

[0040] Step S213: Short-line constraint filtering. For each median in the candidate set of symmetry axis medians, short-line constraint filtering is applied to both ends of the median. Search for candidate short line segments within the specified length range. Candidate short line segments must simultaneously meet the following constraints to pass the filter: (1) Length constraint: The length of the short line segment is within Within the range; (2) Vertical constraint: The absolute value of the difference between the direction angle of the short segment and the direction angle of the centerline is within... Within this range, the shorter line segment is approximately perpendicular to the median. (3) Midpoint constraint: The distance from the midpoint of the short line segment to the line containing the median does not exceed That is, the midpoint of the short line segment is located near the extension of the middle line; (4) Paired constraints: At least one short line segment passing the above constraints is detected at each end of the midline, and the distance between the short line segments at the two ends does not exceed .

[0041] Each constraint is applied sequentially, and after each level of filtering, only candidate short line segments that pass the current constraint are retained, gradually narrowing the range of the candidate set and reducing the amount of subsequent calculations.

[0042] Step S214: Interference Elimination. For the candidate centerlines from Step S213, further investigate the intersection of their associated short line segments and irrelevant line segments. If a candidate short line segment intersects with a table line, grid extension line, or other asymmetrical symbol line segment in the drawing, and the intersection point is within the valid line segment range of that short line segment, then that short line segment is excluded from the candidate set. The criteria for determining irrelevant line segments are: the layer name belongs to a preset set of table layer keywords or grid layer keywords, or the line segment length exceeds a preset long line threshold. Candidate centerlines that still satisfy the pairing constraints after interference elimination are confirmed as valid axes of symmetry, and their position coordinates and direction angles are recorded. .in, The direction angle of the axis of symmetry.

[0043] Step S215: Text annotation association. Traverse all text primitives in the vector primitive set, and for each valid axis of symmetry, add text annotations at both endpoints. Retrieves text primitives within a specified range. The retrieved text primitives are used as associated annotations for the axis of symmetry, recording the text content and insertion point coordinates. These are then stored together with the axis of symmetry object in the symmetry symbol detection result list. Each record in the symmetry symbol detection result list includes the symmetry symbol type, axis of symmetry position coordinates, and direction angle. And related text annotation information.

[0044] In this embodiment of the application, in order to improve the recognition coverage of symmetric symbols in the form of block references, based on step S204, the primitives in the block definition can be decomposed hierarchically, and the nested blocks can be recursively expanded into basic geometric primitives before feature hash calculation is performed, thereby avoiding missed recognition due to large differences in feature hash values ​​caused by different block nesting levels.

[0045] In this embodiment of the application, for raster image format drawings, if no grid lines are detected in the drawing during the parameter adaptive calculation in step S211, a preset ratio of the length of the short side of the minimum outer rectangle of the effective drawing area of ​​the drawing can be used instead. This allows for adaptive calculation of tolerance parameters even in the absence of a shaft reference.

[0046] Step S3: Symmetry analysis.

[0047] Based on the list of symmetry symbol detection results, a mathematical expression for the axis of symmetry corresponding to each symmetry symbol is established, and the mirroring effect area and the set of primitives to be mirrored are determined. Step S3 may specifically include: Step S301: For each symmetry symbol of a symmetry line class, based on its endpoint coordinates... and Calculate the general form equation of the axis of symmetry. Parameters:

[0048] Simultaneously calculate the unit vector along the axis of symmetry. :

[0049] in, , , The three parameters of the general form equation for the axis of symmetry are: and Let the coordinates of the two endpoints of the line of symmetry be... and For planar coordinate variables, This is a unit vector along the axis of symmetry, used for subsequent mirror transformation calculations. The angle of the axis of symmetry direction. Depend on The components are calculated using the arctangent function, and their values ​​range from 1 to 2. .

[0050] For symmetrical symbols of text type, their position coordinates only provide a positional reference for the symmetrical symbol and do not directly give the endpoints of the symmetry axis. In this case, the nearest candidate symmetrical line primitives are searched within a search radius set around the insertion point of the text primitive. If a line segment primitive satisfying the conditions of step S201 is found, the endpoint coordinates of the line segment primitive are substituted into the above formula to calculate the symmetry axis parameter; if no such primitive is found, the rotation angle attribute of the text primitive is used as the symmetry axis direction angle. And construct the axis of symmetry line with the insertion point as the reference point.

[0051] For block-type symmetry symbols, the coordinates of the insertion point of the block are used as a reference. The coordinates of the endpoints of the longest line segment in the block definition are extracted and substituted into the formula above to calculate the symmetry axis parameter. If the block definition does not contain line segment elements, the rotation angle attribute of the block is used as the symmetry axis direction angle. Construct a straight line with the axis of symmetry using the insertion point as the reference point.

[0052] Step S302: For drawings with multiple symmetrical symbols, create a symmetrical symbol association diagram. .in, For a symmetric symbol association graph, the node set For each symmetry symbol, the edge set It represents the spatial proximity or logical connection between two symmetric symbols. Through connected component analysis of the graph, it identifies complex symmetric structures such as nested symmetry and multi-axis symmetry.

[0053] Step S303: For each axis of symmetry, count the number of graphic elements in each half-plane on both sides of the line of symmetry. and Total area of ​​graphic elements and and graphics complexity metrics and In calculating the comprehensive density ratio index Previously, the dimensions of the three sets of ratios were checked separately: The ratio of the number of primitives (dimensionless). It is the ratio of areas (dimensionless). These are the ratios of complexity indices (dimensionless). All three ratios are dimensionless values ​​and can be directly calculated as an arithmetic mean. Calculate the comprehensive density ratio index. :

[0054] in, , These represent the number of graphic elements on either side of the line of symmetry. , These represent the total area of ​​the graphic elements on both sides. , These are the graph complexity indices on both sides, measured by the product of the number of primitives and the average number of vertices per primitive. This is a comprehensive density ratio index.

[0055] when When this happens, the first side is determined to be the original drawing side, and the second side is the side to be mirrored and completed. When, the judgment is the opposite. (default When the condition is met, it is determined that both sides of the figure have been drawn completely, the symmetry symbol is marked as complete, and the subsequent mirror completion process is not triggered. Tolerance threshold for determining whether the two side images are complete.

[0056] Step S304: Extract the set of primitives to be mirrored within the defined original drawing side region. All primitives whose positions are entirely within the original drawing side region are included. For primitives crossing the line of symmetry, calculate the coordinates of their intersection with the line of symmetry, segment the primitives, and include only the original side portion. Primitives whose positions are entirely within the symmetry side region are not included and are marked as existing symmetry side primitives for conflict detection in step S6.

[0057] It should be noted that the above-mentioned graph complexity index This refers to the value obtained by averaging the number of vertices of all primitives within a certain region and multiplying it by the total number of primitives on that region. Among these... This is a graphical complexity index for one side of a graph. Graphical complexity indices are used to comprehensively reflect the geometric complexity of a graph, providing additional criteria for judgment when the number of primitives and area indices are insufficient to distinguish the differences between the two sides.

[0058] In this embodiment, to handle the situation where there are closed boundary markings near the symmetry line, in addition to step S303, it is also possible to detect whether there are rectangular frames, cloud frames, or other closed polylines near the symmetry symbol. If so, the area enclosed by the closed boundary is used to replace the half-plane as the precise boundary of the mirroring area, thereby limiting the mirror completion range to the area clearly marked by the cartographer.

[0059] For data that has passed step S3, step S4 can be further performed. Step S4 may specifically include: Step S4: Mirror geometric transformation.

[0060] For each primitive in the mirror primitive set, based on the symmetry axis parameter , , Perform precise mirror geometric transformations to generate a set of mirror primitives.

[0061] For each control point in the graphic element Calculate its symmetry about the axis of symmetry. mirror point :

[0062]

[0063] in, , , The parameter of the general form equation for the axis of symmetry is... The coordinates of the original control points. These are the coordinates of the control points after mirroring. For the original control points, This is the mirror image point. In the above formula, the molecule... With denominator They have the same dimensions (both are in the dimension of length square, because...). , It has the reciprocal dimension of length. It has the dimension of length. , (Having the dimension of length), the overall ratio has the dimension of length, and... The dimensions are consistent, and the formula is dimensionally self-consistent.

[0064] Transformations are performed on different types of primitives in the following manner: Step S401: For the line segment primitives, respectively, check the coordinates of the starting point. and endpoint coordinates Perform the above point transformation to generate the starting coordinates of the mirrored line segment. and endpoint coordinates .in, The coordinates of the starting point of the original straight line segment are: Let be the coordinates of the endpoint of the original straight line segment. Let be the coordinates of the starting point of the mirrored line segment. These are the coordinates of the endpoint of the mirrored line segment.

[0065] Step S402: For the arc primitive, set the center coordinates. Perform point transformation to generate the coordinates of the mirror circle's center. radius of the arc Remain unchanged. The coordinates of the center of the original arc. The coordinates of the center of the circle after mirroring. Let be the radius of the arc. Let the direction angle of the axis of symmetry be... For the starting angle and termination angle Perform angle mirror transformation:

[0066] in, The angle between the axis of symmetry and the positive x-axis ranges from 0 to 1. Units and Maintain consistency. This is the original angle value. This is the angle value after mirroring. Because the mirror transformation reverses the drawing direction of the arc, the starting angle of the mirrored arc is taken as... The termination angle is taken .in, The initial angle of the original arc. This is the termination angle of the original circular arc.

[0067] Step S403: For polyline and spline curve primitives, perform point transformations sequentially on the coordinates of all vertices. For spline curves, also perform the same transformations on the coordinates of control points, and use a reflection transformation matrix for the tangent direction vector. deal with:

[0068] in, , The parameter of the general form equation for the axis of symmetry is... This is the reflection transformation matrix. For the tangent direction vector... The tangent direction vector after mirroring is .in, The original tangent direction vector. and These are the horizontal and vertical components of the tangent direction vector, respectively. Indicates transpose. This is the tangent direction vector after mirroring. Reflection transformation matrix. It contains no translation component, acts only on the direction vector, and does not affect coordinate translation.

[0069] Step S404: For the fill pattern primitive, perform point transformation on all vertices of its boundary polyline, and simultaneously change the angle attribute of the fill pattern. Perform angle mirror transformation:

[0070] in, This is the original fill pattern angle attribute value. The angle attribute value of the mirrored fill pattern. The direction angle of the axis of symmetry, with a range of values ​​of... . , , All three units are consistent (either degrees or radians), and the formula's dimensions are self-consistent.

[0071] All of the above transformations are performed using 64-bit double-precision floating-point numbers, with coordinate accuracy better than 0.001 mm.

[0072] Step S5: Attribute synchronization.

[0073] The attribute information of the original primitives is synchronized to the corresponding mirror primitives, and the directional attributes are automatically adjusted to generate a complete set of mirror primitives. Step S5 may specifically include: Step S501: For non-directional attributes such as color, line width, layer, line type, line type scale, material specification number, and component number, directly copy the attribute values ​​of the original graphic element and assign them to the corresponding mirror graphic element.

[0074] Step S502: For directional attributes such as slope angle and tilt direction angle stored as angle values, set the angle attribute value of the original primitive to be... The direction angle of the axis of symmetry is Calculate the angle attribute value after mirroring. :

[0075] in, The angle attribute value of the original primitive. The direction angle of the axis of symmetry, with a range of values ​​of... , The angle attribute value is for the mirrored primitive, and all three values ​​have the same unit (either degrees or radians), ensuring the formula's dimensions are consistent. The calculation results are normalized to... Within the range.

[0076] Step S503: For text-type graphic elements, after performing a coordinate mirror transformation, detect the text's rotation angle attribute to determine if the text is reversed horizontally or vertically after mirroring. If reversed text is detected, perform compensation adjustment on the text graphic element's rotation angle to restore the text to its correct readable orientation. Text-type graphic elements include TEXT and MTEXT types. For multi-line text, simultaneously adjust the text alignment to ensure correct text content layout in the mirrored position.

[0077] Step S504: For graphic symbols with inherent directionality, such as rebar hooks, weld symbols, and slope arrows, determine the symbol type through block name matching or geometric feature identification, and perform direction flipping processing according to the mirroring rules of the corresponding symbols. Specifically, extract the direction vector of the symbol, perform the same reflection transformation as coordinate transformation on the direction vector, and generate a mirrored symbol with the correct direction.

[0078] In this embodiment, to handle novel symbols not covered by the directional symbol type recognition rule library, based on step S504, the geometric features of graphic symbols that cannot be identified through tile name matching can be extracted as feature vectors, and their similarity is calculated with the feature vectors in the known directional symbol sample library. Symbols with similarity exceeding a preset threshold are processed according to the mirroring rule of the most similar known symbol, and the processing results are recorded in the list of items pending review for user confirmation.

[0079] Step S6: Mirror verification and conflict detection.

[0080] After attribute synchronization is complete, perform conflict detection and geometric consistency quality verification on the mirrored primitive set, and generate a verified mirrored primitive set and processing report. Step S6 may specifically include: Step S601: Mirror the primitive set With the existing set of elements in the drawing Spatial relationship analysis was conducted using a two-stage detection strategy. Among these steps, For a set of mirrored primitives, For each mirrored primitive in the mirrored primitive set, The total number of mirrored primitives. For an existing set of primitives, For each existing element in the existing set of elements, This represents the total number of existing graphic elements.

[0081] The first phase involves each mirror primitive. Calculate its axis-aligned bounding box .in, For mirror primitives The axis is aligned with the bounding box. For the first Each pair of mirror primitives. Check the intersection conditions of bounding boxes:

[0082] in, , , , For mirror primitives The bounding box boundary coordinates, , , , For existing primitives The bounding box boundary coordinates, For the first Existing primitives. Only primitive pairs whose bounding boxes intersect are included in the second stage of precise detection.

[0083] In the second stage, precise geometric intersection judgment is performed on the primitive pairs that passed the screening in the first stage, and they are classified and processed according to the following three levels: If the primitives are mirror images... With existing primitives Their geometric shapes are completely identical, and the coordinate differences are within tolerance. Within, will Marked as redundant elements, they are not written to the drawing by default; if there is partial geometric overlap but not complete coincidence, Elements marked as potentially conflicting are highlighted and added to the list of projects awaiting review; if there is no spatial overlap, they are directly... Write the drawing data. Among them, This is for coordinate difference tolerance.

[0084] Step S602: Perform geometric consistency verification on the mirrored elements written into the drawing. For each pair of original element control points... and its corresponding mirror point Calculate the signed distance from two points to the axis of symmetry. and Verify the following conditions:

[0085] in, For the first One original primitive control point, for The corresponding mirror point, Control points The signed distance to the axis of symmetry. mirror point The signed distance to the axis of symmetry. For accuracy tolerance, the default value is 0.001mm. For control point indices. Signed distance is calculated as follows: for control points... Its axis of symmetry The signed distance is

[0086] in, , , The parameter of the general form equation for the axis of symmetry is... Control points The coordinates are given by the symbol indicating which side of the axis of symmetry the point is located on. and All units are length units, and tolerances The dimensions must be consistent to verify dimensional consistency. If the above conditions are met for all control points, the mirror transformation accuracy is deemed acceptable; if any condition exceeds the tolerance, the anomaly is recorded and the transformation calculation for the corresponding graphic element is re-executed.

[0087] Step S603: Generate a structured processing report, recording the following information: the total number of symmetry symbols discovered during this processing and their distribution; the number of mirror completion operations performed and the position coordinates and symmetry axis parameters of each completion; a summary of conflict detection results; and a list of items awaiting review. The summary of conflict detection results includes the number of redundant primitives and the number of potentially conflicting primitives. The structured processing report also records statistics on mirror transformation accuracy, including the maximum coordinate deviation and the average coordinate deviation.

[0088] Step S7: Output the drawings.

[0089] Output the complete drawing, including the completed graphics, in the original format or the user-specified format, along with a structured processing report.

[0090] On the other hand, the present invention also proposes an automatic detection system for mirrored drawings of symmetry symbols, comprising: The drawing preprocessing module is used to acquire engineering drawing files, perform parsing processing according to the file format, and generate a structured drawing data set or preprocessed image.

[0091] The symmetry symbol recognition module is used to identify symmetry lines, symmetry symbols, mirrored explanatory text, directional annotations, and block references in drawings based on a structured set of graphic data or a pre-processed image. For vector format drawings, it uses a matching method based on graphic attribute rules; for raster image format drawings, it uses a matching method based on geometric graphic element combination. The module then generates a list of symmetry symbol detection results.

[0092] The symmetry relationship analysis module is used to establish a mathematical expression of the symmetry axis based on the list of symmetry symbol detection results, calculate the comprehensive density ratio index to determine the original drawing side and the side to be mirrored and completed, and extract the set of primitives to be mirrored.

[0093] The mirror transformation module is used to perform mirror geometric transformations on each type of primitive in the primitive set to be mirrored based on the symmetry axis parameter, and generate a mirror primitive set.

[0094] The attribute synchronization module is used to copy the non-directional attributes of the original graphic element to the mirror graphic element, and to perform corresponding adjustment processing on angle-type directional attributes, directional graphic symbols and text-type graphic elements respectively.

[0095] The mirror verification module is used to perform a two-stage conflict detection on the mirror primitive set, which involves bounding box filtering and precise geometric intersection calculation. Conflicting primitives are classified into three levels: redundancy, partial overlap, and no conflict, and geometric consistency verification is performed.

[0096] The drawing output module is used to output complete drawings, including completed graphics, in a specified format, and also output a structured processing report.

[0097] The above modules transmit drawing data and processing results through a unified data bus, supporting two working modes: single drawing processing and batch drawing automated processing.

[0098] By way of example, the system proposed in this invention may also include various features and combinations thereof in the method embodiments, which will not be elaborated here.

[0099] This invention combines primitive attribute-based rule matching with convolutional neural network target detection and Hough transform detection in step S2 to establish corresponding recognition paths for vector format drawings and raster image format drawings, respectively, and then uses a fusion formula... By combining the results of the two detection methods, the problem of insufficient coverage of multiple symmetric symbol expression forms by a single recognition method is overcome, thereby improving the adaptability of symmetric symbol recognition to different cartographic standards and expression methods.

[0100] This invention introduces a comprehensive density ratio index in step S3. By comprehensively considering three indicators—the number of primitives, the area of ​​primitives, and the complexity of graphics—a quantitative comparison is made between the two sides of the symmetry line. This overcomes the problem of misjudging the original drawing side in scenarios with uneven primitive distribution when relying on only a single indicator. As a result, the determination of the mirror effect area has an objective calculation basis, reducing the triggering misjudgment of mirror completion.

[0101] This invention overcomes the problem of incomplete processing of graphic element types leading to incorrect geometric parameters or attribute annotations in mirrored graphics by performing geometric transformation rules for different graphic element types such as line segments, arcs, polylines, spline curves, and filling patterns in step S4, and performing corresponding attribute synchronization processing for angle-type attributes, directional graphic symbols, and text-type graphic elements in step S5.

[0102] This invention overcomes the problem of the inability to automatically detect and classify geometric conflicts between mirror primitives and existing primitives by employing a two-stage conflict detection strategy of fast bounding box screening and accurate geometric intersection calculation in step S6, and classifying the detection results into three levels: complete overlap, partial overlap, and no conflict. Therefore, while automatically completing the data, it avoids graphic overlap and data redundancy, and provides users with a structured basis for conflict handling.

[0103] See Figures 2-9 The following application examples are proposed: When an architectural design institute was preparing structural construction drawings for a multi-purpose building project, it used a half-page drawing method for the reinforcement details of the standard floor slabs. The drawing file was in DWG vector format, and only the left half of the reinforcement details, bounded by the central axis, was shown; the right half was represented by symmetrical annotations. The drawing contained various graphic elements, including straight lines, arcs, polylines, fill patterns, and block references. Reinforcement hook symbols were stored as block references, slope annotations as angle attributes, and text descriptions as TEXT type elements. The downstream 3D model reconstruction system needed to obtain drawing data containing the complete reinforcement geometry, thus triggering the automatic mirror completion process described in this method.

[0104] During the drawing preprocessing stage, the system reads the DWG format file, calls the corresponding format parsing library to extract all graphic elements, and generates a structured graphic element set. The system groups the graphic elements by layer name, and prioritizes extracting graphic elements whose layer names contain the keyword "centerline layer," forming a candidate set of symmetry symbol graphic elements.

[0105] Table 1. Structured graph data set (partial)

[0106] In the symmetry symbol recognition stage, the system performs rule matching on the candidate primitive set. For E001, its line type name is CENTER, belonging to the preset set of dotted-dash line type names, and it is included in the candidate symmetry line set. During step S202, the number of primitives within a 60mm range on both sides of E001 is calculated: Left side... right side The ratio is 6.0, exceeding the threshold. Once confirmed as a valid candidate line of symmetry, record the coordinates of its endpoints and the direction angle. For E006, the text content "symmetry" successfully matched the preset symmetry keyword regular expression and was recorded as a text-based symmetry symbol. For E005, the block name HOOK_L does not belong to the symmetry block name keyword list, and the similarity between the block's geometric feature hash value and the standard symmetry symbol block feature library is 0.32, which is lower than the threshold of 0.85. Therefore, it is not recorded as a symmetry symbol and is retained as a reference for ordinary rebar hook blocks.

[0107] Table 2 List of Symmetry Symbol Detection Results

[0108] In the symmetry analysis phase, the system calculates the symmetry axis parameters based on the endpoint coordinates of S001. Substituting these parameters into the formula in step S301, , ,get , , That is, the equation of the axis of symmetry is Simplify to directional unit vector Direction angle Then, step S303 is executed to collect the graphical data on both sides of the line of symmetry.

[0109] Table 3. Statistical analysis of the graphs on both sides of the line of symmetry and calculation of the overall density ratio.

[0110] The left side is determined to be the original drawing side, and the right side is the side to be mirrored and completed. Step S304 is executed to extract all primitives on the left side and include them in the set of primitives to be mirrored. Five primitives on the right side are marked as existing symmetrical primitives for subsequent conflict detection.

[0111] During the mirror geometry transformation stage, the system performs a mirror transformation on each primitive in the set of primitives to be mirrored, based on the symmetry axis parameter. , , Perform the transformation. The axis of symmetry is... The mirror transformation inverts the horizontal coordinate while keeping the vertical coordinate unchanged. The following shows the transformation results of the core graphic elements.

[0112] Table 4 Comparison of coordinates before and after mirror transformation of core primitives

[0113] For arc E003 The initial angle mirror value is The terminal angle mirror value is After mirroring, the starting angle is set to 270° and the ending angle is set to 90° (i.e., the drawing direction is flipped) to maintain the correct geometric shape of the arc.

[0114] During the attribute synchronization phase, the system performs attribute copying and directional attribute adjustment on the mirrored primitive set. For non-directional primitives such as E002 and E004, attributes such as layer REBAR, linetype CONTINUOUS, and color index 2 are directly copied. For the E005 rebar hook block reference, it is identified as a graphic symbol with inherent directionality by the block name HOOK_L, and its direction vector is extracted. The direction vector is obtained after performing a reflection transformation. The angle attribute was adjusted from 0° to 180° to ensure the hook correctly faces to the right. The rotation angle attribute of the slope annotation text elements in the drawing was checked; it was determined that the text did not appear reversed after mirroring, and no compensation adjustment was needed.

[0115] Table 5 Attribute synchronization processing results

[0116] In the mirror verification and conflict detection phase, the system performs a two-stage conflict detection on the 42 mirrored elements and the 5 existing elements on the right. The first stage, bounding box screening, identifies 3 pairs of intersecting bounding boxes, prompting a second stage of precise judgment. Two pairs of elements are geometrically identical with coordinate differences within 0.001mm, marked as redundant elements and not included in the drawing; one pair exhibits partial geometric overlap, marked as a potential conflict element, highlighted, and recorded in the pending review list. The remaining 40 mirrored elements have no spatial overlap and are directly written into the drawing data. Subsequently, step S602, geometric consistency verification, is performed on the 40 written elements, verifying that the absolute value of the sum of the signed distances from each pair of control points to the axis of symmetry is less than 0.001mm, thus determining the transformation accuracy is acceptable.

[0117] Table 6 Summary of Collision Detection Results

[0118] During the drawing output stage, the system will output the completed reinforcement drawings in DWG format and simultaneously output a structured processing report, recording 2 instances of symmetry symbols found, 40 instances of mirror completion performed, 2 redundant elements, 1 item pending review, maximum coordinate deviation of 0.00mm, and average coordinate deviation of 0.00mm.

[0119] Throughout the process, data is parsed from the DWG file into a structured set of graphic element data (Table 1). A list of detection results is generated through symmetry symbol recognition (Table 2). Symmetry relationship analysis determines the original side, the completed side, and the overall density ratio (Table 3). Mirror geometric transformation generates coordinate-flipped mirror elements (Table 4). Attribute synchronization adjusts directional attributes (Table 5). Finally, after conflict detection and filtering, valid mirror elements are written into the drawing (Table 6). The output data from each step directly serves as the input for the next step. Element numbering is used throughout the entire process, ensuring the integrity and logical consistency of the data flow.

[0120] The embodiments of the present invention have been described above. However, the embodiments are not limited to the specific implementation methods described above. The specific implementation methods described above are merely illustrative and not restrictive. Those skilled in the art can make more equivalent embodiments under the guidance of the present embodiments, and all of them are within the protection scope of the present embodiments.

Claims

1. A method for automatically detecting mirrored images of drawings to identify symmetrical symbols, characterized in that, include: Parse engineering drawing files to generate a structured set of drawing and data elements or a pre-processed image; Based on the structured graph data set or preprocessed image, symmetric annotation information is identified by matching graph attribute rules or matching based on geometric graph element combinations, and a list of symmetric symbol detection results is generated. Based on the list of symmetry symbol detection results, establish the mathematical expression of the symmetry axis, calculate the comprehensive density ratio index on both sides of the symmetry line to determine the original drawing side and the side to be mirrored and completed, and extract the set of primitives to be mirrored; Perform mirror geometric transformations on each type of primitive in the set of primitives to be mirrored based on the symmetry axis parameter to generate a set of mirrored primitives; The attribute information of the original primitives is synchronized to the mirror primitives, and the directional attributes are adjusted by angle mirroring. A two-stage conflict detection process, consisting of bounding box filtering and precise geometric intersection calculation, is performed on the mirrored primitive set and the existing primitive set, and the results are classified into three levels: complete overlap, partial overlap, and no conflict.

2. The method for automatically detecting mirrored drawings for recognizing symmetrical symbols according to claim 1, characterized in that, For vector format drawings, the identification of symmetrical annotation information through matching primitive attribute rules includes: From the structured graphic data set, filter line segment graphic elements according to any one of the following three conditions: the line type name belongs to the set of dotted line type names, the layer name contains the keyword of the center line layer, and the color attribute is the color value of the center line, and generate a candidate symmetry line set; For each line segment in the candidate set of symmetric lines, calculate the number of primitives within a set distance range on both sides of the line segment. and ,when or The line segment is then identified as a valid candidate symmetry line, in which and These represent the number of primitives on the left and right sides of the line segment, respectively. The threshold is the ratio of the number of primitives. Iterate through all text primitives, perform symmetric keyword regular expression matching on the text content, and record the successfully matched text primitives as text-class symmetric symbols; Traverse all block reference primitives, and record block reference primitives with similarity exceeding a preset threshold as block-class symmetric symbols by matching the block name and comparing the block geometric feature hash value with the feature library of standard symmetric symbols.

3. The method for automatically detecting mirrored drawings for recognizing symmetrical symbols according to claim 1, characterized in that, For raster image format drawings, the method of identifying symmetrical annotation information based on geometric primitive combination matching includes: According to the average radius of the axis ring in the drawing. It adaptively calculates all tolerance parameters, including short line length threshold, axis length threshold, search range, and angle tolerance; when the axis ring is not present in the drawing, it is replaced by a preset proportional value of the short side length of the drawing area bounding box. Perform calculations; From the vector primitives converted from the preprocessed image, straight line segments are filtered according to conditions such as length not less than a length threshold, line type or layer conforming to centerline characteristics, to generate a set of candidate symmetry axis centerlines; For each median in the set of candidate symmetry axis medians, at each of its two ends Search for short line segments within the length range, and filter them step by step according to length constraints, perpendicular relationship constraints with the midline, midpoint near the extension of the midline, and pairing constraints. Short line segment pairs that satisfy all constraints are retained as the end marks of the axis of symmetry. Check the intersection of the above short line segments with irrelevant line segments such as table lines and grid extension lines in the drawing, eliminate candidates with intersections, and confirm the remaining candidate axis of symmetry centerlines as valid axes of symmetry; Retrieve text primitives within a defined search range near the endpoints of each valid axis of symmetry, associate and bind the retrieved text annotations with the corresponding axis of symmetry objects, and store them in the symmetry symbol detection result list.

4. The method for automatically detecting mirrored drawings for recognizing symmetrical symbols according to claim 3, characterized in that, The adaptive calculation tolerance parameters include: Short line length threshold The axis length threshold is taken as The search range at the end is taken as the length of the centerline. The vertical relationship tolerance angle is set to a preset angle threshold; where , This is a preset scaling factor; when using the short side of the bounding box as a substitute... At this time, the calculation method of each parameter remains unchanged, and the substitute value is substituted into the corresponding formula.

5. The method for automatically detecting mirrored drawings for recognizing symmetrical symbols according to claim 1, characterized in that, The determination of the original drawing side and the side to be mirrored by calculating the comprehensive density ratio on both sides of the symmetry line includes: Count the number of graphic elements in each half-plane on both sides of the line of symmetry. and Total area of ​​graphic elements and and graphics complexity index and Calculate the comprehensive density ratio index : ; in, , Measured by the product of the number of primitives and the average number of vertices of the primitives; when When determining that the first side is the original drawing side, when The opposite is true when; If both sides of the image are deemed complete, the mirror completion process is not triggered. To determine the tolerance threshold.

6. The method for automatically detecting mirrored drawings for recognizing symmetrical symbols according to claim 1, characterized in that, The step of performing mirror geometric transformations on each type of primitive based on the symmetry axis parameter includes: For each control point in the primitive Calculate its symmetry about the axis of symmetry. mirror point : ; ; in, , , The parameters of the general form equation for the axis of symmetry; the starting angle of the circular arc primitive. and termination angle according to Perform an angle mirror transformation, where The direction angle of the axis of symmetry is taken as the starting angle of the mirrored arc. The termination angle is taken Apply the reflection transformation matrix to the tangent direction vector of the spline curve. deal with:

7. The method for automatically detecting mirrored drawings for recognizing symmetrical symbols according to claim 1, characterized in that, The aforementioned angular mirroring adjustment of the directional attribute includes: For directional attributes stored as angle values, let the angle attribute value of the original primitive be... The direction angle of the axis of symmetry is Calculate the angle attribute value after mirroring. And the calculation results are standardized to Within the range; For text-type primitives, after coordinate mirroring transformation, detect the text rotation angle attribute to determine whether the text is reversed after mirroring. If it is reversed, perform compensation adjustment on the text rotation angle to restore the text to the correct reading position. For graphic symbols with inherent directionality, the symbol type is determined by matching the block name or identifying geometric features, and a reflection transformation is performed on the direction vector to generate a mirrored symbol with the correct direction.

8. The method for automatically detecting mirrored drawings for recognizing symmetrical symbols according to claim 1, characterized in that, The two-stage conflict detection includes: In the first stage, the axis-aligned bounding box is calculated for each mirrored primitive, and the intersection condition check is performed on the bounding box pairs of the mirrored primitive and the existing primitives to filter out primitive pairs whose bounding boxes intersect. In the second stage, a precise geometric intersection judgment is performed on the primitive pairs that passed the screening in the first stage: if the mirror primitive and the existing primitive have completely identical geometry and the coordinate difference is within the tolerance... Within a certain range, redundant elements are marked and not written to the drawing; if there is partial geometric overlap but not complete overlap, they are marked as potentially conflicting elements and recorded in the list of projects pending review; if there is no spatial overlap, mirrored elements are written to the drawing data.

9. The method for automatically detecting mirrored drawings for recognizing symmetrical symbols according to claim 8, characterized in that, Following the two-stage conflict detection, a geometric consistency check is also included: For each pair of original primitive control points and its corresponding mirror point Calculate the signed distance from two points to the axis of symmetry. and ,verify Among them, there is signed distance , , , The parameter is the axis of symmetry. For the coordinates of the control points, For accuracy tolerance; if there are control points that exceed the tolerance, the transformation calculation of the corresponding graphic element is re-executed.

10. A system for automatically discovering mirrored drawings of symmetry symbols, used to execute the method for automatically discovering mirrored drawings of symmetry symbols as described in any one of claims 1 to 9, characterized in that, include: The drawing preprocessing module is used to acquire engineering drawing files, perform parsing processing according to the file format, and generate a structured drawing data set or preprocessed image; The symmetry symbol recognition module is used to identify symmetry annotation information based on the structured graphic data set or preprocessed image by matching graphic attribute rules and geometric graphic element combination matching, and generate a list of symmetry symbol detection results. The symmetry relationship analysis module is used to establish a mathematical expression of the symmetry axis based on the list of symmetry symbol detection results, calculate the comprehensive density ratio index to determine the original drawing side and the side to be mirrored and completed, and extract the set of primitives to be mirrored; The mirror transformation module is used to perform mirror geometric transformations on each type of primitive in the set of primitives to be mirrored based on the symmetry axis parameter, and generate a set of mirrored primitives. The attribute synchronization module is used to synchronize the attribute information of the original primitives to the mirror primitives and to perform angle mirroring adjustments on directional attributes. The mirror verification module is used to perform a two-stage conflict detection on the mirror primitive set and the existing primitive set, which involves bounding box filtering and precise geometric intersection calculation. It is classified into three levels: complete overlap, partial overlap and no conflict, and performs geometric consistency verification. The drawing output module is used to output complete drawings, including completed graphics, in a specified format, and also output a structured processing report.