Building component identification method, device and equipment and storage medium

By acquiring and processing the attributes of primitives and their neighbor primitives in architectural drawings, and using the primitive recognition model for clustering, the problem of low recognition accuracy in the existing technology is solved and higher accuracy of recognition of building components is achieved. .

CN118552974APending Publication Date: 2024-08-27GLODON CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202310175229.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-27
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

In architectural drawings, component recognition methods based on geometric features and computer vision technology are easily affected by other graphics elements, resulting in low recognition accuracy, making it difficult to accurately determine component types, and affecting design efficiency.

Method used

By obtaining the attributes of each primitive and its neighbor primitives in the target drawing, the primitive feature input is generated, and processed using the trained primitive recognition model, clustering similar primitives to characterize the component type, reducing interference and improving Recognition accuracy.

Benefits of technology

The accuracy of recognition of building components is improved. By considering the relationship between primitives and neighboring primitives, misidentifications are reduced. The clustered primitive collection represents the component type, which significantly improves the accuracy of the recognition results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118552974A
    Figure CN118552974A
Patent Text Reader

Abstract

The invention relates to a building component identification method and device, equipment and a storage medium, and particularly relates to the technical field of computer vision. The method comprises the steps of obtaining a target drawing; for each target primitive in the target drawing, extracting neighbor primitives in a specified range corresponding to the target primitive; arranging the primitive attributes of the target primitives and the primitive attributes of the neighbor primitives according to a specified sequence, generating primitive feature input, and performing data processing on the primitive feature input corresponding to each target primitive according to a primitive recognition model to obtain a primitive type corresponding to each target primitive; and performing clustering operation on each target primitive according to the primitive type to obtain each target primitive set so as to represent each type of building component in the target drawing. The building component identification result obtained by the above scheme has high accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, and in particular to a building component recognition method, device, equipment and storage medium. Background Art

[0002] In the field of architecture, architectural drawings are usually imported into software in dwg format. In drawings of this format, there are various primitives, which refer to graphic data and correspond to the visible entities on the drawing interface.

[0003] Since architectural drawings usually contain many primitives, and the primitives in different architectural drawings are very different, it is sometimes difficult for designers to determine what type of building components each primitive in the drawing represents when reading the drawings, resulting in low work efficiency for designers. In the prior art, primitives can usually be identified based on geometric features, or by computer vision technology, so as to automatically identify the component types in the drawings.

[0004] Among the above solutions, the recognition method based on geometric features and the recognition solution based on computer vision technology are easily affected by other graphics elements and have low accuracy. Summary of the invention

[0005] The present application provides a method, device, computer equipment and storage medium for identifying building components, which improve the accuracy of identifying building components. The technical solution is as follows.

[0006] In one aspect, a method for identifying a building component is provided, the method comprising:

[0007] Obtaining a target drawing; the target drawing includes various graphic elements;

[0008] For each target primitive in the target drawing, extract neighboring primitives within a specified range corresponding to the target primitive;

[0009] Arrange the primitive attributes of the target primitive and the primitive attributes of the neighboring primitives in a specified order to generate primitive feature input;

[0010] According to the primitive recognition model, data processing is performed on the primitive feature input corresponding to each target primitive to obtain the primitive type corresponding to each target primitive;

[0011] The target primitives are clustered according to primitive types to obtain target primitive sets to represent various types of building components in the target drawing.

[0012] In another aspect, a method for identifying a building component is provided, the method comprising:

[0013] Obtaining a sample drawing; the sample drawing includes each sample graphic element and a type label of each sample graphic element;

[0014] For each sample primitive in the sample drawing, extract the sample neighboring primitives within the specified range corresponding to the sample primitive;

[0015] Arrange the primitive attributes of the sample primitive and the primitive attributes of the sample neighboring primitives in a specified order to generate a sample primitive feature input;

[0016] According to the primitive recognition model, data processing is performed on the sample primitive feature input corresponding to each sample primitive, so as to obtain the recognition results corresponding to each sample primitive;

[0017] The graphic element recognition model is trained according to the recognition results corresponding to each sample graphic element and the type label of each sample graphic element. After the trained graphic element recognition model is used to identify the type of each target graphic element in the target drawing, the target graphic elements of each type are clustered to characterize the various types of building components in the target drawing.

[0018] In another aspect, a building component identification device is provided, the device comprising:

[0019] A target drawing acquisition module is used to acquire a target drawing; the target drawing includes various graphic elements;

[0020] A neighboring element acquisition module is used to retrieve neighboring elements within a specified range corresponding to each target element in the target drawing;

[0021] A feature input generation module, used for arranging the primitive attributes of the target primitive and the primitive attributes of the neighboring primitives in a specified order to generate primitive feature input;

[0022] A primitive type acquisition module, used to process the primitive feature input corresponding to each target primitive according to the primitive recognition model, and obtain the primitive type corresponding to each target primitive;

[0023] The clustering module is used to perform clustering operations on the target primitives according to primitive types to obtain target primitive sets to represent various types of building components in the target drawing.

[0024] In a possible implementation, the clustering module is further configured to:

[0025] Cluster each target primitive with the nearest primitives of the same type to obtain primitive sets;

[0026] When the clustered primitive sets do not meet the iteration condition, each clustered primitive set is clustered again with the nearest primitive set of the same type;

[0027] When the clustered primitive sets meet the iteration condition, each clustered primitive set is determined as the target primitive set.

[0028] In a possible implementation, the iteration condition is that an average distance between target primitives in each target primitive set is less than a first threshold;

[0029] Alternatively, the iteration condition is that the average distance between the center points of each target primitive set is greater than a second threshold.

[0030] In a possible implementation, the neighboring primitive acquisition module is further configured to:

[0031] Get the bounding rectangle of the target primitive;

[0032] The bounding rectangle is enlarged to a specified size, and the graphic elements intersecting with the enlarged bounding rectangle are determined as neighboring graphic elements.

[0033] In a possible implementation, the feature input generation module is further used to:

[0034] The target primitive and the neighbor primitives are arranged with the target primitive as the first one and the neighbor primitives according to the coordinates to obtain a target primitive sequence;

[0035] The primitive feature input is generated according to the order of each primitive in the target primitive sequence and the primitive attributes of each primitive; the primitive attributes include at least one of the starting point coordinates, end point coordinates, primitive type number, length, arc length, grayscale, and saturation.

[0036] In another aspect, a building component identification device is provided, the device comprising:

[0037] A sample acquisition module is used to acquire a sample drawing; the sample drawing includes each sample graphic element and a type label of each sample graphic element;

[0038] A sample neighboring graphic element acquisition module is used to retrieve, for each sample graphic element in the sample drawing, sample neighboring graphic elements within a specified range corresponding to the sample graphic element;

[0039] A sample input generation module, used for arranging the primitive attributes of the sample primitive and the primitive attributes of the sample neighboring primitives in a specified order to generate a sample primitive feature input;

[0040] The sample processing module is used to process the sample primitive feature input corresponding to each sample primitive according to the primitive recognition model to obtain the recognition result corresponding to each sample primitive;

[0041] The model training module is used to train the primitive recognition model according to the recognition results corresponding to each sample primitive and the type label of each sample primitive, so as to cluster the target primitives of each type to characterize the building components of each type in the target drawing after the type recognition of each target primitive in the target drawing is performed by the trained primitive recognition model.

[0042] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the above-mentioned building component identification method.

[0043] In yet another aspect, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement the above-mentioned building component identification method.

[0044] In another aspect, a computer program product or a computer program is provided, wherein the computer program product or the computer program comprises computer instructions, wherein the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above-mentioned building component identification method.

[0045] The technical solution provided by this application may have the following beneficial effects:

[0046] When identifying building components in drawings, the computer device can first obtain neighboring primitives of each target primitive within a specified range, and generate primitive feature input according to the primitive attributes of the target primitive and the neighboring primitives. At this time, the primitive feature input not only has the characteristics of the primitive itself but also has the characteristics of the primitives adjacent to the primitive. The computer device then processes the primitive feature input through the trained primitive recognition model to obtain the primitive type corresponding to each target primitive; then the computer device generates each target primitive set by clustering the primitives of the same type, and each primitive set represents each type of building component in the target drawing. The above scheme takes into account the adjacency relationship between the primitive and the adjacent primitives in the primitive recognition process, reduces the interference of other primitives on the primitive recognition, and after identifying the primitive type, clusters similar primitives into sets by clustering, and the primitives in the set represent the building components of this category, and screens out the misidentified primitive types. Therefore, the building component recognition result obtained by the above scheme has a high accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0048] Figure 1 The figure is a schematic structural diagram of a building component recognition system according to an exemplary embodiment.

[0049] Figure 2 The present invention is a flowchart of a building component identification method according to an exemplary embodiment.

[0050] Figure 3 The present invention is a flowchart of a building component identification method according to an exemplary embodiment.

[0051] Figure 4 The present invention is a flowchart of a building component identification method according to an exemplary embodiment.

[0052] Figure 5 The figure is a structural block diagram of a building component recognition device according to an exemplary embodiment.

[0053] Figure 6 The figure is a structural block diagram of a building component recognition device according to an exemplary embodiment.

[0054] Figure 7 A structural block diagram of a computer device shown in an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION

[0055] The technical solution of the present application will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.

[0056] It should be understood that the "indication" mentioned in the embodiments of the present application can be a direct indication, an indirect indication, or an indication of an association relationship. For example, A indicates B, which can mean that A directly indicates B, for example, B can be obtained through A; it can also mean that A indirectly indicates B, for example, A indicates C, and B can be obtained through C; it can also mean that there is an association relationship between A and B.

[0057] In the description of the embodiments of the present application, the term "corresponding" may indicate a direct or indirect correspondence between two items, or an association relationship between the two items, or a relationship between indication and being indicated, configuration and being configured, and the like.

[0058] In an embodiment of the present application, "predefinition" can be achieved by pre-saving corresponding codes, tables or other methods that can be used to indicate relevant information in a device (for example, including a terminal device and a network device). The present application does not limit its specific implementation method.

[0059] Figure 1 1 is a schematic diagram showing a structure of a building component recognition system according to an exemplary embodiment. The building component recognition system includes a server 110 and a terminal device 120. The terminal device 120 may include a data processing device and a data storage module.

[0060] Optionally, the terminal device 120 communicates with the server 110 via a transmission network (such as a wireless communication network). The terminal device 120 can upload various data (such as drawing data) stored in the data storage module to the server 110 via the wireless communication network, so that the server 110 can process the acquired drawing data, for example, train a convolutional neural network model used for graphic element recognition and other aspects through the uploaded drawing data.

[0061] Optionally, the terminal device 120 also includes a command input component, such as a mouse, a keyboard, a touch screen, etc. ( Figure 1 (not shown), after the command input component receives the specified command input by the user, the corresponding data can be input on the terminal device. For example, when CAD software is installed on the terminal device, the user can input the corresponding command to the terminal device through the command input component to control the CAD software to generate the corresponding dwg format drawing file.

[0062] Optionally, the terminal device may upload the drawing file to the server 110 so that the server 110 can train a convolutional neural network model for use in aspects such as primitive recognition.

[0063] Optionally, the terminal device further includes a data processing device, which can identify the type of graphic elements in the drawing file through a convolutional neural network model sent by the server when the terminal device 120 opens the drawing file.

[0064] Optionally, the server 110 can obtain the drawing files uploaded by each terminal device, and annotate the drawing files manually or other means, so as to train the convolutional neural network model through the uploaded drawing files and annotation information. After the training is completed, the trained convolutional neural network model can be transmitted to the terminal device so that the terminal device can identify the type of graphic elements in the drawing file.

[0065] Optionally, after the terminal device receives and opens the drawing file, the terminal device can upload the drawing file to the server 110 so that the convolutional neural network model trained in the server 110 can recognize the drawing file, obtain the recognition result and return it to the terminal device to realize online recognition of the drawing file.

[0066] Optionally, the above-mentioned server can be a server cluster or a distributed system composed of multiple physical servers, or it can be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms and other technical computing services.

[0067] Optionally, the system may further include a management device, which is used to manage the system (such as managing the connection status between each module and the server, etc.), and the management device is connected to the server via a communication network. Optionally, the communication network is a wired network or a wireless network.

[0068] Optionally, the above-mentioned wireless network or wired network uses standard communication technology and / or protocol. The network is usually the Internet, but it can also be any other network, including but not limited to any combination of local area network, metropolitan area network, wide area network, mobile, limited or wireless network, private network or virtual private network. In some embodiments, the technology and / or format including hypertext markup language, extensible markup language, etc. are used to represent the data exchanged through the network. In addition, conventional encryption technologies such as secure socket layer, transport layer security, virtual private network, Internet protocol security, etc. can also be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technology can also be used to replace or supplement the above-mentioned data communication technology.

[0069] Figure 2 is a flow chart of a method for identifying a building component according to an exemplary embodiment. The method is executed by a computer device, which may be Figure 1 One of the terminal device and the server shown in . Figure 2 As shown, the building component identification method may include the following steps:

[0070] Step 201, obtaining a target drawing.

[0071] Optionally, in an embodiment of the present application, the target drawing may be a drawing generated by CAD software, and the target drawing includes various graphic elements, and the various graphic elements may be distributed in various layers.

[0072] Optionally, in an embodiment of the present application, when the computer device obtains the target drawing, it can also obtain the graphic attributes of each graphic element in the target drawing, that is, the attribute information input by the designer when generating the graphic element, such as the starting point coordinates, end point coordinates, graphic element type number, length, arc length, grayscale, saturation, etc. of the graphic element.

[0073] Step 202: For each target primitive in the target drawing, retrieve neighboring primitives within a specified range corresponding to the target primitive.

[0074] Since there are usually overlapping parts or overlapping line segments between the various elements in the target drawing, it is not enough to only consider the characteristics of the target element when identifying the type of the target element. The adjacent elements will affect the image performance of the target element. In the architectural field, there is usually a certain relationship between various types of elements. For example, the elements corresponding to the window usually have overlapping parts with the elements corresponding to the wall. Therefore, when performing element recognition, considering the neighboring elements of the target element has a higher amount of information, which can improve the accuracy of element type recognition.

[0075] Step 203 , arranging the primitive attributes of the target primitive and the primitive attributes of the neighboring primitive in a specified order to generate primitive feature input.

[0076] After obtaining the neighboring primitives corresponding to each target primitive, the primitive attributes of the target primitive and the primitive attributes of the neighboring primitives may be arranged in a specified order to generate primitive feature input.

[0077] Optionally, the primitive attribute of the target primitive may be placed at the first position of the primitive feature input, and the primitive features of each adjacent primitive may be arranged in order according to the distance from the target primitive to generate the primitive feature input.

[0078] Optionally, the computer device arranges the primitive attributes of the target primitive and the primitive attributes of the neighboring primitives according to their respective center coordinates (for example, from top to bottom, or from left to right) to generate primitive feature input.

[0079] Step 204 , performing data processing on the primitive feature input corresponding to each target primitive according to the primitive recognition model, and obtaining the primitive type corresponding to each target primitive.

[0080] In an embodiment of the present application, the primitive recognition model can be a convolutional neural network model (e.g., a CNN model) trained based on sample primitives and type annotations corresponding to the sample primitives. After the primitive recognition model performs data processing on the primitive feature input corresponding to the target primitive, a prediction result of the primitive type corresponding to the target primitive can be obtained.

[0081] Step 205 , clustering the target primitives according to primitive types to obtain target primitive sets to represent the various types of building components in the target drawing.

[0082] Optionally, each target primitive may be clustered according to primitive type, that is, primitives of the same type are aggregated into a primitive set.

[0083] Optionally, in an embodiment of the present application, the target primitives may be clustered according to position, that is, similar primitives of the same type are clustered together until clustering conditions are met, and then target primitive sets are obtained to represent various types of building components in the target drawing.

[0084] For example, when each target element set includes an element set of the "door" type, then the type of each element in the element set is "door", that is, the computer device recognizes the door-type building components and forms a set. At this time, the designer can clearly determine where the "door" building components exist in the target drawing.

[0085] In summary, when identifying building components in drawings, the computer device can first obtain the neighboring primitives of each target primitive within a specified range, and generate primitive feature input according to the primitive attributes of the target primitive and the neighboring primitives. At this time, the primitive feature input not only has the characteristics of the primitive itself but also has the characteristics of the primitives adjacent to the primitive. The computer device then processes the primitive feature input through the trained primitive recognition model to obtain the primitive type corresponding to each target primitive; then the computer device generates each target primitive set by clustering the primitives of the same type, and each primitive set represents each type of building component in the target drawing. The above scheme takes into account the adjacency relationship between the primitive and the adjacent primitives in the primitive recognition process, reduces the interference of other primitives on the primitive recognition, and after identifying the primitive type, clusters similar primitives into sets by clustering. The primitives in the set represent the building components of this category, and the misidentified primitive types are screened out. Therefore, the building component recognition result obtained by the above scheme has a high accuracy.

[0086] Figure 3 is a flow chart of a method for identifying a building component according to an exemplary embodiment. The method is executed by a computer device, which may be Figure 1One of the terminal device and the server shown in . Figure 3 As shown, the building component identification method may include the following steps:

[0087] Step 301, obtaining a sample drawing.

[0088] The sample drawing includes each sample graphic element and the type label of each sample graphic element.

[0089] Step 302, for each sample primitive in the sample drawing, extract the sample neighbor primitives within the specified range corresponding to the sample primitive;

[0090] Step 303, arranging the primitive attributes of the sample primitive and the primitive attributes of the sample neighboring primitives in a specified order to generate a sample primitive feature input;

[0091] Step 304 , data processing is performed on the sample primitive feature input corresponding to each sample primitive according to the primitive recognition model to obtain recognition results corresponding to each sample primitive.

[0092] In the embodiment of the present application, the recognition results corresponding to the sample primitives are the categories corresponding to the sample primitives identified by the primitive recognition model, and the above steps 301 to 304 are Figure 2 The corresponding steps 201 to 204 are similar and will not be described again here.

[0093] Step 305, training the primitive recognition model according to the recognition results corresponding to each sample primitive and the type label of each sample primitive, so that after the trained primitive recognition model is used to identify the type of each target primitive in the target drawing, each type of target primitive is clustered to represent each type of building component in the target drawing.

[0094] During the training process of the neural network model, when the recognition result corresponding to the sample is obtained, the error can be calculated through the loss function according to the recognition result and the label corresponding to the sample, and the parameters in the primitive recognition model can be updated through the back propagation algorithm based on the error value, so that the updated primitive recognition model has a more accurate recognition effect.

[0095] Once the primitive recognition model training is completed, the primitive recognition model can be used to perform Figure 2 The corresponding steps are performed to obtain target element sets of various types, thereby representing various types of building components in the target drawing.

[0096] In summary, when identifying building components in drawings, the computer device can first obtain the neighboring primitives of each target primitive within a specified range, and generate primitive feature input according to the primitive attributes of the target primitive and the neighboring primitives. At this time, the primitive feature input not only has the characteristics of the primitive itself but also has the characteristics of the primitives adjacent to the primitive. The computer device then processes the primitive feature input through the trained primitive recognition model to obtain the primitive type corresponding to each target primitive; then the computer device generates each target primitive set by clustering the primitives of the same type, and each primitive set represents each type of building component in the target drawing. The above scheme takes into account the adjacency relationship between the primitive and the adjacent primitives in the primitive recognition process, reduces the interference of other primitives on the primitive recognition, and after identifying the primitive type, clusters similar primitives into sets by clustering. The primitives in the set represent the building components of this category, and the misidentified primitive types are screened out. Therefore, the building component recognition result obtained by the above scheme has a high accuracy.

[0097] Figure 4 is a flow chart of a method for identifying a building component according to an exemplary embodiment. The method is executed by a computer device, which may be Figure 1 One of the terminal device and the server shown in . Figure 4 As shown, the building component identification method may include the following steps:

[0098] Step 401, obtaining a target drawing.

[0099] Optionally, in an embodiment of the present application, the target drawing is drawing data in dwg format obtained by designing CAD software, and the target drawing includes various layers. At this time, the computer device will obtain the graphic elements (such as coordinates, attributes, etc.) corresponding to the graphic elements of each layer in the target drawing.

[0100] Step 402: For each target graphic element in the target drawing, obtain the circumscribed rectangle of the target graphic element.

[0101] Optionally, the target graphic element may be any graphic element in the target drawing.

[0102] When the computer device obtains each target graphic element in the target drawing, it can select the graphic elements to be identified in sequence according to a certain order (for example, according to the distance from the coordinate origin), or randomly select the graphic elements to be identified.

[0103] Step 403: enlarge the bounding rectangle to a specified size, and determine the primitives intersecting with the enlarged bounding rectangle as neighboring primitives.

[0104] When a computer device needs to identify the type of a certain graphic element (i.e., a target graphic element), it can generate an outer rectangular frame corresponding to the target graphic element, and expand the length and width of the outer rectangular frame by a certain size, for example, by 1000 pixels, and the graphic elements intersecting with the enlarged outer rectangle are all neighboring graphic elements of the target graphic element.

[0105] Optionally, the specified size to which the computer device enlarges the circumscribed rectangle is related to the size of the circumscribed rectangle. For example, the computer device may enlarge the circumscribed rectangle by a certain multiple (for example, 1.5 times), that is, a larger primitive needs to pay attention to neighboring primitives within a larger range, while a smaller primitive only needs to pay attention to neighboring primitives within a smaller range.

[0106] Step 404 , the target primitive and the neighbor primitives are arranged with the target primitive as the first and the neighbor primitives according to the coordinates to obtain a target primitive sequence.

[0107] After obtaining the neighboring primitives corresponding to the target primitive, since the neighboring primitives all intersect with the enlarged circumscribed rectangle, they have a certain spatial relationship with the target primitive. Therefore, when performing type recognition on the target primitive, it is necessary to take into account the primitive features corresponding to the neighboring primitives. On the one hand, this avoids interference of the neighboring primitives in the type recognition of the target primitive. On the other hand, it increases the amount of information considered when performing type recognition on the target primitive, which can improve the recognition accuracy of the target primitive.

[0108] At this time, the computer device can arrange the target primitive and the neighboring primitives in a certain order to obtain a target primitive sequence, and subsequently generate a corresponding feature vector according to the target primitive sequence.

[0109] Optionally, the computer device may sort the target primitive and each neighboring primitive according to the relative distance from the origin coordinate (upper left corner coordinate) of the target primitive.

[0110] Optionally, after sorting the target primitive and each neighboring primitive, the computer device will take out the first n primitives in the sorted primitive list to form a target primitive sequence.

[0111] Step 405 , generating the primitive feature input according to the order of each primitive in the target primitive sequence and the primitive attribute of each primitive.

[0112] The primitive attributes include at least one of the starting point coordinates, the end point coordinates, the primitive type number, the length, the arc length, the grayscale, and the saturation.

[0113] After obtaining the target primitive sequence, the primitive attributes of each primitive in the target primitive sequence can be formed into a vector in the order of the primitives to serve as the primitive feature input. At this time, the primitive feature input includes the features of the target primitive and the neighboring primitives.

[0114] Step 406: Data processing is performed on the primitive feature input corresponding to each target primitive according to the primitive recognition model to obtain the primitive type corresponding to each target primitive.

[0115] At this time, the primitive features generated by the above steps are input and data is processed by the primitive recognition model, and the primitive recognition model can obtain the classification result corresponding to the target primitive.

[0116] The primitive recognition model in the embodiment of the present application may be a trained primitive recognition model. The primitive recognition model may be a trained primitive recognition model. Figure 3 The primitive recognition model obtained by the training method shown in the corresponding embodiment.

[0117] Step 407 , clustering the target primitives according to primitive types to obtain target primitive sets to represent the various types of building components in the target drawing.

[0118] In a possible implementation, each target primitive is clustered with the nearest primitives of the same type to obtain each primitive set;

[0119] When the clustered primitive sets do not meet the iteration condition, each clustered primitive set is clustered again with the nearest primitive set of the same type;

[0120] When the clustered primitive sets meet the iteration condition, each clustered primitive set is determined as the target primitive set.

[0121] After obtaining the primitive type of each target primitive, each target primitive can be treated as a separate category (that is, as a primitive set), and then each target primitive can be classified into the primitive set closest to the primitive, and the above operation is iterated until the iteration condition is met. At this time, each target primitive is clustered into each target primitive set according to type, and each target primitive set contains target primitives of the same type.

[0122] Optionally, when the clustered primitive set does not meet the iteration condition, the clustered primitive set can be re-clustered with the average value of each primitive in the same type of primitive set and the same type of primitive set corresponding to the smallest average value.

[0123] In a possible implementation, the iteration condition is that an average distance between target primitives in each target primitive set is less than a first threshold;

[0124] Alternatively, the iteration condition is that the average distance between the center points of each target primitive set is greater than a second threshold.

[0125] That is, in the clustering process, it is necessary to judge whether the clustering is completed by the degree of aggregation of the clustering results. One method to calculate the degree of aggregation is: average distance within a class / average distance between classes. One method to calculate the average distance within a class is: the average distance between any two graph elements in the class. One method to calculate the average distance between any two class centers is: the average distance between any two class centers. The class center can be obtained by averaging the coordinates of the center points of all graph elements in the class.

[0126] In summary, when identifying building components in drawings, the computer device can first obtain the neighboring primitives of each target primitive within a specified range, and generate primitive feature input according to the primitive attributes of the target primitive and the neighboring primitives. At this time, the primitive feature input not only has the characteristics of the primitive itself but also has the characteristics of the primitives adjacent to the primitive. The computer device then processes the primitive feature input through the trained primitive recognition model to obtain the primitive type corresponding to each target primitive; then the computer device generates each target primitive set by clustering the primitives of the same type, and each primitive set represents each type of building component in the target drawing. The above scheme takes into account the adjacency relationship between the primitive and the adjacent primitives in the primitive recognition process, reduces the interference of other primitives on the primitive recognition, and after identifying the primitive type, clusters similar primitives into sets by clustering. The primitives in the set represent the building components of this category, and the misidentified primitive types are screened out. Therefore, the building component recognition result obtained by the above scheme has a high accuracy.

[0127] Figure 5 The structure block diagram of a building component recognition device according to an exemplary embodiment is shown. The building component recognition device includes:

[0128] The target drawing acquisition module 501 is used to acquire the target drawing; the target drawing includes various graphic elements;

[0129] A neighboring primitive acquisition module 502 is used to retrieve neighboring primitives within a specified range corresponding to each target primitive in the target drawing;

[0130] A feature input generating module 503 is used to arrange the primitive attributes of the target primitive and the primitive attributes of the neighboring primitives in a specified order to generate primitive feature input;

[0131] The primitive type acquisition module 504 is used to process the primitive feature input corresponding to each target primitive according to the primitive recognition model to obtain the primitive type corresponding to each target primitive;

[0132] The clustering module 505 is used to perform clustering operations on the target primitives according to primitive types to obtain target primitive sets to represent various types of building components in the target drawing.

[0133] In a possible implementation, the clustering module is further configured to:

[0134] Cluster each target primitive with the nearest primitives of the same type to obtain primitive sets;

[0135] When the clustered primitive sets do not meet the iteration condition, each clustered primitive set is clustered again with the nearest primitive set of the same type;

[0136] When the clustered primitive sets meet the iteration condition, each clustered primitive set is determined as the target primitive set.

[0137] In a possible implementation, the iteration condition is that an average distance between target primitives in each target primitive set is less than a first threshold;

[0138] Alternatively, the iteration condition is that the average distance between the center points of each target primitive set is greater than a second threshold.

[0139] In a possible implementation, the neighboring primitive acquisition module is further configured to:

[0140] Get the bounding rectangle of the target primitive;

[0141] The bounding rectangle is enlarged to a specified size, and the graphic elements intersecting with the enlarged bounding rectangle are determined as neighboring graphic elements.

[0142] In a possible implementation, the feature input generation module is further used to:

[0143] The target primitive and the neighbor primitives are arranged with the target primitive as the first one and the neighbor primitives according to the coordinates to obtain a target primitive sequence;

[0144] The primitive feature input is generated according to the order of each primitive in the target primitive sequence and the primitive attributes of each primitive; the primitive attributes include at least one of the starting point coordinates, end point coordinates, primitive type number, length, arc length, grayscale, and saturation.

[0145] In summary, when identifying building components in drawings, the computer device can first obtain the neighboring primitives of each target primitive within a specified range, and generate primitive feature input according to the primitive attributes of the target primitive and the neighboring primitives. At this time, the primitive feature input not only has the characteristics of the primitive itself but also has the characteristics of the primitives adjacent to the primitive. The computer device then processes the primitive feature input through the trained primitive recognition model to obtain the primitive type corresponding to each target primitive; then the computer device generates each target primitive set by clustering the primitives of the same type, and each primitive set represents each type of building component in the target drawing. The above scheme takes into account the adjacency relationship between the primitive and the adjacent primitives in the primitive recognition process, reduces the interference of other primitives on the primitive recognition, and after identifying the primitive type, clusters similar primitives into sets by clustering. The primitives in the set represent the building components of this category, and the misidentified primitive types are screened out. Therefore, the building component recognition result obtained by the above scheme has a high accuracy.

[0146] Figure 6 The structure block diagram of a building component recognition device according to an exemplary embodiment is shown. The building component recognition device includes:

[0147] The sample acquisition module 601 is used to acquire a sample drawing; the sample drawing includes each sample graphic element and a type label of each sample graphic element;

[0148] A sample neighboring primitive acquisition module 602 is used to retrieve, for each sample primitive in the sample drawing, sample neighboring primitives within a specified range corresponding to the sample primitive;

[0149] A sample input generation module 603 is used to arrange the primitive attributes of the sample primitive and the primitive attributes of the sample neighboring primitives in a specified order to generate a sample primitive feature input;

[0150] The sample processing module 604 is used to process the sample primitive feature input corresponding to each sample primitive according to the primitive recognition model to obtain the recognition result corresponding to each sample primitive;

[0151] The model training module 605 is used to train the graphic element recognition model according to the recognition results corresponding to each sample graphic element and the type label of each sample graphic element, so as to perform type recognition on each target graphic element of the target drawing through the trained graphic element recognition model, and then cluster the target graphic elements of each type to represent the various types of building components in the target drawing.

[0152] In summary, when identifying building components in drawings, the computer device can first obtain the neighboring primitives of each target primitive within a specified range, and generate primitive feature input according to the primitive attributes of the target primitive and the neighboring primitives. At this time, the primitive feature input not only has the characteristics of the primitive itself but also has the characteristics of the primitives adjacent to the primitive. The computer device then processes the primitive feature input through the trained primitive recognition model to obtain the primitive type corresponding to each target primitive; then the computer device generates each target primitive set by clustering the primitives of the same type, and each primitive set represents each type of building component in the target drawing. The above scheme takes into account the adjacency relationship between the primitive and the adjacent primitives in the primitive recognition process, reduces the interference of other primitives on the primitive recognition, and after identifying the primitive type, clusters similar primitives into sets by clustering. The primitives in the set represent the building components of this category, and the misidentified primitive types are screened out. Therefore, the building component recognition result obtained by the above scheme has a high accuracy.

[0153] Figure 7 The structural block diagram of a computer device 700 shown in an exemplary embodiment of the present application is shown. The computer device can be implemented as a server in the above-mentioned solution of the present application. The computer device 700 includes a central processing unit (CPU) 701, a system memory 704 including a random access memory (RAM) 702 and a read-only memory (ROM) 703, and a system bus 705 connecting the system memory 704 and the central processing unit 701. The computer device 700 also includes a large-capacity storage device 706 for storing an operating system 709, an application program 710 and other program modules 711.

[0154] The mass storage device 706 is connected to the central processing unit 701 via a mass storage controller (not shown) connected to the system bus 705. The mass storage device 706 and its associated computer readable medium provide non-volatile storage for the computer device 700. That is, the mass storage device 706 may include a computer readable medium (not shown) such as a hard disk or a compact disc read-only memory (CD-ROM) drive.

[0155] Without loss of generality, the computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, Erasable Programmable Read Only Memory (EPROM), Electronically-Erasable Programmable Read-Only Memory (EEPROM) flash memory or other solid-state storage technology, CD-ROM, Digital Versatile Disc (DVD) or other optical storage, cassette, tape, disk storage or other magnetic storage devices. Of course, those skilled in the art will know that the computer storage medium is not limited to the above. The above-mentioned system memory 704 and mass storage device 706 can be collectively referred to as memory.

[0156] According to various embodiments of the present disclosure, the computer device 700 can also be connected to a remote computer on the network through a network such as the Internet. That is, the computer device 700 can be connected to the network 708 through the network interface unit 707 connected to the system bus 705, or the network interface unit 707 can be used to connect to other types of networks or remote computer systems (not shown).

[0157] The memory further includes at least one computer program, which is stored in the memory. The central processing unit 701 implements all or part of the steps in the methods shown in the above embodiments by executing the at least one computer program.

[0158] In an exemplary embodiment, a computer-readable storage medium is also provided, which is used to store at least one computer program, and the at least one computer program is loaded and executed by a processor to implement all or part of the steps in the above method. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0159] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above-mentioned Figures 2 to 4 All or part of the steps of the method shown in any embodiment.

[0160] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0161] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A method for identifying building components, characterized in that: The method comprises: Obtaining a target drawing; the target drawing includes various graphic elements; For each target primitive in the target drawing, extract neighboring primitives within a specified range corresponding to the target primitive; Arrange the primitive attributes of the target primitive and the primitive attributes of the neighboring primitives in a specified order to generate primitive feature input; According to the primitive recognition model, data processing is performed on the primitive feature input corresponding to each target primitive to obtain the primitive type corresponding to each target primitive; The target primitives are clustered according to primitive types to obtain target primitive sets to represent various types of building components in the target drawing.

2. The method according to claim 1, characterized in that The step of clustering the target primitives according to primitive types to obtain primitive sets includes: Cluster each target primitive with the nearest primitives of the same type to obtain primitive sets; When the clustered primitive sets do not meet the iteration condition, each clustered primitive set is clustered again with the nearest primitive set of the same type; When the clustered primitive sets meet the iteration condition, each clustered primitive set is determined as the target primitive set.

3. The method according to claim 2, characterized in that The iteration condition is that the average distance between target primitives in each target primitive set is less than a first threshold; Alternatively, the iteration condition is that the average distance between the center points of each target primitive set is greater than a second threshold.

4. The method according to any one of claims 1 to 3, characterized in that: The extracting of neighboring primitives within a specified range corresponding to the target primitive includes: Get the bounding rectangle of the target primitive; The bounding rectangle is enlarged to a specified size, and the graphic elements intersecting with the enlarged bounding rectangle are determined as neighboring graphic elements.

5. The method according to any one of claims 1 to 3, characterized in that: The step of arranging the primitive attributes of the target primitive and the primitive attributes of the neighboring primitives in a specified order to generate primitive feature input includes: The target primitive and the neighbor primitives are arranged with the target primitive as the first one and the neighbor primitives according to the coordinates to obtain a target primitive sequence; The primitive feature input is generated according to the order of each primitive in the target primitive sequence and the primitive attributes of each primitive; the primitive attributes include at least one of the starting point coordinates, end point coordinates, primitive type number, length, arc length, grayscale, and saturation.

6. A method for identifying building components, characterized in that: The method comprises: Obtaining a sample drawing; the sample drawing includes each sample graphic element and a type label of each sample graphic element; For each sample primitive in the sample drawing, extract the sample neighboring primitives within the specified range corresponding to the sample primitive; Arrange the primitive attributes of the sample primitive and the primitive attributes of the sample neighboring primitives in a specified order to generate a sample primitive feature input; According to the primitive recognition model, data processing is performed on the sample primitive feature input corresponding to each sample primitive, so as to obtain the recognition results corresponding to each sample primitive; The graphic element recognition model is trained according to the recognition results corresponding to each sample graphic element and the type label of each sample graphic element. After the trained graphic element recognition model is used to identify the type of each target graphic element in the target drawing, the target graphic elements of each type are clustered to characterize the various types of building components in the target drawing.

7. A building component identification device, characterized in that: The device comprises: A target drawing acquisition module is used to acquire a target drawing; the target drawing includes various graphic elements; A neighboring element acquisition module is used to retrieve neighboring elements within a specified range corresponding to each target element in the target drawing; A feature input generation module, used for arranging the primitive attributes of the target primitive and the primitive attributes of the neighboring primitives in a specified order to generate primitive feature input; A primitive type acquisition module, used to process the primitive feature input corresponding to each target primitive according to the primitive recognition model, and obtain the primitive type corresponding to each target primitive; The clustering module is used to perform clustering operations on the target primitives according to primitive types to obtain target primitive sets to represent various types of building components in the target drawing.

8. A building component identification device, characterized in that: The device comprises: A sample acquisition module is used to acquire a sample drawing; the sample drawing includes each sample graphic element and a type label of each sample graphic element; A sample neighboring graphic element acquisition module is used to retrieve, for each sample graphic element in the sample drawing, sample neighboring graphic elements within a specified range corresponding to the sample graphic element; A sample input generation module, used for arranging the primitive attributes of the sample primitive and the primitive attributes of the sample neighboring primitives in a specified order to generate a sample primitive feature input; The sample processing module is used to process the sample primitive feature input corresponding to each sample primitive according to the primitive recognition model to obtain the recognition result corresponding to each sample primitive; The model training module is used to train the primitive recognition model according to the recognition results corresponding to each sample primitive and the type label of each sample primitive, so as to cluster the target primitives of each type to characterize the building components of each type in the target drawing after the type recognition of each target primitive in the target drawing is performed by the trained primitive recognition model.

9. A computer device, characterized in that: The computer device comprises a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the building component identification method according to any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the building component identification method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • CAD drawing recognition method and device based on domain knowledge and target detection

    CN110909650A

  • Primitive identification method and identification device based on CAD drawing

    CN111881809A

  • In-situ label identification method and device and electronic equipment

    CN114444185A

  • Method and device for extracting layers based on primitive features

    CN114882519A

  • PCB component identification method and device

    WO2021232670A1