Graphics element recognition method and recognition device based on CAD drawings

By dividing the entries in the CAD drawing into multiple graph groups and calculating shape feature variables, and training the recognition model, the problems of low efficiency and insufficient accuracy of element recognition in the existing technology are solved, and fast and accurate entries are achieved Identify.

CN111881809BActive Publication Date: 2024-12-13GLODON CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010719005.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-23
Publication Date
2024-12-13
Estimated Expiration
2040-07-23

AI Technical Summary

Technical Problem

The prior art machine learning model based on business features for element recognition requires a lot of labor and time cost, and is prone to inaccurate recognition results, especially when fitting similar shapes in CAD drawings.

Method used

By dividing the entries in the CAD drawing into multiple graph groups, each graph group contains the same type of entries, multiple feature variables such as color features, line features and shape features are calculated, and these feature variables are used to train and identify the model To determine the element type, the dependence on business characteristics is reduced.

Benefits of technology

Fast and accurate element recognition is achieved, labor and time costs are reduced, recognition efficiency and accuracy are improved, and the complexity of business feature training is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111881809B_ABST
    Figure CN111881809B_ABST
Patent Text Reader

Abstract

The present invention provides a primitive recognition method and primitive recognition device based on CAD drawings, the method comprising: dividing all primitives contained in the CAD drawings into multiple groups, wherein each group contains primitives of the same type; calculating multiple feature variables of the group, the feature variables are used to characterize the shape features of the primitives contained in the group; inputting the multiple feature variables into a recognition model to determine the type of primitives contained in the group. The present invention first divides all primitives into multiple groups based on the layers and colors of the CAD drawings, calculates multiple feature variables in each group respectively, and finally inputs the feature variables into a recognition model to determine the type corresponding to the primitive in each group. In particular, the feature variables in the present invention are based on generalized features such as the number, length, angle, and connection relationship of the primitives, without involving business features, which can effectively reduce labor costs and time costs, and improve the efficiency and accuracy of image source recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of graphic element recognition, and in particular to a graphic element recognition method, device, computer equipment and computer-readable storage medium based on CAD drawings. Background Art

[0002] With the development of Internet technology, in order to quickly and accurately establish accurate architectural model information, intelligent recognition technology has begun to be introduced into the engineering modeling process. Through intelligent recognition of CAD drawings, the information required by users can be obtained more quickly and accurately, and the data required by users can be obtained in accordance with specific business needs, and quickly applied to the bidding stage. Therefore, how to quickly obtain accurate CAD drawing information is a problem that related design software needs to solve.

[0003] In the prior art, machine learning models are generally trained based on business features to perform primitive recognition. In this case, programmers need to have a certain degree of understanding of different businesses, and select and train features according to the different businesses and graphic styles. The prior art requires a lot of preliminary business training for programmers, which is difficult to see results in a short period of time, and is very labor-intensive and time-consuming. In addition, machine recognition based on business features is prone to fitting with graphics with similar shapes in CAD drawings, which can easily lead to inaccurate recognition results. Summary of the invention

[0004] The purpose of the present invention is to provide a simple and universal primitive recognition technology, so that operators can easily handle it without having to master a large number of business features, so as to solve the above-mentioned problems existing in the prior art.

[0005] To achieve the above object, the present invention provides a method for identifying graphic elements based on CAD drawings, comprising:

[0006] Divide all the graphics elements contained in the CAD drawing into multiple graphics groups, where each graphics group contains graphics elements of the same type;

[0007] Calculating a plurality of characteristic variables of the graph group, wherein the characteristic variables are used to characterize shape characteristics of the graph elements contained in the graph group;

[0008] The plurality of feature variables are input into a recognition model to determine the types of graphics elements included in the graphics group.

[0009] Exemplarily, the step of dividing all the graphic elements contained in the CAD drawing into a plurality of graphic groups includes:

[0010] Obtaining a first graphic element contained in any layer of the CAD drawing;

[0011] Obtaining a second image element having the same color from the first image element;

[0012] The second graphics elements are divided into the same graphics group.

[0013] Exemplarily, the calculating a plurality of characteristic variables of the graph group includes:

[0014] Determine a connected group included in the graph group, and obtain information about the connected group; the connected group refers to a set of graph elements that intersect with each other;

[0015] Obtaining basic information, length information, number of graphic elements, angle information, connection information, and arc information in the graphic group;

[0016] The multiple feature variables are calculated according to the connection group information, the basic information, the length information, the primitive quantity information, the angle information, the connection information and the arc information.

[0017] Exemplarily, the characteristic variables include one or more of the following:

[0018] A color feature, characterizing the color of the image element in the image group;

[0019] Linearity features, characterizing the linearity of the graphics elements in the graphics group;

[0020] A drawing group number feature, representing the number of drawing groups included in the CAD drawing;

[0021] A length ratio, representing the ratio of the total length of all line segments in the drawing group to the total length of all line segments in the CAD drawing;

[0022] A ratio of the number of graphic elements, representing the ratio of the number of graphic elements in the graphic group to the number of graphic sources in the CAD drawing;

[0023] The number of full circles represents the number of connected groups that form a circle;

[0024] The arc-to-straight-line ratio represents the ratio of the number of arcs to the number of straight lines in the graph group;

[0025] An angle feature, characterizing the angle of the straight lines in the group of graphs;

[0026] The number of endpoint intersections represents the number of lines that intersect other lines only at their endpoints;

[0027] The number of non-endpoint intersections represents the number of straight lines that intersect other lines at non-endpoints;

[0028] The endpoint-line ratio represents the ratio of the longest line length in the graph group to the short line length connecting the endpoints;

[0029] A starting point angle, representing the starting point angle of a short line connecting the longest line in the graph group with the endpoints;

[0030] The end point angle represents the end point angle of the short line connecting the longest line in the graph group with the endpoint;

[0031] The number of arcs represents the number of arcs contained in the graph group;

[0032] The arc number ratio represents the ratio of the number of arcs contained in the drawing group to the number of all the graphics elements in the drawing;

[0033] The arc-to-line segment ratio represents the ratio of the number of arcs whose two ends are connected to the line segments to the number of arcs whose two ends are not connected to the line segments;

[0034] The arc segment parallel ratio represents the ratio of the number of line segments connected to the two ends of the arc and parallel to each other to the number of all line segments connected to the two ends of the arc;

[0035] The horizontal-to-vertical ratio represents the ratio of the horizontal or vertical line segments in the group of graphics to all the graphics elements.

[0036] Exemplarily, the recognition model is obtained by process training:

[0037] Acquire a plurality of sample data, wherein the sample data includes a plurality of feature variables as input data and a primitive type label as output data;

[0038] Training a neural network model using the plurality of sample data, and determining weight parameters in the neural network model using a gradient descent method;

[0039] The neural network model with determined weight parameters is used as the recognition model.

[0040] According to a second aspect of the present invention, there is provided a graphic element recognition device based on a CAD drawing, comprising:

[0041] A grouping unit is used to divide all the graphics elements contained in the CAD drawing into a plurality of graphics groups, wherein each graphics group contains graphics elements of the same type;

[0042] A feature calculation unit, adapted to calculate a plurality of feature variables of the graph group, wherein the feature variables are used to characterize shape features of the graph elements contained in the graph group;

[0043] The recognition unit is adapted to input the plurality of characteristic variables into a recognition model to determine the types of graphic elements included in the graphic group.

[0044] Exemplarily, the grouping unit includes:

[0045] A layer subunit, adapted to obtain a first graphic element contained in any layer of the CAD drawing;

[0046] A color subunit is adapted to obtain a second image element having the same color as the first image element,

[0047] The image group subunit is adapted to divide the second image elements into the same image group.

[0048] Exemplarily, the feature calculation unit includes:

[0049] A connected group subunit, adapted to determine a connected group contained in the graph group and obtain connected group information; the connected group refers to a set of graph elements that intersect with each other;

[0050] An information acquisition subunit, adapted to acquire basic information, length information, number of graphic elements, angle information, connection information, and arc information in the graphic group;

[0051] The calculation subunit is adapted to calculate the multiple feature variables according to the connection group information, the basic information, the length information, the graphic element quantity information, the angle information, the connection information and the arc information.

[0052] According to a third aspect of the present invention, there is provided a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0053] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.

[0054] The method, device, computer equipment and computer-readable storage medium for identifying primitives based on CAD drawings provided by the present invention provide a solution for quickly and accurately identifying CAD primitives. The present invention first divides all primitives into multiple groups based on the layers and colors of the CAD drawings, calculates multiple feature variables in each group, and finally inputs the feature variables into the recognition model to determine the type corresponding to the primitive in each group. In particular, the feature variables in the present invention are based on generalized features such as the number, length, angle, and connection relationship of the primitives, without involving business features, which can effectively reduce labor costs and time costs and improve the efficiency and accuracy of source recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 A flow chart of a method for identifying a primitive according to a first embodiment of the present invention is shown;

[0056] Figure 2 A schematic flow chart of dividing a graph group according to Embodiment 1 of the present invention is shown;

[0057] Figure 3 A schematic flow chart of calculating characteristic variables according to the first embodiment of the present invention is shown;

[0058] Figure 4 A schematic flow chart of training a recognition model according to Embodiment 1 of the present invention is shown;

[0059] Figure 5 A schematic diagram of a modular structure of a first embodiment of the present invention is shown;

[0060] Figure 6 A schematic diagram of the hardware structure of the first embodiment of the present invention is shown. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0062] The method, device, computer equipment and computer-readable storage medium for identifying primitives based on CAD drawings provided by the present invention provide a solution for quickly and accurately identifying CAD primitives. The present invention first divides all primitives into multiple groups based on the layers and colors of the CAD drawings, calculates multiple feature variables in each group, and finally inputs the feature variables into the recognition model to determine the type corresponding to the primitive in each group. In particular, the feature variables in the present invention are based on generalized features such as the number, length, angle, and connection relationship of the primitives, without involving business features, which can effectively reduce labor costs and time costs and improve the efficiency and accuracy of source recognition.

[0063] Embodiment 1

[0064] See also Figure 1 This embodiment proposes a method for identifying graphic elements based on CAD drawings, including:

[0065] S110: Divide all graphics elements contained in the CAD drawing into multiple graphics groups, wherein each graphics group contains graphics elements of the same type.

[0066] CAD drawings in the field of architecture contain many types of elements, such as columns, beams, shear walls, etc. Due to the symmetry of buildings, each element has a high repetition rate. For example, the elements between each floor are mostly similar. This step is used to group the elements of the same type from the CAD drawings into a group, thereby forming multiple drawing groups. For example, all the elements representing beams are divided into the first drawing group, all the elements representing columns are divided into the second drawing group, all the elements representing shear walls are divided into the third drawing group, and so on.

[0067] The image groups can be divided according to the identification names of the image elements, or according to the layers and colors. By grouping, each group of the present embodiment contains the same type of image elements. In the subsequent recognition process, the image element recognition is performed for each image group respectively, which can effectively reduce the recognition calculation amount and improve the recognition efficiency.

[0068] S120: Calculate a plurality of feature variables of the graph group, where the feature variables are used to characterize shape features of the graph elements included in the graph group.

[0069] This step is used to calculate the feature variables contained in each image group. It should be noted that the feature variables are used to represent the generalized shape features of the primitives and do not involve business features. In other words, the feature variables extracted in this step are suitable for CAD primitives in any business scenario without involving specific business features, which is conducive to improving recognition efficiency.

[0070] S130: Input the plurality of feature variables into a recognition model to determine the types of graphic elements included in the graphic group.

[0071] The recognition model in this embodiment can analyze the input feature variables and output the primitive types corresponding to these feature variables, such as beams, columns, shear walls, etc. The recognition model can be a machine learning model obtained through big data training, including a BP neural network model, a long short-term memory model, a Boltzmann machine model, etc., which is not limited in this embodiment. The recognition model can be trained by any existing machine learning method.

[0072] Through the above steps, this embodiment identifies the type of graphic element based on the characteristic variables in each graphic group, which can improve the recognition efficiency and recognition accuracy of the graphic element.

[0073] As mentioned above, drawing groups can be divided according to layers and colors. Those skilled in the art will understand that different layers in CAD drawings generally represent different objects, such as axis grid layers, shear wall layers, lamp layers, etc. Further, in the same layer, different colors generally represent different types of primitives. For example, white represents beam primitives, red represents column primitives, etc. Therefore, primitives belonging to the same layer and having the same color are usually of the same type. Figure 2A schematic flow chart of dividing a graph group according to Embodiment 1 of the present invention is shown, which specifically includes:

[0074] S111: Obtain the first graphic element contained in any layer of the CAD drawing.

[0075] For example, a complete CAD drawing contains three layers, namely layer 1, layer 2 and layer 3. In this step, the user obtains all the elements of any layer among layer 1, layer 2 and layer 3.

[0076] S112: Obtain a second graphic element having the same color from the first graphic element.

[0077] A layer can contain one or more colors, which are usually used to represent different types of primitives. This step is used to obtain all primitives with the same color belonging to the same layer. For example, obtain the white primitives in layer 1, or obtain the red primitives in layer 2, etc.

[0078] S113: Divide the second graphic elements into the same graphic group.

[0079] Through the above steps, all the graphics elements contained in each graphics group of this embodiment belong to the same layer and have the same color. In this case, the probability that all graphics elements belong to the same type is relatively high, thereby improving the efficiency of subsequent graphics element recognition.

[0080] Figure 3 FIG. 2 shows a schematic flow chart of calculating characteristic variables according to Embodiment 1 of the present invention. Figure 3 As shown, step S120 includes:

[0081] S121: Determine a connected group included in the graphic group, and obtain information about the connected group; the connected group refers to a set of graphic elements that intersect with each other.

[0082] This step is used to identify graphics composed of multiple interconnected sources, such as rectangular blocks formed by the intersection of line segments in the axis grid. For architectural elements, certain types of elements have fixed connection relationships, such as between beams, between beams and columns, between walls and beams, etc. By identifying the interconnection group, the connection relationship between elements can be determined, which serves as the basis for source identification.

[0083] S122: Obtain basic information, length information, number of graphic elements, angle information, connection information, and arc information in the graphic group. The above information is shape information that can be directly obtained from CAD drawings and has nothing to do with specific business scenarios.

[0084] Among them, basic information includes the color and linearity of the graphic element, length information includes the length of the line segment in the graphic group, graphic source quantity information includes the number of graphic elements in each graphic group and the number of graphic elements in each connected group, angle information includes the angle of each straight line or line segment, connection information includes the endpoint connection relationship or non-endpoint connection relationship between two graphic elements, arc information includes the number of arcs and the connection relationship, etc.

[0085] S123: Calculate the multiple feature variables according to the basic information, the length information, the graphic element quantity information, the angle information, the connection information, the arc information and the connection group information.

[0086] The following is a detailed description of each feature variable:

[0087] A color feature, characterizing the color of the image element in the image group;

[0088] Line type features, characterizing the line type of the graphic elements in the graphic group, such as dashed lines, straight lines, dotted lines, etc.;

[0089] A drawing group number feature, representing the number of drawing groups included in the CAD drawing;

[0090] A length ratio, representing the ratio of the total length of all line segments in the drawing group to the total length of all line segments in the CAD drawing;

[0091] A ratio of the number of graphic elements, representing the ratio of the number of graphic elements in the graphic group to the number of graphic sources in the CAD drawing;

[0092] The number of full circles represents the number of connected groups that form a circle;

[0093] The arc-to-straight-line ratio represents the ratio of the number of arcs to the number of straight lines in the graph group;

[0094] An angle feature, characterizing the angle of the straight lines in the group of graphs;

[0095] The number of endpoint intersections represents the number of lines that intersect other lines only at their endpoints;

[0096] The number of non-endpoint intersections represents the number of straight lines that intersect other lines at non-endpoints;

[0097] The endpoint-line ratio represents the ratio of the longest line length in the graph group to the short line length connecting the endpoints;

[0098] A starting point angle, representing the starting point angle of a short line connecting the longest line in the graph group with the endpoints;

[0099] The end point angle represents the end point angle of the short line connecting the longest line in the graph group with the endpoint;

[0100] The number of arcs represents the number of arcs contained in the graph group;

[0101] The arc number ratio represents the ratio of the number of arcs contained in the drawing group to the number of all the graphics elements in the drawing;

[0102] The arc-to-line segment ratio represents the ratio of the number of arcs whose two ends are connected to the line segments to the number of arcs whose two ends are not connected to the line segments;

[0103] The arc segment parallel ratio represents the ratio of the number of line segments connected to the two ends of the arc and parallel to each other to the number of all line segments connected to the two ends of the arc;

[0104] The horizontal-to-vertical ratio represents the ratio of the horizontal or vertical line segments in the group of graphics to all the graphics elements.

[0105] The above-mentioned characteristic variables mentioned in this embodiment are only used for example, not for limitation. Those skilled in the art can understand that any characteristic variables calculated based on basic information, length information, number of primitives information, angle information, connection information, arc information and connection group information are within the protection scope of this embodiment.

[0106] Figure 4 FIG. 2 shows a schematic flow chart of training a recognition model according to Embodiment 1 of the present invention. Figure 4 As shown, the recognition model of this embodiment can be trained by the following steps:

[0107] S410: Acquire multiple sample data, the sample data including multiple feature variables as input data and graphic element type labels as output data. The multiple feature variables may include the color feature, line feature, graphic element number feature, length ratio, graphic element number ratio, full circle number, arc line ratio, angle feature, endpoint intersection number, non-endpoint intersection number, endpoint line ratio, starting point angle, end point angle, arc number, arc number ratio, arc connection line segment ratio, arc line segment parallel ratio, horizontal vertical ratio, etc. The graphic element type label may be a value corresponding to a preset graphic element type, for example, 1 represents a beam, 2 represents a column, and 3 represents a shear wall.

[0108] S420: Train the neural network model using the plurality of sample data, and determine the weight parameters in the neural network model according to an optimization algorithm. The optimization algorithm may be any algorithm in the prior art, such as a gradient descent method.

[0109] S430: Using the neural network model with determined weight parameters as the recognition model.

[0110] Through the above steps, a trained recognition model can be obtained. For multiple feature parameters corresponding to a certain image group, the type labels of the image elements contained in the image group can be directly output.

[0111] Please continue reading Figure 5 , shows a primitive recognition device. In this embodiment, the primitive recognition device 10 may include or be divided into one or more program modules. One or more program modules are stored in a storage medium and executed by one or more processors to complete the present invention and implement the above-mentioned primitive recognition method. The program module referred to in the present invention refers to a series of computer program instruction segments that can complete specific functions, which is more suitable for describing the execution process of the primitive recognition device 500 in the storage medium than the program itself. The following description will specifically introduce the functions of each program module in this embodiment:

[0112] The grouping unit 510 is adapted to divide all the graphics elements contained in the CAD drawing into a plurality of graphics groups, wherein each graphics group contains graphics elements of the same type;

[0113] A feature calculation unit 520, adapted to calculate a plurality of feature variables of the graph group, wherein the feature variables are used to characterize shape features of the graph elements contained in the graph group;

[0114] The recognition unit 530 is adapted to input the plurality of feature variables into a recognition model to determine the types of graphics elements included in the graphics group.

[0115] The grouping unit 510 further includes:

[0116] The layer subunit 511 is adapted to obtain a first graphic element contained in any layer of the CAD drawing;

[0117] The color subunit 512 is adapted to obtain a second image element having the same color as the first image element,

[0118] The image group subunit 513 is adapted to divide the second image elements into the same image group.

[0119] The feature calculation unit 520 further includes:

[0120] The interconnected group subunit 521 is adapted to determine the interconnected groups contained in the graph group and obtain the interconnected group information; the interconnected group refers to a set of mutually intersecting graph elements;

[0121] The information acquisition subunit 522 is adapted to acquire basic information, length information, number of graphic elements, angle information, connection information, and arc information in the graphic group;

[0122] The calculation subunit 523 is adapted to calculate the plurality of feature variables according to the connection group information, the basic information, the length information, the primitive quantity information, the angle information, the connection information and the arc information.

[0123] This embodiment can effectively reduce labor costs and time costs and improve the efficiency and accuracy of image source recognition through the above-mentioned device.

[0124] The present embodiment also provides a computer device, such as a smart phone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server or cabinet server (including an independent server or a server cluster composed of multiple servers) that can execute programs. The computer device 60 of the present embodiment includes at least but is not limited to: a memory 61 and a processor 62 that can communicate with each other via a system bus, such as Figure 6 It should be pointed out that Figure 6 Only a computer device 60 having components 61 - 62 is shown, but it should be understood that implementing all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.

[0125] In this embodiment, the memory 61 (i.e., readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 61 can be an internal storage unit of the computer device 60, such as a hard disk or memory of the computer device 60. In other embodiments, the memory 61 can also be an external storage device of the computer device 60, such as a plug-in hard disk equipped on the computer device 60, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 61 can also include both the internal storage unit of the computer device 60 and its external storage device. In this embodiment, the memory 61 is generally used to store the operating system and various application software installed on the computer device 60, such as the program code of the graphic element recognition device 500 of the first embodiment. In addition, the memory 61 can also be used to temporarily store various types of data that have been output or are to be output.

[0126] In some embodiments, the processor 62 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips. The processor 62 is generally used to control the overall operation of the computer device 60. In this embodiment, the processor 62 is used to run the program code stored in the memory 61 or process data, such as running the primitive recognition device 500 to implement the primitive recognition method of the first embodiment.

[0127] This embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a disk, an optical disk, a server, an App application store, etc., on which a computer program is stored, and when the program is executed by a processor, a corresponding function is realized. The computer-readable storage medium of this embodiment is used to store the primitive recognition device 500, and when executed by the processor, the primitive recognition method of the first embodiment is realized.

[0128] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0129] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.

[0130] A person of ordinary skill in the art can understand that all or part of the steps carried out in the above-mentioned embodiment method can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable medium. When the program is executed, it includes one of the steps of the method embodiment or a combination thereof.

[0131] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0132] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.

[0133] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for identifying graphic elements based on CAD drawings. It is characterized in that include: Divide all the graphics elements contained in the CAD drawing into multiple graphics groups, where each graphics group contains graphics elements of the same type; Calculating a plurality of characteristic variables of the graph group, wherein the characteristic variables are used to characterize shape characteristics of the graph elements contained in the graph group; Inputting the plurality of feature variables into a recognition model to determine the types of graphics elements included in the graphics group; The calculating of the plurality of characteristic variables of the graph group comprises: Determine a connected group included in the graph group, and obtain information about the connected group; the connected group refers to a set of graph elements that intersect with each other; Obtaining basic information, length information, number of graphic elements, angle information, connection information, and arc information in the graphic group; the basic information includes the color and linearity of the graphic elements; The multiple feature variables are calculated according to the connection group information, the basic information, the length information, the primitive quantity information, the angle information, the connection information and the arc information.

2. The method for identifying primitives according to claim 1, It is characterized in that The step of dividing all the graphic elements contained in the CAD drawing into a plurality of graphic groups comprises: Obtaining a first graphic element contained in any layer of the CAD drawing; Obtaining a second image element having the same color from the first image element; The second graphics elements are divided into the same graphics group.

3. The method for identifying primitives according to claim 1, It is characterized in that The characteristic variables include one or more of the following: A color feature, characterizing the color of the image element in the image group; Line type features, characterizing the line type of the graphic elements in the graphic group; A drawing group number feature, representing the number of drawing groups included in the CAD drawing; A length ratio, representing the ratio of the total length of all line segments in the drawing group to the total length of all line segments in the CAD drawing; A ratio of the number of graphic elements, representing the ratio of the number of graphic elements in the graphic group to the number of graphic elements in the CAD drawing; The number of full circles represents the number of connected groups that form a circle; The arc-to-straight-line ratio represents the ratio of the number of arcs to the number of straight lines in the graph group; An angle feature, characterizing the angle of the straight lines in the group of graphs; The number of endpoint intersections represents the number of lines that intersect other lines only at their endpoints; The number of non-endpoint intersections represents the number of straight lines that intersect other lines at non-endpoints; The endpoint-line ratio represents the ratio of the longest line length in the graph group to the short line length connecting the endpoints; A starting point angle, representing the starting point angle of a short line connecting the longest line in the graph group with the endpoints; The end point angle represents the end point angle of the short line connecting the longest line in the graph group with the endpoint; The number of arcs represents the number of arcs contained in the graph group; The arc number ratio represents the ratio of the number of arcs contained in the drawing group to the number of all the graphics elements in the drawing; The arc-to-line segment ratio represents the ratio of the number of arcs whose two ends are connected to the line segments to the number of arcs whose two ends are not connected to the line segments; The arc segment parallel ratio represents the ratio of the number of line segments connected to the two ends of the arc and parallel to each other to the number of all line segments connected to the two ends of the arc; The horizontal-to-vertical ratio represents the ratio of the horizontal or vertical line segments in the group of graphics to all the graphics elements.

4. The method for identifying primitives according to claim 1, It is characterized in that The recognition model is obtained through process training: Acquire a plurality of sample data, wherein the sample data includes a plurality of feature variables as input data and a primitive type label as output data; Training a neural network model using the plurality of sample data, and determining weight parameters in the neural network model using a gradient descent method; The neural network model with determined weight parameters is used as the recognition model.

5. A graphic element recognition device based on CAD drawings, It is characterized in that include: A grouping unit is used to divide all the graphics elements contained in the CAD drawing into a plurality of graphics groups, wherein each graphics group contains graphics elements of the same type; A feature calculation unit, adapted to calculate a plurality of feature variables of the graph group, wherein the feature variables are used to characterize shape features of the graph elements contained in the graph group; a recognition unit adapted to input the plurality of characteristic variables into a recognition model to determine the types of graphic elements contained in the graphic group; The feature calculation unit comprises: A connected group subunit, adapted to determine a connected group contained in the graph group and obtain connected group information; the connected group refers to a set of graph elements that intersect with each other; The information acquisition subunit is adapted to acquire basic information, length information, number of graphic elements, angle information, connection information, and arc information in the graphic group; the basic information includes the color and linearity of the graphic elements; The calculation subunit is adapted to calculate the multiple feature variables according to the connection group information, the basic information, the length information, the graphic element quantity information, the angle information, the connection information and the arc information.

6. The primitive recognition device according to claim 5, It is characterized in that The grouping units include: A layer subunit, adapted to obtain a first graphic element contained in any layer of the CAD drawing; A color subunit is adapted to obtain a second image element having the same color as the first image element, The image group subunit is adapted to divide the second image elements into the same image group.

7. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

8. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.