Method and device for automatically converting engineering drawing into editable format file
By automating the process to extract graphic elements from drawings, match part templates, and identify text attributes, the problem of low efficiency and high error rate in engineering drawing processing has been solved, enabling efficient and accurate automatic conversion of drawings into editable format files.
Patent Information
- Application Number
- CN202511643899.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-11
- Publication Date
- 2026-02-10
AI Technical Summary
In existing technologies, the efficiency of automated processing of engineering drawings is low, while manual processing of drawings leads to a high error rate, which can easily result in missing CAD files and affect production accuracy.
The automated process extracts graphic elements from drawings, matches them with part templates, identifies text attributes and associates them with output. It utilizes global and local feature vector matching, combined with confidence assessment and manual completion, to achieve automated drawing processing.
Significantly improves drawing processing efficiency, reduces error rate, ensures CAD file integrity, and guarantees production accuracy.
Smart Images

Figure CN121502841A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of drawing format processing, and particularly relates to a method and device for automatically converting engineering drawings into editable format files. BACKGROUND
[0002] In the drawing processing and manufacturing industry, factories often use paper or PDF format drawings provided by customers as production input files. Because most factories lack professional design and research and development capabilities, two key pre-work tasks need to be completed: first, converting non-editable paper / PDF drawings into editable CAD format files to lay the foundation for subsequent technical adjustments; second, disassembling information from the drawings, counting the number of parts, specifications and other data to support procurement, nesting and production planning.
[0003] However, the current industry is to process drawings one by one by professional personnel, manually converting them into CAD files and extracting part parameters. But the above method is low in efficiency, and it takes several hours to process a single complex assembly drawing, which is difficult to meet the needs of mass production. Moreover, the error rate is high, and the size marking and part attribute misreading rate are high due to experience and fatigue, which easily causes the loss of CAD files and leads to a decrease in production accuracy. SUMMARY
[0004] The present application provides a method and device for automatically converting engineering drawings into editable format files to solve the technical problem of low work efficiency and high error rate in manual processing of drawings in the prior art, which easily causes the loss of CAD files and leads to a decrease in production accuracy.
[0005] In a first aspect, the present application provides a method for automatically converting engineering drawings into editable format files, which comprises: extracting all target graphic elements in a target engineering drawing; selecting a preset number of most similar candidate templates from a preset part library based on the blocks corresponding to all the target graphic elements; calculating the matching values between each block and each part template of the most similar candidate templates, and determining the parts corresponding to each block according to the confidence of the matching values; recognizing the text content of the target engineering drawing to generate attribute information; connecting each part of the target engineering drawing and associating each part with each attribute information to output an editable format file.
[0006] The application can completely replace the mode of traditional manual processing of drawings by automatically extracting drawing graphic elements, matching part templates, identifying text attributes and associating output through an automated process. On the one hand, without manual screening of parts and manual entry of attribute information, the processing efficiency of drawings is improved several times, solving the problem of low efficiency of manual processing. On the other hand, the matching of graphic elements depends on the accurate calculation of the preset library, and the text recognition and attribute association are automatically completed through the program, avoiding human judgment errors, entry deviations and other situations, and significantly reducing the error rate. In addition, the editable format file output by automation can completely retain the part information and attribute data of the CAD drawing, effectively preventing file loss caused by manual operation, and ultimately ensuring that subsequent production links can be based on accurate and complete drawing data, ensuring production accuracy.
[0007] In an optional implementation, the extracting all target graphic elements in the target engineering drawing comprises: Collecting an initial engineering drawing through a scanner, converting the format of the initial engineering drawing, and generating an updated engineering drawing; Performing noise reduction processing, tilt correction processing and region segmentation processing on the updated engineering drawing in sequence to generate a target engineering drawing; Extracting all initial graphic elements in the target engineering drawing by using a contour tracking algorithm; Fitting each initial graphic element by using a least squares method to generate a plurality of target graphic elements.
[0008] The application processes engineering drawings through a standardized automated process, solving the problems of format incompatibility, poor image quality and inaccurate graphic extraction that may occur when manually processing initial drawings.
[0009] In an optional implementation, the filtering a preset number of most similar candidate templates from the preset part template library based on the blocks corresponding to all the target graphic elements comprises: Extracting global feature vectors of the blocks corresponding to all the target graphics; Matching template feature vectors of each candidate template in the preset part template library based on the global feature vectors of each block to obtain a plurality of similar candidate templates; Sorting each similar candidate template according to the similarity to determine a preset number of most similar candidate templates.
[0010] This invention efficiently solves the pain points of traditional manual or local feature comparison by using global feature vector matching and sorting. Extracting global feature vectors from image blocks completely captures key information such as graphic contours and structural proportions, avoiding omissions or misjudgments that are prone to occur with local features, and providing a reliable basis for matching. Automated comparison is achieved based on vector quantization calculations, replacing manual visual observation and experience-based judgment, saving significant manual time, and avoiding matching biases caused by subjective differences, thus improving efficiency and consistency. Sorting by similarity to determine a preset number of most similar candidate templates quickly focuses on the optimal result, avoiding omissions or interference from manual screening, providing accurate support for subsequent part confirmation, and contributing to a more efficient and accurate overall drawing processing workflow.
[0011] In one optional implementation, calculating the matching value between each of the blocks and the part template of each of the most similar candidate templates, and determining the part corresponding to each block based on the confidence level of the matching value, includes: Extract the local feature vectors of each of the aforementioned patches; Calculate the matching value between the local feature vector of each of the aforementioned blocks and the local feature vector of the part template of each of the most similar candidate templates; The confidence level of the matching value is compared with a preset confidence threshold, and the part corresponding to each of the blocks is determined based on the comparison result.
[0012] This invention precisely solves the problems of high error and inconsistent judgment standards in traditional manual part identification by using local feature vector matching and confidence level determination. Extracting local feature vectors from images captures detailed graphic features and is more effective at identifying subtle differences than relying on global features, laying the foundation for accurate part matching. Calculating the matching value of the local feature vector and comparing it with a threshold replaces manual experience-based judgment with a quantitative standard, avoiding misjudgments caused by subjective bias and significantly reducing the error rate. Parts are determined based on the confidence level results, ensuring that only those with satisfactory matching are selected, eliminating subsequent production problems caused by inaccurate matching.
[0013] In one optional implementation, comparing the confidence level of the matching value with a preset confidence threshold and determining the part corresponding to each of the blocks based on the comparison result includes: Determine whether the confidence level of the matched value is greater than or equal to a preset confidence threshold; If so, the part is determined as the corresponding block based on the part template corresponding to the matching value; If not, the block is marked, and the part marked by the block is set by the operator.
[0014] This invention employs a dual mechanism of "confidence assessment + manual completion" to address both the potential for missed or false identifications in purely automated recognition and the low efficiency of entirely manual identification. First, high-matching image blocks are filtered using a pre-set confidence threshold, directly and automatically identifying parts, replacing manual block-by-block judgment and significantly improving processing efficiency. Images that do not meet the threshold are simply marked for manual setting, rather than relying entirely on manual intervention, reducing unnecessary human intervention. This "automation-first, manual-second" approach retains the high efficiency of automation while providing a safety net through manual completion to avoid part identification errors caused by purely machine-based misjudgments, thus balancing efficiency and accuracy.
[0015] In one optional implementation, the step of recognizing the text content of the target engineering drawing and generating attribute information includes: Input the target engineering drawings into the preset recognition model; The recognition model extracts image features of the target engineering drawing and predicts the regions containing text content in each image feature, generating multiple text candidate regions. The candidate text region is divided into multiple text image blocks according to the text arrangement; The text portion recognition is performed on each of the text image blocks to obtain the text content within each text image block corresponding to the text candidate region, and attribute information is generated.
[0016] This invention automates the extraction of text from drawings and generates attribute information using a preset recognition model, solving the problems of low efficiency and easy omissions in traditional manual text recognition. The recognition model can accurately extract image features and predict candidate text regions, avoiding the time-consuming and missed detections of manually searching for text regions; it divides text image blocks according to the arrangement of text to ensure the continuity of text recognition and prevent recognition breaks caused by scattered text; it accurately recognizes text in each image block and generates attribute information, replacing the tedious operation of manually entering text.
[0017] In one optional implementation, the step of connecting the various parts of the target engineering drawing, associating each part with its respective attribute information, and outputting an editable format file includes: Perform layer analysis on the target engineering drawing to distinguish the lines of the target engineering drawing; The graph is constructed by setting the text image blocks and the outline regions of the parts as nodes and the spatial relationships between each text image block and the outline regions of each part as edges. Based on the edges of the graph, the parts are connected using the lines described above; Based on the nodes of the map, the attribute information of each part is determined, an editable format file is generated and output.
[0018] This invention achieves part connection and attribute association through layer analysis and atlas construction, efficiently solving the problems of error-prone traditional manual part-attribute association and uneditable files. Layer analysis accurately distinguishes lines, providing a clear foundation for part connection and avoiding the confusion of manual line arrangement; atlas construction uses text blocks and part outlines as nodes and spatial relationships as edges, making the association logic between parts and attributes visible and eliminating subjective biases from manual association; based on the atlas, parts are connected by lines, attributes are determined, and editable files are output, replacing manual association and format conversion, which improves processing efficiency and ensures accurate part connections and correct attribute correspondences.
[0019] Secondly, the present invention provides an apparatus for automatically converting engineering drawings into editable format files, the apparatus comprising: The extraction module is used to extract all target graphic elements from the target engineering drawing; The filtering module is used to filter out a preset number of most similar candidate templates from a preset parts library based on the blocks corresponding to all the target graphic elements. The calculation module is used to calculate the matching value between each of the above-mentioned blocks and the part template of each of the most similar candidate templates, and to determine the part corresponding to each of the above-mentioned blocks based on the confidence level of the matching value; The recognition module is used to recognize the text content of the target engineering drawing and generate attribute information; The output module is used to connect the various parts of the target engineering drawing, associate each part with its attribute information, and output an editable format file.
[0020] Thirdly, the present invention provides an electronic device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform a method for automatically converting engineering drawings of the first aspect or any corresponding embodiment into an editable format file.
[0021] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute a method for automatically converting engineering drawings described in the first aspect or any corresponding embodiment into editable format files.
[0022] Fifthly, the present invention provides a computer program product, including computer instructions, which are used to cause a computer to execute a method for automatically converting engineering drawings described in the first aspect or any corresponding embodiment into editable format files. Attached Figure Description
[0023] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0024] Figure 1 A schematic diagram of a first method for automatically converting engineering drawings into editable format files according to an embodiment of the present invention; Figure 2 This is a second flowchart illustrating a method for automatically converting engineering drawings into editable format files according to an embodiment of the present invention. Figure 3 This is a structural block diagram of an apparatus for automatically converting engineering drawings into editable format files according to an embodiment of the present invention. Figure 4 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0026] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.
[0027] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0028] This invention provides a method for automatically converting engineering drawings into editable format files. Through an automated process, it extracts graphic elements from the drawings, matches them with part templates, identifies text attributes, and outputs them in association, completely replacing the traditional manual drawing processing method. On one hand, it eliminates the need for manual part selection and attribute information entry, significantly reducing manpower and increasing drawing processing efficiency several times over, solving the problem of low efficiency in manual processing. On the other hand, graphic element matching relies on precise calculations from a preset library, and text recognition and attribute association are automatically completed by the program, avoiding human error and input deviations, significantly reducing the error rate. Furthermore, the automatically output editable format files completely retain the part information and attribute data of the CAD drawings, effectively preventing file loss caused by manual operation, ensuring that subsequent production processes can be based on accurate and complete drawing data.
[0029] According to an embodiment of the present invention, a method embodiment for automatically converting engineering drawings into editable format files is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0030] This embodiment provides a method for automatically converting engineering drawings into editable format files. Figure 1 This is a flowchart of a method for automatically converting engineering drawings into editable format files according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps: Step S101: Extract all target graphic elements from the target engineering drawing.
[0031] It should be noted that the target engineering drawings refer to standardized engineering drawings used to extract graphic elements after undergoing preliminary processing such as format conversion, noise reduction, tilt correction, and area segmentation.
[0032] Target graphic elements refer to the graphic units in the target engineering drawings that can represent the basic structural features of the parts, such as straight lines, curves, polygons, and other core graphic elements that constitute the outline of the parts.
[0033] In this embodiment of the invention, the preprocessed target engineering drawing is scanned at the pixel level to identify graphic units with complete outlines and conforming to engineering specifications. Then, redundant lines and interfering pixels are removed through morphological operations to filter out the core graphic elements that constitute the part structure.
[0034] Step S102: Based on the blocks corresponding to all target graphic elements, select a preset number of the most similar candidate templates from the preset part library.
[0035] It should be noted that a block refers to a collection of graphics that is composed of multiple target graphic elements and has independent structural meaning.
[0036] A pre-built parts library refers to a database that contains templates of various standard parts and their feature information.
[0037] The preset quantity (N) refers to the number of most similar candidate templates that are selected in advance according to the actual application requirements.
[0038] The most similar candidate templates refer to the few part templates selected from the preset part library that have the highest similarity to the target block in terms of graphic features.
[0039] In this embodiment of the invention, the global feature vectors of the blocks corresponding to all target graphic elements are extracted, and these features are compared with the feature vectors of each candidate template in the preset parts library (such as GB standard parts, enterprise general parts library), so that the Top-N (preset number) most similar candidate templates can be quickly selected.
[0040] Step S103: Calculate the matching value between each block and the part template of each most similar candidate template, and determine the part corresponding to each block based on the confidence level of the matching value.
[0041] It should be noted that a part template refers to a standard template that contains the complete graphic features and structural parameters of a specific part in a preset part library.
[0042] The matching value refers to a quantitative value calculated by an algorithm to measure the degree of similarity between the features of the block and the part template. The higher the value, the higher the similarity between the two.
[0043] Confidence level refers to an indicator that reflects the reliability of matching results, based on the statistical characteristics of matching values or the output of an algorithm model.
[0044] In this embodiment of the invention, the ORB feature matching method is used to quantify the degree of matching between the block and the part template in terms of global structure and local details. Then, the confidence level is calculated by combining the distribution characteristics of the matching value. The confidence level is compared with a preset confidence threshold. If the confidence level meets the standard, the corresponding part is directly determined.
[0045] Step S104: Identify the text content of the target engineering drawing and generate attribute information.
[0046] It should be noted that the text content refers to all kinds of information presented in text form in the target engineering drawings, including part names, technical parameters, annotations, etc.
[0047] Attribute information refers to the set of data extracted from text content that describes the inherent characteristics or technical requirements of a part, such as dimensional values and material.
[0048] In this embodiment of the invention, image recognition technology is used to locate the text area in the drawing, segment the independent text units and perform character recognition, and then combine the standard logic of the engineering drawing to perform semantic analysis on the recognized text content, extract key information such as part model, size parameters, and material, and integrate them to form attribute information corresponding to the part.
[0049] Step S105: Connect the various parts of the target engineering drawing, associate each part with its attribute information, and output an editable format file.
[0050] It should be noted that connection refers to establishing the relationship between parts based on the line connection relationship and assembly logic between parts in the engineering drawings, reflecting the combination method of parts in actual assembly.
[0051] Association refers to binding parts with their corresponding attribute information, so that each part can be mapped to attribute data describing its characteristics, achieving a one-to-one correspondence between graphics and information.
[0052] Editable format files refer to files stored in a specific format that support subsequent modifications and editing, and can retain the adjustability of part structure, connection relationships and attribute information.
[0053] In this embodiment of the invention, the assembly connection relationship between parts is established based on the connecting lines and spatial position relationship of the parts in the drawing. Then, the attribute information is matched to the corresponding parts through the spatial correspondence between text and parts. Finally, the structure of the connected parts and the associated attribute information are integrated to support mainstream CAD format files such as DWG and DXF for subsequent editing operations, and the layer information (graphic layer, annotation layer, text layer) is preserved.
[0054] This embodiment provides a method for automatically converting engineering drawings into editable format files. Figure 2 This is a flowchart of a method for automatically converting engineering drawings into editable format files according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps: Step S201: Extract all target graphic elements from the target engineering drawing.
[0055] Specifically, step S201 includes: Step S2011: Collect the initial engineering drawings using a scanner, convert the format of the initial engineering drawings, and generate updated engineering drawings.
[0056] It should be noted that a scanner is a device used to convert images on physical media such as paper drawings into digital images.
[0057] Initial engineering drawings refer to the original, unprocessed engineering drawings, such as paper drawings or PDF electronic drawings.
[0058] Updating engineering drawings refers to digital engineering drawings that have been converted to a new format and now conform to a preset format standard.
[0059] In this embodiment of the invention, paper drawings (acquired by a high-resolution scanner with a resolution ≥600dpi) or PDF format electronic drawings are received; the input files are standardized and uniformly converted into grayscale image format (such as TIFF), updated engineering drawings are generated, and the original file backup is stored.
[0060] Step S2012: The updated engineering drawings are sequentially subjected to noise reduction processing, tilt correction processing, and region segmentation processing to generate the target engineering drawings.
[0061] It should be noted that noise reduction refers to the process of using image processing algorithms (such as median filtering) to remove noise interference in updated engineering drawings and improve image clarity.
[0062] Tilt correction refers to the process of rotating and adjusting the image by detecting the tilt angle of the edges or feature lines of the drawing, so that the drawing is in a standard horizontal or vertical position.
[0063] Region segmentation refers to the process of dividing the overall drawing into multiple independent sub-regions based on the distribution characteristics, functional attributes, or spatial location of graphic elements in the drawing.
[0064] In this embodiment of the invention, the image preprocessing process for updating engineering drawings is as follows: Noise reduction: An adaptive median filtering algorithm is used to remove interference such as scanning noise and paper stains; Tilt correction: The Hough transform is used to detect the straight lines of the drawing border, calculate the tilt angle and automatically correct it (correction accuracy ≤ 0.1°). Region segmentation: Based on connected component analysis, the drawing is segmented into a graphic area (including part outlines and assembly relationships), a labeling area (including dimensions and tolerances), and a text description area (including technical requirements and material list). After performing the above image preprocessing on the updated engineering drawings, the target engineering drawings are obtained.
[0065] Step S2013: Use a contour tracking algorithm to extract all initial graphic elements in the target engineering drawing.
[0066] It should be noted that contour tracking algorithm refers to an image processing algorithm used to locate and track edge pixels of a graphic in a digital image, thereby constructing a complete graphic contour.
[0067] The initial circular element refers to the graphic contour unit initially extracted from the target engineering drawing through the contour tracking algorithm.
[0068] In this embodiment of the invention, a contour tracking algorithm is used to extract basic graphic elements such as straight lines, circles, and arcs from the target engineering drawing to form initial graphic elements.
[0069] Step S2014: Fit each initial graphic element using the least squares method to generate multiple target graphic elements.
[0070] It should be noted that the least squares method is a mathematical optimization technique that finds the best function match for data by minimizing the sum of squared errors. It is often used to fit discrete data into a continuous mathematical model.
[0071] In this embodiment of the invention, the contour data of the initial graphic elements are used to construct a mathematical model corresponding to the graphic type (such as a straight line, an arc, etc.). The sum of squares of the deviations between the model and the actual contour points is minimized by calculation, and the subtle distortions and noise interference in the initial graphic elements are corrected to obtain the target graphic elements.
[0072] Step S202: Based on the blocks corresponding to all target graphic elements, select a preset number of the most similar candidate templates from the preset part library.
[0073] Specifically, step S202 includes: Step S2021: Extract the global feature vectors of the tiles corresponding to all target graphics.
[0074] It should be noted that global feature vectors refer to vector data extracted and quantified by algorithms that can reflect the overall structural features of the tiles (such as outline shape, element layout, size ratio, etc.).
[0075] In this embodiment of the invention, a cascaded architecture of "rapid coarse screening of global features + fine matching of local ORB features" is adopted to integrate the target graphic elements contained in each tile, analyze its overall structural shape, geometric size ratio and topological relationship between each element, and then calculate a fast global descriptor through Zernike moments, so as to transform these global features into a quantifiable vector form, forming a global feature vector that can completely represent the overall features of the tile.
[0076] Step S2022: Based on the global feature vector of each block, match the template feature vector of each candidate template in the preset part library to obtain multiple similar candidate templates.
[0077] It should be noted that candidate templates refer to various standard templates for parts contained in the preset parts library, with each template corresponding to the graphic features of a specific part.
[0078] Template feature vector refers to the vector data obtained by quantizing and encoding the global features of candidate templates in the preset part library.
[0079] Similar candidate templates refer to candidate templates that have a certain degree of similarity to the target image patch after comparison with global feature vectors.
[0080] In this embodiment of the invention, the similarity (such as cosine similarity, Euclidean distance, etc.) between the global feature vector of each block and the template feature vector of each candidate template in the preset part library is calculated, and candidate templates with high similarity are selected to obtain multiple similar candidate templates.
[0081] Step S2023: Sort the candidate templates according to their similarity and determine the preset number of most similar candidate templates.
[0082] It should be noted that similarity refers to a quantitative index obtained by calculating the distance or correlation between the global feature vector of a patch and the template feature vector of a candidate template. It is used to measure the degree of similarity between the two, and the higher the value, the stronger the similarity.
[0083] In this embodiment of the invention, the calculated similarity values are arranged in descending order to select the most similar candidate templates. The top-ranked candidate templates that meet the N-fold similarity requirement are then selected, resulting in the N most similar candidate templates. This eliminates most irrelevant parts and narrows down the candidate set.
[0084] Step S203: Calculate the matching value between each block and the part template of each most similar candidate template, and determine the part corresponding to each block based on the confidence level of the matching value.
[0085] In some optional implementations, step S203 above includes: Step S2031: Extract the local feature vectors of each map patch.
[0086] It should be noted that local feature vectors refer to feature vectors extracted and quantified from key local areas of a tile through algorithms, focusing on the detailed structure of the graphic (such as edge and corner shapes, local textures, etc.).
[0087] In this embodiment of the invention, for local regions with significant recognizability in the image (such as corners, holes, special textures, etc.), the ORB (Oriented FAST and Rotated BRIEF) feature matching algorithm is used to extract their key points and corresponding feature descriptors, forming a local feature vector that can reflect local details.
[0088] Step S2032: Calculate the matching value between the local feature vector of each block and the local feature vector of the part template of each most similar candidate template.
[0089] In this embodiment of the invention, the local feature vectors of the block and the part template are compared based on the ORB feature matching algorithm. The preliminary matching result is obtained by calculating the Hamming distance of the feature descriptors. Then, the preliminary matching result is geometrically verified by the RANSAC algorithm to remove mismatched points that do not meet the geometric constraints. Finally, the matching value reflecting the degree of local feature matching is calculated based on the number of effective matching points and the matching accuracy.
[0090] Step S2033: Compare the confidence level of the matching value with the preset confidence threshold, and determine the part corresponding to each block based on the comparison result.
[0091] Specifically, step S2033 includes: Step a1: Determine whether the confidence level of the matched value is greater than or equal to the preset confidence threshold.
[0092] It should be noted that the pre-set confidence threshold refers to the confidence threshold value set in advance based on the accuracy requirements of engineering drawing processing, application scenario requirements, etc.
[0093] In this embodiment of the invention, based on the distribution characteristics of the matching values and historical matching data, a confidence level reflecting the reliability of the matching result is obtained by statistics. Then, the confidence level is compared with a preset confidence threshold set according to the actual application scenario to determine whether the matching between the block and the part template meets the credibility standard.
[0094] Step a2: If yes, then determine the part as the corresponding block based on the part template corresponding to the matching value.
[0095] In this embodiment of the invention, when the confidence level of the matching value is equal to or exceeds a preset confidence threshold, the part template in the most similar candidate template corresponding to the matching value is directly associated with the corresponding block, and the part represented by the block is identified as consistent with the part template.
[0096] Step a3: If not, mark the block and have the operator set the part to mark the block.
[0097] It should be noted that marking refers to the operation by which the system identifies tiles that have not reached the confidence threshold by adding specific symbols, colors, or labels.
[0098] Operators refer to staff members who possess the ability to interpret engineering drawings and have professional knowledge of part identification. They are responsible for manually judging and processing blocks that the system cannot automatically determine.
[0099] In this embodiment of the invention, when the confidence level of the matching value does not reach a preset confidence threshold, the system automatically adds a special identifier to the block and classifies it as an "unknown part" to distinguish it from blocks with identified parts. Simultaneously, the marked "unknown part" is pushed to the operation interface, where the operator, combining professional knowledge and drawing specifications, manually specifies the part corresponding to the block, ensuring that all blocks are accurately associated with their corresponding parts. Using the successfully matched geometric information, the position and orientation of the block in the original drawing can be accurately marked. Matching accuracy ≥ 95%.
[0100] Step S204: Identify the text content of the target engineering drawing and generate attribute information.
[0101] In some optional implementations, step S204 above includes: Step S2041: Input the target engineering drawing into the preset recognition model.
[0102] It should be noted that the recognition model refers to a machine learning model that has been trained in advance using a large number of engineering drawing samples, such as the CNN-LSTM model based on deep learning.
[0103] In this embodiment of the invention, the target engineering drawings are imported into a pre-trained CNN-LSTM model.
[0104] Step S2042: Extract image features of the target engineering drawing through the recognition model, predict the regions containing text content in each image feature, and generate multiple text candidate regions.
[0105] It should be noted that image features refer to information extracted from the target engineering drawings that reflects the essential attributes of the image, such as edge contours, texture distribution, and grayscale value changes.
[0106] The text content area refers to the image area in the target engineering drawing where information is presented in text form, including key content such as part parameters and annotations.
[0107] A text candidate region refers to an image region that may contain text content, predicted by a recognition model.
[0108] In this embodiment of the invention, the feature extraction module of the recognition model is used to extract image features such as line distribution and grayscale changes from the target engineering drawing. These features are then analyzed to locate regions that may contain text and mark their bounding boxes, forming multiple text candidate regions.
[0109] Step S2043: Divide the candidate text regions into multiple text image blocks according to the text arrangement.
[0110] It should be noted that text arrangement refers to the spatial distribution of text in the target engineering drawings, including the arrangement direction (horizontal, vertical, etc.), spacing rules, and combination logic.
[0111] A text image block refers to an image unit containing independent and complete text content, which is obtained by cutting out the candidate text region according to the text arrangement rules. Each block corresponds to a piece of text with practical meaning (such as part model, dimension annotation, etc.).
[0112] In this embodiment of the invention, the text in the candidate text area is grouped and cut according to the arrangement rules of the text in the target engineering drawing (such as horizontal rows, vertical columns or arranged at a specific angle), and the continuously arranged text is divided into independent text image blocks to ensure that each text image block corresponds to a complete text content (such as a single annotation item, parameter value, etc.).
[0113] Step S2044: Perform text partial recognition on each text image block to obtain the text content within each text image block corresponding to the text candidate region, and generate attribute information.
[0114] It should be noted that text recognition refers to the process of using technologies such as Optical Character Recognition (OCR) to convert text in image blocks into computer-readable text information.
[0115] In this embodiment of the invention, optical character recognition (OCR) technology is used to recognize and convert the characters in each text image block, transforming the text in image form into editable text information. Natural language processing (NLP) technology extracts the part material (e.g., "Q235") and surface treatment (e.g., "galvanized") from the text description. Then, combined with the annotation specifications of the engineering drawings, semantic analysis is performed on the recognized text content to extract key parameters such as the part's model, size, and material, and integrate them to form attribute information corresponding to the part's features.
[0116] Step S205: Connect the various parts of the target engineering drawing, associate each part with its attribute information, and output an editable format file.
[0117] In some optional implementations, step S205 above includes: Step S2051: Perform layer analysis on the target engineering drawing to distinguish the lines of the target engineering drawing.
[0118] It should be noted that layer analysis refers to the process of parsing the attributes (such as color, line type, and line width) and functional divisions of layers in a target engineering drawing.
[0119] Lines refer to the basic elements that make up the graphics in engineering drawings, including entity outlines, dimension lines, center lines, leader lines, etc.
[0120] In this embodiment of the invention, by parsing the layer attribute information (such as color, line type, line width, etc.) of the target engineering drawing, the functional types corresponding to different layers (such as outline layer, dimension line layer, center line layer, etc.) are identified, and then the lines are classified based on the layer association relationship to distinguish the solid lines that constitute the part structure, the auxiliary lines used for annotation, and other functional lines.
[0121] Step S2052: Set the text image blocks and the outline regions of the parts as nodes, and set the spatial relationship between each text image block and the outline regions of each part as edges to construct the graph.
[0122] It should be noted that a node refers to an element in a graph that represents an independent unit of information; here, it specifically refers to the outline area of text image blocks and parts.
[0123] An edge is an element used to connect two nodes, representing the spatial relationship (such as adjacent, contained, or corresponding) between the text image block and the part outline area.
[0124] A graph refers to a graph-structured data model consisting of nodes and edges.
[0125] The outline area of a part refers to the image area enclosed by the outline lines that constitute the shape of a single part in the target engineering drawing.
[0126] Spatial relationship refers to the relative positional relationship between text image blocks and part outline areas on the drawing plane, such as up and down, left and right, containment, and adjacent.
[0127] In this embodiment of the invention, based on the independent identifiers of each text image block (such as an image block with dimensions) and each part contour area, the spatial relationship between the two is determined by image analysis tools (such as the text block being located above, to the right of, or around the contour area). These relationships are defined as attributes of the edges. Finally, a graph structure algorithm is used to connect the nodes with the attributed edges to form a graph of the correspondence between text annotations and parts.
[0128] Step S2053: Based on the edges of the graph, connect each part using lines.
[0129] In this embodiment of the invention, based on the spatial relationship between the text image blocks represented by the edges in the atlas and the outline area of the parts, and combined with the connecting lines (such as assembly lines, connecting lines, etc.) distinguished by layer analysis, different parts are connected according to the actual assembly logic or structural relationship by identifying the correspondence between the start and end points of the lines and the outline area of the parts.
[0130] Step S2054: Based on the nodes of the map, determine the attribute information of each part, generate an editable format file and output it.
[0131] In this embodiment of the invention, the association between nodes in the map is obtained through a spatial location mapping algorithm. The attribute information (such as size, material, etc.) corresponding to the text image block is bound to its associated part node. That is, the identified part ID is associated with the corresponding size, material, tolerance and other attribute information, and integrated to form complete attribute data for each part. The attribute information is stored in JSON format, which includes the fields "part ID-name-quantity-size-material-tolerance". Then, the structural information, connection relationship and attribute data of the part are uniformly converted into an editable standardized format file (such as CAD format).
[0132] Specifically, the steps for generating and outputting CAD format files are as follows: Editable graphic generation: Converts recognized graphic elements and blocks into native CAD entities (such as LINE, CIRCLE, and BLOCK objects). Attribute embedding: Structured attribute information is written into the extended data (XData) of the block through CAD secondary development interfaces (such as AutoLISP and ObjectARX). Output format: Supports generating mainstream CAD format files such as DWG and DXF, retains layer information (graphic layer, annotation layer, text layer) and outputs to a specified storage path or system.
[0133] It is worth mentioning that the implementation process of this invention also includes: (I) System Hardware Configuration Image acquisition equipment: Industrial-grade scanner (600dpi resolution, supports A0-A4 paper size); Processing server: CPU ≥ Intel Xeon E5-2690, GPU ≥ NVIDIA Tesla V100 (for accelerating deep learning model inference), memory ≥ 32GB; Storage devices: SSD ≥ 1TB (for storing original drawings and generated CAD files).
[0134] (II) Software Implementation Development environment: Operating system: Windows Server 2019; Development languages: Python 3.8 (image recognition module), C++ (CAD interface development); Core libraries: OpenCV (image processing), TensorFlow (OCR model), PyAutoCAD (CAD interaction).
[0135] Process Example: (1) The user inputs an A3 paper mechanical assembly drawing through a scanner, and the system automatically converts it into a 600dpi grayscale TIFF image; (2) The preprocessing module removes wrinkle noise from the image and detects a 3.2° tilt in the drawing through Hough transform, and automatically corrects it; (3) Region segmentation divides the image into a left graphic area (including bearings, gears and other parts), a right annotation area (including the dimension “φ30H7”), and a bottom text description area (including “material: 45# steel”); (4) The image recognition module extracts the gear contour and matches it to the "M2Z20" model in the standard gear library through ORB feature matching, with a confidence level of 92%; (5) The text “φ30H7” in the annotation area is recognized by OCR and bound to the inner hole of the gear through spatial mapping; “45# steel” is extracted from the text description area as the gear material; (6) The attribute association module generates a mapping table: Part ID "G001" - Name "Spur Gear" - Quantity "2" - Size "φ30H7" - Material "45# Steel"; (7) The CAD generation module creates a DWG file, converts the gear into an editable block, and writes the attributes into the block extended data through ObjectARX; (8) The system marks a low confidence result (a fuzzy tolerance mark), and the operator corrects it to "±0.01" through the interactive interface, and finally outputs a complete CAD file.
[0136] The present invention also has the following beneficial effects: Efficiency improvement: The processing time for a single complex assembly drawing is reduced from 4-6 hours by manual labor to 10-15 minutes, improving efficiency by 20-30 times, which can meet the daily processing needs of thousands of drawings.
[0137] Improved accuracy: Image recognition accuracy ≥95%, text recognition accuracy ≥98%, overall information extraction error rate ≤1%, far lower than manual processing level.
[0138] Standardized output: The generated CAD file blocks have built-in structured attributes and can be directly called by nesting software and ERP systems, reducing subsequent data entry work.
[0139] Cost reduction: Reduce reliance on professional CAD personnel, reducing labor costs by more than 60%, while also reducing production rework costs caused by information errors.
[0140] Highly scalable: It supports adapting drawing types from different industries (such as machinery, sheet metal, and architecture) by updating the standard drawing library and training samples.
[0141] This embodiment also provides an apparatus for automatically converting engineering drawings into editable format files. This apparatus is used to implement the above embodiments and preferred embodiments, and details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0142] This embodiment provides a device for automatically converting engineering drawings into editable format files, such as... Figure 3 As shown, it includes: Extraction module 301 is used to extract all target graphic elements in the target engineering drawing; The filtering module 302 is used to filter out a preset number of most similar candidate templates from a preset part library based on the blocks corresponding to all target graphic elements. Calculation module 303 is used to calculate the matching value between each block and the part template of each most similar candidate template, and determine the part corresponding to each block based on the confidence level of the matching value; The recognition module 304 is used to recognize the text content of the target engineering drawing and generate attribute information; Output module 305 is used to connect the various parts of the target engineering drawing, associate each part with its attribute information, and output an editable format file.
[0143] In some alternative implementations, the extraction module 301 includes: The acquisition unit is used to acquire initial engineering drawings through a scanner, convert the format of the initial engineering drawings, and generate updated engineering drawings; The processing unit is used to sequentially perform noise reduction processing, tilt correction processing, and region segmentation processing on the updated engineering drawings to generate the target engineering drawings. The extraction unit is used to extract all initial graphic elements in the target engineering drawing using a contour tracking algorithm; The fitting unit is used to fit each initial graphic element using the least squares method to generate multiple target graphic elements.
[0144] In some alternative implementations, the filtering module 302 includes: Extract global feature units, which are used to extract the global feature vectors of the tiles corresponding to all target graphics; The matching unit is used to match the template feature vector of each candidate template in the preset part library based on the global feature vector of each block, so as to obtain multiple similar candidate templates. The sorting unit is used to sort the candidate templates according to their similarity and determine a preset number of the most similar candidate templates.
[0145] In some alternative implementations, the computing module 303 includes: Extract local feature units to extract local feature vectors for each map patch; The calculation unit is used to calculate the matching value between the local feature vector of each block and the local feature vector of the part template of each most similar candidate template; The comparison unit is used to compare the confidence level of the matching value with a preset confidence threshold, and determine the part corresponding to each block based on the comparison result.
[0146] In some alternative implementations, the comparison unit includes: The judgment sub-unit is used to determine whether the confidence level of the matched value is greater than or equal to a preset confidence threshold. Determine the part sub-unit, which is used to determine the part of the corresponding block based on the part template corresponding to the matching value if it is true; The marking subunit is used to mark the block if not otherwise specified, and the operator sets the marking block for the part.
[0147] In some alternative implementations, the identification module 304 includes: The input unit is used to input the target engineering drawings into the preset recognition model; The prediction unit is used to extract image features of the target engineering drawing through the recognition model, predict the regions containing text content in each image feature, and generate multiple text candidate regions. The segmentation unit is used to divide the candidate text region into multiple text image blocks according to the text arrangement; The recognition unit is used to perform text partial recognition on each text image block, obtain the text content in each text image block corresponding to the text candidate region, and generate attribute information.
[0148] In some alternative implementations, the output module 305 includes: The analysis unit is used to perform layer analysis on the target engineering drawings and distinguish the lines of the target engineering drawings; The building unit is used to set the outline regions of text image blocks and parts as nodes, and the spatial relationship between each text image block and the outline regions of each part as edges, to build the graph; Connection unit, used to connect parts by lines based on the edges of the graph; The output unit is used to determine the attribute information of each part based on the nodes of the map, generate an editable format file, and output it.
[0149] The apparatus for automatically converting engineering drawings into editable format files provided in this embodiment of the invention can execute the method for automatically converting engineering drawings into editable format files provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the above modules and units are the same as in the corresponding embodiments described above, and will not be repeated here.
[0150] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.
[0151] The following is a detailed reference. Figure 4 This diagram illustrates a structural schematic suitable for implementing an electronic device according to embodiments of the present invention. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 401, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 402 or a program loaded from memory 408 into random access memory (RAM) 403. The RAM 403 also stores various programs and data required for the operation of the electronic device. The processor 401, ROM 402, and RAM 403 are interconnected via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0152] Typically, the following devices can be connected to I / O interface 405: input devices 406 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 407 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 408 including, for example, magnetic tapes, hard disks, etc.; and communication devices 409. Communication device 409 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 4 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.
[0153] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 409, or installed from a memory 408, or installed from a ROM 402. When the computer program is executed by the processor 401, it performs the functions defined in the method for automatically converting engineering drawings into editable format files according to embodiments of the present invention.
[0154] Figure 4 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of the present invention.
[0155] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium after being downloaded via a network. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the method for automatically converting engineering drawings into editable format files as shown in the above embodiments is implemented.
[0156] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0157] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for automatically converting engineering drawings into editable format files, characterized in that, The method includes: Extract all target graphic elements from the target engineering drawings; Based on the blocks corresponding to all the target graphic elements, a preset number of the most similar candidate templates are selected from the preset parts library; Calculate the matching value between each of the above-mentioned blocks and the part template of each of the most similar candidate templates, and determine the part corresponding to each of the above-mentioned blocks based on the confidence level of the matching value; Identify the text content of the target engineering drawing and generate attribute information; Connect the various parts of the target engineering drawing, associate each part with its attribute information, and output an editable format file.
2. The method according to claim 1, characterized in that, The extraction of all target graphic elements from the target engineering drawing includes: The initial engineering drawings are acquired by scanning, and the format of the initial engineering drawings is converted to generate updated engineering drawings. The updated engineering drawings are sequentially subjected to noise reduction, tilt correction, and region segmentation to generate the target engineering drawings; A contour tracing algorithm is used to extract all initial graphic elements from the target engineering drawing; Multiple target graphic elements are generated by fitting each of the initial graphic elements using the least squares method.
3. The method according to claim 1, characterized in that, The step of selecting a preset number of most similar candidate templates from a preset parts library based on the blocks corresponding to all the target graphic elements includes: Extract the global feature vectors of all the tiles corresponding to the target graphics; Based on the global feature vector of each of the aforementioned blocks, the template feature vector of each candidate template in the preset part library is matched to obtain multiple similar candidate templates; The similar candidate templates are sorted according to their similarity to determine a preset number of the most similar candidate templates.
4. The method according to claim 1, characterized in that, The step of calculating the matching value between each of the aforementioned blocks and the part template of each of the most similar candidate templates, and determining the part corresponding to each of the aforementioned blocks based on the confidence level of the matching value, includes: Extract the local feature vectors of each of the aforementioned patches; Calculate the matching value between the local feature vector of each of the aforementioned blocks and the local feature vector of the part template of each of the most similar candidate templates; The confidence level of the matching value is compared with a preset confidence threshold, and the part corresponding to each of the blocks is determined based on the comparison result.
5. The method according to claim 4, characterized in that, The step of comparing the confidence level of the matching value with a preset confidence threshold and determining the part corresponding to each of the blocks based on the comparison result includes: Determine whether the confidence level of the matched value is greater than or equal to a preset confidence threshold; If so, the part is determined as the corresponding block based on the part template corresponding to the matching value; If not, the block is marked, and the part marked by the block is set by the operator.
6. The method according to claim 1, characterized in that, The process of recognizing the text content of the target engineering drawing and generating attribute information includes: Input the target engineering drawings into the preset recognition model; The recognition model extracts image features of the target engineering drawing and predicts the regions containing text content in each image feature, generating multiple text candidate regions. The candidate text region is divided into multiple text image blocks according to the text arrangement; The text portion recognition is performed on each of the text image blocks to obtain the text content within each text image block corresponding to the text candidate region, and attribute information is generated.
7. The method according to claim 6, characterized in that, The process involves connecting the various parts of the target engineering drawing, associating each part with its attribute information, and outputting an editable format file, including: Perform layer analysis on the target engineering drawing to distinguish the lines of the target engineering drawing; The graph is constructed by setting the text image blocks and the outline regions of the parts as nodes and the spatial relationships between each text image block and the outline regions of each part as edges. Based on the edges of the graph, the parts are connected using the lines described above; Based on the nodes of the map, the attribute information of each part is determined, an editable format file is generated and output.
8. A device for automatically converting engineering drawings into editable format files, characterized in that, The device includes: The extraction module is used to extract all target graphic elements from the target engineering drawing; The filtering module is used to filter out a preset number of most similar candidate templates from a preset parts library based on the blocks corresponding to all the target graphic elements. The calculation module is used to calculate the matching value between each of the above-mentioned blocks and the part template of each of the most similar candidate templates, and to determine the part corresponding to each of the above-mentioned blocks based on the confidence level of the matching value; The recognition module is used to recognize the text content of the target engineering drawing and generate attribute information; The output module is used to connect the various parts of the target engineering drawing, associate each part with its attribute information, and output an editable format file.
9. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the method of automatically converting engineering drawings into editable format files as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to execute the method of automatically converting the engineering drawings of any one of claims 1 to 7 into an editable format file.
11. A computer program product, characterized in that, The method includes computer instructions for causing a computer to execute a method for automatically converting engineering drawings into editable format files according to any one of claims 1 to 7.