Method, apparatus, electronic device and storage medium for identifying graphic units in drawings

Through automated graphic element combination and similarity calculation, the problems of low efficiency and poor accuracy of graphic unit recognition in engineering drawings are solved, and efficient and accurate graphic unit recognition is achieved.

CN115082948BActive Publication Date: 2025-07-22ISOFTSTONE INFORMATION TECHNOLOGY (GROUP) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210356420.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-30
Publication Date
2025-07-22
Estimated Expiration
2042-03-30

AI Technical Summary

Technical Problem

In the prior art, the identification of graphic units in engineering drawings relies on manual statistics, and there are problems of low recognition efficiency and poor accuracy.

Method used

By obtaining the graphic elements to be identified and the standard legend in the drawing data, arrange and combine according to the composition of the standard legend, calculate the similarity, determine the graphic units that meet the preset conditions, and automatically identify the graphic units.

Benefits of technology

Improve the efficiency and accuracy of graphic unit recognition and reduce the need for manual intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115082948B_ABST
    Figure CN115082948B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose a method, apparatus, electronic device, and storage medium for identifying graphic units in drawings. The method includes: obtaining all to-be-identified graphic elements included in the drawing data, the standard legend corresponding to the to-be-identified target graphic unit, and the standard graphic elements included in the standard legend; arranging and combining the to-be-identified graphic elements according to the composition of the standard graphic elements in the standard legend to obtain multiple to-be-identified element units; determining the similarity between each to-be-identified element unit and the standard legend, and determining the to-be-identified element unit corresponding to the similarity that meets the preset similarity determination condition as the target element unit; identifying the graphic unit formed by each to-be-identified graphic element in the target element unit as the target graphic unit. It avoids relying on manual identification of graphic units in drawings and improves the efficiency and accuracy of identifying graphic units.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of engineering drawing recognition, and in particular, to a method, device, electronic device, and storage medium for recognizing graphic units in drawings. Background Art

[0002] In the engineering field, construction is usually carried out according to pre-designed drawings. During the construction process, it is usually necessary to calculate the quantity of each graphic unit in the drawing for purchase and installation.

[0003] Generally, when calculating the quantity of each graphic unit in the drawing, construction workers identify each graphic unit by eye and count the quantity of graphic units. However, this traditional manual recognition and counting method may have situations of omission or recognition error, and has low recognition efficiency and high recognition cost. Summary of the Invention

[0004] The embodiments of the present application provide a method, device, electronic device, and storage medium for recognizing graphic units in drawings to achieve the purpose of quickly recognizing graphic units in construction drawings.

[0005] In a first aspect, the embodiments of the present application provide a method for recognizing graphic units in drawings, the method including:

[0006] Obtaining all to-be-recognized graphic elements included in the drawing data, a standard legend corresponding to the to-be-recognized target graphic unit, and standard graphic elements included in the standard legend;

[0007] Arranging and combining the to-be-recognized graphic elements according to the composition of the standard graphic elements in the standard legend to obtain a plurality of to-be-recognized element units;

[0008] Determining the similarity between each to-be-recognized element unit and the standard legend, and determining the to-be-recognized element unit corresponding to the similarity that meets the preset similarity determination condition as the target element unit;

[0009] Recognizing the graphic unit formed by each to-be-recognized graphic element in the target element unit as the target graphic unit.

[0010] In a second aspect, the embodiments of the present application further provide a device for recognizing graphic units in drawings, the device for recognizing graphic units in drawings including:

[0011] An obtaining module, configured to obtain all to-be-recognized graphic elements included in the drawing data, a standard legend corresponding to the to-be-recognized target graphic unit, and standard graphic elements included in the standard legend;

[0012] A permutation and combination module, configured to perform permutation and combination on the to-be-recognized graphic elements according to the composition of the standard graphic elements in the standard legend, so as to obtain a plurality of to-be-recognized element units;

[0013] A similarity calculation module, configured to determine the similarity between each of the to-be-recognized element units and the standard legend, and determine the to-be-recognized element units corresponding to the similarities that meet the preset similarity determination condition as target element units;

[0014] An identification unit, configured to identify the graphic unit formed by each of the to-be-recognized graphic elements in the target element units as the target graphic unit.

[0015] In a third aspect, an embodiment of the present application further provides an electronic device, where the electronic device includes:

[0016] One or more processors;

[0017] A storage device, configured to store one or more programs,

[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the graphic unit recognition method in the drawing provided in any embodiment of the present application.

[0019] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and characterized in that when the program is executed by a processor, it implements the graphic unit recognition method in the drawing provided in any embodiment of the present application.

[0020] The technical solution of the embodiment of the present application obtains all the to-be-recognized graphic elements included in the drawing data, the standard legend corresponding to the to-be-recognized target graphic unit, and the standard graphic elements included in the standard legend; performs permutation and combination on the to-be-recognized graphic elements according to the composition of the standard graphic elements in the standard legend to obtain a plurality of to-be-recognized element units; determines the similarity between each of the to-be-recognized element units and the standard legend, and determines the to-be-recognized element units corresponding to the similarities that meet the preset similarity determination condition as target element units; and identifies the graphic unit formed by each of the to-be-recognized graphic elements in the target element units as the target graphic unit. It avoids relying on manual recognition of graphic units in the drawing and improves the efficiency and accuracy of recognizing graphic units. Description of the Drawings

[0021] Figure 1 It is a schematic flowchart of the graphic unit recognition method in the drawing provided in Embodiment 1 of the present application;

[0022] Figure 2 It is a schematic diagram of a standard legend provided in Embodiment 1 of the present application;

[0023] Figure 3 It is a schematic flowchart of arranging and combining the to-be-recognized graphic elements provided in the second embodiment of the present application;

[0024] Figure 4 It is a schematic flowchart of determining the similarity between the to-be-recognized element unit and the standard legend provided in the third embodiment of the present application;

[0025] Figure 5 It is a schematic diagram of the element positions of the standard legend provided in the third embodiment of the present application;

[0026] Figure 6 It is a schematic diagram of a feature vector group and eigenvalues provided in the third embodiment of the present application;

[0027] Figure 7 It is a schematic structural diagram of a graphic unit recognition device in a drawing provided in the fourth embodiment of the present application;

[0028] Figure 8 It is a schematic structural diagram of an electronic device provided in the fifth embodiment of the present application;

[0029] Figure 9 It is a schematic diagram of a standard image element provided in the first embodiment of the present application. Detailed implementation manners

[0030] The present application will be further described in detail below with reference to the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present application, rather than limiting the present application. Additionally, it should be noted that for the sake of description, only parts related to the present application are shown in the drawings rather than all the structures.

[0031] Embodiment 1

[0032] Figure 1 It is a schematic flowchart of a method for recognizing graphic units in a drawing provided in the first embodiment of the present application. This embodiment is applicable to the scenario of recognizing graphic units in a drawing. This method can be executed by a graphic unit recognition device in a drawing, and this device can be implemented in a hardware and / or software manner and is generally integrated in an electronic device such as a computer with data operation capabilities. The specific steps are as follows:

[0033] Step 101: Obtain all the to-be-recognized graphic elements included in the drawing data, the standard legend corresponding to the to-be-recognized target graphic unit, and the standard graphic elements included in the standard legend.

[0034] In this step, the drawing corresponding to the drawing data can be a process drawing, a circuit diagram, a civil engineering drawing, etc. The to-be-recognized graphic elements can be the basic elements constituting the graphic unit, such as straight line segments, curves, arcs, circles, ellipses, texts, blocks, annotations, etc.

[0035] The target graphic unit to be recognized is the graphic unit that needs to be recognized in this recognition. Generally, a standard legend is pre-configured for the graphic unit that needs to be recognized in this recognition. Relying on the standard legend, the graphic unit that meets the standard similarity with the standard legend can be recognized from the drawing data.

[0036] In a specific example, reference can be made to Figure 2 , Figure 2 , which is a schematic diagram of a standard legend provided in the first embodiment of this application. As Figure 2 shown, the standard image elements of this standard legend include an arc and two straight lines. In addition, the schematic diagram of the standard image elements can be referred to Figure 9 , Figure 9 , which is a schematic diagram table of a standard image element provided in the first embodiment of this application.

[0037] Step 102: Arrange and combine the graphic elements to be recognized according to the composition of the standard graphic elements in the standard legend to obtain multiple elements to be recognized units.

[0038] In this step, arranging and combining means combining the graphic elements to be recognized included in the drawing data according to the element composition of the standard legend. Each time a set of element compositions of the standard legend is combined, it can be regarded as an element to be recognized unit.

[0039] Still taking the example of Figure 2 as an example, Figure 2 shown, the element composition of the standard legend is an arc and two straight lines. Therefore, an arc and two straight lines can be polled from the graphic elements to be recognized included in the drawing data as a combination to form an element to be recognized unit.

[0040] It should be noted that for the specific process of arranging and combining, reference can be made to the description of the subsequent embodiments, which will not be elaborated here.

[0041] Step 103: Determine the similarity between each element to be recognized unit and the standard legend, and determine the element to be recognized unit corresponding to the similarity that meets the preset similarity determination condition as the target element unit.

[0042] In this step, the preset similarity determination condition can be greater than a preset threshold. When the similarity is greater than the preset threshold, it can be determined that it meets the preset similarity determination condition.

[0043] In addition, for the process of determining the similarity, reference can be made to the description of the subsequent embodiments, which will not be elaborated here.

[0044] Step 104: Recognize the graphic unit formed by each graphic element to be recognized in the target element unit as the target graphic unit.

[0045] In this embodiment, all the to-be-recognized graphic elements included in the drawing data, the standard legend corresponding to the to-be-recognized target graphic unit, and the standard graphic elements included in the standard legend are obtained; the to-be-recognized graphic elements are arranged and combined according to the composition of the standard graphic elements in the standard legend to obtain multiple to-be-recognized element units; the similarity between each to-be-recognized element unit and the standard legend is determined, and the to-be-recognized element unit corresponding to the similarity that meets the preset similarity determination condition is determined as the target element unit; the graphic unit formed by each to-be-recognized graphic element in the target element unit is recognized as the target graphic unit. This avoids relying on manual identification of graphic units in the drawing and improves the efficiency and accuracy of identifying graphic units.

[0046] Embodiment Two

[0047] Please refer to Figure 3 , Figure 3 which is a schematic flowchart of arranging and combining to-be-recognized graphic elements provided by Embodiment Two of this application.

[0048] As Figure 3 shown, in this embodiment, the process of arranging and combining to-be-recognized graphic elements may include:

[0049] Step 301: For any standard graphic element, search for the to-be-recognized graphic elements whose similarity to the standard graphic element meets the preset condition from all the to-be-recognized graphic elements to obtain the to-be-recognized element group corresponding to the standard graphic element.

[0050] In this step, the to-be-recognized graphic elements can be grouped first according to the element composition of the standard graphic, then the similarity between the standard graphic element and the corresponding to-be-recognized graphic element is calculated, and finally the to-be-recognized graphic elements with a similarity greater than the preset threshold are grouped into the to-be-recognized element group.

[0051] Specifically, taking one of the standard graphic elements of the standard graphic as an example, since the calculation methods of the similarity of different types of graphic elements are different, for this standard graphic element in this step, the target similarity algorithm corresponding to the standard graphic element can be determined first according to the mapping relationship between the preset graphic element type and the similarity algorithm. The mapping relationship between the preset graphic element type and the similarity algorithm can refer to Table 1 below.

[0052] Table 1

[0053] Graphic element type Similarity algorithm Arc Algorithm 1 Line Algorithm 2 Block Algorithm 3

[0054] In a specific example, if the standard image element is an arc, then according to Table 1, the corresponding target similarity algorithm can be determined as Algorithm 1.

[0055] Then, the target to-be-recognized graphic elements of the same type as the standard graphic elements can be queried from all the to-be-recognized graphic elements. It should be noted that in the drawing data, corresponding element type identifiers are set for each graphic element. For example, the type identifier for a straight line is "Line", and for an arc is "Arc", etc.

[0056] Still taking the arc as an example, when querying, only the elements with the type identifier "Arc" need to be found. Specifically, it can be to poll each to-be-recognized graphic element and sequentially determine whether the type identifier of each to-be-recognized graphic element is "Arc". If so, it is output as the query result. After the polling is completed, the target to-be-recognized graphic elements of the same type as the standard graphic elements can be queried from all the to-be-recognized graphic elements.

[0057] After finding the target to-be-recognized graphic elements of the same type, the similarity between each target to-be-recognized graphic element and the standard graphic element can be determined according to the target similarity algorithm. Since different types of graphic elements correspond to different similarity calculation methods, the following can give examples of arcs and straight lines. For other types of graphic elements, the corresponding similarity algorithm can be formulated with reference to this example.

[0058] For a straight line, its length is used to calculate its similarity. The specific formula is S n =(l n >l0? (l0 / l n ): (l n / l0)) * 100.

[0059] Among them, the meaning of this formula is to first judge whether l n is greater than l0. If it is greater, then take (l0 / l n ), if not, then take (l n / l0).

[0060] For the calculation of the straight line length, it can be achieved by means of the key point coordinates of the straight line. The specific formula can be l n =(p1.X == p2.X)? (|p1.Y - p2.Y|) : (p1.Y == p2.Y)? (|p1.X - p2.X|) : (p1.Y - p2.Y) / (p1.X - p2.X).

[0061] Among them, p1 and p2 are two key points of the straight line n. Usually, the key points of a straight line are the two endpoints of the straight line. The meaning of this formula is to judge whether the X coordinate of p1 is the same as the X coordinate of p2. If they are the same, then take the absolute value of the difference between the p1Y coordinate and the p2Y coordinate. If they are not the same, then judge whether the Y coordinate of p1 is the same as the Y coordinate of p2. If they are the same, then take the absolute value of the difference between the p1X coordinate and the p2X coordinate. Otherwise, finally take the ratio of the difference between the two points' Y coordinates to the difference between the X coordinates.

[0062] For an arc, the final similarity can be determined by means of the arc length and radius of the arc. Specifically, reference can be made to the formula S n =(l n >l0? (l0 / l n ): (l n / l0) + r n >r0? (r0 / r n ): (r n / r0)) / 2 * 100

[0063] where l0 is the length of the standard arc, l n is the length of the arc to be recognized, r0 is the radius of the standard arc, and r n is the radius of the arc to be recognized. The specific meaning of the formula can refer to the relevant explanations of the operation symbols in the foregoing formula.

[0064] Among them, the characteristic attributes of the arc include key points (the starting point p1 and the ending point p1 of the arc), the center of the circle and the radius. The calculation formula for the arc length is l n =(θ2 - θ1) * r, where θ2 - θ1 is the included angle of the arc. Generally, it can be calculated by means of the included angle between the line connecting the key point and the center of the circle and the X-axis. Specifically, the key points are the starting point and the ending point of the arc. The included angle between the line connecting the ending point and the center of the circle and the X-axis is θ2, and the included angle between the line connecting the starting point and the center of the circle and the X-axis is θ1.

[0065] After calculating the similarity, the set composed of the target graphic elements to be recognized corresponding to the similarity greater than the first preset threshold is determined as the group of elements to be recognized corresponding to the standard graphic element. It should be noted that the first preset threshold can be set according to requirements. Generally, the higher the threshold, the more accurate the recognition will be, but the fuzziness will decrease, which may lead to omissions. Therefore, setting an appropriate threshold has a great relationship with the accuracy of recognition. Preferably, it can be set to 80%.

[0066] Step 302: Arrange and combine the graphic elements to be recognized in each group of elements to be recognized according to the composition of the standard graphic elements in the standard legend, and obtain a plurality of elements to be recognized units, where the composition of the graphic elements in each element to be recognized unit is consistent with the composition of the standard graphic elements in the standard legend.

[0067] Since in the foregoing steps, for any standard graphic element, a group of elements to be recognized is formed, therefore, in this step, elements can be taken from each group of elements to be recognized according to the order of the elements within the group.

[0068] Specifically, the composition information of the standard graphic elements in the standard legend can be determined first. The composition information includes the target types of the graphic elements owned by the standard legend and the target quantities of the graphic elements of each type.

[0069] Then, for any target type, extract a target number of to-be-recognized graphic elements from the group of to-be-recognized elements corresponding to the target type. After each extraction of all the to-be-recognized graphic elements of all target types, combine all the to-be-recognized graphic elements extracted this time into a to-be-recognized element unit until all the permutation and combination results corresponding to all the composition information of the to-be-recognized graphic elements in each group of to-be-recognized elements are exhausted.

[0070] In a specific example, Figure 2 In the standard legend shown, it includes a standard graphic element of an arc type and two standard graphic elements of a straight line type. That is to say, Figure 2 The composition information of the standard legend is a standard graphic element of an arc type and two standard graphic elements of a straight line type.

[0071] Then, according to this composition information, perform multiple extractions. In the previous steps, there will be a group of to-be-recognized elements of an arc type and a group of to-be-recognized elements of a straight line type. Then, each time of extraction, one to-be-recognized graphic element can be extracted from the group of to-be-recognized elements of the arc type, and two to-be-recognized graphic elements of the straight line type can be extracted from the group of to-be-recognized elements of the straight line type.

[0072] Since Figure 2 there are two graphic elements of the straight line type in the standard legend, therefore, the elements in the group of to-be-recognized elements of the straight line type can be internally combined first, with two as a group, and all possible combinations can be formed to form a new set. Then, the group of to-be-recognized elements of the arc type is combined with the elements in the new set two by two, and multiple to-be-recognized element units can be formed.

[0073] Embodiment III

[0074] Please refer to Figure 4 , Figure 4 which is a schematic flowchart of a process for determining the similarity between a to-be-recognized element unit and a standard legend provided in Embodiment III of the present application.

[0075] As Figure 4 shown, the process for determining the similarity between a to-be-recognized element unit and a standard legend provided in this embodiment may include:

[0076] Step 401: Determine the characteristic parameters of the standard legend according to the association relationship between the standard graphic elements included in the standard legend.

[0077] In this step, the association relationship may include the positional relationship between the standard graphic elements. For the Figure 2 standard legend shown, its positional relationship may be as shown in Table 2.

[0078] Table 2

[0079] Object 1 Position relationship Object 2 Association value 87 Connected to 83 Endpoint 88 Perpendicular to 87 Center 88 Connected to 87 Center

[0080] Among them, the correspondence between the objects mentioned in Table 2 above and the standard graphic elements is shown in Table 3.

[0081] Table 3

[0082] Number Type Weight (%) 83 Arc 40 87 Line 30 88 Line 30

[0083] That is to say, the straight line 87 is connected to one of the two endpoints of the arc 83, the straight line 88 is perpendicular to the center of the straight line 87, and the straight line 88 is connected to the center of the straight line 87.

[0084] Then the positional relationship can be the arc 83, the straight line 87, and the straight line 88 in sequence. Among them, the positional relationship can be obtained by sorting the elements in a fixed direction, such as from top to bottom, from left to right, etc.

[0085] It should be noted that the weights in Table 3 are used for subsequent similarity calculation. When calculating the similarity, it is necessary to first calculate the similarity between each graphic element (the to-be-recognized graphic elements of the same type and the standard graphic elements), and then according to the weights in Table 3, perform weighted summation on each similarity to obtain the similarity between the final to-be-recognized element unit and the standard legend.

[0086] Step 402: For any to-be-recognized element unit, determine the characteristic parameters of the to-be-recognized element unit according to the association relationship between the to-be-recognized graphic elements included in the to-be-recognized element unit.

[0087] In this step, specifically, the key points of each standard graphic element of the standard legend can be obtained; according to the positional relationship, the key points of each standard graphic element are connected pairwise. Each time two key points are connected, a feature vector is obtained. After pairwise connection, multiple feature vectors are obtained; the lengths of each feature vector are obtained, and the set of the lengths of all feature vectors is determined as the characteristic parameters of the standard legend.

[0088] It should be noted that connecting the key points pairwise according to the positional relationship means performing ordered pairwise connection in a certain order.

[0089] In a specific example, reference can be made to Figure 5 , Figure 5 which is a schematic diagram of the element positions of a standard legend provided in Embodiment 3 of the present application.

[0090] Such as Figure 5As shown in the figure, the standard legend consists of three elements: the straight lines L1, L2, and the arc A, denoted as the element group En = {L1, L2, A}; among them, the straight line L1 has characteristic points {p1, p2}, the straight line L2 has characteristic points {p3, p4}, and the arc A has characteristic points {c1, p1, p2}.

[0091] Therefore, by combining the key points in pairs according to the element position relationship and connecting them, the obtained feature vector group and the corresponding eigenvalues after transformation can be referred to Figure 6 , Figure 6 which is a schematic diagram of a feature vector group and eigenvalues provided in Embodiment 3 of the present application.

[0092] Step 403: Compare the characteristic parameters of each element unit to be recognized with those of the standard legend to obtain the comparison result corresponding to each element unit to be recognized.

[0093] In this step, the characteristic parameters include the lengths of multiple feature vectors obtained by connecting key points in pairs. When making a specific comparison, for any element unit to be recognized, determine the similarity value between each length in the characteristic parameters of the standard legend and the corresponding length in the characteristic parameters of the element unit to be recognized; determine the standard deviation and the average similarity value of all similarity values, and perform variance noise reduction on the obtained similarity values based on the standard deviation and the average similarity value; average the similarity values after variance noise reduction, and determine the obtained average value as the comparison result between the characteristic parameters of the element unit to be recognized and those of the standard legend.

[0094] In a specific example, assume that the array composed of the vector lengths in the characteristic parameters of the standard legend is D n ’ = {d1’, …, d x ’}, and the array composed of the vector lengths in the characteristic parameters of the element unit to be recognized is D n = {d1, …, d x}

[0095] The similarity value calculation formula in the above step can be S n ’ = {d1 > d1’? d1’ / d1 : d1 / d1’, …, d x > d x ’? d x ’ / d x : d x / d x ’} = {s1’, …, s x ’}

[0096] The calculation formula for the similarity standard deviation can be where x is the number of elements in the array. s x is the similarity value of the corresponding eigenvalue is the average similarity value of the array

[0097] The formula for variance noise reduction is The final similarity calculation formula is

[0098] Step 404: For the comparison result of any element unit to be recognized, if the comparison result is greater than the second preset threshold, determine the element unit to be recognized as the target element unit.

[0099] Since the comparison results of all element units to be recognized, that is, the similarities, have been obtained in the previous process, in this step, the second preset threshold can be set. If the comparison result is greater than the second preset threshold, determine the element unit to be recognized as the target element unit.

[0100] Furthermore, since the graphic elements in the target element unit also have the characteristic attributes mentioned above (such as key points, etc.), the absolute spatial coordinate values, the outer bounding region relative to the legend, the parameters of the corresponding legend, the relative rotation angle, the performance consumption value, etc. of the target element unit can be calculated by means of these characteristic attributes, and the extracted data is written into an external file and output as a unified search result.

[0101] Embodiment 4

[0102] Figure 7 It is a schematic structural diagram of a graphic unit recognition device in a drawing provided by Embodiment 4 of the present application. The graphic unit recognition device provided by the embodiments of the present application can execute the graphic unit recognition method in any embodiment of the present application, and has corresponding functional modules and beneficial effects for executing the method. The device can be implemented in a software and / or hardware manner, such as Figure 7 As shown, the graphic unit recognition device in the drawing specifically includes: an acquisition module 701, a permutation and combination module 702, a similarity calculation module 703, and an identification unit 704.

[0103] Among them, the acquisition module is used to acquire all graphic elements to be recognized, the standard legend corresponding to the target graphic unit to be recognized, and the standard graphic elements included in the standard legend in the drawing data;

[0104] The permutation and combination module is used to perform permutation and combination on the graphic elements to be recognized according to the composition of the standard graphic elements in the standard legend to obtain multiple element units to be recognized;

[0105] The similarity calculation module is used to determine the similarity between each element unit to be recognized and the standard legend, and determine the element unit to be recognized corresponding to the similarity that meets the preset similarity determination condition as the target element unit;

[0106] The identification unit is used to identify the graphic unit formed by each graphic element to be recognized in the target element unit as the target graphic unit.

[0107] By obtaining all the to-be-recognized graphic elements included in the drawing data, the standard legend corresponding to the to-be-recognized target graphic unit, and the standard graphic elements included in the standard legend; arranging and combining the to-be-recognized graphic elements according to the composition of the standard graphic elements in the standard legend to obtain multiple to-be-recognized element units; determining the similarity between each to-be-recognized element unit and the standard legend, and determining the to-be-recognized element unit corresponding to the similarity that meets the preset similarity determination condition as the target element unit; identifying the graphic unit formed by each to-be-recognized graphic element in the target element unit as the target graphic unit. This avoids relying on manual identification of graphic units in the drawing and improves the efficiency and accuracy of identifying graphic units.

[0108] Furthermore, the arrangement and combination module includes:

[0109] A search unit, which is used to search for the to-be-recognized graphic elements whose similarity with any standard graphic element meets the preset condition from all the to-be-recognized graphic elements, and obtain the to-be-recognized element group corresponding to the standard graphic element;

[0110] An arrangement and combination unit, which is used to arrange and combine the to-be-recognized graphic elements in each to-be-recognized element group according to the composition of the standard graphic elements in the standard legend to obtain multiple to-be-recognized element units, where the composition of the graphic elements in each to-be-recognized element unit is the same as the composition of the standard graphic elements in the standard legend.

[0111] Furthermore, the search unit includes:

[0112] A first determination subunit, which is used to determine the target similarity algorithm corresponding to any standard graphic element according to the mapping relationship between the preset graphic element type and the similarity algorithm;

[0113] A query subunit, which is used to query the target to-be-recognized graphic elements of the same type as the standard graphic element from all the to-be-recognized graphic elements;

[0114] A second determination subunit, which is used to determine the similarity between each target to-be-recognized graphic element and the standard graphic element according to the target similarity algorithm;

[0115] A set composition subunit, which is used to determine the set formed by the target to-be-recognized graphic elements corresponding to the similarity greater than the first preset threshold as the to-be-recognized element group corresponding to the standard graphic element.

[0116] Furthermore, the arrangement and combination unit includes:

[0117] A third determination subunit, which is used to determine the composition information of the standard graphic elements in the standard legend, and the composition information includes the target type of the graphic elements owned by the standard legend and the target quantity of each type of graphic elements;

[0118] An extraction subunit, configured to extract a target number of to-be-recognized graphic elements from a group of to-be-recognized elements corresponding to any target type for any target type;

[0119] A combination subunit, configured to, after all the to-be-recognized graphic elements of all target types are extracted each time, combine all the to-be-recognized graphic elements extracted this time into a to-be-recognized element unit until all the permutation and combination results corresponding to all the composition information of the to-be-recognized graphic elements in each group of to-be-recognized elements are exhausted.

[0120] Further, the similarity calculation module includes:

[0121] A first determination unit, configured to determine the characteristic parameters of the standard legend according to the association relationship between the standard graphic elements included in the standard legend;

[0122] A second determination unit, configured to determine the characteristic parameters of the to-be-recognized element unit according to the association relationship between the to-be-recognized graphic elements included in the to-be-recognized element unit for any to-be-recognized element unit;

[0123] A difference comparison unit, configured to perform a difference comparison on the characteristic parameters of each to-be-recognized element unit and the characteristic parameters of the standard legend to obtain a comparison result corresponding to each to-be-recognized element unit;

[0124] A third determination unit, configured to, for the comparison result of any to-be-recognized element unit, if the comparison result is greater than a second preset threshold, determine the to-be-recognized element unit as a target element unit.

[0125] Further, the association relationship includes the positional relationship between the standard graphic elements;

[0126] The second determination unit includes:

[0127] An acquisition subunit, configured to acquire the key points of each standard graphic element of the standard legend;

[0128] A connection subunit, configured to connect the key points of each standard graphic element pairwise according to the positional relationship, and obtain a feature vector each time two key points are connected. After pairwise connection, a plurality of feature vectors are obtained;

[0129] A length calculation subunit, configured to calculate the lengths of the respective feature vectors and determine the set of the lengths of all the feature vectors as the characteristic parameters of the standard legend.

[0130] Further, the characteristic parameters include the lengths of the respective feature vectors obtained by pairwise connection of the key points;

[0131] The difference comparison unit includes:

[0132] A fourth determination subunit, configured to determine, for any element unit to be recognized, a similarity value between each length in the characteristic parameters of the standard legend and the corresponding length in the characteristic parameters of the element unit to be recognized;

[0133] A variance noise reduction subunit, configured to determine the standard deviation and the similarity average value of all similarity values, and perform variance noise reduction on the obtained similarity values based on the standard deviation and the similarity average value;

[0134] A fifth determination subunit, configured to average the similarity values after variance noise reduction, and determine the obtained average value as the comparison result between the characteristic parameters of the element unit to be recognized and the characteristic parameters of the standard legend.

[0135] Embodiment 5

[0136] Figure 8 is a schematic structural diagram of an electronic device provided in Embodiment 5 of the present application. As Figure 8 shown, the electronic device includes a processor 810, a memory 820, an input device 830, and an output device 840; the number of processors 810 in the electronic device may be one or more, Figure 8 and one processor 810 is taken as an example herein; the processor 810, the memory 820, the input device 830, and the output device 840 in the electronic device may be connected through a bus or other means, Figure 8 and the connection through the bus is taken as an example herein.

[0137] The memory 820, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as program instructions / modules corresponding to the method for recognizing graphic units in the drawings in the embodiments of the present application (for example, the extraction module 701, the first determination module 702, and the second determination module 703 in the graphic unit recognition device in the drawings). The processor 810 executes various functional applications and data processing of the electronic device by running the software programs, instructions, and modules stored in the memory 820, that is, implements the above-mentioned method for recognizing graphic units in the drawings.

[0138] That is, obtain all graphic elements to be recognized, the standard legend corresponding to the target graphic unit to be recognized, and the standard graphic elements included in the standard legend contained in the drawing data;

[0139] Arrange and combine the graphic elements to be recognized according to the composition of the standard graphic elements in the standard legend to obtain multiple element units to be recognized;

[0140] Determine the similarity between each element unit to be recognized and the standard legend, and determine the element unit to be recognized corresponding to the similarity that meets the preset similarity determination condition as the target element unit;

[0141] Identify the graphic unit formed by each graphic element to be recognized in the target element unit as the target graphic unit.

[0142] The memory 820 may mainly include a program storage area and a data storage area. Among them, the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 820 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some instances, the memory 820 may further include a memory remotely provided with respect to the processor 810, and these remote memories may be connected to the electronic device through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0143] The input device 830 may be used to receive the input power construction drawings and generate key signal inputs related to the user settings and function control of the electronic device. The output device 840 may include a display device such as a display screen.

[0144] Embodiment Six

[0145] Embodiment Six of the present application further provides a storage medium containing computer-executable instructions, and the computer-executable instructions are used to execute a method for identifying graphic units in a drawing when executed by a computer processor. The method includes:

[0146] Obtain all graphic elements to be recognized included in the drawing data, the standard legend corresponding to the target graphic unit to be recognized, and the standard graphic elements included in the standard legend;

[0147] Arrange and combine the graphic elements to be recognized according to the composition of the standard graphic elements in the standard legend to obtain a plurality of element units to be recognized;

[0148] Determine the similarity between each element unit to be recognized and the standard legend, and determine the element unit to be recognized corresponding to the similarity that meets the preset similarity determination condition as the target element unit;

[0149] Identify the graphic unit formed by each graphic element to be recognized in the target element unit as the target graphic unit.

[0150] Of course, for a storage medium containing computer-executable instructions provided in the embodiments of the present application, the computer-executable instructions are not limited to the above method operations, and may also execute related operations in the method for identifying graphic units in a drawing provided in any embodiment of the present application.

[0151] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software and necessary general hardware. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disc of a computer, etc., including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of various embodiments of this application.

[0152] It should be noted that in the embodiments of the above search device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of mutual distinction and do not limit the protection scope of this application.

[0153] Note that the above is only the preferred embodiment of this application and the applied technical principle. Those skilled in the art will understand that this application is not limited to the specific embodiments here. Various obvious changes, re-adjustments, and substitutions can be made by those skilled in the art without departing from the protection scope of this application. Therefore, although this application has been described in more detail through the above embodiments, this application is not limited to the above embodiments. Without departing from the concept of this application, more other equivalent embodiments can be included, and the scope of this application is determined by the scope of the appended claims.

Claims

1. A method for identifying graphic units in drawings, characterized in that The method includes: Obtaining all the to-be-recognized graphic elements included in the drawing data, the standard legend corresponding to the to-be-recognized target graphic unit, and the standard graphic elements included in the standard legend; Arranging and combining the to-be-recognized graphic elements according to the composition of the standard graphic elements in the standard legend to obtain a plurality of to-be-recognized element units; Determining the similarity between each to-be-recognized element unit and the standard legend according to the association relationship between the standard graphic elements included in the standard legend and the association relationship between the to-be-recognized graphic elements included in the to-be-recognized element unit, and determining the to-be-recognized element unit corresponding to the similarity that meets the preset similarity determination condition as the target element unit; Recognizing the graphic unit formed by each to-be-recognized graphic element in the target element unit as the target graphic unit.

2. The method according to claim 1, wherein The arranging and combining the to-be-recognized graphic elements according to the composition of the standard graphic elements in the standard legend to obtain a plurality of to-be-recognized element units includes: For any standard graphic element, searching for the to-be-recognized graphic elements whose similarity with the standard graphic element meets the preset condition from all the to-be-recognized graphic elements to obtain the to-be-recognized element group corresponding to the standard graphic element; Arranging and combining the to-be-recognized graphic elements in each to-be-recognized element group according to the composition of the standard graphic elements in the standard legend to obtain a plurality of to-be-recognized element units, wherein the composition of the graphic elements in each to-be-recognized element unit is consistent with the composition of the standard graphic elements in the standard legend.

3. The method according to claim 2, characterized in that, The for any standard graphic element, searching for the to-be-recognized graphic elements whose similarity with the standard graphic element meets the preset condition from all the to-be-recognized graphic elements to obtain the to-be-recognized element group corresponding to the standard graphic element includes: For any standard graphic element, determining the target similarity algorithm corresponding to the standard graphic element according to the mapping relationship between the preset graphic element type and the similarity algorithm; Querying the target to-be-recognized graphic elements of the same type as the standard graphic element from all the to-be-recognized graphic elements; Determining the similarity between each target to-be-recognized graphic element and the standard graphic element according to the target similarity algorithm; Determining the set composed of the target to-be-recognized graphic elements corresponding to the similarity greater than the first preset threshold as the to-be-recognized element group corresponding to the standard graphic element.

4. The method according to claim 2, characterized in that, The arranging and combining the to-be-recognized graphic elements in each to-be-recognized element group according to the composition of the standard graphic elements in the standard legend to obtain a plurality of to-be-recognized element units includes: Determining the composition information of the standard graphic elements in the standard legend, where the composition information includes the target type of the graphic elements owned by the standard legend and the target quantity of the graphic elements of each type; For any target type, extracting the target quantity of to-be-recognized graphic elements from the to-be-recognized element group corresponding to the target type; After extracting all the to-be-recognized graphic elements of all target types each time, combine all the to-be-recognized graphic elements extracted this time into a to-be-recognized element unit until all the permutation and combination results corresponding to the composition information of the to-be-recognized graphic elements in each to-be-recognized element group are exhausted.

5. The method according to claim 1, wherein Determining the similarity between each of the to-be-recognized element units and the standard legend, and determining the to-be-recognized element units corresponding to the similarities that meet the preset similarity determination conditions as target element units, includes: Determine the characteristic parameters of the standard legend according to the association relationship between the standard graphic elements included in the standard legend; For any one of the to-be-recognized element units, determine the characteristic parameters of the to-be-recognized element unit according to the association relationship between the to-be-recognized graphic elements included in the to-be-recognized element unit; Perform a difference comparison between the characteristic parameters of each of the to-be-recognized element units and the characteristic parameters of the standard legend to obtain the comparison results corresponding to each of the to-be-recognized element units; For the comparison result of any one of the to-be-recognized element units, if the comparison result is greater than the second preset threshold, determine the to-be-recognized element unit as a target element unit.

6. The method according to claim 5, wherein The association relationship includes the positional relationship between standard graphic elements; The determining the characteristic parameters of the standard legend according to the association relationship between the standard graphic elements included in the standard legend includes: Obtain the key points of each of the standard graphic elements of the standard legend; Connect the key points of each of the standard graphic elements pairwise according to the positional relationship. Each time two key points are connected, a feature vector is obtained. After pairwise connection, multiple feature vectors are obtained; Calculate the lengths of each feature vector, and determine the set of the lengths of all feature vectors as the characteristic parameters of the standard legend.

7. The method according to claim 5, wherein The characteristic parameters include the lengths of the multiple feature vectors obtained by pairwise connection of key points; The performing a difference comparison between the characteristic parameters of each of the to-be-recognized element units and the characteristic parameters of the standard legend to obtain the comparison results corresponding to each of the to-be-recognized element units includes: For any one of the to-be-recognized element units, determine the similarity value between each length in the characteristic parameters of the standard legend and the corresponding length in the characteristic parameters of the to-be-recognized element unit; Determine the standard deviation and the similarity average value of all the similarity values, and perform variance denoising on the obtained similarity values based on the standard deviation and the similarity average value; Average the similarity values after variance denoising, and determine the obtained average value as the comparison result between the characteristic parameters of the to-be-recognized element unit and the characteristic parameters of the standard legend.

8. A graphic unit recognition device in a drawing, characterized in that The device includes: An acquisition module, configured to acquire all the to-be-recognized graphic elements included in the drawing data, the standard legend corresponding to the to-be-recognized target graphic unit, and the standard graphic elements included in the standard legend; A permutation and combination module, configured to perform permutation and combination on the to-be-recognized graphic elements according to the composition of the standard graphic elements in the standard legend to obtain multiple to-be-recognized element units; A similarity calculation module, configured to determine the similarity between each of the to-be-recognized element units and the standard legend according to the association relationships between the standard graphic elements included in the standard legend and the association relationships between the to-be-recognized graphic elements included in the to-be-recognized element units, and determine the to-be-recognized element units corresponding to the similarities that meet the preset similarity determination conditions as target element units; An identification unit, configured to identify the graphic unit formed by each of the to-be-recognized graphic elements in the target element unit as the target graphic unit.

9. An electronic device, characterized in that, The electronic device includes: One or more processors; A storage device, configured to store one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method for identifying graphic units in the drawings as described in any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method for identifying graphic units in the drawings as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Legender identification method, computer equipment and readable storage medium

    CN112990092A