Electric power drawing automatic forming method and system based on image recognition

Through the technology based on image recognition, the automatic identification and generation of power drawings is solved, and the problem of inefficient storage and sharing of existing power drawings is achieved, efficient and accurate drawing generation is achieved, and work efficiency is improved.

CN119863811APending Publication Date: 2025-04-22BEIJING JOIN BRIGHT DIGITAL POWER TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411892854.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

The existing power drawings are stored in paper form, which makes it difficult to store the drawings and cannot be shared in real time. The paper drawings are inconsistent with the on-site wiring, resulting in low work efficiency.

Method used

The automatic drawing of power drawing based on image recognition is adopted. By identifying the position coordinates of the primitives, texts and line segments, new power drawings are automatically generated to improve the drawing efficiency.

Benefits of technology

It realizes rapid extraction and intelligent analysis of drawings, and efficiently and accurately generates new power drawings, avoiding the tedious process of manual redrawing, and greatly improving the efficiency of drawing formation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119863811A_ABST
    Figure CN119863811A_ABST
Patent Text Reader

Abstract

The invention provides an electric power drawing automatic forming method and system based on image recognition, and belongs to the technical field of image processing.The method comprises the steps that primitives in a first electric power drawing are recognized, and the position coordinates of each primitive are extracted; filling pixels obtained by recognition in the first electric power drawing with background colors, recognizing characters in the first electric power drawing, and extracting position coordinates of each segment of characters; filling characters obtained by recognition in the first electric power drawing with background color, recognizing line segments in the first electric power drawing, and extracting starting point coordinates and terminal point coordinates of each line segment; and automatically generating a second electric power drawing based on the position coordinate of each primitive, the position coordinate of each segment of text, and the starting point coordinate and the end point coordinate of each line segment. According to the electric power drawing automatic forming method and system based on image recognition, the drawing efficiency of the electric power drawing can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure belongs to the field of image processing technology, and more specifically, relates to an automatic drawing method and system for electric power drawings based on image recognition. Background Art

[0002] The power layout diagram is mainly used to indicate the actual location of all equipment and terminal blocks on the power equipment, and to provide necessary information for the installation, maintenance and repair of the control equipment in the power system. The layout diagram is drawn on one drawing or the layout diagram of the power components of the control cabinet and the operating table are drawn separately according to the complexity of the equipment. The outline of the components is drawn based on their axis, and the spacing size of each component is marked. The input and output line mode and the terminal block, connector or connector are selected according to the number of input and output lines of the component, the wire specifications and the output line position, and the wiring numbers of the input and output lines are marked in a certain order.

[0003] At present, the drawings of conventional substations are stored offline in paper form. The drawings are difficult to save and cannot be shared in real time. At the same time, there are inconsistencies between paper drawings and on-site wiring. During the preparation, execution and protection and maintenance test of secondary operations, staff need to frequently refer to paper drawings to obtain necessary information. Experienced experts will also rely on experience to varying degrees when making decisions. Paper drawings cannot guide the test process, which is inefficient. Summary of the invention

[0004] The purpose of the present disclosure is to provide a method and system for automatically drawing electric power drawings based on image recognition, so as to improve the efficiency of drawing electric power drawings.

[0005] According to a first aspect of an embodiment of the present disclosure, there is provided a method for automatically drawing an electric power drawing based on image recognition, comprising: Identify the graphic elements in the first power drawing and extract the position coordinates of each graphic element; Fill the recognized graphic elements in the first power drawing with the background color, recognize the text in the first power drawing, and extract the position coordinates of each text; Fill the recognized text in the first power drawing with the background color, recognize the line segments in the first power drawing, and extract the starting point coordinates and the end point coordinates of each line segment; The second electrical drawing is automatically generated based on the position coordinates of each graphic element, the position coordinates of each text segment, and the starting point coordinates and the end point coordinates of each line segment.

[0006] A second aspect of the embodiments of the present disclosure provides an automatic drawing system for electric power drawings based on image recognition, comprising: A first recognition module, used to recognize the graphic elements in the first power drawing and extract the position coordinates of each graphic element; The second recognition module is used to fill the recognized graphic elements in the first power drawing with the background color, recognize the text in the first power drawing, and extract the position coordinates of each text; A third recognition module is used to fill the text recognized in the first electric power drawing with a background color, recognize the line segments in the first electric power drawing, and extract the starting point coordinates and the end point coordinates of each line segment; The drawing generation module is used to automatically generate a second power drawing based on the position coordinates of each graphic element, the position coordinates of each text segment, and the starting point coordinates and the end point coordinates of each line segment.

[0007] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of the above-mentioned method for automatic drawing of electric power drawings based on image recognition when executing the computer program.

[0008] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned method for automatic drawing of electric power drawings based on image recognition are implemented.

[0009] The beneficial effects of the automatic drawing method and system for electric power drawings based on image recognition provided by the embodiments of the present disclosure are: In the disclosed embodiments, considering that graphics are usually relatively important components in electric power drawings, with relatively complex shapes and clear geometric features, graphics are first identified so that their unique shapes, colors and other features can be utilized to achieve accurate identification of graphics; filling graphics with background colors and then identifying text can effectively avoid occlusion and confusion of graphics on text recognition, thereby improving the accuracy of text recognition; similarly, filling text with background colors and then identifying line segments can avoid interference of text on line segment recognition.

[0010] The disclosed embodiments, with the help of advanced big data model graphic recognition, OCR (optical character recognition) technology and precise target recognition algorithms, can automatically parse and identify information such as electrical components, graphic connections, text labels, etc. in drawings, realize rapid information extraction and intelligent analysis, and help to efficiently and accurately generate new power drawings, avoiding the tedious process of manually redrawing drawings, thereby greatly improving drawing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0012] Figure 1 A schematic diagram of a flow chart of an automatic drawing method for electric power drawings based on image recognition provided by an embodiment of the present disclosure; Figure 2 A schematic diagram of a flow chart of an automatic drawing method for electric power drawings based on image recognition provided by another embodiment of the present disclosure; Figure 3 A schematic diagram of the effect of merging parallel lines provided by an embodiment of the present disclosure; Figure 4 A schematic diagram of the processing effect of an abnormal connection disconnection situation provided by an embodiment of the present disclosure; Figure 5 A structural block diagram of an automatic drawing system for electric power drawings based on image recognition provided by an embodiment of the present disclosure; Figure 6 A schematic block diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0013] In the following description, specific details such as specific system structures and technologies are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present disclosure. However, it should be clear to those skilled in the art that the present disclosure may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obstructing the description of the present disclosure with unnecessary details.

[0014] In order to make the purpose, technical solutions and advantages of the present disclosure more clear, specific embodiments will be described below in conjunction with the accompanying drawings.

[0015] Please refer to Figure 1-Figure 2 , Figure 1 A schematic diagram of a flow chart of an automatic drawing method for electric power drawings based on image recognition provided by an embodiment of the present disclosure, the method comprising: S101: Identify graphic elements in a first electric power drawing and extract the position coordinates of each graphic element.

[0016] In this embodiment, the graphic elements in the first power drawing include graphic symbols of equipment such as transformers, switches, and motors. A high-resolution drawing file (i.e., the first power drawing) can be obtained through PDF or CAD conversion tools. In order to better identify graphic elements and text information, the PPI (pixel density unit, indicating the number of pixels per inch) of the image is recommended to be above 300; set the graphic element specification definition according to the graphic element type contained in the drawing, set the data set for AI recognition and annotation, and the graphic element specification definition is detailed in Table 1.

[0017] Table 1 Definition of graphic element specifications

[0018] By using the established graphic element data specification, relevant graphic elements are marked on the first electric power drawing, the marking includes the coordinates of the object and the corresponding category, a marked data set is generated, and a neural network model is trained to identify the graphic elements in the first electric power drawing.

[0019] For example, the neural network model can use YOLOv8, and the YOLOv8 training parameters can be configured based on the labeled data set, mainly including parameters such as epochs training rounds, imgsz target image size, batch training batch size, etc. After training, the model can effectively identify and locate the components in the first power drawing.

[0020] On this basis, the position coordinates of each primitive can be accurately extracted according to the image coordinate system, usually with the upper left corner as the origin, the right as the positive direction of the x-axis, and the downward as the positive direction of the y-axis. The coordinates of the upper left corner and lower right corner of the primitive's circumscribed rectangular box, or the coordinates of the primitive's center point and other information are recorded to facilitate subsequent accurate processing and reconstruction of the primitive.

[0021] S102: Fill the recognized graphic elements in the first power drawing with a background color, recognize the text in the first power drawing, and extract the position coordinates of each text segment.

[0022] In this embodiment, an OCR (optical character recognition) model can be used to perform text recognition in the first power drawing. For example, the PaddleOCR default model can be used for text recognition, which can provide relatively accurate recognition results in most cases. In order to improve the accuracy of character detection, before character detection, OpenCV is used to whiten the detected component area (fill the background color) to reduce the interference of the component area on character recognition. At the same time, a sliding window is used for optical character recognition, and the image is divided into multiple small areas to improve the recognition effect of small characters, and the position coordinates of each paragraph of text are extracted and output. For example, the upper left corner coordinates and lower right corner coordinates of the text area or the starting and ending coordinates of the text baseline, so that the text can be accurately placed in the corresponding position when generating a new drawing.

[0023] S103: Fill the recognized text in the first power drawing with a background color, recognize the line segments in the first power drawing, and extract the starting point coordinates and the end point coordinates of each line segment.

[0024] In this embodiment, the edge detection algorithm in OpenCV (such as Canny edge detection) can be used to first detect the edge information in the image, and then the line segments in the edge information are extracted through a line segment fitting algorithm (such as Hough transform), and the starting point coordinates and end point coordinates of each line segment are determined.

[0025] In order to improve the accuracy of line segment detection, the detected components and character areas may be subjected to the same whitening process (filled with background color) to reduce the interference of these areas on line segment detection.

[0026] S104: Automatically generate a second electrical drawing based on the position coordinates of each graphic element, the position coordinates of each text segment, and the start point coordinates and end point coordinates of each line segment.

[0027] In this embodiment, after the coordinate information of the graphic element, text and line segment is extracted, the graphic drawing library or special automatic drawing software can be used to draw the graphic element, text and line segment on the new canvas in turn according to the drawing specifications and standards of the power drawing to generate a second power drawing. In the drawing process, the position of each element can be determined according to the coordinate information, and the style of the graphic element (such as color, size, fill pattern, etc.), the font and size of the text, and the thickness and line type of the line segment can be set according to the standard specifications of the power industry to ensure that the generated new drawing meets the professional requirements of the power engineering drawing.

[0028] From the above, it can be concluded that this embodiment takes into account that graphics are usually more important components in power drawings, with relatively complex shapes and clear geometric features. By first identifying the graphics, its unique shape, color and other features can be utilized to achieve accurate identification of the graphics; filling the graphics with background colors and then identifying text can effectively avoid the obstruction and confusion of graphics on text recognition, thereby improving the accuracy of text recognition; similarly, filling the text with background colors and then identifying line segments can avoid the interference of text on line segment recognition.

[0029] This embodiment, with the help of advanced big data model graphic recognition, OCR (optical character recognition) technology and precise target recognition algorithms, can automatically parse and identify electrical components, graphic connections, text labels and other information in the drawings, realize rapid information extraction and intelligent analysis, and help to generate new power drawings efficiently and accurately, avoiding the tedious process of manually redrawing the drawings, and greatly improving the efficiency of drawing.

[0030] Please refer to Figure 3In one embodiment of the present disclosure, the method for automatically drawing an electric power drawing based on image recognition further includes: Based on the starting point coordinates and the end point coordinates of each line segment in the second power drawing, all line segments are divided into a first group of line segments and a second group of line segments; wherein the first group of line segments are line segments in a first direction, and the second group of line segments are line segments in a second direction, and the first direction and the second direction are perpendicular to each other; The first group of line segments and the second group of line segments are divided into a plurality of groups respectively, wherein the first distance between the line segments in each group is less than the first distance threshold, and the second distance between the line segments in each group is less than the second distance threshold; the first distance is the distance between any two line segments in the first direction, and the second distance is the distance between any two line segments in the second direction; The target line segment with the highest confidence is selected from each group, and the line segments of each group are merged into the target line segment.

[0031] In this embodiment, a layout algorithm may be used to correct the second power drawing. For example, parallel line segments with close spacing in the second power drawing may be identified, that is, multiple parallel lines caused by abnormal recognition of a single line segment on the drawing, and each group of parallel line segments may be merged. The first direction may be a horizontal direction, and the second direction may be a vertical direction.

[0032] The specific implementation steps are as follows: a. Group all line segments horizontally and vertically, and sort them from top to bottom and from left to right according to the starting points of the line segments to facilitate subsequent calculations.

[0033] b. Determine the vertical spacing between adjacent line segments in the first group of line segments and the second group of line segments. If it exceeds the set threshold, continue grouping.

[0034] Specifically, when two line segments are in their respective groups (the first group of line segments or the second group of line segments), and the distance between them in the horizontal direction is less than the first distance threshold, and the distance between them in the vertical direction is less than the second distance threshold, the two line segments are divided into the same group. The first distance threshold and the second distance threshold can be set according to factors such as the accuracy requirements of the power drawings and the characteristics of the line layout, for example, set to 5 pixel units. Through the above grouping process, line segments with the same direction and close distance can be grouped into one group.

[0035] c. Select the line segment with the highest confidence value among the parallel lines of each group, take the line segment as the target line segment, and merge the line segments of each group into the target line segment. The confidence value may be the probability value of the corresponding detection result obtained in the line segment detection process of step S103.

[0036] After the above processing steps, the line segment information in the second power drawing can be effectively sorted out, making the wiring structure of the power system clearer. Figure 3As shown, Figure 3 (a) is a schematic diagram before parallel lines merge. Figure 3 (b) is a schematic diagram after the parallel lines are merged.

[0037] Please refer to Figure 4 In one embodiment of the present disclosure, the method for automatically drawing an electric power drawing based on image recognition further includes: Move the reference line from one side of the second electrical drawing to the other side along the second direction; the reference line is a straight line in the first direction; In response to the reference line moving to a distance between the reference line and a starting point of any second line segment being less than or equal to a first distance threshold, adding the second line segment to the first set; the second line segment is a line segment in a second direction; In response to the reference line moving to a position coincident with any first line segment, and the reference line intersecting with any second line segment in the first set or an extension of any second line segment at a first intersection, extending any first line segment and / or second line segment to the first intersection; the first line segment is a line segment in a first direction; In response to the reference line moving to a distance between the reference line and an end point of any second line segment being greater than a first distance threshold, the second line segment is removed from the first set.

[0038] In this embodiment, a scanning line algorithm may be used to identify closely spaced perpendicular line segments, handle disconnection caused by abnormal identification of the endpoints of the intersecting line segments on the second power drawing, and extend the line segments to the connection points.

[0039] The specific implementation steps are as follows: a. The basic idea of ​​using the scanning line algorithm to determine whether line segments intersect is to simulate a horizontal line (i.e., reference line) to scan the entire second power drawing from top to bottom, and record the intersection points of the line segments in the process; b. Define algorithm execution events, including scanning to the starting point trigger event, scanning to the end point trigger event, and scanning to the vertex trigger event; c. Create a priority queue to store all events and sort them in the order of y coordinates. If there are the same y coordinates, sort them according to the x coordinates; d. Create the first set to store all the line segments that the current scan line passes through, and sort the line segments according to the x coordinates of their intersections with the scan line; e. Processing events: when the starting point area of ​​any second line segment is scanned (the distance between the reference line and the starting point of the second line segment is less than the first distance threshold), the second line segment is added to the first set; when the end point is scanned (that is, the distance between the reference line and the end point of the second line segment is less than the first distance threshold), the second line segment is removed from the first set; when the reference line coincides with any first line segment and the reference line intersects with any second line segment in the first set or the extension line of any second line segment at the first intersection, any first line segment and / or second line segment is extended to the first intersection.

[0040] After the above processing steps, the disconnection caused by abnormal recognition of the endpoints of the intersecting line segments can be corrected. Figure 4 As shown, Figure 4 (a) is the schematic diagram before the line segment is extended. Figure 4 (b) is the schematic diagram after the line segment is extended.

[0041] In one embodiment of the present disclosure, the method for automatically drawing an electric power drawing based on image recognition further includes: Determine a corresponding first rectangular area based on the position coordinates of the first graphic element; the first graphic element is any graphic element; Determine a second rectangular area based on the center of the first rectangular area; the second rectangular area is located outside the first rectangular area, and the second rectangular area is similar to the first rectangular area; Determine the line segment whose endpoints are within the second rectangular area as the third line segment; If the third line segment is not connected to the first graphic element, the third line segment is extended until it is connected to the first graphic element.

[0042] In this embodiment, the relative position of the component and the nearby lines in the second electrical drawing can be identified, the connection relationship between the component and the line can be determined, the component can be moved to align with the line, and the line can be extended to connect the component.

[0043] Specifically, for any graphic element (such as the first graphic element) in the power drawing, the corresponding first rectangular area can be determined based on its position coordinates. For example, if the graphic element is a circle, then the circumscribed rectangle of the graphic element is the smallest rectangle that can just contain the circle.

[0044] The center of the first rectangular area is the intersection of the diagonal lines of the first rectangular area. The second rectangular area is determined with the center of the first rectangular area as the center. The second rectangular area surrounds the first rectangular area and is similar to the first rectangular area, that is, the ratio of the corresponding sides of the second rectangular area and the first rectangular area is the same. By setting a second rectangular area that is similar to the first rectangular area and outside it, the line segment near the primitive that is connected to the primitive (that is, the third line segment) can be covered. If the third line segment is not connected to the first primitive, it needs to be extended to connect it to the first primitive.

[0045] It can be concluded from the above that this embodiment corrects the line segments that are connected to the graphic elements but not connected, so that the connection relationship between the lines and equipment in the power drawings is presented more accurately and clearly.

[0046] In one embodiment of the present disclosure, the method for automatically drawing an electric power drawing based on image recognition further includes: Delete line segments whose length is less than the length threshold.

[0047] In this embodiment, invalid shorter lines in the second power drawing may be further processed, shorter oblique line data may be filtered, shorter lines with overlapping graphic elements and texts may be determined, and covered short lines may be filtered.

[0048] The diagonal line is determined by the fact that the coordinate difference between the starting point and the end point is not 0, that is:

[0049] Loop through the rectangular boxes of all graphics and text positions, calculate whether the coordinates of the line's start and end points are both contained in the rectangle, and determine whether the line is covered.

[0050] In one embodiment of the present disclosure, identifying a graphic element in a first power drawing includes: Move the set sliding window in the first power drawing, and extract local features of the first power drawing at each sliding window position; At each sliding window position, the graphic elements in the first power drawing are identified and marked based on the local features of the first power drawing.

[0051] In this embodiment, a sliding window algorithm can be used to split a large-sized image into several small images for identification during the recognition of components, text or lines. The size of the window and the step length of the movement are determined, and the window is moved on the image according to the specified step length, each time moving a distance of the window size. At each window position, a convolutional neural network algorithm is used to extract local features, such as color, texture, shape, etc. These features are input into a machine learning algorithm for classification or identification to determine the object or feature in the image.

[0052] For the intersection area between sliding windows, the non-maximum suppression (NMS) technology based on confidence is used to reduce the number of repeated anchor boxes, thereby ensuring the accuracy of the detection results. The position coordinates of each primitive are extracted and output.

[0053] It can be concluded from the above that this embodiment uses a sliding window method to divide a large image into several small areas for detection one by one, which can detect components more focusedly in each small area, thereby improving the sensitivity and accuracy of component detection.

[0054] In one embodiment of the present disclosure, the second power drawing is automatically generated based on the position coordinates of each graphic element, the position coordinates of each text segment, and the starting point coordinates and the end point coordinates of each line segment, including: The second-generation electrical drawings in SVG format are automatically generated based on the position coordinates of each graphic element, the position coordinates of each text, and the starting coordinates and end coordinates of each line segment.

[0055] In this embodiment, the device can be acquired according to the graphic element specification definition, the SVG code fragment can be drawn, the corresponding SVG style and animation effect can be set, and the SVG file can be generated.

[0056] SVG, or Scalable Vector Graphics, can represent graphic information in a concise and portable form. Its advantages are: scalability, can be enlarged without reducing image quality, can be printed at any resolution with high quality, text is optional and searchable, etc. It can easily display the location and connection relationship of power grid equipment.

[0057] Corresponding to the automatic drawing method of electric power drawings based on image recognition in the above embodiment, Figure 5 This is a structural block diagram of an automatic drawing system for electric power drawings based on image recognition provided by an embodiment of the present disclosure. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown. Figure 5 The automatic drawing system 20 for electric power drawings based on image recognition includes: a first recognition module 21, a second recognition module 22, a third recognition module 23 and a drawing generation module 24. The first recognition module 21 is used to recognize the graphic elements in the first power drawing and extract the position coordinates of each graphic element; The second recognition module 22 is used to fill the recognized graphic elements in the first power drawing with the background color, recognize the text in the first power drawing, and extract the position coordinates of each text segment; The third recognition module 23 is used to fill the text recognized in the first power drawing with a background color, recognize the line segments in the first power drawing, and extract the starting point coordinates and the end point coordinates of each line segment; The drawing generation module 24 is used to automatically generate a second power drawing based on the position coordinates of each graphic element, the position coordinates of each text segment, and the starting point coordinates and the end point coordinates of each line segment.

[0058] In one embodiment of the present disclosure, the drawing generation module 24 is specifically used to: Based on the starting point coordinates and the end point coordinates of each line segment in the second power drawing, all line segments are divided into a first group of line segments and a second group of line segments; wherein the first group of line segments are line segments in a first direction, and the second group of line segments are line segments in a second direction, and the first direction and the second direction are perpendicular to each other; The first group of line segments and the second group of line segments are divided into a plurality of groups respectively, wherein the first distance between the line segments in each group is less than the first distance threshold, and the second distance between the line segments in each group is less than the second distance threshold; the first distance is the distance between any two line segments in the first direction, and the second distance is the distance between any two line segments in the second direction; The target line segment with the highest confidence is selected from each group, and the line segments of each group are merged into the target line segment.

[0059] In one embodiment of the present disclosure, the drawing generation module 24 is specifically used to: Move the reference line from one side of the second electrical drawing to the other side along the second direction; the reference line is a straight line in the first direction; In response to the reference line moving to a distance between the reference line and the starting point of any second line segment being less than a first distance threshold, adding the second line segment to the first set; the second line segment is a line segment in a second direction; In response to the reference line moving to a position coincident with any first line segment, and the reference line intersecting with any second line segment in the first set or an extension of any second line segment at a first intersection, extending any first line segment and / or second line segment to the first intersection; the first line segment is a line segment in a first direction; In response to the reference line moving to a distance between the reference line and an end point of any second line segment being smaller than a first distance threshold, the second line segment is removed from the first set.

[0060] In one embodiment of the present disclosure, the drawing generation module 24 is specifically used to: Determine a corresponding first rectangular area based on the position coordinates of the first graphic element; the first graphic element is any graphic element; Determine a second rectangular area based on the center of the first rectangular area; the second rectangular area is located outside the first rectangular area, and the second rectangular area is similar to the first rectangular area; Determine the line segment whose endpoints are within the second rectangular area as the third line segment; If the third line segment is not connected to the first graphic element, the third line segment is extended until it is connected to the first graphic element.

[0061] In one embodiment of the present disclosure, the drawing generation module 24 is specifically used to: Delete line segments whose length is less than the length threshold.

[0062] In one embodiment of the present disclosure, the first identification module 21 is specifically used for: Move the set sliding window in the first power drawing, and extract local features of the first power drawing at each sliding window position; At each sliding window position, the graphic elements in the first power drawing are identified and marked based on the local features of the first power drawing.

[0063] In one embodiment of the present disclosure, the drawing generation module 24 is specifically used to: The second-generation electrical drawings in SVG format are automatically generated based on the position coordinates of each graphic element, the position coordinates of each text, and the starting coordinates and end coordinates of each line segment.

[0064] See also Figure 6 , Figure 6 A schematic block diagram of an electronic device provided by an embodiment of the present disclosure. Figure 6 The electronic device 300 in the embodiment shown may include: one or more processors 301, one or more input devices 302, one or more output devices 303 and one or more memories 304. The processors 301, input devices 302, output devices 303 and memories 304 communicate with each other via a communication bus 305. The memory 304 is used to store computer programs, which include program instructions. The processor 301 is used to execute the program instructions stored in the memory 304. The processor 301 is configured to call the program instructions to execute the functions of each module / unit in the above-mentioned device embodiments, such as Figure 5 The functions of modules 21 to 24 are shown.

[0065] It should be understood that in the embodiment of the present disclosure, the processor 301 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0066] The input device 302 may include a touch panel, a fingerprint collection sensor (for collecting the user's fingerprint information and fingerprint direction information), a microphone, etc., and the output device 303 may include a display (LCD, etc.), a speaker, etc.

[0067] The memory 304 may include a read-only memory and a random access memory, and provide instructions and data to the processor 301. A portion of the memory 304 may also include a non-volatile random access memory. For example, the memory 304 may also store information about the device type.

[0068] In a specific implementation, the processor 301, input device 302, and output device 303 described in the embodiments of the present disclosure can execute the implementation methods described in the first and second embodiments of the method for automatic drawing of electric power drawings based on image recognition provided in the embodiments of the present disclosure, and can also execute the implementation methods of the electronic device described in the embodiments of the present disclosure, which will not be repeated here.

[0069] In another embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by the processor, all or part of the processes in the above-mentioned embodiment method are implemented, and the computer program can also be completed by instructing the relevant hardware through the computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0070] The computer-readable storage medium may be an internal storage unit of the electronic device of any of the aforementioned embodiments, such as a hard disk or memory of the electronic device. The computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Furthermore, the computer-readable storage medium may also include both an internal storage unit of the electronic device and an external storage device. The computer-readable storage medium is used to store computer programs and other programs and data required by the electronic device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.

[0071] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this disclosure.

[0072] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the electronic devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0073] In the several embodiments provided in the present application, it should be understood that the disclosed electronic devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces or units, or it can be an electrical, mechanical or other form of connection.

[0074] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present disclosure.

[0075] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0076] The above are only specific embodiments of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present disclosure, and these modifications or replacements should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A method for automatically drawing electric power drawings based on image recognition, characterized in that: include: Identify the graphic elements in the first power drawing and extract the position coordinates of each graphic element; Fill the recognized graphic elements in the first power drawing with the background color, recognize the text in the first power drawing, and extract the position coordinates of each text; Fill the recognized text in the first power drawing with the background color, recognize the line segments in the first power drawing, and extract the starting point coordinates and the end point coordinates of each line segment; The second electrical drawing is automatically generated based on the position coordinates of each graphic element, the position coordinates of each text segment, and the starting point coordinates and the end point coordinates of each line segment.

2. The method for automatically drawing electric power drawings based on image recognition according to claim 1, characterized in that: Also includes: Based on the starting point coordinates and the end point coordinates of each line segment in the second power drawing, all line segments are divided into a first group of line segments and a second group of line segments; wherein the first group of line segments are line segments in a first direction, and the second group of line segments are line segments in a second direction, and the first direction and the second direction are perpendicular to each other; The first group of line segments and the second group of line segments are divided into a plurality of groups respectively, wherein the first distance between the line segments in each group is less than the first distance threshold, and the second distance between the line segments in each group is less than the second distance threshold; the first distance is the distance between any two line segments in the first direction, and the second distance is the distance between any two line segments in the second direction; A target line segment with the highest confidence is selected from each group, and the line segments of each group are merged into the target line segment.

3. The method for automatically drawing electric power drawings based on image recognition according to claim 1, characterized in that: Also includes: Move a reference line from one side of the second power drawing to the other side along a second direction; the reference line is a straight line in the first direction; In response to the reference line moving to a distance from a starting point of any second line segment being less than a first distance threshold, adding the second line segment to the first set; the second line segment is a line segment in a second direction; In response to the reference line moving to a position coincident with any first line segment, and the reference line intersecting with any second line segment in the first set or an extension of any second line segment at a first intersection point, extending the any first line segment and / or the second line segment to the first intersection point; The first line segment is a line segment in a first direction; In response to the reference line moving to a distance from an end point of any second line segment being smaller than a first distance threshold, the second line segment is removed from the first set.

4. The method for automatically drawing electric power drawings based on image recognition according to claim 1, characterized in that: Also includes: Determine a corresponding first rectangular area based on the position coordinates of the first graphic element; The first graphic element is any graphic element; Determine a second rectangular area based on the center of the first rectangular area; the second rectangular area is located outside the first rectangular area, and the second rectangular area is similar to the first rectangular area; Determine a line segment whose endpoint is within the second rectangular area as a third line segment; If the third line segment is not connected to the first graphic element, the third line segment is extended until it is connected to the first graphic element.

5. The method for automatically drawing electric power drawings based on image recognition according to claim 1, characterized in that: Also includes: Delete line segments whose length is less than the length threshold.

6. The method for automatically drawing electric power drawings based on image recognition according to claim 5, characterized in that: The identifying of the graphic element in the first power drawing includes: Move the set sliding window in the first power drawing, and extract local features of the first power drawing at each sliding window position; At each sliding window position, the graphic elements in the first power drawing are identified and marked based on the local features of the first power drawing.

7. The method for automatically drawing electric power drawings based on image recognition according to claim 1, characterized in that: The method of automatically generating a second power drawing based on the position coordinates of each graphic element, the position coordinates of each text segment, and the starting point coordinates and the end point coordinates of each line segment includes: The second-generation electrical drawings in SVG format are automatically generated based on the position coordinates of each graphic element, the position coordinates of each text, and the starting coordinates and end coordinates of each line segment.

8. An automatic drawing system for electric power drawings based on image recognition, characterized in that: include: A first recognition module, used to recognize the graphic elements in the first power drawing and extract the position coordinates of each graphic element; The second recognition module is used to fill the recognized graphic elements in the first power drawing with the background color, recognize the text in the first power drawing, and extract the position coordinates of each text; A third recognition module is used to fill the text recognized in the first electric power drawing with a background color, recognize the line segments in the first electric power drawing, and extract the starting point coordinates and the end point coordinates of each line segment; The drawing generation module is used to automatically generate a second power drawing based on the position coordinates of each graphic element, the position coordinates of each text segment, and the starting point coordinates and the end point coordinates of each line segment.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Nuclear industry drawing identification method, medium and equipment

    CN121033892A

  • Processing system for processing multi-modal electric power engineering drawing data

    CN121147207A

  • A treatment system for processing multi-modal power engineering drawing data

    CN121147207B