Drawing Recognition Method, Device, Equipment and Storage Medium

By identifying the distribution box space and branches in electrical drawings, and using network models to match text and components, the problem of not being able to correlate electrical drawing text and components in the prior art is solved, and efficient identification and correlation of electrical drawings is achieved.

CN114283433BActive Publication Date: 2025-07-25WANYI TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111328807.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-10
Publication Date
2025-07-25
Estimated Expiration
2041-11-10

AI Technical Summary

Technical Problem

In the prior art, the identification model of the electrical drawing can only recognize the component itself, but cannot recognize the text information corresponding to the component and associate it.

Method used

By identifying the distribution box space in the electrical drawings, obtaining the text and components of the branch, a pre-trained network model is used to identify the distribution box space and branches, and gradually match and associate the text and components.

Benefits of technology

The effective correlation between text and components in electrical drawings is achieved, and the accuracy and efficiency of electrical drawing recognition is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114283433B_ABST
    Figure CN114283433B_ABST
Patent Text Reader

Abstract

The present application relates to a drawing recognition method, device, equipment and storage medium. The method includes obtaining an electrical drawing to be detected; recognizing the distribution box space included in the electrical drawing; recognizing at least one branch included in the distribution box space, and any branch is an incoming line circuit or an outgoing line circuit; for any branch, obtaining M texts belonging to the branch, respectively recognizing the components matching each text in the branch, and associating the mutually matching texts and components. The present application gradually obtains the smallest unit of the text and the component with a matching relationship, that is, the branch, in the way of electrical drawing - distribution box space - branch - component / text, so that it can be quickly obtained which text in the branch matches which component based on the branch, and the mutually matching texts and components are associated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and in particular, to a method, device, equipment, and storage medium for drawing recognition. Background Art

[0002] An electrical drawing is a drawing that reflects the connection of each component in an electronic product and electronic equipment. It is an engineering language that can intuitively reflect the connection of the actual circuit. By effectively interpreting and reviewing the electrical drawing, it is possible to determine whether the relevant information on the electrical drawing meets the review standards.

[0003] In the related art, when recognizing an electrical drawing, the electrical drawing to be detected is input into a trained image recognition model to recognize each component in the electrical drawing. However, the model in the related art can only recognize the component itself, and cannot recognize the corresponding text information of the component and associate the text information with the component. Summary of the Invention

[0004] In a first aspect, a method for drawing recognition is provided, including:

[0005] Obtain an electrical drawing to be detected;

[0006] Identify the distribution box space included in the electrical drawing;

[0007] Identify at least one branch included in the distribution box space, where any one of the branches is an incoming line circuit or an outgoing line circuit;

[0008] For any one of the branches, obtain M texts belonging to the branch, and respectively identify the components in the branch that match each of the texts, and associate the mutually matching texts with the components.

[0009] Optionally, identifying the distribution box space included in the electrical drawing includes:

[0010] Express the electrical drawing in a picture format to obtain a picture drawing;

[0011] Use a pre-trained first network model to recognize the picture drawing to obtain the distribution box space.

[0012] Optionally, identifying at least one branch included in the distribution box space includes:

[0013] Identify the overall branch formed by the incoming line circuit and the outgoing line circuit in the distribution box space;

[0014] Output a branch picture indicating the overall branch;

[0015] Use the pre-trained second network model to recognize the branch pictures and obtain the at least one branch.

[0016] Optionally, obtaining M texts belonging to the branch includes:

[0017] Obtain the rectangular bounding box enclosing the branch and N texts in the sub-space of the distribution box;

[0018] From the N texts, find m first texts located within the rectangular bounding box and n second texts intersecting the rectangular bounding box;

[0019] Find the second texts from the n second texts whose overlapping degree with the rectangular bounding box meets the overlapping requirement;

[0020] Take the m first texts and the second texts that meet the overlapping requirement as the M texts.

[0021] Optionally, finding m first texts located within the rectangular bounding box and n second texts intersecting the rectangular bounding box from the N texts includes:

[0022] Obtain the coordinate intervals of each of the N texts respectively;

[0023] Find the target coordinate intervals from the coordinate intervals that have an intersection with the coordinate interval corresponding to the rectangular bounding box;

[0024] Take the texts corresponding to the target coordinate intervals as the m first texts and the n second texts.

[0025] Optionally, finding the second texts from the n second texts whose overlapping degree with the rectangular bounding box meets the overlapping requirement includes:

[0026] For any one of the n second texts, perform the following processing:

[0027] Respectively determine the intersection over union of the text rectangle of the second text and the rectangular bounding boxes of each of the at least one branch;

[0028] When it is determined based on the intersection over union that the intersection over union of the second text and the branch where the rectangular bounding box is located is the largest, determine the second text as the text whose overlapping degree with the rectangular bounding box meets the overlapping requirement.

[0029] Optionally, before finding m first texts located within the rectangular bounding box and n second texts intersecting the rectangular bounding box from the N texts, it further includes:

[0030] Amplify the rectangular bounding box.

[0031] Optionally, identifying the components in the branch that match each of the texts includes:

[0032] For any one of the texts, perform the following processing:

[0033] Identify P components in the branch;

[0034] Determine the distances between the text and each of the P components respectively;

[0035] Take the component with the minimum distance as the component that matches the text.

[0036] In a second aspect, there is provided a drawing recognition device, including:

[0037] An acquisition unit, configured to acquire an electrical drawing to be detected;

[0038] A first recognition unit, configured to recognize the distribution box sub-space included in the electrical drawing;

[0039] A second recognition unit, configured to recognize at least one branch included in the distribution box sub-space, and any one of the branches is an incoming line loop or an outgoing line loop;

[0040] An association unit, configured to, for any one of the branches, acquire M texts belonging to the branch, and respectively identify the components in the branch that match each of the texts, and associate the mutually matching texts and components.

[0041] In a third aspect, there is provided an electronic device, including: a processor, a memory, and a communication bus, wherein the processor and the memory complete mutual communication through the communication bus;

[0042] The memory is configured to store a computer program;

[0043] The processor is configured to execute the program stored in the memory to implement the drawing recognition method described in the first aspect.

[0044] In a fourth aspect, there is provided a computer-readable storage medium, storing a computer program, where when the computer program is executed by a processor, the drawing recognition method described in the first aspect is implemented.

[0045] The above technical solution provided by the embodiments of the present application has the following advantages compared with the prior art: In the technical solution provided by the embodiments of the present application, an electrical drawing to be detected is obtained; the distribution box space included in the electrical drawing is identified; at least one branch included in the distribution box space is identified, and any branch is an incoming line circuit or an outgoing line circuit; for any branch, M texts belonging to the branch are obtained, and the components matching each text in the branch are respectively identified, and the mutually matching texts and components are associated. The present application gradually obtains the smallest unit of the text and the component with the matching relationship, that is, the branch, in the way of electrical drawing - distribution box space - branch - component / text, so that it can be quickly obtained based on the branch which text in the branch matches which component, and the mutually matching texts and components are associated. Description of the Drawings

[0046] The drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present invention and used together with the specification to explain the principles of the present invention.

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.

[0048] Figure 1 It is a schematic structural diagram of the network system in the embodiments of the present application;

[0049] Figure 2 It is a schematic flowchart of a method for drawing recognition in the embodiments of the present application;

[0050] Figure 3 It is a schematic diagram of a distribution box drawing that marks the distribution box space in a box selection manner shown in the embodiments of the present application;

[0051] Figure 4 It is a schematic picture of the distribution box space shown in the embodiments of the present application;

[0052] Figure 5 It is a schematic picture of the overall branch identified in the distribution box space shown in the embodiments of the present application;

[0053] Figure 6 It is a schematic diagram of a branch picture without text shown in the embodiments of the present application;

[0054] Figure 7 It is a schematic picture marked with an outgoing line circuit shown in the embodiments of the present application;

[0055] Figure 8Another schematic flowchart of the drawing recognition method in the embodiments of the present application;

[0056] Figure 9 Schematic structural diagram of the drawing recognition device in the embodiments of the present application;

[0057] Figure 10 Schematic structural diagram of the electronic device in the embodiments of the present application. Detailed implementation manners

[0058] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the protection scope of the present application.

[0059] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and do not necessarily need to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments of the present application described here can be implemented in an order different from those illustrated or described here. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily need to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0060] First, an example is given to introduce the network system architecture to which the solutions in the embodiments of the present application may be applied.

[0061] Please refer to Figure 1 , Figure 1 which is an architecture diagram of a network system provided by the embodiments of the present application. As Figure 1 shown, the network system includes a terminal 101, a drawing review server 102, and a database 103.

[0062] Among them, the network system can be connected through a wired or wireless network, which can be a virtual private network, a local area network, a wide area network or a metropolitan area network, etc. The specific communication transmission protocol is not limited.

[0063] The terminal 101 can be used to submit the electrical drawing to be detected to the drawing review server 102 through program code or touch signals, so as to request the drawing review server 102 to execute the relevant steps of drawing recognition.

[0064] As the execution entity, in some embodiments, the drawing review server 102 may be the background server of the intelligent drawing review platform. The intelligent drawing review platform standardizes rules such as building industry design drawing review standards and automatically conducts electrical drawing reviews. The drawing review server 102 processes a series of network models by executing program code through a processor, such as constructing a convolutional neural network, etc.

[0065] The database 103 can be used to store information such as electrical drawings to be detected, picture drawings, branch pictures, first text, second text, and coordinate intervals. Developers can input conditional query statements through the terminal to extract the required information from the database 103, such as: extracting branch pictures. The database 103 can be a local database, such as Vanke's Van-Bu database, or a third-party database independent of the drawing review server 102, such as the databases of some design institutes, or it can also be a cloud database.

[0066] It should be understood that the terminal 101 in this embodiment can be a device such as a desktop computer, a tablet computer, or a supercomputer; the drawing review server 102 can be a local server, a cloud server, or a server cluster.

[0067] It should be understood, Figure 1 The shown network system architecture is only an example, and it may also include more components such as routers and switches.

[0068] Based on Figure 1 the shown network system architecture, the component recognition method proposed in the embodiments of the present application will be elaborated in detail below with reference to the relevant drawings.

[0069] In the related art, since electrical drawings usually include dozens or even hundreds of components and texts, it is difficult to find matching components and texts from a large number of components and texts.

[0070] To solve the above technical problems, the embodiments of the present application provide a drawing recognition method, as Figure 2 shown, including the following steps:

[0071] Step 201, obtain the electrical drawing to be detected.

[0072] In this embodiment, the electrical drawing to be detected is an electrical drawing containing the sub-space of the distribution box, such as the electrical drawing can be a sub-drawing of the distribution box. In the application, the sub-drawing of the distribution box usually includes multiple sub-spaces of the distribution box. Each sub-space of the distribution box includes two types of branches, namely the incoming line loop and the outgoing line loop. It should be understood that usually there is one incoming line loop and multiple outgoing line loops in a sub-space of the distribution box.

[0073] Among them, the incoming line circuit and the outgoing line circuit have a demarcation line. The outgoing line circuit starts from the intersection point of the demarcation line and the wire, with the circuit breaker as the basis for the outgoing line circuit, and the right wire end point connected to the circuit breaker as the end point, which is the length range of an outgoing line circuit. If other components are included in the middle where the circuit breaker is connected to the wire, these components also belong to the range of the outgoing line circuit. The height of the outgoing line circuit is the height of the circuit breaker. If there are other components higher than the circuit breaker, the height of these other components is taken as the height range of the outgoing line circuit. The outgoing line circuit is the branch in the distribution box space other than the outgoing line circuit. Usually, the range of the outgoing line circuit ends at the intersection point of the demarcation line and the wire.

[0074] Step 202: Identify the distribution box space included in the electrical drawing.

[0075] In a specific embodiment, the distribution box space in the electrical drawing is identified through the first network model.

[0076] Specifically, the electrical drawing is expressed in the form of a picture to obtain a picture drawing; the first pre-trained network model is used to identify the picture drawing to obtain the distribution box space.

[0077] It should be understood that the picture drawing refers to the format of the electrical drawing being in the picture format, such as the PNG format.

[0078] In this embodiment, the electrical drawing can be a CAD drawing or other two-dimensional electrical drawing formats, which are pre-stored by the user in the database 103 for direct acquisition during use.

[0079] In this embodiment, the drawing review server 101 obtains the electrical drawing from the database 103 according to the first signal triggered by the first external input device, and performs a picture printing operation on the obtained electrical drawing according to the second signal triggered by the second external input device to obtain the drawing picture corresponding to the electrical drawing.

[0080] Exemplarily, the first external input (or the second external input device) includes but is not limited to a mouse, a key keyboard, or a touch keyboard.

[0081] It should be understood that the first external input device and the second external input device can be the same type of input device or different types of input devices. This embodiment does not make specific limitations on this.

[0082] It should be understood that the drawing review server 102 expressing the electrical drawing in the picture format is actually a process of converting the format of the electrical drawing, that is, converting the electrical drawing from the drawing format to the picture format. Taking the electrical drawing as a CAD drawing and the picture format as PNG as an example, performing a picture printing operation on the electrical drawing is actually converting the electrical drawing from the dwg format to the PNG format.

[0083] In this embodiment, when training the first network model, the distribution box diagram marked with the sub-space of the distribution box is used as the training sample. When marking the sub-space of the distribution box in the distribution box diagram, the marking can be completed by selecting the sub-space of the distribution box. Please refer to Figure 3 , Figure 3 which is a schematic diagram of the distribution box diagram for marking the sub-space of the distribution box by the selection method shown in this embodiment. Among them, Figure 3 the part shown by the red rectangular box in

[0084] is the sub-space of the distribution box.

[0085] Step 203: Identify at least one branch included in the sub-space of the distribution box, and any branch is an incoming line circuit or an outgoing line circuit.

[0086] In the electrical drawing to be detected, usually in addition to the sub-space of the distribution box, there will also be information such as the remarks, name, and ID of the drawing. Please refer to Figure 4 , Figure 4 which is a schematic diagram of the picture of the sub-space of the distribution box shown in this embodiment. In order to reduce the interference caused by this information and improve the recognition accuracy, in this embodiment, the whole branch composed of the incoming line circuit and the outgoing line circuit in the sub-space of the distribution box is first recognized, and then the incoming line circuit and the outgoing line circuit are recognized one by one from the whole branch.

[0087] In a specific embodiment, recognize the whole branch composed of the incoming line circuit and the outgoing line circuit in the sub-space of the distribution box; output the branch picture indicating the whole branch; use the pre-trained second network model to recognize the branch picture to obtain at least one branch.

[0088] In the application, since the number of outgoing line circuits is uncertain, there is at least one, and there may be dozens of them. In order to prevent uneven scales when the pictures are uniformly scaled, in this embodiment, the whole branch composed of the incoming line circuit and the outgoing line circuit in the sub-space of the distribution box is recognized. Please refer to Figure 5 , Figure 5 which is a schematic diagram of the picture of the whole branch recognized in the sub-space of the distribution box shown in this embodiment.

[0089] In the application, the output branch picture indicating the whole branch may or may not contain text. There is a switch control on the drawing review server 102. Through this switch control, the user can indicate that the output branch picture contains text or does not contain text. Please refer to Figure 6 , Figure 6 which is a schematic diagram of the branch picture without text shown in this embodiment.

[0090] In this embodiment, when training the second network model for identifying the branch circuit picture, pictures marked with the appearance of a loop and the incoming loop are used as samples. Among them, when marking the appearance of a loop and the incoming loop in the samples, the marking can be completed by means of box selection. Please refer to Figure 7 , Figure 7 which is a schematic diagram of a picture marked with the appearance of a loop shown in this embodiment.

[0091] It should be understood that in this embodiment, the first network model and the second network model can be the same network model or different network models; similarly, the network model for identifying the incoming loop and the network model for identifying the outgoing loop can also be the same network model or different network models, and this embodiment does not make specific limitations in this regard.

[0092] Step 204: For any branch, obtain M texts belonging to the branch, and respectively identify the components in the branch that match each text, and associate the mutually matching texts and components.

[0093] In this embodiment, when the M texts belong to the branch, any one of the M texts can be completely located within the rectangular bounding box of the branch or intersect with the rectangular bounding box of the branch.

[0094] It should be understood that when using the box selection method to mark the samples of the second network model for training to identify the branch, the branch identified based on this second network model has a rectangular bounding box.

[0095] In a specific embodiment, when obtaining M texts belonging to the branch, obtain the rectangular bounding box surrounding the branch and N texts in the sub - space of the distribution box; from the N texts, find m first texts located within the rectangular bounding box and n second texts intersecting with the rectangular bounding box; from the n second texts, find the second texts whose overlapping degree with the rectangular bounding box meets the overlapping requirements; take the m first texts and the second texts that meet the overlapping requirements as the M texts.

[0096] In this embodiment, m first texts and n second texts can be found from the N texts based on coordinates.

[0097] Specifically, respectively obtain the coordinate intervals of each of the N texts; find the target coordinate intervals that have an intersection with the coordinate interval corresponding to the rectangular bounding box from the coordinate intervals; take the texts corresponding to the target coordinate intervals as the m first texts and the n second texts.

[0098] In the application, the coordinate interval of the text can be determined by the text bounding box surrounding the text. Specifically, take the coordinate interval of the text bounding box as the coordinate interval of the text.

[0099] It should be understood that the coordinate interval of the text having an intersection with the coordinate interval of the rectangular bounding box includes two cases: the coordinate interval of the text completely falling within the coordinate interval of the rectangular bounding box, and a part of the coordinates in the coordinate interval of the text falling within the coordinate interval of the rectangular bounding box while the other part of the coordinates not falling within the coordinate interval of the rectangular bounding box. Among them, when the coordinate interval of the text completely falls within the coordinate interval of the rectangular bounding box, it indicates that the text is the first text; when a part of the coordinates in the coordinate interval of the text falls within the coordinate interval of the rectangular bounding box while the other part of the coordinates not falling within the coordinate interval of the rectangular bounding box, it indicates that the text is the second text.

[0100] In this embodiment, specifically, the overlapping degree between the second text and the rectangular bounding box can be obtained through the intersection over union of the text bounding box of the second text and the rectangular bounding box.

[0101] In one embodiment, when determining whether the overlapping degree between the second text and the rectangular bounding box meets the overlapping requirement, it can be determined that the overlapping requirement is met when the intersection over union of the bounding box of the second text and the rectangular bounding box is greater than the intersection over union threshold. Among them, the intersection over union threshold can be determined manually based on experience or based on actual needs.

[0102] Among them, the intersection over union of the bounding box of the second text and the rectangular bounding box indicates the degree of coincidence between the bounding box of the second text and the rectangular bounding box.

[0103] In one embodiment, in order to improve the accuracy of the second text whose overlapping degree with the rectangular bounding box meets the overlapping requirement found, when searching for the second text whose overlapping degree with the rectangular bounding box meets the overlapping requirement, the intersection over union of the text and each branch is compared, the largest intersection over union is selected, and the branch corresponding to the largest intersection over union is determined to have an overlapping degree with the rectangular bounding box that meets the overlapping requirement.

[0104] Specifically, for any one of the n second texts, the following processing is performed: the intersection over union of the text rectangular box of the second text and the rectangular bounding boxes of each branch in at least one branch is determined respectively; when it is determined based on the intersection over union that the intersection over union of the second text and the branch where the rectangular bounding box is located is the largest, the second text is determined to be the text whose overlapping degree with the rectangular bounding box meets the overlapping requirement.

[0105] In this embodiment, considering that the rectangular bounding boxes of different branches usually do not overlap and are far apart, in order to improve the accuracy of the m first texts and the n second texts obtained, before searching for the m first texts and the n second texts from the N texts, the rectangular bounding boxes of the branches can also be amplified.

[0106] The following two amplification methods are provided in the application:

[0107] Coordinate amplification scheme 1 (non - table): Amplify 60 pixels upward from the upper - left corner and 250 pixels to the right from the lower - right corner.

[0108] Coordinate amplification scheme 2 (embedded table): Amplify 60 pixels upward from the upper - left corner and replace the lower - right corner coordinates with those of the lower - right corner of the embedded table.

[0109] In this embodiment, components in the branch that match each text are identified based on the nearest - neighbor principle. It should be understood that the distance between the text that satisfies the nearest - neighbor tuple and the component meets the set conditions.

[0110] In a specific embodiment, for any text, the following processing is performed: Identify P components in the branch; respectively determine the distance between the text and each component among the P components; and use the component with the minimum distance as the component that matches the text.

[0111] It should be understood that the distance between the text and the component can be specifically determined by the coordinate range of the text and the coordinate range of the component.

[0112] In the technical solution provided by the embodiment of the present application, an electrical drawing to be detected is obtained; the distribution box space included in the electrical drawing is identified; at least one branch included in the distribution box space is identified, and any branch is an incoming - line loop or an outgoing - line loop; for any branch, M texts belonging to the branch are obtained, and components in the branch that match each text are respectively identified, and the mutually - matching texts and components are associated. The present application obtains the smallest unit of the text and component with a matching relationship, that is, the branch, in the way of electrical drawing - distribution box space - branch - component / text, so that it can be quickly obtained based on the branch which text in the branch matches which component, and the mutually - matching texts and components are associated.

[0113] To more clearly describe the solution of the present application, the embodiment of the present application also provides a drawing recognition method, as Figure 8 shown in, which may include the following steps:

[0114] Step 801: Obtain the electrical drawing to be detected and identify the distribution box space included in the electrical drawing.

[0115] The electrical drawing contains multiple distribution box spaces. The CAD system drawing containing the distribution box is parsed to output a PNG picture. Each distribution box space is box - selected on the PNG picture for model training. Specifically, the yoloact - mini network model is used. After training is completed, the new electrical drawing is input into the trained model to identify the distribution box space included in the electrical drawing.

[0116] Step 802: Identify the overall incoming - line loop and outgoing - line loop in the distribution box space.

[0117] Since the number of outgoing line circuits is uncertain, with the minimum being one and the maximum being over 20 branches, to prevent uneven scales during unified image scaling, the present invention regards the input branches and output branches as a whole.

[0118] When printing the incoming line circuit and the outgoing line circuit as a whole, a flag switch can be used to include or not include text in the output picture.

[0119] Step 803: Identify each incoming line circuit or outgoing line circuit and the text in the incoming line circuit or outgoing line circuit.

[0120] The following takes the outgoing line circuit as an example for illustration, and the incoming line circuit is similar.

[0121] Identify each outgoing line circuit:

[0122] In Figure 6 , manually select each outgoing line circuit by drawing a box, export each boxed outgoing line circuit as a PNG - format picture as labeled data, and then input the picture into the model for training, so that the model learns about each boxed outgoing line circuit to obtain the feature information of the outgoing line circuit.

[0123] As follows Figure 7 , the range enclosed by each red rectangular box is an outgoing line circuit, which can be identified by the upper - left and lower - right coordinates. Among them, the range of the outgoing line circuit is: taking the intersection point of the demarcation line between the outgoing line circuit and the incoming line circuit and the wire as the starting point, the circuit breaker as the basis for the outgoing line circuit, and the right - hand wire endpoint connected to the circuit breaker as the ending point, which is the length range of an outgoing line circuit. If there are other components in the middle of the connection between the circuit breaker and the wire, these components also belong to the range of the outgoing line circuit. The height of the outgoing line circuit is the height of the circuit breaker. If there are other components higher than the circuit breaker, take the height of these other components as the height range of the outgoing line circuit.

[0124] Identification of text in the outgoing line circuit:

[0125] 1. Amplify based on the coordinate range of the outgoing line circuit

[0126] Coordinate amplification scheme one (non - table): Amplify 60 pixels upward from the upper - left corner and 250 pixels to the right from the lower - right corner.

[0127] Coordinate amplification scheme two (nested table): Amplify 60 pixels upward from the upper - left corner and replace the lower - right corner coordinate with the lower - right corner coordinate of the embedded table.

[0128] 2. Screen out the corresponding text information based on the amplified range

[0129] The outgoing line circuit is framed by a rectangular box. Isn't the text in the outgoing line circuit necessarily intersecting with the outgoing line circuit?

[0130] Judge whether the text intersects with the outgoing line loop. If so, go to the next step;

[0131] If the coordinates of the text are above the outgoing line loop, it belongs to the outgoing line loop, and the text is output; if not above the outgoing line loop, go to the next step;

[0132] Compare the text with the Intersection over Union (IOU) of each outgoing line loop, and select the maximum IOU. Then the text belongs to the outgoing line loop, and the text is output.

[0133] Note: Approximately 60 pixels is equal to the height of the text of the outgoing line loop; 250 pixels is the threshold obtained through debugging of the test drawing.

[0134] Step 804: Component identification.

[0135] The outgoing line loop of the distribution box is generally composed of a circuit breaker, a leakage circuit breaker, a contactor, a thermal relay, a straight line, text, etc.

[0136] In Figure 6 Mark the category and coordinate information of each component (determined by box selection) respectively, and establish a data set. Then use the yolov5 model to train the data set. Enable the model to learn each boxed component to obtain the feature information of each component.

[0137] Input the new picture to be recognized into the trained model for recognition, and the recognized result is identified using the category and position coordinates.

[0138] Step 805: Establish the association between each component and the text.

[0139] Bind the text in the incoming line loop or the outgoing line loop to the component based on the principle of the nearest neighbor to obtain the rule information and coordinate information of each component.

[0140] Based on the same concept, in the embodiments of the present application, a drawing recognition device is provided. The specific implementation of the device can refer to the description in the method embodiment part, and the repeated parts will not be elaborated. As Figure 9 shown, the device mainly includes:

[0141] An acquisition unit 901, configured to acquire an electrical drawing to be detected;

[0142] A first recognition unit 902, configured to recognize the distribution box sub-space included in the electrical drawing;

[0143] A second recognition unit 903, configured to recognize at least one branch included in the distribution box sub-space, and any branch is an incoming line loop or an outgoing line loop;

[0144] An association unit 904 is configured to, for any branch, obtain M texts belonging to the branch, respectively identify the components in the branch that match each text, and associate the mutually matching texts and components.

[0145] The first recognition unit 902 is configured to:

[0146] Express the electrical drawing in a picture format to obtain a picture drawing;

[0147] Use a pre-trained first network model to recognize the picture drawing to obtain the distribution box space.

[0148] The second recognition unit 903 is configured to:

[0149] Recognize the overall branch formed by the incoming line loop and the outgoing line loop in the distribution box space;

[0150] Output a branch picture indicating the overall branch;

[0151] Use a pre-trained second network model to recognize the branch picture to obtain at least one branch.

[0152] The acquisition unit 901 is configured to:

[0153] Obtain a rectangular bounding box surrounding the branch and N texts in the distribution box space;

[0154] From the N texts, find m first texts located within the rectangular bounding box and n second texts intersecting with the rectangular bounding box;

[0155] From the n second texts, find the second texts whose overlapping degree with the rectangular bounding box meets the overlapping requirement;

[0156] Use the m first texts and the second texts that meet the overlapping requirement as the M texts.

[0157] The acquisition unit 901 is configured to:

[0158] Respectively obtain the coordinate intervals of each text in the N texts;

[0159] From the coordinate intervals, find the target coordinate intervals having an intersection with the coordinate interval corresponding to the rectangular bounding box;

[0160] Use the texts corresponding to the target coordinate intervals as the m first texts and the n second texts.

[0161] The acquisition unit 901 is configured to:

[0162] For any one of the n second texts, perform the following processing:

[0163] Determine the intersection over union (IoU) between the text rectangle of the second text and the rectangular bounding box of each branch in at least one branch respectively;

[0164] When, based on the IoU, it is determined that the IoU between the second text and the branch where the rectangular bounding box is located is the largest, determine that the second text is the text whose overlapping degree with the rectangular bounding box meets the overlapping requirement.

[0165] The apparatus is further configured to:

[0166] Before finding m first texts located within the rectangular bounding box and n second texts intersecting with the rectangular bounding box from N texts, amplify the rectangular bounding box according to the outgoing line characteristics of the branch.

[0167] The association unit 904 is configured to:

[0168] For any text, perform the following processing:

[0169] Identify P components in the branch;

[0170] Determine the distance between the text and each of the P components respectively;

[0171] Take the component with the minimum distance as the component matching the text.

[0172] Based on the same concept, an electronic device is further provided in an embodiment of the present application. As Figure 10 shown, the electronic device mainly includes: a processor 1001, a memory 1002, and a communication bus 1003. Among them, the processor 1001 and the memory 1002 communicate with each other through the communication bus 1003. Among them, a program executable by the processor 1001 is stored in the memory 1002, and the processor 1001 executes the program stored in the memory 1002 to implement the following steps:

[0173] Obtain the electrical drawing to be detected;

[0174] Identify the distribution box sub-space included in the electrical drawing;

[0175] Identify at least one branch included in the distribution box sub-space, and any branch is an incoming line loop or an outgoing line loop;

[0176] For any branch, obtain M texts belonging to the branch, and respectively identify the components matching each text in the branch, and associate the mutually matching texts and components.

[0177] The communication bus 1003 mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus 1003 can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 10 it is only represented by a thick line in Figure 10 , but it does not mean that there is only one bus or one type of bus.

[0178] The memory 1002 may include a Random Access Memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor 1001.

[0179] The aforementioned processor 1001 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc., and may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0180] In another embodiment of the present application, a computer-readable storage medium is further provided. A computer program is stored in the computer-readable storage medium. When the computer program runs on a computer, the computer is enabled to execute the drawing recognition method described in the above embodiment.

[0181] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions are transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wirelessly (such as infrared, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape, etc.), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state drive), etc.

[0182] It should be noted that in this document, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.

[0183] The above are only specific embodiments of the present invention, enabling those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown herein, but rather to the broadest scope consistent with the principles and novel features claimed herein.

Claims

1. A drawing recognition method, characterized in that Including: Obtain the electrical drawing to be detected; Identify the distribution box space included in the electrical drawing; Identify at least one branch included in the distribution box space, and any one of the branches is an incoming line circuit or an outgoing line circuit; For any one of the branches, obtain M texts belonging to the branch, and respectively identify the components in the branch that match each of the texts, and associate the mutually matching texts with the components; Among them, the obtaining of M texts belonging to the branch includes: Obtain the rectangular bounding box surrounding the branch and N texts in the distribution box space; From the N texts, find m first texts located inside the rectangular bounding box and n second texts intersecting with the rectangular bounding box; Find the second texts from the n second texts whose overlapping degree with the rectangular bounding box meets the overlapping requirement; Use the m first texts and the second texts that meet the overlapping requirement as the M texts.

2. The method according to claim 1, characterized in that, Identifying the distribution box space included in the electrical drawing includes: Express the electrical drawing in picture format to obtain a picture drawing; Use a pre-trained first network model to identify the picture drawing to obtain the distribution box space.

3. The method according to claim 1, wherein Identifying at least one branch included in the distribution box space includes: Identify the overall branch formed by the incoming line circuit and the outgoing line circuit in the distribution box space; Output a branch picture indicating the overall branch; Use a pre-trained second network model to identify the branch picture to obtain the at least one branch.

4. The method according to claim 1, wherein From the N texts, finding m first texts located inside the rectangular bounding box and n second texts intersecting with the rectangular bounding box includes: Respectively obtain the coordinate intervals of each text in the N texts; Find the target coordinate intervals from the coordinate intervals that have an intersection with the coordinate interval corresponding to the rectangular bounding box; Use the texts corresponding to the target coordinate intervals as the m first texts and the n second texts.

5. The method according to claim 1, wherein Finding the second texts from the n second texts whose overlapping degree with the rectangular bounding box meets the overlapping requirement includes: For any one of the n second texts, perform the following processing: Respectively determine the intersection over union of the text rectangular box of the second text and the rectangular bounding box of each branch in the at least one branch; When it is determined based on the intersection over union that the intersection over union of the second text and the branch where the rectangular bounding box is located is the largest, determine the second text as the text whose overlapping degree with the rectangular bounding box meets the overlapping requirement.

6. The method according to claim 1, characterized in that Before finding m first texts located inside the rectangular bounding box and n second texts intersecting with the rectangular bounding box from the N texts, it further includes: Amplify the rectangular bounding box.

7. The method according to claim 1, characterized in that Respectively identifying the components in the branch that match each of the texts includes: For any one of the texts, perform the following processing: Identify P components in the branch; Respectively determine the distances between the text and each of the P components; Use the component with the smallest distance as the component that matches the text.

8. A drawing recognition device, characterized in that, Including: An acquisition unit for acquiring an electrical drawing to be detected; A first recognition unit for recognizing the distribution box space included in the electrical drawing; A second recognition unit for recognizing at least one branch included in the distribution box space, and any one of the branches being an incoming line loop or an outgoing line loop; An association unit for, for any one of the branches, acquiring M texts belonging to the branch, respectively recognizing components in the branch that match each of the texts, and associating the mutually matching texts with the components; Wherein, the acquiring M texts belonging to the branch includes: Acquiring a rectangular bounding box enclosing the branch and N texts in the distribution box space; From the N texts, searching for m first texts located within the rectangular bounding box and n second texts intersecting the rectangular bounding box; Searching for second texts among the n second texts whose overlapping degree with the rectangular bounding box meets the overlapping requirement; Taking the m first texts and the second texts meeting the overlapping requirement as the M texts.

9. An electronic device, characterized in that, Including: A processor, a memory, and a communication bus, wherein the processor and the memory complete mutual communication through the communication bus; The memory for storing a computer program; The processor for executing the program stored in the memory to implement the drawing recognition method according to any one of claims 1-7.

10. A computer-readable storage medium storing a computer program, characterized in that, The computer program, when executed by the processor, implements the drawing recognition method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Electronic drawing text matching method and apparatus, storage medium and computer device

    CN107315817A

  • Text-based component recognition method, system and device and storage medium

    CN109446885A