A computer vision-based electrical wiring diagram recognition system and method

Through computer vision technology, combined with RPN and yolov5 object detection network algorithm and DBNet algorithm, the automated recognition of electrical wiring diagrams is realized, solving the cumbersome and high cost problems of traditional drawing methods, and improving the recognition speed and accuracy.

CN116403235BActive Publication Date: 2025-07-11ANHUI JIYUAN SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310234582.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-07
Publication Date
2025-07-11
Estimated Expiration
2043-03-07

AI Technical Summary

Technical Problem

Traditional electrical wiring diagram drawing and management methods are cumbersome, prone to missing attributes and association errors, and real-time updates require high labor costs and lack of automated identification solutions.

Method used

The electrical wiring diagram recognition system based on computer vision is adopted, including the element detection module, the text extraction module, the text association module and the information matching module. The element detection is performed using the RPN and yolov5 object detection network algorithms, and the DBNet algorithm performs text extraction, and the busbar is identified through template matching.

Benefits of technology

It realizes automatic identification of electrical wiring diagrams, improves identification speed and accuracy, reduces labor costs, and ensures standardization and real-time updates of wiring diagrams.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116403235B_ABST
    Figure CN116403235B_ABST
Patent Text Reader

Abstract

This application relates to a computer vision-based electrical wiring diagram recognition system and method. Specifically, the system includes a graphic element detection module, a text extraction module, a text association module, and an information matching module. Specifically, the graphic element detection module performs object detection on the electrical wiring diagram to obtain the graphic elements in the electrical wiring diagram; the text extraction module extracts text from the electrical wiring diagram to obtain the text in the electrical wiring diagram; the text association module matches the center points of the detection frames of the graphic elements detected by the graphic element detection module with the text frames of the text extracted by the text extraction module; the information matching module performs template matching on the busbars in the electrical wiring diagram. Through this application, the problem of how to automatically recognize electrical wiring diagrams is solved, the automation of electrical wiring diagram recognition is realized, multiple system modules with different tasks are cascaded and nested, and the speed and accuracy of recognition are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a computer vision-based electrical wiring diagram recognition system and method. Background Art

[0002] In recent years, with the development of the economy and society, the contradiction between the development speed of the distribution network and the power supply needs of power users and the need for lean management of the distribution network has become increasingly prominent. How to ensure the safe operation of the distribution network and the reliable power supply of users is the core, to carry out the data source management and terminal integration of the distribution network, to open up the "dead end" of the distribution network information, and to make the distribution network work observable, judgeable and controllable through in-depth data mining and analysis, which is the new development direction of the distribution network management model in the future.

[0003] The traditional drawing and management of wiring diagrams has high requirements for power grid staff. For example, dispatching and operation maintenance personnel need to use manual drawing and input methods, refer to the original design of the plant wiring diagram to draw the screen and carry out electrical equipment modeling work. However, due to the complex graphic style and the large number of equipment types, the maintenance work is cumbersome, and it is very easy to have attribute missing, association errors, and virtual connection of connecting lines. Therefore, the traditional way of drawing distribution network wiring drawings is likely to lead to a lack of standardization of plant wiring diagrams, which in turn creates potential risks; at the same time, due to the construction of new networks, renovation of old lines, mode changes, maintenance, etc., the component composition and connection method of the main wiring often change. To achieve real-time updates of plant wiring diagrams, it requires high labor costs and management costs.

[0004] Currently, no effective solution has been proposed for the problem of how to automatically identify electrical wiring diagrams in related technologies. Summary of the invention

[0005] The embodiments of the present application provide a computer vision-based electrical wiring diagram recognition system and method to at least solve the problem of how to automatically recognize electrical wiring diagrams in the related art.

[0006] In a first aspect, an embodiment of the present application provides an electrical wiring diagram recognition system based on computer vision, the system comprising a graphic element detection module, a text extraction module, a text association module and an information matching module;

[0007] The graphic element detection module is used to perform target detection on the electrical wiring diagram to obtain graphic elements in the electrical wiring diagram;

[0008] The text extraction module is used to extract text from the electrical wiring diagram to obtain text in the electrical wiring diagram;

[0009] The text association module is used to perform center point matching between the detection boxes of the graphic elements detected by the graphic element detection module and the text boxes of the text extracted by the text extraction module;

[0010] The information matching module is used to perform template matching on the busbars in the electrical wiring diagram.

[0011] In some embodiments, performing object detection on the electrical wiring diagram includes:

[0012] Performing object detection on the electrical wiring diagram through a model based on the Region Proposal Network (RPN) algorithm; or, performing object detection on the electrical wiring diagram through a model based on the YOLOv5 object detection network algorithm.

[0013] In some embodiments, performing text extraction on the electrical wiring diagram to obtain the text in the electrical wiring diagram includes:

[0014] Performing text extraction on the electrical wiring diagram through a model based on the DBNet text detection algorithm to obtain the text in the electrical wiring diagram.

[0015] In some embodiments, performing text extraction on the electrical wiring diagram through a model based on the DBNet text detection algorithm to obtain the text in the electrical wiring diagram includes:

[0016] Using the extraction layer of the CNN network to extract the image features of the electrical wiring diagram, and performing feature fusion on the image features through a feature pyramid;

[0017] Based on the feature map after feature fusion, calculating a binary feature map through a differentiable binarization algorithm, and generating a text box of the text in the electrical wiring diagram on the binary feature map.

[0018] In some embodiments, performing center point matching between the detection boxes of the graphic elements detected by the graphic element detection module and the text boxes of the text extracted by the text extraction module includes:

[0019] Obtaining the four corner point coordinates of the graphic element detection box detected by the graphic element detection module, and calculating the center point coordinates of the graphic element detection box according to the four corner point coordinates;

[0020] Obtaining the four corner point coordinates of the text box of the text extracted by the text extraction module, and calculating the center point coordinates of the text box according to the four corner point coordinates;

[0021] According to the center point coordinates of the graphic element detection box and the center point coordinates of the text box, complete the one-to-one association between the graphic elements and the text in the electrical wiring diagram.

[0022] In some of these embodiments, performing template matching on the busbars in the electrical wiring diagram includes:

[0023] Covering a preset position in the electrical wiring diagram with white pixels, where the preset position is the position of the graphic detection frame obtained by the graphic detection module and the position of the text frame obtained by the text extraction module;

[0024] Performing busbar matching on the covered electrical wiring diagram using a preset template to obtain the busbars of the electrical wiring diagram.

[0025] In some of these embodiments, before performing busbar matching on the covered electrical wiring diagram using a preset template, it further includes:

[0026] Using the Canny operator to perform edge detection and extraction on the template image to obtain the edge information of the preset template and the gradients in the horizontal and vertical directions;

[0027] Calculating the gradient values and directions of each boundary point in the preset template based on the edge information and the gradients in the two directions.

[0028] In some of these embodiments, the information matching module traverses the graphics in the electrical wiring diagram by means of proximity matching based on the busbars after template matching to obtain the topological information between the graphics in the electrical wiring diagram.

[0029] In some of these embodiments, before performing object detection on the electrical wiring diagram using a model based on the yolov5 object detection network algorithm, it further includes:

[0030] Manually annotating the graphics in the training data;

[0031] Training a model based on the yolov5 object detection network algorithm using the manually annotated training data.

[0032] In a second aspect, an embodiment of the present application provides a method for identifying an electrical wiring diagram based on computer vision, the method including:

[0033] Performing object detection on the electrical wiring diagram to obtain the graphics in the electrical wiring diagram;

[0034] Performing text extraction on the electrical wiring diagram to obtain the text in the electrical wiring diagram;

[0035] Matching the center points of the detection frames of the graphics detected by the graphic detection module with the text frames of the text extracted by the text extraction module;

[0036] Performing template matching on the busbars in the electrical wiring diagram.

[0037] Compared with the related art, an electrical wiring diagram recognition system and method based on computer vision provided by an embodiment of the present application, wherein a primitive detection module performs object detection on an electrical wiring diagram to obtain primitives in the electrical wiring diagram; a text extraction module extracts text from the electrical wiring diagram to obtain text in the electrical wiring diagram; a text association module matches the center points of the detection frames of the primitives detected by the primitive detection module with the text frames of the text extracted by the text extraction module; an information matching module performs template matching on the busbars in the electrical wiring diagram. Through the primitive detection module, the text extraction module, the text association module and the information matching module, the problem of how to automatically recognize an electrical wiring diagram is solved, the automation of electrical wiring diagram recognition is realized, and a system module with multiple different tasks is cascaded and nested, improving the recognition speed and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments and descriptions thereof of the present application are used to explain the present application and do not constitute an improper limitation to the present application. In the drawings:

[0039] Figure 1 is a structural block diagram of an electrical wiring diagram recognition system based on computer vision according to an embodiment of the present application;

[0040] Figure 2 is a schematic training process diagram of a yolov5 object detection model according to an embodiment of the present application;

[0041] Figure 3 is a schematic process diagram of extracting primitive topology information in an electrical wiring diagram according to an embodiment of the present application;

[0042] Figure 4 is an internal structural schematic diagram of an electronic device according to an embodiment of the present application.

[0043] Reference numerals in the drawings: 11, primitive detection module; 12, text extraction module; 13, text association module; 14, information matching module. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0044] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be described and explained below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. Based on the embodiments provided by the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present application.

[0045] Obviously, the accompanying drawings in the following description are only some examples or embodiments of the present application. For those of ordinary skill in the art, without creative efforts, the present application can also be applied to other similar scenarios based on these drawings. In addition, it can also be understood that although the efforts made in such a development process may be complex and lengthy, for those of ordinary skill in the art related to the content disclosed in the present application, some design, manufacturing, or production changes based on the technical content disclosed in the present application are only conventional technical means and should not be understood as the content disclosed in the present application being insufficient.

[0046] In the present application, the mention of "embodiment" means that the specific features, structures, or characteristics described in connection with the embodiment can be included in at least one embodiment of the present application. The appearance of this phrase at various positions in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those of ordinary skill in the art explicitly and implicitly understand that the embodiments described in the present application can be combined with other embodiments without conflict.

[0047] Unless otherwise defined, the technical terms or scientific terms involved in the present application should have the ordinary meaning understood by those of ordinary skill in the technical field to which the present application belongs. The terms "a", "an", "one kind", "the", and other similar words involved in the present application do not indicate a limitation in quantity and can represent a singular or plural number. The terms "including", "comprising", "having", and any variations thereof involved in the present application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include unlisted steps or units, or may further include other steps or units inherent to these processes, methods, products, or devices. The terms "connected", "coupled", and other similar words involved in the present application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The term "a plurality" involved in the present application refers to two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships may exist. For example, "A and / or B" may represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after. The terms "first", "second", "third", etc. involved in the present application are only used to distinguish similar objects and do not represent a specific order for the objects.

[0048] The embodiment of the present application provides an electrical wiring diagram recognition system based on computer vision. Figure 1 It is a structural block diagram of the electrical wiring diagram recognition system based on computer vision according to the embodiment of the present application, asFigure 1 As shown in Figure 1 , the system includes a graphic element detection module 11, a text extraction module 12, a text association module 13, and an information matching module 14;

[0049] The graphic element detection module 11 is used to perform object detection on the electrical wiring diagram to obtain the graphic elements in the electrical wiring diagram (such as graphic elements of various distribution equipment such as circuit breakers, load switches, disconnectors, fuses, distributed photovoltaics, and low-voltage distributed photovoltaics);

[0050] Specifically, the graphic element detection module 11 performs object detection on the electrical wiring diagram through a model based on the RPN region proposal network algorithm; or performs object detection on the electrical wiring diagram through a model based on the yolov5 object detection network algorithm.

[0051] It should be noted that object detection algorithms based on deep learning are currently mainly divided into two categories: one-stage detection algorithms (one-shot) and two-stage detection algorithms (two-shot). Among them, the two-stage detection algorithm will first generate detection frames to be detected (RPN algorithm, Region Proposal Networks) and then send the content in the generated detection frames to the detector for detection. This algorithm has high accuracy but slow detection speed; in the one-stage detection algorithm, grid generation and detection are performed synchronously without waiting to generate detection frames first, so the speed is faster but the accuracy is slightly lower.

[0052] Since object detection, as part of the graphic element recognition task, has relatively high requirements for both speed and accuracy. Based on this situation, the present invention preferably uses the yolov5 object detection network that can balance speed and accuracy to detect the picture. Further, yolov5 uses the Pytorch framework. Different from the static computational graph of tensorflow, the computational graph of pytorch is dynamic and can be changed in real time according to the calculation needs. And yolov5 can also control the network size by changing the network depth parameter.

[0053] Before the graphic element detection module 11 performs the graphic element recognition task through the yolov5 object detection model, the yolov5 object detection model also needs to be trained. The training process is as follows:

[0054] Manually label the graphic elements in the training data. Preferably, the labeling content includes the substation voltage level, substation name, substation type, graphic element type and coordinates, text content and coordinates, connections between graphic elements, and connection relationships between graphic elements and text. Among them, the connection relationship between graphic elements should indicate the terminal numbers of the graphic elements, such as terminal 0, terminal 1, etc. If the graphic element recognition type is a transformer, the winding information of the transformer should also be clearly labeled.

[0055] Figure 2It is a schematic diagram of the training process of the YOLOv5 object detection model according to an embodiment of the present application. As Figure 2 shown, the training data after manual annotation will first pass through the backbone network to extract features, and then the extracted feature maps will be sent to the neck layer for feature fusion. The purpose is to enable the network to learn more effective features. After fusing the feature maps at multiple scales, they will be passed into the detector for grid detection to determine whether the loss function converges. If the gradient of the loss function has converged, it means that the network has learned a set of relatively reasonable parameters and can correctly detect the objects in the image. If it has not converged, iterative training needs to be continued to update the parameters. After training is completed, using this model can complete the primitive inference of the wiring diagram, and the output result is all the existing known primitives in a wiring diagram.

[0056] The text extraction module 12 is used to extract text from the electrical wiring diagram to obtain the text in the electrical wiring diagram;

[0057] Specifically, the text extraction module 12 extracts text from the electrical wiring diagram through a model based on the DBNet text detection algorithm to obtain the text in the electrical wiring diagram.

[0058] It should be noted that the DBNet network uses a differentiable binarization algorithm to improve the training process, and uses a variational approximation method to approximate the non-differentiable binarization function, so as to speed up the inference speed during training without excessive loss of accuracy. The CNN network extraction layer is used to extract the image features of the input backbone network, and then feature fusion is performed through the feature pyramid. The fused feature maps are used for probability map prediction and threshold map prediction, and then the differentiable binarization algorithm is used to calculate the approximate binary feature map. Finally, detection boxes are generated at the corresponding positions of the binary feature map, and the corresponding text positions (text boxes) and probabilities can be output.

[0059] The text association module 13 is used to match the center points of the detection boxes of the primitives detected by the primitive detection module 11 with the text boxes of the text extracted by the text extraction module 12;

[0060] Specifically, the text association module 13 obtains the four corner point coordinates of the primitive detection box detected by the primitive detection module 11, and calculates the center point coordinates of the primitive detection box according to the four corner point coordinates; obtains the four corner point coordinates of the text box of the text extracted by the text extraction module 12, and calculates the center point coordinates of the text box of the text according to the four corner point coordinates;

[0061] Based on the center point coordinates of the graphic element detection frame and the center point coordinates of the text text box, the one-to-one association between the graphic elements and the text in the electrical wiring diagram is completed. Preferably, the Euclidean distance is used to traverse and calculate the pairwise distances between the center points of the text text box and the graphic element detection frame, and the text text box and the graphic element detection frame corresponding to the two center points with the closest Euclidean distance are paired to form a corresponding detection pair.

[0062] In addition, the association information of the graphic elements and the text, including the graphic element category information, text information, rotation angle information, and link information, can be output and saved in a specified format file for convenient invocation.

[0063] The information matching module 14 is used to perform template matching on the busbars in the electrical wiring diagram.

[0064] Specifically, the information matching module 14 covers the preset positions in the electrical wiring diagram with white pixels, where the preset positions are the positions of the graphic element detection frames obtained by the graphic element detection module and the positions of the text text boxes obtained by the text extraction module; a preset template is used to perform busbar matching on the covered electrical wiring diagram to obtain the busbars of the electrical wiring diagram.

[0065] Before the information matching module 14 performs template matching on the busbars in the electrical wiring diagram, it also includes: using the Canny operator to perform edge detection and extraction on the template image to obtain the edge information of the preset template, as well as the gradients in the horizontal and vertical directions; according to the edge information and the gradients in the two directions, calculate the gradient values and directions of each boundary point in the preset template.

[0066] It should be noted that the information matching module 14 needs to detect the connection lines and busbars in the electrical wiring diagram. Since the busbars are line segments with fixed shapes, they are easily interfered by other parts when using pattern recognition technology. Therefore, the obtained graphic element and text information are first deleted to reduce the interference factors in busbar recognition. The text content and graphic element content are covered with white pixels, and then the busbars in the picture are extracted by using the method of template matching. Template matching is a process of moving the template on the entire image and calculating the similarity between the template and the covered window on the image (template matching is implemented based on two-dimensional convolution). Template matching is mainly divided into two parts: making the template and finding the matching target.

[0067] When making the busbar detection template, first perform edge extraction on the template image to find the edge points of the template image. In this embodiment, the Canny operator is used for edge detection and extraction. Then use gradient-based edge extraction to calculate the gradients in the horizontal and vertical directions in the template, and then calculate the gradient values and directions of each boundary point according to the gradients in the two directions and the extracted edge information. The busbars can be divided into horizontal routing and vertical routing.

[0068] When performing template matching, first perform edge extraction on the electrical wiring diagram excluding graphic elements and text, and calculate the horizontal gradient and vertical gradient. Then use a sliding window search to calculate the matching value of the prepared template in a fixed sliding window from top to bottom and from left to right. Here, the matching value is calculated as the gradient distance of the edge points. If the distance is less than the set threshold, the line can be matched with the busbar in the template.

[0069] The information matching module 14 also traverses the graphic elements in the electrical wiring diagram in a neighboring matching manner for the busbar after template matching, and obtains the topological information between the graphic elements in the electrical wiring diagram.

[0070] Figure 3 It is a schematic flowchart of extracting the topological information of graphic elements in the electrical wiring diagram according to an embodiment of the present application. As Figure 3 shown, using a position-based matching algorithm, first obtain the position of the busbar points in the picture to be matched, determine the busbar direction, and then use a gradient-based edge extraction algorithm to obtain the edge and endpoint information of the remaining line segments. After obtaining the corresponding edge and endpoint information, use a neighboring matching method to extract the topological feature information of the graphic elements.

[0071] Through the graphic element detection module 11, text extraction module 12, text association module 13, and information matching module 14 in the embodiments of the present application, the problem of how to automatically recognize the electrical wiring diagram is solved. The yolov5 object detection algorithm is used to quickly and efficiently extract the corresponding graphic element targets in the wiring diagram, and then DBNet is used to extract and recognize the text. Finally, combined with image processing and other technologies, the text and graphic elements are matched, and the corresponding link relationship is obtained and output and saved in a specified format. In this process, multiple deep neural networks with different tasks are cascaded and nested to form a brand-new automated pipeline, which improves the speed and accuracy of electrical wiring diagram recognition.

[0072] It should be noted that the above-mentioned each module can be a functional module or a program module, and can be implemented either by software or by hardware. For the modules implemented by hardware, the above-mentioned each module can be located in the same processor; or the above-mentioned each module can also be located in different processors in any combination form.

[0073] The embodiment of the present application provides a method for recognizing an electrical wiring diagram based on computer vision. The method includes the following steps:

[0074] Step 1, perform object detection on the electrical wiring diagram to obtain the graphic elements in the electrical wiring diagram;

[0075] Step 2, perform text extraction on the electrical wiring diagram to obtain the text in the electrical wiring diagram;

[0076] Step 3: Match the center points of the detection frames of the graphic elements detected by the graphic element detection module with the text frames of the text extracted by the text extraction module.

[0077] Step 4: Perform template matching on the busbars in the electrical wiring diagram.

[0078] It should be noted that the steps shown in the above process or the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0079] This embodiment also provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0080] Optionally, the above electronic device may further include a transmission device and an input / output device, where the transmission device is connected to the above processor, and the input / output device is connected to the above processor.

[0081] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation manners, and will not be repeated here.

[0082] In addition, in combination with the above-mentioned method for identifying an electrical wiring diagram based on computer vision in the embodiment, an embodiment of the present application can be implemented by providing a storage medium. A computer program is stored on the storage medium; when the computer program is executed by a processor, it implements any one of the above-mentioned methods for identifying an electrical wiring diagram based on computer vision.

[0083] In one embodiment, a computer device is provided. The computer device can be a terminal. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a method for identifying an electrical wiring diagram based on computer vision. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, touchpad, or mouse, etc.

[0084] In one embodiment, Figure 4 is a schematic diagram of the internal structure of an electronic device according to an embodiment of the present application. As Figure 4 shown, an electronic device is provided. The electronic device may be a server, and its internal structure diagram may be as Figure 4 shown. The electronic device includes a processor, a network interface, an internal memory, and a non-volatile memory connected through an internal bus. Among them, the non-volatile memory stores an operating system, a computer program, and a database. The processor is used to provide computing and control capabilities, the network interface is used to communicate with an external terminal through a network connection, the internal memory is used to provide an environment for the operation of the operating system and the computer program, the computer program, when executed by the processor, is used to implement a method for identifying an electrical wiring diagram based on computer vision, and the database is used to store data.

[0085] Those skilled in the art can understand that Figure 4 the structure shown in

[0086] is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the electronic device to which the solution of the present application is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0087] Those skilled in the art should understand that the technical features of the above-described embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as falling within the scope described in this specification.

[0088] The above-described embodiments only represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several deformations and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.

Claims

1. An electrical wiring diagram recognition system based on computer vision, characterized in that, The system includes a graphic element detection module, a text extraction module, a text association module, and an information matching module; The graphic element detection module is used to perform target detection on the electrical wiring diagram to obtain the graphic elements in the electrical wiring diagram; The text extraction module is used to extract text from the electrical wiring diagram through a model based on the DBNet text detection algorithm, including: using a CNN network extraction layer to extract image features of the electrical wiring diagram, performing feature fusion on the image features through a feature pyramid; based on the feature map after feature fusion, calculating a binary feature map through a differentiable binarization algorithm, and generating text boxes of the text in the electrical wiring diagram on the binary feature map; The text association module is used to perform center point matching between the detection boxes of the graphic elements detected by the graphic element detection module and the text boxes of the text extracted by the text extraction module; The information matching module is used to cover a preset position in the electrical wiring diagram with white pixels, where the preset position is the position of the graphic element detection box obtained by the graphic element detection module and the position of the text box of the text obtained by the text extraction module; Use the Canny operator to perform edge detection and extraction on the template image to obtain the edge information of the preset template, as well as the gradients in the horizontal and vertical directions; according to the edge information and the gradients in the two directions, calculate the gradient values and directions of each boundary point in the preset template; Use a preset template to perform bus matching on the covered electrical wiring diagram to obtain the bus of the electrical wiring diagram.

2. The system according to claim 1, wherein Performing target detection on the electrical wiring diagram includes: Performing target detection on the electrical wiring diagram through a model based on the RPN region proposal network algorithm; or, performing target detection on the electrical wiring diagram through a model based on the yolov5 target detection network algorithm.

3. The system according to claim 1, wherein Performing center point matching between the detection boxes of the graphic elements detected by the graphic element detection module and the text boxes of the text extracted by the text extraction module includes: Obtaining the four corner point coordinates of the graphic element detection box detected by the graphic element detection module, and calculating the center point coordinates of the graphic element detection box according to the four corner point coordinates; Obtaining the four corner point coordinates of the text box of the text extracted by the text extraction module, and calculating the center point coordinates of the text box of the text according to the four corner point coordinates; According to the center point coordinates of the graphic element detection box and the center point coordinates of the text box of the text, complete the one-to-one association of the graphic elements and text in the electrical wiring diagram.

4. The system according to claim 1, characterized in that The information matching module traverses the graphic elements in the electrical wiring diagram in a proximity matching manner based on the bus after template matching to obtain the topological information between the graphic elements in the electrical wiring diagram.

5. The system according to claim 1, wherein Before performing target detection on the electrical wiring diagram through a model based on the yolov5 target detection network algorithm, it further includes: Manually annotating the graphic elements in the training data; Training the model based on the yolov5 target detection network algorithm through the manually annotated training data.

6. A method for identifying electrical wiring diagrams based on computer vision, characterized in that, The method includes: Performing target detection on the electrical wiring diagram to obtain the graphic elements in the electrical wiring diagram; Extract the text in the electrical wiring diagram through a model based on the DBNet text detection algorithm, including: using the CNN network extraction layer to extract the image features of the electrical wiring diagram, and performing feature fusion on the image features through a feature pyramid; based on the feature map after feature fusion, calculating a binary feature map through a differentiable binarization algorithm, and generating a text box for the text in the electrical wiring diagram on the binary feature map; Perform center point matching on the detection box of the primitive detected by the primitive detection module and the text box of the text extracted by the text extraction module; Cover a preset position in the electrical wiring diagram with white pixels, where the preset position is the position of the primitive detection box obtained by the primitive detection module and the position of the text box of the text obtained by the text extraction module; Use the Canny operator to perform edge detection and extraction on the template image to obtain the edge information of the preset template and the gradients in the horizontal and vertical directions; calculate the gradient value and direction of each boundary point in the preset template according to the edge information and the gradients in the two directions; Perform bus matching on the covered electrical wiring diagram using a preset template to obtain the bus of the electrical wiring diagram.

Citation Information

Patent Citations

  • Electric power drawing topological relation detection method based on artificial intelligence

    CN111859805A

  • Pixel recognition method, device and equipment and medium

    CN114140812A