Design element identification method and device for two-dimensional CAD drawing and medium
By preprocessing, disassembling and reorganizing CAD drawings on the server side, and combining with the preset recognition model, the problem of CAD drawing recognition in the prior art relying on manual operations is solved, and accurate identification and correlation analysis of complex or non-standard drawings are achieved, which improves recognition efficiency and accuracy.
Patent Information
- Application Number
- CN202411684259.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-11
AI Technical Summary
In the prior art, the identification and analysis of CAD drawings mainly relies on manual operations, which are time-consuming and error-prone. Especially when the drawings are complex or non-standard, it is difficult to accurately identify design elements, resulting in limited automated processing and data analysis.
The server receives the original image of the two-dimensional CAD drawing imported by the user terminal, determines the recognition order based on the image tag and the current CAD project work tasks, pre-processes, disassembles and reorganizes the images using the pre-set recognition model and drawing decomposition tools, and finally recognizes design elements and analyzes the association relationship.
It realizes accurate design elements identification of complex or non-standard CAD drawings, improves identification efficiency and accuracy, reduces the workload and error rate of manual identification, and improves design efficiency.
Smart Images

Figure CN119600638A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer-aided design, and in particular to a method, device and medium for identifying design elements of a two-dimensional CAD drawing. Background Art
[0002] In some traditional industries, such as electronics, electrical engineering, surveying and mapping (land planning), architecture (construction drawings), interior decoration, structure, civil engineering, and general machinery manufacturing, two-dimensional drawings that use lines and symbols as the main form of expression and can express the shape, size, and position of objects in a concise and clear manner are still the main tools for design and construction. Identifying design elements in two-dimensional CAD drawings can ensure the accuracy of the design and avoid errors caused by misunderstanding or missing drawing information. Storing the identified design elements can also directly call related elements from the knowledge base when similar or identical parts need to be designed, saving design time and cost. Therefore, identifying design elements in two-dimensional CAD drawings is an important process.
[0003] At present, the recognition and analysis of CAD drawings mostly rely on manual operations, which is not only time-consuming but also prone to errors. In addition, when the drawings are complex or non-standard, this traditional recognition technology based on manual operations often cannot accurately identify all design elements, resulting in restrictions on subsequent automated processing and data analysis. In addition, the method of recognizing two-dimensional CAD drawings based on fixed algorithms and rules, although it improves the recognition efficiency, is difficult to recognize all design elements when faced with complex, non-standard or drawings containing special symbols. Due to inaccurate or incomplete recognition results, the time cost of subsequent processing will increase, and it may also cause design errors or production accidents. Summary of the invention
[0004] In order to solve the above technical problems, one or more embodiments of the present specification provide a method, device and medium for identifying design elements of a two-dimensional CAD drawing.
[0005] One or more embodiments of this specification adopt the following technical solutions:
[0006] One or more embodiments of this specification provide a method for identifying design elements of a two-dimensional CAD drawing, the method comprising:
[0007] The server receives the original images of the two-dimensional CAD drawings imported by each user terminal, and determines the recognition order of the original images of the two-dimensional CAD drawings to be recognized based on the tags corresponding to the original data of each two-dimensional CAD drawing and the current CAD project work tasks of the server;
[0008] Preprocessing the original two-dimensional CAD drawing image to be identified based on the identification sequence to obtain the current two-dimensional CAD drawing image to be processed;
[0009] Inputting the size condition corresponding to the preset recognition model and the splitting screening condition of the two-dimensional CAD drawing image into the preset disassembly tool, so as to disassemble the two-dimensional CAD drawing image based on the preset disassembly tool to obtain a plurality of single-frame two-dimensional CAD drawing images;
[0010] Sequentially reorganizing the plurality of single-frame two-dimensional CAD drawing images, so as to input the plurality of single-frame two-dimensional CAD drawing images into the preset recognition model based on the reorganized order;
[0011] Based on the preset recognition model, the multiple single-frame two-dimensional CAD drawing images are recognized to obtain design element information of the two-dimensional CAD drawing images, and the design element information is parsed to obtain the association relationship between the design elements in the two-dimensional CAD drawing images; wherein the association relationship includes: connection relationship, intersection relationship and inclusion relationship.
[0012] Optionally, in one or more embodiments of the present specification, the server receives the original two-dimensional CAD drawing images imported by each user terminal, and determines the recognition order of the original two-dimensional CAD drawing images to be recognized based on the tags corresponding to the original two-dimensional CAD drawing data and the current CAD project work tasks of the server, specifically including:
[0013] The server receives the original two-dimensional CAD drawing images imported by each user terminal, obtains tags corresponding to each of the original two-dimensional CAD drawing images, and parses them to obtain tag information corresponding to each of the original two-dimensional CAD drawing images; wherein the tag information includes: project name, drawing name, and drawing version;
[0014] Based on the project name corresponding to each of the two-dimensional CAD drawing original images, the two-dimensional CAD drawing original images are grouped to obtain multiple groups of two-dimensional CAD drawing original images;
[0015] If it is determined that the project name does not match the project name of the current CAD project work task, the group of two-dimensional CAD drawing original images is added to the preset cache space to wait for recognition;
[0016] If it is determined that the project name matches the project name of the current CAD project work task, filtering the group of two-dimensional CAD drawing original images based on the drawing version to obtain a to-be-identified two-dimensional CAD drawing original image corresponding to the current CAD project work task;
[0017] According to the assembly process of the current CAD project work task and the drawing name, the original images of the two-dimensional CAD drawings to be identified are sorted to obtain the identification order of the original images of the two-dimensional CAD drawings to be identified.
[0018] Optionally, in one or more embodiments of the present specification, preprocessing the original image of the two-dimensional CAD drawing to be identified based on the identification order to obtain the current two-dimensional CAD drawing image to be processed specifically includes:
[0019] Sequentially acquiring the original image of the two-dimensional CAD drawing to be identified based on the identification sequence, and processing the original image of the two-dimensional CAD drawing to be identified based on a preset high-speed filter to obtain a filtered original image of the two-dimensional CAD drawing to be identified;
[0020] The filtered two-dimensional CAD drawing original image to be identified is subjected to grayscale conversion to obtain a grayscale two-dimensional CAD drawing original image, and a grayscale threshold value corresponding to the grayscale two-dimensional CAD drawing original image is determined according to the grayscale value of each pixel of the grayscale two-dimensional CAD drawing original image;
[0021] The grayscale two-dimensional CAD drawing original image is binarized based on the grayscale threshold to obtain a two-dimensional CAD drawing image to be processed.
[0022] Optionally, in one or more embodiments of the present specification, the size condition corresponding to the preset recognition model and the splitting screening condition of the two-dimensional CAD drawing image are input into a preset disassembly tool, so as to disassemble the two-dimensional CAD drawing image based on the preset disassembly tool to obtain a plurality of single-frame two-dimensional CAD drawing images, specifically including:
[0023] Summarize the size conditions corresponding to the preset recognition model and the splitting and screening conditions of the two-dimensional CAD drawing image to determine the configuration information corresponding to the preset drawing disassembly tool;
[0024] Performing format conversion on the two-dimensional CAD drawing image based on the input format corresponding to the preset drawing disassembly tool to obtain a converted two-dimensional CAD drawing image;
[0025] The preset disassembly tool is configured based on the configuration information to input the converted two-dimensional CAD drawing image into the configured preset disassembly tool, disassemble the converted two-dimensional CAD drawing image, and obtain multiple single-frame two-dimensional CAD drawing images.
[0026] Optionally, in one or more embodiments of the present specification, sequentially reorganizing the plurality of single-frame two-dimensional CAD drawing images so as to input the plurality of single-frame two-dimensional CAD drawing images into the preset recognition model based on the reorganized order specifically includes:
[0027] Determining whether the two-dimensional CAD drawing image corresponds to a plurality of single-frame two-dimensional CAD drawing images, and if not, inputting the two-dimensional CAD drawing image into the preset recognition model;
[0028] If so, extracting the character feature vectors of each text target frame in the single-frame two-dimensional CAD drawing image, and determining the drawing title of each single-frame two-dimensional CAD drawing image based on the matching relationship between the preset character library and the character feature vector;
[0029] Determining the hierarchical relationship and connection relationship of each of the single-frame two-dimensional CAD drawing images based on the drawing title of each of the single-frame two-dimensional CAD drawing images;
[0030] Based on the hierarchical relationship and the connection relationship, a composition order of multiple single-frame two-dimensional CAD drawing images is determined, so that the multiple single-frame two-dimensional CAD drawing images are rearranged based on the composition order, and the multiple single-frame two-dimensional CAD drawing images are input into the preset recognition model based on the reorganized order.
[0031] Optionally, in one or more embodiments of the present specification, before recognizing the multiple single-frame two-dimensional CAD drawing images based on the preset recognition model and obtaining the design element information of the two-dimensional CAD drawing images, the method further includes:
[0032] Collecting existing two-dimensional CAD drawing images, and preprocessing the existing two-dimensional CAD drawing images to obtain existing two-dimensional CAD drawing images with annotation information; wherein the annotation information is used to annotate design element information corresponding to the existing two-dimensional CAD drawing images, and the association relationship between the design elements;
[0033] Dividing the existing two-dimensional CAD drawing image with annotation information based on a preset ratio to obtain training set data and test set data;
[0034] Iteratively training the preset convolutional neural network model through the training set data to obtain a preset convolutional neural network model that meets the requirements, and performing performance evaluation on the preset convolutional neural network model that meets the requirements based on the test set data to obtain an evaluation result;
[0035] Based on the evaluation result, determine whether to iteratively train the preset convolutional neural network model that meets the requirements to obtain the preset recognition model.
[0036] Optionally, in one or more embodiments of the present specification, preprocessing the existing two-dimensional CAD drawing image to obtain the existing two-dimensional CAD drawing image with annotation information specifically includes:
[0037] Inputting the size condition corresponding to the preset convolutional neural network model and the splitting screening condition of the two-dimensional CAD drawing image into a preset disassembly tool, so as to disassemble the existing two-dimensional CAD drawing image based on the preset disassembly tool to obtain a plurality of single-frame existing two-dimensional CAD drawing images;
[0038] Based on the component structure information and structure reference information corresponding to the existing two-dimensional CAD drawing images of each single drawing frame, the design element information of the existing two-dimensional CAD drawing images of each single drawing frame and the association relationship between each design element are summarized;
[0039] Based on the association between the design element information and each design element, annotating the existing two-dimensional CAD drawing image of the single drawing frame;
[0040] The annotated single-frame existing two-dimensional CAD drawing image is moved by preset movement data to obtain an extended single-frame existing two-dimensional CAD drawing image corresponding to the single-frame existing two-dimensional CAD drawing image;
[0041] The single-frame existing two-dimensional CAD drawing image with annotations and the extended single-frame existing two-dimensional CAD drawing image are used as the existing two-dimensional CAD drawing image with annotation information.
[0042] Optionally, in one or more embodiments of the present specification, parsing the design element information to obtain the association relationship between the design elements in the two-dimensional CAD drawing image specifically includes:
[0043] Parsing the design element information to determine the spatial position data and text annotation data corresponding to each of the design element information;
[0044] Determine the connection order between the design elements based on the text annotation data, and determine the position coordinates and position orientation of each design element based on the spatial position data;
[0045] The association relationship between the design elements in the two-dimensional CAD drawing image is determined through the connection sequence between the design elements and the position coordinates and position orientation of the design elements.
[0046] One or more embodiments of this specification provide a design element recognition device for a two-dimensional CAD drawing, the device comprising:
[0047] at least one processor; and,
[0048] a memory communicatively connected to the at least one processor; wherein,
[0049] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can: execute any of the above-mentioned methods for identifying design elements of two-dimensional CAD drawings.
[0050] One or more embodiments of the present specification provide a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute any of the above-mentioned methods for identifying design elements of two-dimensional CAD drawings.
[0051] At least one of the above technical solutions adopted in the embodiments of this specification can achieve the following beneficial effects:
[0052] By disassembling drawings with preset disassembly tools, complex drawings can be automatically split into multiple single-frame images, which helps improve the efficiency of subsequent recognition. Sequential reorganization of the disassembled single-frame images ensures that the single-frame 2D CAD drawing images input into the recognition model are arranged in the correct assembly order or dependency relationship. This helps the recognition model better understand the content of the drawing, thereby improving the accuracy of recognition. By inputting the reorganized image into the preset recognition model, accurate recognition of design elements can be achieved while retaining the association information between elements. And by automatically identifying design elements and associations through the preset recognition model, the workload of manual recognition can be significantly reduced, the error rate of manual recognition can be reduced, and the recognition accuracy and design efficiency can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art description. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:
[0054] Figure 1 A schematic diagram of a design element recognition method for a two-dimensional CAD drawing provided in an embodiment of this specification;
[0055] Figure 2 A schematic diagram of the device structure of a design element recognition device for a two-dimensional CAD drawing provided in an embodiment of this specification;
[0056] Figure 3 A schematic diagram of the internal structure of a non-volatile storage medium provided in an embodiment of this specification. DETAILED DESCRIPTION
[0057] The embodiments of this specification provide a method, device and medium for identifying design elements of a two-dimensional CAD drawing.
[0058] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0059] like Figure 1 As shown, in the embodiment of this specification, a flow chart of a method for identifying design elements of a two-dimensional CAD drawing is provided. Figure 1 It can be seen that in one or more embodiments of this specification, a method for identifying design elements of a two-dimensional CAD drawing includes the following process:
[0060] S101: The server receives the original images of the two-dimensional CAD drawings imported by each user terminal, and determines the recognition order of the original images of the two-dimensional CAD drawings to be recognized based on the labels corresponding to the original data of each two-dimensional CAD drawing and the current CAD project work tasks of the server.
[0061] The server first receives the original images of 2D CAD drawings from each user terminal. These images may contain content from different fields such as architectural design, mechanical parts design, circuit diagram design, etc., and each drawing has a corresponding label, and its label information includes: project name, drawing name, drawing version, etc., which are used to describe the nature and purpose of the drawing. Then the server parses the labels corresponding to the original data of each 2D CAD drawing, and through the obtained labels and the current CAD project work tasks of the server, it can prioritize the identification and processing of the original images of the 2D CAD drawings with high priority based on the progress of the project work tasks, and determine the identification order of the original images of the 2D CAD drawings to be identified. It helps to achieve efficient identification and processing of CAD drawings, improve the work efficiency and quality of CAD projects, and meet the actual needs of users.
[0062] Specifically, in one or more embodiments of the present specification, the server receives the original images of the two-dimensional CAD drawings imported by each user terminal, and determines the recognition order of the original images of the two-dimensional CAD drawings to be recognized based on the tags corresponding to the original data of each two-dimensional CAD drawing and the current CAD project work tasks of the server, which specifically includes the following processes:
[0063] First, the server receives the original image of the two-dimensional CAD drawing imported by each user terminal, and obtains the label corresponding to each original image of the two-dimensional CAD drawing for parsing, so as to obtain the label information corresponding to each original image of the two-dimensional CAD drawing. Among them, the label information includes: project name, drawing name, and drawing version. Then, in order to quickly associate the relevant drawings with the current CAD project work task and avoid the interference of irrelevant drawings, the original images of the two-dimensional CAD drawings are grouped according to the project name corresponding to each original image of the two-dimensional CAD drawing, and multiple groups of original images of the two-dimensional CAD drawings are obtained. If it is determined that the project name does not match the project name of the current CAD project work task, the group of original images of the two-dimensional CAD drawings is added to the preset cache space for identification, and if it is determined that the project name matches the project name of the current CAD project work task, the group of original images of the two-dimensional CAD drawings is filtered by the drawing version to ensure that the latest or specified version of the drawings is identified, avoiding errors or confusion caused by the use of outdated drawings, and obtaining the original image of the two-dimensional CAD drawings to be identified corresponding to the current CAD project work task. In other words, through the cache and filtering mechanism, the system can more effectively utilize server resources, avoid invalid processing of irrelevant drawings, and thus improve resource utilization. Then, according to the assembly process and drawing name of the current CAD project work task, the original images of each 2D CAD drawing to be identified are sorted to obtain the recognition order of each 2D CAD drawing to be identified. This can ensure that the recognition order of the drawings is consistent with the actual assembly order, which helps to optimize the workflow and reduce unnecessary duplication of work and errors.
[0064] S102: Preprocessing the original two-dimensional CAD drawing image to be identified based on the identification sequence to obtain a current two-dimensional CAD drawing image to be processed.
[0065] In order to improve the quality of the drawing image, thereby providing high-quality input data and improving the execution efficiency and accuracy of CAD project tasks, in the embodiment of this specification, the original image of the two-dimensional CAD drawing to be identified is preprocessed according to the recognition order determined in the above step S101, so as to obtain the current two-dimensional CAD drawing image to be processed.
[0066] Specifically, in one or more embodiments of the present specification, preprocessing the original image of the two-dimensional CAD drawing to be identified based on the recognition order to obtain the current two-dimensional CAD drawing image to be processed specifically includes the following process:
[0067] First, the original image of the two-dimensional CAD drawing to be identified is obtained in sequence based on the recognition order, and the original image of the two-dimensional CAD drawing to be identified is processed based on the preset high-speed filter, so as to obtain the filtered original image of the two-dimensional CAD drawing to be identified. Then, the filtered original image of the two-dimensional CAD drawing to be identified is gray-converted to obtain the gray-scale two-dimensional CAD drawing original image, and the gray-scale threshold corresponding to the gray-scale two-dimensional CAD drawing original image is determined according to the gray-scale value of each pixel of the gray-scale two-dimensional CAD drawing original image. Then, the gray-scale two-dimensional CAD drawing original image is binarized based on the determined gray-scale threshold to obtain the current two-dimensional CAD drawing image to be processed. In the above process, by obtaining the original image of the two-dimensional CAD drawing to be identified in sequence based on the recognition order, it can be ensured that the processing order is consistent with the assembly process of the project work task, avoiding the confusion and errors that may be caused by disordered processing, thereby improving the processing efficiency. Using preset high-speed filters to process images can effectively remove noise and interference and improve image clarity and quality. Binarization of grayscale images based on grayscale thresholds can convert images into images containing only black and white colors, which helps to further simplify the image processing process and improve the execution efficiency and accuracy of CAD drawing recognition.
[0068] S103: Inputting the size condition corresponding to the preset recognition model and the splitting screening condition of the two-dimensional CAD drawing image into a preset disassembly tool, so as to disassemble the two-dimensional CAD drawing image based on the preset disassembly tool to obtain a plurality of single-frame two-dimensional CAD drawing images.
[0069] Since the original image of the two-dimensional CAD drawing to be identified uploaded by the user may include multiple frames, the content to be identified in the original image of the two-dimensional CAD drawing to be identified is too complicated, which easily makes the time cost of the identification process high and prone to identification errors. Different types of CAD drawings have different disassembly requirements, and traditional manual disassembly methods are difficult to adapt to this complexity. Therefore, in order to solve this problem, in the embodiment of this specification, the size conditions corresponding to the preset recognition model and the splitting and screening conditions of the two-dimensional CAD drawing image are input into the preset disassembly tool, so that the two-dimensional CAD drawing image is disassembled according to the preset disassembly tool to obtain multiple single-frame two-dimensional CAD drawing images.
[0070] Specifically, in one or more embodiments of the present specification, based on the size condition corresponding to the preset recognition model and the splitting screening condition of the two-dimensional CAD drawing image, a preset disassembly tool is input to disassemble the two-dimensional CAD drawing image based on the preset disassembly tool to obtain multiple single-frame two-dimensional CAD drawing images, which specifically includes the following process:
[0071] First, the size conditions corresponding to the preset recognition model and the splitting and screening conditions of the two-dimensional CAD drawing image are summarized to determine the configuration information corresponding to the preset disassembly tool. By summarizing the size conditions and splitting and screening conditions of the preset recognition model, the configuration information of the disassembly tool is automatically determined, which reduces manual intervention and improves the automation and intelligence level of the processing. Then, the two-dimensional CAD drawing image is formatted based on the input format corresponding to the preset disassembly tool to obtain the converted two-dimensional CAD drawing image. This process converts the format of the two-dimensional CAD drawing image to ensure that it is compatible with the input format of the preset disassembly tool, which solves the problem caused by the difference in drawing formats generated by different CAD software, so that the disassembly tool can handle a wider range of drawing types. Then, the preset disassembly tool is configured based on the configuration information, so that the converted two-dimensional CAD drawing image is input into the configured preset disassembly tool, and the converted two-dimensional CAD drawing image is disassembled to obtain multiple single-frame two-dimensional CAD drawing images.
[0072] S104: sequentially reorganizing the plurality of single-frame two-dimensional CAD drawing images, so as to input the plurality of single-frame two-dimensional CAD drawing images into the preset recognition model based on the reorganized order.
[0073] After the splitting of the two-dimensional CAD drawing images is realized based on the above steps, since there is an association relationship between each single-frame two-dimensional CAD drawing image, for example, for assembly drawings, the single-frame two-dimensional CAD drawing image may correspond to different parts and accessories, so in order to meet the assembly order of parts or the dependency relationship between each single-frame two-dimensional CAD drawing image in other scenes, in the embodiment of this specification, multiple single-frame two-dimensional CAD drawing images will be sequentially reorganized, so that multiple single-frame two-dimensional CAD drawing images are input into a pre-set recognition model according to the reorganized order. In this process, the single-frame two-dimensional CAD drawing images input into the recognition model are ensured to be arranged according to the correct assembly order or dependency relationship. This helps the recognition model to better understand the drawing content, thereby improving the accuracy of recognition. And through the automated and intelligent sequential reorganization process, a drawing sequence that meets the requirements can be quickly obtained, reducing the time and energy required for manual sorting and improving processing efficiency.
[0074] Specifically, in one or more embodiments of the present specification, a plurality of single-frame two-dimensional CAD drawing images are sequentially reorganized to input the plurality of single-frame two-dimensional CAD drawing images into a preset recognition model based on the reorganized order, specifically including the following process:
[0075] Determine whether the two-dimensional CAD drawing image corresponds to multiple single-frame two-dimensional CAD drawing images. If not, then input the two-dimensional CAD drawing image into the preset recognition model. If it corresponds to multiple single-frame two-dimensional CAD drawing images, then extract the character feature vectors of each text target frame in the single-frame two-dimensional CAD drawing image, and determine the drawing title of each single-frame two-dimensional CAD drawing image based on the matching relationship between the preset character library and the character feature vector. Then, according to the drawing title of each single-frame two-dimensional CAD drawing image, determine the hierarchical relationship and connection relationship of each single-frame two-dimensional CAD drawing image. According to the hierarchical relationship and connection relationship, determine the composition order of multiple single-frame two-dimensional CAD drawing images, so as to rearrange the multiple single-frame two-dimensional CAD drawing images according to the composition order, and input the multiple single-frame two-dimensional CAD drawing images into the preset recognition model based on the reorganized order.
[0076] In the above process, by extracting the character feature vector of the text target box in the drawing and matching it with the preset character library, the drawing title can be accurately identified. The hierarchical relationship and connection relationship determined based on the title information can further ensure that the logical relationship between the drawings is correctly reflected, thereby improving the recognition accuracy. For complex drawings containing multiple parts or components, this method can ensure that the various parts of the drawing are identified and processed in the correct order and logical relationship. It helps to improve recognition efficiency while enhancing recognition accuracy.
[0077] S105: Identify the multiple single-frame two-dimensional CAD drawing images based on the preset recognition model, obtain design element information of the two-dimensional CAD drawing images, and parse the design element information to obtain the association relationship between the design elements in the two-dimensional CAD drawing images; wherein the association relationship includes: connection relationship, intersection relationship and inclusion relationship.
[0078] After obtaining multiple single-frame two-dimensional CAD drawing images based on the above step S104, in order to accurately identify the design elements in the two-dimensional CAD drawings, such as lines, shapes, annotations, etc., multiple single-frame two-dimensional CAD drawing images will be identified according to the preset recognition model, so as to obtain the design element information of the two-dimensional CAD drawing images. Then, by parsing these design element information, the association relationship of each design element in the two-dimensional CAD drawing image can be obtained, so that the understanding of the two-dimensional CAD drawings does not only stay at the surface graphic level, but also goes deep into the logic and structural relationship between the elements. Among them, it should be noted that the association relationship includes: connection relationship, intersection relationship and inclusion relationship. In this process, through the machine learning algorithm, the system can perform consistency checks according to preset standards or specifications to ensure that each drawing meets the requirements, avoiding different interpretations caused by differences in personal understanding. And the recognition process based on automation can significantly reduce the time of manual review, while reducing errors and improving efficiency means reducing the cost waste caused by rework, and also can reduce the demand for full-time auditors.
[0079] Furthermore, in order to solve the problem that traditional recognition technology often cannot accurately identify all design elements, resulting in the limitation of subsequent automated processing and data analysis, the automatic recognition and identification of design elements and features in two-dimensional CAD drawings is realized. In one or more embodiments of this specification, before multiple single-frame two-dimensional CAD drawing images are recognized based on a preset recognition model and the design element information of the two-dimensional CAD drawing images is obtained, the method also includes the following process:
[0080] Collect existing two-dimensional CAD drawing images, and pre-process the existing two-dimensional CAD drawing images to obtain existing two-dimensional CAD drawing images with annotation information; wherein the annotation information is used to annotate the design element information corresponding to the existing two-dimensional CAD drawing images, as well as the association relationship between the design elements. By collecting and pre-processing the existing two-dimensional CAD drawing images in this step, the quality and consistency of the input data are ensured, and the annotation information not only annotates the design element information, but also annotates the association relationship between the design elements, which helps the model to understand the drawing content more accurately. Then, the existing two-dimensional CAD drawing images with annotation information are divided based on a preset ratio to obtain training set data and test set data. Then, the preset convolutional neural network model is iteratively trained through the training set data to obtain a preset convolutional neural network model that meets the requirements, and the performance of the preset convolutional neural network model that meets the requirements is evaluated based on the test set data to obtain an evaluation result, thereby determining whether to iteratively train the preset convolutional neural network model that meets the requirements according to the evaluation result to obtain a preset recognition model. By evaluating the accuracy and robustness of the model, it can be ensured that it can achieve the expected recognition accuracy on different types of CAD drawings.
[0081] Furthermore, in one or more embodiments of the present specification, preprocessing the existing two-dimensional CAD drawing image to obtain the existing two-dimensional CAD drawing image with annotation information specifically includes:
[0082] The same as the above splitting process, in the embodiment of this specification, the size conditions corresponding to the preset convolutional neural network model and the splitting screening conditions of the two-dimensional CAD drawing image are input into the preset disassembly tool, so as to disassemble the existing two-dimensional CAD drawing image based on the preset disassembly tool, obtain multiple single-frame existing two-dimensional CAD drawing images, and then summarize the design element information of each single-frame existing two-dimensional CAD drawing image and the association relationship between each design element based on the component structure information and structure reference information corresponding to the two-dimensional CAD drawing image of each single frame. Among them, it should be noted that the component structure information is the core part of the CAD drawing, which describes in detail the key attributes such as the shape, size, and position of each component in the drawing, while the structure reference information reveals the connection relationship, assembly order, etc. between the components. Therefore, the component structure information and structure reference information based on the drawing reflect the attribute information of the design elements such as lines, text, and blocks in the CAD drawing and the association relationship between the design elements. Then, according to the association relationship between the design element information and each design element, the single-frame existing two-dimensional CAD drawing image is annotated. Then, the annotated single-frame existing 2D CAD drawing image is moved by preset movement data, wherein it can be understood that the movement includes operations such as translation and rotation, so as to obtain an extended single-frame existing 2D CAD drawing image corresponding to the single-frame existing 2D CAD drawing image. The single-frame existing 2D CAD drawing image with annotations and the extended single-frame existing 2D CAD drawing image are used as existing 2D CAD drawing images with annotation information.
[0083] By using the preset convolutional neural network model and disassembly tool in this process, the method can efficiently and automatically process two-dimensional CAD drawing images. This greatly reduces the time and cost of manual disassembly and annotation of drawings, and improves work efficiency. By performing operations such as translation and rotation on the annotated single-frame image by preset movement data, an extended single-frame image corresponding to the original image can be obtained. This not only increases the diversity of data and the number of training set samples of the model, but also helps to improve the generalization ability of subsequent model training.
[0084] Specifically, in one or more embodiments of the present specification, the design element information is parsed to obtain the association relationship of each design element in the two-dimensional CAD drawing image, specifically including: parsing the design element information, determining the spatial position data and text annotation data corresponding to each design element information. Among them, the spatial position data helps to understand the layout of the elements on the drawing, and the text annotation data provides additional information about the function, attribute or connection relationship of the element. Based on the spatial position data, the position information of each design element can be ensured to be accurate. Based on the text annotation data, the understanding of the design elements can be increased, which helps to determine the association relationship. Therefore, the connection order between each design element is determined based on the text annotation data, and the position coordinates and position orientation of each design element are determined based on the spatial position data. The association relationship of each design element in the two-dimensional CAD drawing image is determined by the connection order between each design element and the position coordinates and position orientation of each design element. This process can quickly parse the design element information and understand its association relationship by comprehensively using the spatial position data and text annotation data. This helps to improve the efficiency of subsequent designers in the drawing analysis and design modification process.
[0085] like Figure 2 As shown, the present specification embodiment provides a schematic diagram of a design element recognition device for a two-dimensional CAD drawing. Figure 2 It can be seen that in one or more embodiments of this specification, a design element recognition device for a two-dimensional CAD drawing includes:
[0086] at least one processor; and,
[0087] a memory communicatively connected to the at least one processor; wherein,
[0088] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can: execute any of the above-mentioned methods for identifying design elements of two-dimensional CAD drawings.
[0089] like Figure 3 As shown, the present specification provides a schematic diagram of the structure of a non-volatile storage medium. Figure 3 It can be seen that in one or more embodiments of the present specification, a non-volatile storage medium stores computer executable instructions, and the computer executable instructions can: execute any of the above-mentioned design element recognition methods for two-dimensional CAD drawings.
[0090] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0091] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0092] The above description is only one or more embodiments of this specification and is not intended to limit this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of this specification shall be included in the scope of the claims of this specification.
Claims
1. A method for identifying design elements of a two-dimensional CAD drawing, characterized in that: The method comprises: The server receives the original images of the two-dimensional CAD drawings imported by each user terminal, and determines the recognition order of the original images of the two-dimensional CAD drawings to be recognized based on the tags corresponding to the original data of each two-dimensional CAD drawing and the current CAD project work tasks of the server; Preprocessing the original two-dimensional CAD drawing image to be identified based on the identification sequence to obtain the current two-dimensional CAD drawing image to be processed; Inputting the size condition corresponding to the preset recognition model and the splitting screening condition of the two-dimensional CAD drawing image into the preset disassembly tool, so as to disassemble the two-dimensional CAD drawing image based on the preset disassembly tool to obtain a plurality of single-frame two-dimensional CAD drawing images; Sequentially reorganizing the plurality of single-frame two-dimensional CAD drawing images, so as to input the plurality of single-frame two-dimensional CAD drawing images into the preset recognition model based on the reorganized order; Based on the preset recognition model, the multiple single-frame two-dimensional CAD drawing images are recognized to obtain design element information of the two-dimensional CAD drawing images, and the design element information is parsed to obtain the association relationship between the design elements in the two-dimensional CAD drawing images; wherein the association relationship includes: connection relationship, intersection relationship and inclusion relationship.
2. The method for identifying design elements of a two-dimensional CAD drawing according to claim 1, characterized in that: The server receives the original images of the two-dimensional CAD drawings imported by each user terminal, and determines the recognition order of the original images of the two-dimensional CAD drawings to be recognized based on the tags corresponding to the original data of each two-dimensional CAD drawing and the current CAD project work task of the server, specifically including: The server receives the original two-dimensional CAD drawing images imported by each user terminal, obtains tags corresponding to each of the original two-dimensional CAD drawing images, and parses them to obtain tag information corresponding to each of the original two-dimensional CAD drawing images; wherein the tag information includes: project name, drawing name, and drawing version; Based on the project name corresponding to each of the two-dimensional CAD drawing original images, the two-dimensional CAD drawing original images are grouped to obtain multiple groups of two-dimensional CAD drawing original images; If it is determined that the project name does not match the project name of the current CAD project work task, the group of two-dimensional CAD drawing original images is added to the preset cache space to wait for recognition; If it is determined that the project name matches the project name of the current CAD project work task, filtering the group of two-dimensional CAD drawing original images based on the drawing version to obtain a to-be-identified two-dimensional CAD drawing original image corresponding to the current CAD project work task; According to the assembly process of the current CAD project work task and the drawing name, the original images of the two-dimensional CAD drawings to be identified are sorted to obtain the identification order of the original images of the two-dimensional CAD drawings to be identified.
3. The method for identifying design elements of a two-dimensional CAD drawing according to claim 1, characterized in that: Preprocessing the original two-dimensional CAD drawing image to be identified based on the identification sequence to obtain the current two-dimensional CAD drawing image to be processed specifically includes: Sequentially acquiring the original image of the two-dimensional CAD drawing to be identified based on the identification sequence, and processing the original image of the two-dimensional CAD drawing to be identified based on a preset high-speed filter to obtain a filtered original image of the two-dimensional CAD drawing to be identified; The filtered two-dimensional CAD drawing original image to be identified is subjected to grayscale conversion to obtain a grayscale two-dimensional CAD drawing original image, and a grayscale threshold value corresponding to the grayscale two-dimensional CAD drawing original image is determined according to the grayscale value of each pixel of the grayscale two-dimensional CAD drawing original image; The grayscale two-dimensional CAD drawing original image is binarized based on the grayscale threshold to obtain a two-dimensional CAD drawing image to be processed.
4. The method for identifying design elements of a two-dimensional CAD drawing according to claim 1, characterized in that: Inputting the size condition corresponding to the preset recognition model and the splitting screening condition of the two-dimensional CAD drawing image into the preset disassembly tool, so as to disassemble the two-dimensional CAD drawing image based on the preset disassembly tool to obtain a plurality of single-frame two-dimensional CAD drawing images, specifically including: Summarize the size conditions corresponding to the preset recognition model and the splitting and screening conditions of the two-dimensional CAD drawing image to determine the configuration information corresponding to the preset drawing disassembly tool; Performing format conversion on the two-dimensional CAD drawing image based on the input format corresponding to the preset drawing disassembly tool to obtain a converted two-dimensional CAD drawing image; The preset disassembly tool is configured based on the configuration information to input the converted two-dimensional CAD drawing image into the configured preset disassembly tool, disassemble the converted two-dimensional CAD drawing image, and obtain multiple single-frame two-dimensional CAD drawing images.
5. The method for identifying design elements of a two-dimensional CAD drawing according to claim 1, characterized in that: The plurality of single-frame two-dimensional CAD drawing images are sequentially reorganized to input the plurality of single-frame two-dimensional CAD drawing images into the preset recognition model based on the reorganized order, specifically comprising: Determining whether the two-dimensional CAD drawing image corresponds to a plurality of single-frame two-dimensional CAD drawing images, and if not, inputting the two-dimensional CAD drawing image into the preset recognition model; If so, extracting the character feature vectors of each text target frame in the single-frame two-dimensional CAD drawing image, and determining the drawing title of each single-frame two-dimensional CAD drawing image based on the matching relationship between the preset character library and the character feature vector; Determining the hierarchical relationship and connection relationship of each of the single-frame two-dimensional CAD drawing images based on the drawing title of each of the single-frame two-dimensional CAD drawing images; Based on the hierarchical relationship and the connection relationship, a composition order of multiple single-frame two-dimensional CAD drawing images is determined, so that the multiple single-frame two-dimensional CAD drawing images are rearranged based on the composition order, and the multiple single-frame two-dimensional CAD drawing images are input into the preset recognition model based on the reorganized order.
6. The method for identifying design elements of a two-dimensional CAD drawing according to claim 1, characterized in that: Before identifying the plurality of single-frame two-dimensional CAD drawing images based on the preset recognition model and obtaining design element information of the two-dimensional CAD drawing images, the method further includes: Collecting existing two-dimensional CAD drawing images, and preprocessing the existing two-dimensional CAD drawing images to obtain existing two-dimensional CAD drawing images with annotation information; wherein the annotation information is used to annotate design element information corresponding to the existing two-dimensional CAD drawing images, and the association relationship between the design elements; Dividing the existing two-dimensional CAD drawing image with annotation information based on a preset ratio to obtain training set data and test set data; Iteratively training the preset convolutional neural network model through the training set data to obtain a preset convolutional neural network model that meets the requirements, and performing performance evaluation on the preset convolutional neural network model that meets the requirements based on the test set data to obtain an evaluation result; Based on the evaluation result, determine whether to iteratively train the preset convolutional neural network model that meets the requirements to obtain the preset recognition model.
7. A method for identifying design elements of a two-dimensional CAD drawing according to claim 6, characterized in that: Preprocessing the existing two-dimensional CAD drawing image to obtain the existing two-dimensional CAD drawing image with annotation information specifically includes: Inputting the size condition corresponding to the preset convolutional neural network model and the splitting screening condition of the two-dimensional CAD drawing image into a preset disassembly tool, so as to disassemble the existing two-dimensional CAD drawing image based on the preset disassembly tool to obtain a plurality of single-frame existing two-dimensional CAD drawing images; Based on the component structure information and structure reference information corresponding to the existing two-dimensional CAD drawing images of each single drawing frame, the design element information of the existing two-dimensional CAD drawing images of each single drawing frame and the association relationship between each design element are summarized; Based on the association between the design element information and each design element, annotating the existing two-dimensional CAD drawing image of the single drawing frame; The annotated single-frame existing two-dimensional CAD drawing image is moved by preset movement data to obtain an extended single-frame existing two-dimensional CAD drawing image corresponding to the single-frame existing two-dimensional CAD drawing image; The single-frame existing two-dimensional CAD drawing image with annotations and the extended single-frame existing two-dimensional CAD drawing image are used as the existing two-dimensional CAD drawing image with annotation information.
8. The method for identifying design elements of a two-dimensional CAD drawing according to claim 1, characterized in that: Parsing the design element information to obtain the association relationship between the design elements in the two-dimensional CAD drawing image specifically includes: Parsing the design element information to determine the spatial position data and text annotation data corresponding to each of the design element information; Determine the connection order between the design elements based on the text annotation data, and determine the position coordinates and position orientation of each design element based on the spatial position data; The association relationship between the design elements in the two-dimensional CAD drawing image is determined through the connection sequence between the design elements and the position coordinates and position orientation of the design elements.
9. A design element recognition device for a two-dimensional CAD drawing, characterized in that: The device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can: execute the design element recognition method of the two-dimensional CAD drawing described in any one of claims 1-8.
10. A non-volatile storage medium storing computer executable instructions, characterized in that: The computer executable instructions can: execute the design element recognition method of the two-dimensional CAD drawing described in any one of claims 1-8 above.