An engineering graphics three-view contour structure semantic matching recognition and intelligent correction method and system

CN122906713APending Publication Date: 2026-10-13ZHEJIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611399746.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-10
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

[0004]综上所述,现有的三视图识别与错误检测方法主要存在以下不足:(1)依赖模板匹配、像素级比对或形状相似度度量,仅能识别图形在几何形状层面的差异,难以捕捉轮廓结构之间的语义一致性;(2)部分方法需要借助三维重建,计算复杂且泛化能力受限;(3)缺乏对三视图之间投影对应关系和拓扑结构的深度理解,导致对图形特征错误的检测能力不足

Benefits of technology

[0022]1、本发明通过轮廓结构语义匹配,利用图形基元的拓扑关系与结构特征实现分析视图与标准视图的自动识别与匹配,无需人工指定比对模板,显著提高了三视图一致性分析与智能批改的自动化程度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122906713A_ABST
    Figure CN122906713A_ABST
Patent Text Reader

Abstract

The application discloses a contour structure semantic matching recognition and intelligent correction method and system for engineering graphics three-view, comprising the following steps: obtaining a to-be-analyzed graph and a reference graph, performing image preprocessing to obtain a binary line drawing image; performing contour detection, dividing the image into multiple view regions according to the spatial distribution relationship of contour centroids, extracting contour primitives, constructing a topological graph structure, and determining a target reference graph; extracting key structure points to perform random three-point affine registration and geometric alignment; performing gray diffusion processing and difference operation, extracting redundant structure regions and missing structure regions; performing endpoint-fixed straight line detection, judging difference line segments as redundant line segments or missing line segments, and generating a correction result. The application realizes automatic correspondence between the to-be-analyzed graph and the reference graph through contour structure semantic matching, completes accurate geometric alignment by using random three-point affine registration, extracts structured differences through gray diffusion and difference analysis, and finally outputs a correction result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision and image processing technology, and in particular to a method and system for semantic matching and intelligent correction of contour structures in three-view drawings of engineering graphics. Background Technology

[0002] In engineering graphics teaching and practice, three-view drawings, as a fundamental means of representing the shape and structure of objects, have always been a core issue in graphics education and automated grading. Traditional three-view drawing inspection and correction mainly rely on manual verification of each drawing, which suffers from low efficiency, strong subjectivity, and difficulty in large-scale application. With the development of computer vision and artificial intelligence technologies, automated three-view drawing recognition and inspection methods have gradually become a research hotspot.

[0003] Currently, some technologies attempt to automate the detection or correction of three-view drawings. For example, an existing solution discloses a method for grading AutoCAD proficiency exams, which automatically corrects drawings by comparing explicit drawing information such as primitives and layers. Although it introduces feature extraction, it still relies on predefined primitive feature templates and struggles to analyze the semantic consistency of contour structures. Another existing solution discloses layer extraction from DXF files and item-by-item comparison with graphic elements, which can identify erroneous lines. However, this method is essentially primitive-level matching and cannot identify topological relationships and projection correspondence errors between contours. Some solutions disclose the approach of reconstructing two-dimensional views into three-dimensional solid images and comparing them with standard drawings, introducing solid reconstruction. However, the calculation process is complex, requires high view quality and reconstruction rules, and has limited generalization ability. Furthermore, existing solutions disclose the use of graph convolutional networks for semantic segmentation of components in engineering drawings, which can extract contour and component information. However, it lacks the ability to understand the structural relationships and semantic consistency between contour primitives, making it difficult to effectively identify deep errors in topological structure and view correspondence.

[0004] In summary, existing three-view recognition and error detection methods have the following shortcomings: (1) They rely on template matching, pixel-level comparison or shape similarity measurement, which can only identify differences in geometric shape and are difficult to capture semantic consistency between contour structures; (2) Some methods require the use of three-dimensional reconstruction, which is computationally complex and has limited generalization ability; (3) They lack a deep understanding of the projection correspondence and topological structure between three views, resulting in insufficient ability to detect errors in graphic features. Summary of the Invention

[0005] The purpose of this invention is to provide a technical solution for a method and system for contour structure semantic matching recognition and intelligent correction of three-view drawings in engineering graphics, which addresses the shortcomings of existing technologies. The method achieves automatic correspondence between the graphic to be analyzed and the reference graphic through contour structure semantic matching, completes accurate geometric alignment by using random three-point affine registration, extracts structured differences through grayscale diffusion and differential analysis, and finally outputs the correction results.

[0006] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:

[0007] A method for semantic matching, recognition, and intelligent correction of contour structures in engineering graphics three-view drawings includes the following steps:

[0008] S1. Obtain the graphic to be analyzed and the reference graphic, and perform image preprocessing on the graphic to be analyzed and the reference graphic to obtain a binary line drawing image;

[0009] S2. Perform contour detection on the binary line drawing image. Divide the image into multiple view regions according to the spatial distribution relationship of the contour centroids. Extract the contour primitives of each view region. Construct a topological graph structure that reflects the connection and adjacency relationship between primitives. Perform equal arc length sampling on the contours of each view region. Calculate the shape context descriptor and integrate topological consistency to form the structural semantic matching cost between views. Determine the target reference graphic from the reference graphic based on the structural semantic matching cost.

[0010] S3. Extract the key structural points in the graphic to be analyzed and the target reference graphic, and perform random three-point affine registration based on the key structural points to geometrically align the graphic to be analyzed and the target reference graphic.

[0011] S4. Perform grayscale diffusion processing on the registered analysis graphic and the target reference graphic, and perform difference operations to extract redundant and missing structural regions in the graphic to be analyzed.

[0012] S5. Perform endpoint line detection on redundant and missing structural regions, extract the endpoint position, length, direction and category information of the difference line segments, and determine the difference line segments as redundant or missing line segments based on the existence status of the difference line segments in the graphic to be analyzed and the target reference graphic, and generate the correction results.

[0013] This method combines semantic matching of contour structure with precise registration of affine geometry, eliminating the need for manually specifying comparison templates. It can effectively overcome interference from rotation, scaling, translation, and line width differences, significantly improving the accuracy and robustness of three-view correction.

[0014] A semantic matching and intelligent correction system for contour structure of three-view drawings in engineering graphics is provided to implement the aforementioned method for semantic matching and intelligent correction of contour structure of three-view drawings in engineering graphics, including:

[0015] The image preprocessing module is used to acquire the image to be analyzed and the reference image, and to perform image preprocessing to obtain a binary line drawing image;

[0016] The contour structure semantic matching module is used to perform contour detection on binary line drawing images. Based on the spatial distribution relationship of the contour centroids, the image is divided into multiple view regions. Contour primitives in each view region are extracted and a topological graph structure is constructed. The contours of each view region are sampled with equal arc length and the shape context descriptor is calculated. The topological consistency is combined to form the structure semantic matching cost. The target reference graphic is determined from the reference graphic based on the structure semantic matching cost.

[0017] The key structural point extraction module is used to extract key structural points from the graphic to be analyzed and the target reference graphic;

[0018] The affine registration module is used to perform random three-point affine registration based on key structural points, and to geometrically align the graphic to be analyzed with the target reference graphic.

[0019] The difference extraction module is used to perform grayscale diffusion processing and difference operations on the registered image to be analyzed and the target reference image to extract redundant and missing structural regions.

[0020] The module includes a line segment detection and correction output module, which is used to perform fixed-endpoint line detection on redundant and missing structural regions, extract the endpoint position, length, direction and category information of the difference line segments, determine the difference line segments as redundant or missing line segments, and generate correction results.

[0021] The present invention, by adopting the above-described technical solution, has the following beneficial effects:

[0022] 1. This invention achieves automatic identification and matching of analytical views and standard views by utilizing the topological relationships and structural features of graphic primitives through contour structure semantic matching, eliminating the need for manually specifying comparison templates and significantly improving the three-view accuracy. Figure 1 The degree of automation in consistency analysis and intelligent grading.

[0023] 2. This invention calculates similarity based on contour structure and shape context, and measures graphic similarity from the perspective of overall topological structure and contour primitive distribution. It can effectively identify the consistency of graphics at the structural semantic level, overcome the shortcomings of existing methods that are difficult to capture the topological relationship between contour primitives and the projection correspondence between views, and fundamentally improve the ability to detect structural errors.

[0024] 3. This invention introduces a random three-point affine registration mechanism for feature points. By performing multiple random sampling and transformation estimations on the feature point set, even if there are false detections, missed detections, or local missing features, it is still possible to obtain better affine transformation parameters, achieve accurate geometric alignment between the image to be tested and the template image, and provide an accurate geometric benchmark for subsequent difference analysis.

[0025] 4. This invention organically combines semantic understanding of contour structure with precise registration of affine geometry, achieving a unified semantic recognition at the graphic structure level and precise alignment at the pixel level. While ensuring the correctness of overall structural matching, it also takes into account the accuracy of local geometric positioning. It is applicable to various input forms such as scanned images, photographed images, and electronically drawn images, and can be widely used in fields such as engineering drawing comparison and intelligent correction of engineering graphics teaching. Attached Figure Description

[0026] The present invention will be further described below with reference to the accompanying drawings:

[0027] Figure 1 The flowchart shows a method for contour structure semantic matching, recognition, and intelligent correction of three-view drawings in engineering graphics, as well as a method in the system of the present invention.

[0028] Figure 2 This is a flowchart illustrating the overall technical process of the method in this invention.

[0029] Figure 3 This is a graph showing the change in the accuracy of contour point set matching under rotation conditions in this invention.

[0030] Figure 4 This is a graph showing the change in the accuracy of contour point set matching under scaling conditions in this invention.

[0031] Figure 5 This is a graph showing the change in the accuracy of contour point set matching under shearing conditions in this invention.

[0032] Figure 6 This is a graph showing the change in the accuracy of contour point set matching under Gaussian noise conditions in this invention.

[0033] Figure 7 This is a schematic diagram of the optimal matching of a random three-point affine registration point set in this invention. Detailed Implementation

[0034] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0035] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0036] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion.

[0037] The Chinese translations of the English terms in this invention are shown in the table below:

[0038] like Figure 1 and Figure 2 As shown, this invention provides a method for semantic matching and intelligent correction of contour structures in three-view drawings of engineering graphics, comprising the following steps:

[0039] S1. Image Acquisition and Preprocessing: Acquire the image to be analyzed and the reference image, and perform image preprocessing on the image to be analyzed and the reference image to obtain a binary line drawing image. Image preprocessing includes at least one of grayscale conversion, binarization, noise suppression, morphological processing, and size normalization.

[0040] The image to be analyzed can be a scanned image, a photographed image, or an electronically drawn image.

[0041] When reference graphics are stored as a graphics library, all candidate reference graphics are read.

[0042] The image is sequentially subjected to grayscale conversion, binarization, denoising, morphological processing, and size normalization to obtain a binary line drawing image suitable for contour extraction and structural analysis.

[0043] S2. View Region Division and Contour Structure Semantic Matching: Contour detection is performed on the binary line drawing image. Invalid contours are filtered out by area, aspect ratio and bounding rectangle information. Based on the spatial distribution relationship of the contour centroids, the main contours in the image are divided into multiple view regions, including the front view, left view and top view.

[0044] For a rotating graphic to be analyzed, the rotation angle is determined based on the centroid arrangement of each view contour, and the direction is corrected.

[0045] Extract the contour primitives of each view region, construct a topological graph structure that reflects the connection and adjacency relationship between primitives, sample the contours of each view region with equal arc length, calculate the shape context descriptor, and integrate topological consistency to form the structural semantic matching cost between views. Determine the target reference graphic from the reference graphic based on the structural semantic matching cost.

[0046] The shape context descriptor is constructed by statistically analyzing the distance and angle distributions between contour points. Specifically, it includes: assuming the set of sampling points for a certain view contour is... , where p i =(x i ,y i For sampling point p i The distances and angles of the remaining sampling points relative to this point are divided into distance buckets R. k And angled bins This yields the shape context descriptor for that point:

[0047] ;

[0048] Where I(·) is an indicator function, which takes the value 1 when the condition is true and 0 otherwise; r ij For sampling point p j Relative to p i The distance; For sampling point p j Relative to p i The angle; k is the distance to the bin number. Angle bin numbering is used to represent the spatial distribution characteristics of contour points within the overall contour structure. By using shape context descriptors to measure graphic similarity at the level of overall topology and contour primitive distribution, the consistency of graphics at the structural semantic level can be effectively identified.

[0049] The structural semantic matching cost is obtained by fusing topological differences with the shape context point matching cost; let the shape context descriptor of a point in the graph to be analyzed be... The shape context descriptor of a point in the reference figure is: The cost of matching the basic points between the two is:

[0050] ;

[0051] Here, b represents the bucket number in the descriptor, and ε is a constant to prevent the denominator from being zero. The cost matrix is ​​composed of the matching costs of all points, and the optimal matching relationship is solved using the Hungarian algorithm. The comprehensive matching cost of each view is obtained after fusing the topological consistency metric, and the overall structural semantic matching cost is the weighted sum of the matching costs of each view. By fusing topological consistency, the topological relationships between contours and the projection correspondences between views can be effectively identified, fundamentally improving the ability to detect structural errors.

[0052] When a reference graphics library exists When the target graphic is selected, it is:

[0053] ;

[0054] Where S represents the graph to be analyzed, and A k C represents the k-th reference figure in the reference figure library. total (S,A k The overall structural semantic matching cost between the two is ). The selected optimal matching reference figure.

[0055] S3. Key structural point extraction and random three-point affine registration: Extract key structural points from the image to be analyzed and the target reference image. Key structural point extraction uses a pre-trained YOLO model to detect endpoints, intersections and inflection points; or uses SIFT feature points, Harris corner points, FAST corner points, ORB feature points or other image key point detection methods to obtain the image structural point set.

[0056] Random three-point affine registration is performed based on key structural points to geometrically align the graphic to be analyzed with the target reference graphic.

[0057] Random three-point affine registration solves the affine transformation model by using three sets of corresponding feature points; let feature point p be in the figure to be analyzed. i =[x i ,y i ,1] T The corresponding feature point q in the target reference image i =[u i ,v i ] T The affine transformation matrix A satisfies q i =Ap i Multiple random sampling yields several candidate affine matrices, and the reprojection error of each model is:

[0058] ;

[0059] The optimal affine matrix is ​​selected based on criteria such as minimizing error or maximizing the number of interior points. This maps the graphic to be analyzed to the coordinate system of the target reference graphic, achieving precise geometric alignment. Figure 4 As shown.

[0060] Each time, three sets of corresponding points are randomly selected to solve for a candidate affine matrix A. t The optimal affine transformation parameters are determined by minimizing the reprojection error:

[0061] ;

[0062] Alternatively, it can be determined by maximizing the number of interior points:

[0063] ;

[0064] Where N is the number of feature points participating in the evaluation, ρ(·) is the error evaluation function, and τ is the reprojection error threshold; through the optimal affine transformation matrix Spatial transformation is performed on the graphic to be analyzed to achieve geometric registration with the target reference graphic. Multiple random samplings are used to obtain several candidate affine matrices. The optimal affine matrix is ​​selected based on criteria such as minimum error or maximum number of interior points. The graphic to be analyzed is then mapped to the coordinate system of the target reference graphic to achieve precise geometric alignment.

[0065] By introducing a random three-point affine registration mechanism, even when there are false detections, missed detections, or local missing features, better affine transformation parameters can still be obtained, achieving accurate geometric alignment between the image under test and the template image.

[0066] S4. Binary line drawing grayscale diffusion and difference: Perform grayscale diffusion processing on the registered analysis graphic and the target reference graphic, and perform difference operation to extract redundant and missing structural regions in the graphic to be analyzed.

[0067] After registration, the binary line drawing is assigned a grayscale value based on the distance from the nearest line pixel, with the line pixel as the center, so as to achieve a smooth transition from hard boundaries to continuous grayscale.

[0068] Gray-level diffusion processing is achieved through distance transformation or gray-level attenuation functions; let the set of line regions be Ω, and the distance from any pixel x in the image to the nearest line pixel be D(x), then the gray-level diffusion image is represented as:

[0069] ;

[0070] Where σ is the grayscale diffusion scale parameter. Through grayscale diffusion processing, hard-boundary line drawings are transformed into grayscale structure images with buffering characteristics, which can effectively reduce the impact of minor geometric misalignments and linewidth differences on subsequent differential analysis, and significantly improve the accuracy of difference detection.

[0071] Let the grayscale diffusion result of the registered image to be analyzed be G. s (x), the grayscale diffusion result of the target reference image is G. r (x), then the redundant structure region and the missing structure region are respectively:

[0072] ;

[0073] ;

[0074] And the corresponding difference region is obtained by setting a threshold λ:

[0075] ;

[0076] ;

[0077] Among them, M add (x) represents the redundant structural region of the graphic to be analyzed relative to the target reference graphic, M miss (x) represents the missing structural region of the image to be analyzed relative to the target reference image. Through thresholding, connected component analysis, and morphological processing, spurious differences are removed, resulting in stable redundant and missing structural regions. Based on this, a spatial distribution heatmap of structural differences after geometric registration can be further generated, visually demonstrating the concentration and offset direction of the difference regions.

[0078] S5. Detection and Correction of Difference Line Segments: Perform endpoint line detection on redundant and missing structural regions, extract the endpoint position, length, direction and category information of difference line segments, and determine whether the difference line segments are redundant or missing based on their presence in the graphic to be analyzed and the target reference graphic, and generate correction results.

[0079] Fixed-endpoint line detection is used to represent the difference region as a line segment; endpoint-constrained line fitting is performed on connected pixels or edge pixels in the difference region to obtain a set of difference line segments, where any difference line segment is represented as:

[0080] ;

[0081] Among them, (x i1 ,y i1 ) and (x i2 ,y i2 ) represent the coordinates of the two endpoints of the line segment, α i c represents the direction of the line segment. iThe system categorizes line segments; if a differing line segment originates from a region with redundant structure, it is classified as a redundant line segment; if a differing line segment originates from a region with missing structure, it is classified as a missing line segment. By using fixed-endpoint line detection, pixel-level differences are transformed into structured line segment difference results, making the grading results more intuitive, readable, and facilitating teaching feedback.

[0082] Fixed endpoint line detection employs at least one of the following algorithms: Hough line detection, line segment detection, or endpoint constrained line fitting.

[0083] Line segments with obvious positional offsets and no structural missing or redundant segments are identified as positional deviation segments.

[0084] This method combines semantic matching of contour structure with precise registration of affine geometry, eliminating the need for manually specifying comparison templates. It can effectively overcome interference from rotation, scaling, translation, and line width differences, significantly improving the accuracy and robustness of three-view correction.

[0085] In one specific embodiment, the test image 64.jpg is used as the three-view drawing of the engineering graphics to be analyzed. First, the graphics to be analyzed and the candidate graphics in the reference graphics library are sequentially subjected to grayscale conversion, binarization, denoising, morphological processing and size normalization to obtain binary line drawings; then, the view regions such as the front view, left view and top view are divided according to the distribution of the centroid of the contour, and the contour primitives and their topological relationships in each view are extracted.

[0086] For the graph to be analyzed S and the candidate reference graph A k Let the shape context descriptors of the corresponding sampling points be respectively and Then the basic matching cost of the corresponding point pair is:

[0087] ;

[0088] Where b is the descriptor bucket number, and ε is a constant to prevent the denominator from being zero. Combining the matching cost and topological consistency of the contour sampling points in each view, the overall matching cost C(S,A) between the graphic to be analyzed and the candidate reference graphic is obtained. k And determine the target reference figure according to the following formula:

[0089] ;

[0090] In this embodiment, the minimum total cost of overall matching between the test image 64.jpg and the finally selected target reference image is:

[0091] ;

[0092] That is, after performing structural semantic matching between the test image 64.jpg and each candidate image in the reference image library, the candidate image P59a with the smallest total matching cost and a cost value of 0.0475 is selected as the target reference image.

[0093] Subsequently, the YOLO model was used to extract key structural points such as endpoints, intersections, and inflection points from the test image 64.jpg and the target reference image. Three pairs of non-collinear corresponding points were randomly selected, and the i-th key point in the test image was denoted as:

[0094] ;

[0095] The corresponding key points in the target reference image are:

[0096] ;

[0097] Let the affine transformation matrix be:

[0098] ;

[0099] Then the corresponding points satisfy:

[0100] ;

[0101] Expanding, we get:

[0102] ;

[0103] ;

[0104] Substituting the three pairs of corresponding points into the two equations above, we can obtain information about a. 11 a 12 a 21 a 22 t x and t y The six equations are used to obtain a candidate affine matrix. The above process is repeated for different random three-point combinations to obtain multiple candidate affine matrices.

[0105] For any candidate affine matrix, the key point p in the test image i The predicted coordinates are obtained after transformation:

[0106] ;

[0107] The single-point reprojection error of this point pair is:

[0108] ;

[0109] If the number of corresponding keypoint pairs participating in the evaluation is N, then the total reprojection error of the candidate affine matrix is ​​the sum of the reprojection errors of all single points:

[0110] ;

[0111] Therefore, the optimal affine matrix is:

[0112] ;

[0113] In this embodiment, after the test image 64.jpg is registered using the optimal affine matrix, the sum of the single-point reprojection errors of each evaluation key point is:

[0114] ;

[0115] Figure 7 The image in the middle is a schematic diagram of the optimal matching of a random three-point affine registration point set. The left side shows the test image after registration deformation processing, and the right side shows the matched image from the answer database. Here, C:1 indicates that the category number of this point is 1. According to the order in [classes.txt], number 1 corresponds to "line-line" (the intersection of two straight lines). Numbering starts from "0", "C:0" is "endpoint", and "C:2" is "line-circle" (the intersection of a straight line and an arc). px represents pixels; for example, "d=10.3px" means that the distance error between the point in the student image and the corresponding point in the answer image is approximately 10.3 pixels.

[0116] This section has been cropped according to actual requirements, showing the correspondence between the keypoint set of the test image 64.jpg after optimal affine transformation and the keypoint set of the target reference image. The total reprojection error is marked as 49.07px, and the maximum single-point error is 18.49px. The point matching relationships are indicated on the image; points with the same icon number on the left and right sides are matching points. For example... Figure 7 Point 2 on the left matches point 2 on the right. The two points are connected by a line, and the transformed single-point position error is marked on the line.

[0117] After registration, grayscale diffusion was performed on the two binary line drawings, and the grayscale diffusion results G of the test image and the target reference image were obtained respectively. s (x) and G r (x). The redundant and missing structural regions are respectively:

[0118] ;

[0119] ;

[0120] After threshold segmentation, connected component analysis, and morphological processing, stable redundant and missing structural regions are obtained. These regions can then be further classified into redundant or missing line segments using methods such as endpoint detection, according to different subsequent requirements, and a structured correction report can be output.

[0121] To verify the adaptability of the method of this invention to different geometric deformations and noise drying, the cost of contour point set matching was tested under rotation, scaling, shearing, and Gaussian noise conditions, and the results are as follows. Figure 3 , Figure 4 , Figure 5 and Figure 6 As shown.

[0122] Figure 3 The results are from the rotation deformation test. When the rotation angle changes from 0° to approximately 350°, the matching cost generally ranges from approximately 0.03 to 0.16, and fluctuates in some angle ranges. This indicates that larger angle rotations will have a certain impact on the correspondence of the contour point set, but effective matching results can still be obtained. Figure 4 The results are from the scaling deformation test. When the scaling factor increases from 0.4 to 1.6, the matching cost is approximately 0.028 to 0.035. Among them, the matching cost is the lowest when the scaling factor is close to 1.0, which is approximately 0.0277. The matching cost increases slightly when deviating from the original scale, but the overall change is small, indicating that the method of the present invention has good adaptability to scale changes.

[0123] Figure 5 The results are from the shear deformation test. When the shear coefficient changes from −0.6 to 0.6, the matching cost reaches its minimum value near the shear coefficient of 0, close to 0. As the degree of shear increases, the matching cost gradually increases, with a maximum of about 0.06. This indicates that shear deformation increases the matching difficulty, but the matching cost remains low within the tested range. Figure 6 The results are for Gaussian noise tests. As the noise standard deviation increases, the matching cost rises from approximately 0.035 to approximately 0.058, with a more significant increase at higher noise levels, indicating that noise reduces the matching effect; however, the matching cost remains low at different noise intensities.

[0124] In summary, the method of the present invention has a certain degree of robustness under rotation, scaling, shearing and Gaussian noise interference conditions, and has good adaptability to scaling deformation. Under large rotation angle, strong shearing and high noise conditions, although the matching cost increases, it can still achieve effective matching of contour point sets.

[0125] A semantic matching and intelligent correction system for contour structure of three-view drawings in engineering graphics is provided to implement the aforementioned method for semantic matching and intelligent correction of contour structure of three-view drawings in engineering graphics, including:

[0126] The image preprocessing module is used to acquire the image to be analyzed and the reference image, and to perform image preprocessing to obtain a binary line drawing image;

[0127] The contour structure semantic matching module is used to perform contour detection on binary line drawing images. Based on the spatial distribution relationship of the contour centroids, the image is divided into multiple view regions. Contour primitives in each view region are extracted and a topological graph structure is constructed. The contours of each view region are sampled with equal arc length and the shape context descriptor is calculated. The topological consistency is combined to form the structure semantic matching cost. The target reference graphic is determined from the reference graphic based on the structure semantic matching cost.

[0128] The key structural point extraction module is used to extract key structural points from the graphic to be analyzed and the target reference graphic;

[0129] The affine registration module is used to perform random three-point affine registration based on key structural points, and to geometrically align the graphic to be analyzed with the target reference graphic.

[0130] The difference extraction module is used to perform grayscale diffusion processing and difference operations on the registered image to be analyzed and the target reference image to extract redundant and missing structural regions.

[0131] The module includes a line segment detection and correction output module, which is used to perform fixed-endpoint line detection on redundant and missing structural regions, extract the endpoint position, length, direction and category information of the difference line segments, determine the difference line segments as redundant or missing line segments, and generate correction results.

[0132] The above are merely specific embodiments of the present invention, but the technical features of the present invention are not limited thereto. Any simple changes, equivalent substitutions, or modifications made based on the present invention to achieve substantially the same technical effect are all covered within the protection scope of the present invention.

Claims

1. A method for semantic matching, recognition, and intelligent correction of contour structures in three-view drawings of engineering graphics, characterized in that... Includes the following steps: S1. Obtain the graphic to be analyzed and the reference graphic, and perform image preprocessing on the graphic to be analyzed and the reference graphic to obtain a binary line drawing image; S2. Perform contour detection on the binary line drawing image, divide the image into multiple view regions according to the spatial distribution relationship of the contour centroids, extract the contour primitives of each view region, construct a topological graph structure that reflects the connection and adjacency relationship between primitives, perform equal arc length sampling on the contours of each view region, calculate the shape context descriptor, and form the structural semantic matching cost between views by integrating topological consistency, and determine the target reference graphic from the reference graphic according to the structural semantic matching cost. S3. Extract key structural points from the graphic to be analyzed and the target reference graphic, and perform random three-point affine registration based on the key structural points to geometrically align the graphic to be analyzed and the target reference graphic. S4. Perform grayscale diffusion processing on the registered analysis graphic and the target reference graphic, and perform difference operation to extract redundant and missing structural regions in the graphic to be analyzed. S5. Perform endpoint line detection on the redundant structure region and the missing structure region, extract the endpoint position, length, direction and category information of the difference line segments, and determine the difference line segments as redundant line segments or missing line segments according to the existence status of the difference line segments in the graphic to be analyzed and the target reference graphic, and generate the correction result.

2. The method for semantic matching, recognition, and intelligent correction of contour structures in engineering graphics three-view drawings according to claim 1, characterized in that: The image preprocessing in step S1 includes at least one of grayscale conversion, binarization, noise suppression, morphological processing, and size normalization.

3. The method for semantic matching, recognition, and intelligent correction of contour structures in engineering graphics three-view drawings according to claim 1, characterized in that: The view area in step S2 includes the front view, the left view, and the top view.

4. The method for semantic matching, recognition, and intelligent correction of contour structures in engineering graphics three-view drawings according to claim 1, characterized in that: In step S2, for the graphic to be analyzed that is rotated, the rotation angle is determined based on the centroid arrangement of the contours of each view and the direction is corrected.

5. The method for semantic matching, recognition, and intelligent correction of contour structures in engineering graphics three-view drawings according to claim 1, characterized in that: In step S2, the shape context descriptor is constructed by statistically analyzing the distance and angle distributions between contour points, specifically including: assuming the sampling point set of a certain view contour is... , where p i =(x i ,y i For sampling point p i The distances and angles of the remaining sampling points relative to this point are divided into distance buckets R. k And angled bins This yields the shape context descriptor for that point: ; Where I(·) is an indicator function, which takes the value 1 when the condition is true and 0 otherwise; r ij For sampling point p j Relative to p i The distance; For sampling point p j Relative to p i The angle; k is the distance to the bin number. Number the angle-based bins.

6. The method for semantic matching, recognition, and intelligent correction of contour structures in engineering graphics three-view drawings according to claim 1, characterized in that: In step S2, the structural semantic matching cost is obtained by fusing topological differences based on the shape context point matching cost; let the shape context descriptor of a point in the graphic to be analyzed be... The shape context descriptor of a point in the reference figure is: The cost of matching the basic points between the two is: ; Where b represents the bucket number in the descriptor, and ε is a constant to prevent the denominator from being zero; the cost matrix is ​​composed of the matching costs of all points, and the optimal matching relationship is solved by the Hungarian algorithm; the comprehensive matching cost of each view is obtained after fusing the topology consistency metric, and the overall structural semantic matching cost is the weighted sum of the matching costs of each view.

7. The method for semantic matching, recognition, and intelligent correction of contour structures in engineering graphics three-view drawings according to claim 6, characterized in that: When a reference graphics library exists When the target graphic is selected, it is: ; Where S represents the graph to be analyzed, and A k C represents the k-th reference figure in the reference figure library. total (S,A k ) represents the overall structural semantic matching cost between the two.

8. The method for semantic matching, recognition, and intelligent correction of contour structures in engineering graphics three-view drawings according to claim 1, characterized in that: The key structural point extraction in step S3 uses a pre-trained YOLO model to detect endpoints, intersections, and inflection points; or uses SIFT feature points, Harris corner points, FAST corner points, ORB feature points, or other image key point detection methods to obtain the image structural point set.

9. The method for semantic matching, recognition, and intelligent correction of contour structures in engineering graphics three-view drawings according to claim 1, characterized in that: The random three-point affine registration in step S3 solves the affine transformation model by using three sets of corresponding feature points; let feature point p in the figure to be analyzed. i The corresponding feature point q in the target reference image i The affine transformation matrix A satisfies q i =Ap i Each time, three sets of corresponding points are randomly selected to solve for a candidate affine matrix A. t The optimal affine transformation parameters are determined by minimizing the reprojection error: ; Alternatively, it can be determined by maximizing the number of interior points: ; Where N is the number of feature points participating in the evaluation, ρ(·) is the error evaluation function, and τ is the reprojection error threshold; through the optimal affine transformation matrix Perform spatial transformation on the graphic to be analyzed to achieve geometric registration between it and the target reference graphic.

10. The method for semantic matching, recognition, and intelligent correction of contour structures in engineering graphics three-view drawings according to claim 1, characterized in that: The grayscale diffusion processing in step S4 is achieved through distance transformation or a grayscale attenuation function; let the set of line regions be Ω, and the distance from any pixel x in the image to the nearest line pixel be D(x), then the grayscale diffusion image is represented as: ; Where σ is the grayscale diffusion scale parameter.

11. The method for semantic matching, recognition, and intelligent correction of contour structures in engineering graphics three-view drawings according to claim 10, characterized in that: Let the grayscale diffusion result of the registered image to be analyzed be G. s (x), the grayscale diffusion result of the target reference image is G. r (x), then the redundant structure region and the missing structure region are respectively: ; ; And the corresponding difference region is obtained by setting a threshold λ: ; ; Among them, M add (x) represents the redundant structural region of the graphic to be analyzed relative to the target reference graphic, M miss (x) represents the missing structural region of the graphic to be analyzed relative to the target reference graphic.

12. The method for semantic matching, recognition, and intelligent correction of contour structures in engineering graphics three-view drawings according to claim 1, characterized in that: The fixed-endpoint line detection in step S5 is used to represent the difference region as a line segment; endpoint-constrained line fitting is performed on the connected pixels or edge pixels in the difference region to obtain a set of difference line segments, where any difference line segment is represented as: ; Among them, (x i1 ,y i1 ) and (x i2 ,y i2 ) represent the coordinates of the two endpoints of the line segment, α i c represents the direction of the line segment. i The segment category is determined by the structure of the segment. If the segment with the difference originates from a region with redundant structure, it is classified as a redundant segment. If the segment with the difference originates from a region with missing structure, it is classified as a missing segment.

13. The method for semantic matching, recognition, and intelligent correction of contour structures in engineering graphics three-view drawings according to claim 12, characterized in that: The fixed endpoint line detection employs at least one of the following: Hough line detection algorithm, line segment detection algorithm, or endpoint constraint line fitting algorithm.

14. The method for semantic matching, recognition, and intelligent correction of contour structures in engineering graphics three-view drawings according to claim 1, characterized in that: In step S5, line segments with obvious positional offsets and no structural missing or redundant segments are identified as positional deviation line segments.

15. A semantic matching and intelligent correction system for contour structure of three-view drawings in engineering graphics, used to implement the semantic matching and intelligent correction method for contour structure of three-view drawings in engineering graphics as described in any one of claims 1 to 7, characterized in that, include: The image preprocessing module is used to acquire the image to be analyzed and the reference image, and to perform image preprocessing to obtain a binary line drawing image; The contour structure semantic matching module is used to perform contour detection on the binary line drawing image, divide the image into multiple view regions according to the spatial distribution relationship of the contour centroid, extract contour primitives in each view region and construct a topological graph structure, perform equal arc length sampling on the contours of each view region and calculate the shape context descriptor, integrate topological consistency to form a structural semantic matching cost, and determine the target reference graphic from the reference graphic based on the structural semantic matching cost. The key structural point extraction module is used to extract key structural points from the graphic to be analyzed and the target reference graphic. The affine registration module is used to perform random three-point affine registration based on the key structural points, and to geometrically align the graphic to be analyzed with the target reference graphic. The difference extraction module is used to perform grayscale diffusion processing and difference operations on the registered image to be analyzed and the target reference image to extract redundant and missing structural regions. The module includes a line segment detection and correction output module, which performs endpoint line detection on the redundant structure region and the missing structure region, extracts the endpoint position, length, direction and category information of the difference line segments, determines the difference line segments as redundant line segments or missing line segments, and generates correction results.