Single-line graph extraction method, electronic device, medium, and computing program product

By processing the low-voltage primary main wiring diagram into a binary image and performing erosion, dilation, outer contour extraction, and cropping, the problem of time-consuming and laborious manual extraction of single-line diagrams in existing technologies is solved, achieving fast and accurate single-line diagram extraction and supporting low-voltage power distribution management and power flow calculation.

CN116993638BActive Publication Date: 2026-01-06SIEMENS (CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310877985.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-17
Publication Date
2026-01-06
Estimated Expiration
2043-07-17

AI Technical Summary

Technical Problem

Existing technologies cannot quickly and accurately extract single-line diagrams from low-voltage primary main wiring diagrams using computer vision technology, resulting in manual operation being time-consuming, labor-intensive, and prone to errors.

Method used

By converting the low-voltage primary wiring diagram into a binary image, performing erosion and dilation processing, extracting horizontal and vertical lines, extracting and trimming the outer contour, determining the outer contour that meets the preset conditions, and extracting single-line diagrams based on the maximum longitudinal spacing.

Benefits of technology

It enables the rapid and accurate extraction of single-line diagrams from low-voltage primary main wiring diagrams, supporting low-voltage power distribution management and power flow calculation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116993638B_ABST
    Figure CN116993638B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a single line graph extraction method, wherein, the low-voltage primary main wiring diagram is converted into a binary graph; a first corrosion and then expansion processing is performed on the binary graph to obtain a second graph; the horizontal lines and the vertical lines are extracted from the second graph respectively to obtain a third graph containing only the horizontal lines and a fourth graph containing the horizontal lines and the vertical lines; an outer contour extraction operation is performed in the fourth graph to obtain a first outer contour set; in the first outer contour set, a first outer contour satisfying a first preset condition is determined; the third graph is cut by the first outer contour to obtain a fifth graph; an outer contour extraction operation is performed in the fifth graph to obtain a second outer contour set; in the second outer contour set, a first group of outer contours satisfying a second preset condition is determined; and based on the two outer contours corresponding to the maximum longitudinal spacing, a single line graph in the low-voltage primary main wiring diagram is extracted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this application mainly relate to the field of low-voltage power distribution, and particularly to a method for extracting single-line diagrams, electronic devices, media, and computing program products. Background Technology

[0002] To achieve the digitization of low-voltage power distribution, especially in asset management and power flow calculation, the first step is to extract single-line diagrams from existing low-voltage primary main wiring diagrams. Single-line diagrams are simplified representations of the three-phase main circuits of low-voltage switchgear using single lines and are used in power distribution network system diagrams at all levels. However, in addition to single-line diagrams, low-voltage primary main wiring diagrams contain various other tabular information, making extraction impossible using computer vision technology. Currently, single-line diagrams can only be extracted manually, which is time-consuming, labor-intensive, and prone to errors. Summary of the Invention

[0003] This application provides a method, electronic device, medium, and computing program product for extracting single-line diagrams. Through this application, single-line diagrams in low-voltage primary main wiring diagrams can be extracted quickly and accurately.

[0004] In a first aspect, a method for extracting a single-line diagram is provided, comprising: converting a low-voltage primary main wiring diagram into a binary diagram; performing an erosion-dilation process on the binary diagram to obtain a second diagram; extracting horizontal and vertical lines from the second diagram to obtain a third diagram containing only horizontal lines and a fourth diagram containing both horizontal and vertical lines; performing an outer contour extraction operation on the fourth diagram to obtain a first outer contour set; determining a first outer contour that meets a first preset condition in the first outer contour set; cropping the third diagram using the first outer contour to obtain a fifth diagram; performing an outer contour extraction operation on the fifth diagram to obtain a second outer contour set; determining a first group of outer contours that meets a second preset condition in the second outer contour set; determining the largest longitudinal spacing among the longitudinal spacings between any two outer contours in the first group of outer contours; and extracting a single-line diagram from the low-voltage primary main wiring diagram based on the two outer contours corresponding to the largest longitudinal spacing.

[0005] In a second aspect, an electronic device is provided, comprising: at least one memory configured to store computer-readable code; and at least one processor configured to invoke the computer-readable code to perform the steps of the method provided in the first aspect.

[0006] Thirdly, a computer-readable medium is provided, on which computer-readable instructions are stored, which, when executed by a processor, cause the processor to perform the steps of the method provided in the first aspect.

[0007] Fourthly, a computer program product is provided, the computer program product being tangibly stored on a computer-readable medium and including computer-executable instructions that, when executed, cause at least one processor to perform the steps of the method provided in the first aspect. Attached Figure Description

[0008] The following figures are intended only to illustrate and explain the embodiments of this application, and do not limit the scope of the embodiments of this application. Wherein:

[0009] Figure 1 This is a flowchart of a method for extracting a single-line graph according to an embodiment of this application;

[0010] Figure 2 This is a schematic diagram of a fourth figure containing horizontal and vertical lines according to an embodiment of this application.

[0011] Figure 3 This is a schematic diagram of an electronic device according to an embodiment of this application.

[0012] Explanation of reference numerals in the attached figures

[0013] 100: Method for extracting single-line charts 101-110: Method steps

[0014] 300: Electronic device; 301: Processor; 302: Communication interface

[0015] 303: Memory; 304: Communication bus; 305: Program Detailed Implementation

[0016] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed merely to enable those skilled in the art to better understand and implement the subject matter described herein, and are not intended to limit the scope, applicability, or examples set forth in the claims. The function and arrangement of the elements discussed may be changed without departing from the scope of the embodiments of this application. Various processes or components may be omitted, substituted, or added as needed in the various examples. For example, the described methods may be performed in a different order than described, and steps may be added, omitted, or combined. Furthermore, features described in some examples may be combined in other examples.

[0017] As used herein, the term "comprising" and its variations are open terms meaning "including but not limited to". The term "based on" means "at least partially based on". The terms "one embodiment" and "an embodiment" mean "at least one embodiment". The term "another embodiment" means "at least one other embodiment". The terms "first", "second", etc., may refer to different or the same objects. Other definitions, whether explicit or implicit, may be included below. Unless explicitly indicated by the context, the definition of a term shall remain consistent throughout the specification.

[0018] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0019] Figure 1 This is a flowchart of a method for extracting a single-line graph according to an embodiment of this application, as follows: Figure 1 As shown, the single-line chart extraction method 100 includes:

[0020] Step 101: Convert the low-voltage primary main wiring diagram into a binary diagram.

[0021] Optionally, the low-voltage primary wiring diagram is converted to a grayscale image to obtain the eighth image. Gaussian blur is applied to the eighth image to obtain the ninth image. Image inversion is performed on the ninth image to obtain the tenth image. Adaptive threshold binarization is then performed on the tenth image to obtain a binary image.

[0022] The purpose of adaptive threshold binarization is to separate the target region from the background region, which mainly involves adjusting the neighborhood size and the threshold offset. The neighborhood size can range from [10, 20], while the threshold offset can range from [-10, 0].

[0023] Step 102: Perform erosion followed by expansion on the binary image to obtain the second image.

[0024] The erosion-dilation process can eliminate minor noise in the image and smooth target boundaries. Through related image processing techniques, the target region can be made more prominent, thus facilitating extraction.

[0025] Step 103: By extracting horizontal and vertical lines from the second image, a third image containing only horizontal lines and a fourth image containing both horizontal and vertical lines are obtained.

[0026] You can extract horizontal lines from the second image to obtain an image containing only horizontal lines. Similarly, extract vertical lines from the second image to obtain an image containing only vertical lines. Merging the images containing only horizontal lines and the images containing only vertical lines results in a fourth image containing both horizontal and vertical lines, as shown below. Figure 2 As shown.

[0027] In one embodiment, by extracting horizontal and vertical lines from the second image, a third image containing only horizontal lines, a fourth image containing both horizontal and vertical lines, and a sixth image containing only vertical lines are obtained. A positional operation is then performed on the third and sixth images to obtain a seventh image containing the intersection of horizontal and vertical lines.

[0028] Step 104: Perform an outer contour extraction operation in the fourth image to obtain the first outer contour set.

[0029] Optionally, since individual line segments in the fourth figure may not be smooth, and their thickness may vary at different points, the outer contour of an individual line segment in the fourth figure can be extracted, i.e., enclosed by a rectangle. The outer contours of multiple sets of intersecting line segments in the fourth figure can also be extracted. Here, the outer contour of a set of intersecting line segments refers to the rectangular outer contour that can enclose that set of intersecting line segments.

[0030] In one embodiment, the number of intersection points of each outer contour in the first outer contour set can be determined based on the seventh figure. Then, the area of ​​each outer contour in the first outer contour set is calculated.

[0031] Step 105: In the first set of outer contours, determine the first outer contour that satisfies the first preset condition.

[0032] Optionally, the first preset condition includes: containing four or more intersection points and having an area greater than a preset threshold. Optionally, the preset threshold can be set to the square of 200,000 pixels.

[0033] Step 106: Cut out the third image from the first outer contour to obtain the fifth image.

[0034] Optionally, the first outer contour can be extended outward by a preset distance before cutting.

[0035] Step 107: Perform an outer contour extraction operation in the fifth image to obtain the second outer contour set.

[0036] Extract the outer contours of multiple horizontal lines in the fifth figure. The outer contour of a horizontal line refers to the rectangular outer contour that can enclose the horizontal line.

[0037] Step 108: In the second set of outer contours, determine the first set of outer contours that meet the second preset conditions.

[0038] Optionally, before step 108, in the second outer contour set, when the distance between any two outer contours is less than a preset threshold, the corresponding outer contours are merged to obtain an updated second outer contour set.

[0039] Optionally, in the updated second outer contour set, a first set of outer contours that satisfy the second preset condition is determined. The first set of outer contours that satisfy the second preset condition includes N outer contours that are closest to the longest outer contour in the updated second outer contour set, where N is a positive integer. Optionally, N ≤ 5.

[0040] Step 109: Determine the largest longitudinal spacing among the longitudinal spacings between any two outer contours within the first set of outer contours.

[0041] Optionally, the longitudinal spacing between any two outer contours within the first set of outer contours is calculated to obtain multiple longitudinal spacings. The largest longitudinal spacing is then determined from among these multiple longitudinal spacings.

[0042] Alternatively, the longitudinal spacing between any two outer contours can be calculated using the following formula:

[0043]

[0044] Among them, dis x This represents the shortest distance between the two outer contours in the X direction, while dis y It represents the shortest distance between the two outer contours in the Y direction. and These are the coordinates of the center points of the two outer contours, respectively. and The coordinates of the midpoints of the two outer contours are respectively, w1 and w2 are the widths of the two outer contours respectively, and h1 and h2 are the heights of the two outer contours respectively.

[0045] Step 110: Extract the single-line diagram from the low-voltage primary main wiring diagram based on the two outer contours corresponding to the largest longitudinal spacing.

[0046] Optionally, before extraction, the line can be extended by a preset distance to preserve the edge lines of the single-line graph.

[0047] In one scenario, suppose the first set of outer contours contains four outer contours, numbered A, B, C, and D from top to bottom. The two outer contours with the largest vertical spacing are B and C. Based on outer contours B and C, the single-line diagram in the low-voltage primary main wiring diagram is extracted. Specifically, based on outer contour B and its horizontal extension to both sides of the low-voltage primary main wiring diagram (referred to as limit B), and outer contour C and its horizontal extension to both sides of the low-voltage primary main wiring diagram (referred to as limit C), the portion of the low-voltage primary main wiring diagram above limit B and below limit C is trimmed to extract the single-line diagram in the low-voltage primary main wiring diagram.

[0048] This application embodiment applies relevant image processing techniques to the low-voltage primary main wiring diagram to more accurately extract the horizontal and vertical lines. Secondly, the outer contour is extracted from the diagram containing both horizontal and vertical lines, and the first outer contour that meets the first preset condition is cropped from the diagram containing only horizontal lines. The outer contour is then extracted from the resulting diagram.

[0049] Among multiple outer contours that meet the second preset condition, two adjacent outer contours with the maximum longitudinal spacing are identified. This is used to trim the low-voltage primary main wiring diagram to extract the single-line diagrams. This embodiment of the application allows for the rapid and accurate extraction of single-line diagrams from low-voltage primary main wiring diagrams, which is beneficial for asset management and power flow calculation in low-voltage power distribution management.

[0050] Figure 3 This is a schematic diagram of an electronic device according to one embodiment of this application. The specific embodiments of this application do not limit the specific implementation of the electronic device. Figure 3 As shown, the electronic device 300 may include: a processor 301, a communications interface 302, a memory 303, and a communication bus 304. Wherein:

[0051] The processor 301, communication interface 302, and memory 303 communicate with each other through the communication bus 304.

[0052] Communication interface 302 is used to communicate with other electronic devices or servers.

[0053] The processor 301 is used to execute program 305, which can specifically execute the relevant steps in any of the aforementioned method embodiments.

[0054] Specifically, program 305 may include program code that includes computer operation instructions.

[0055] Processor 301 may be a CPU, an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application. The smart device may include one or more processors of the same type, such as one or more CPUs; or it may include processors of different types, such as one or more CPUs and one or more ASICs.

[0056] Memory 303 is used to store program 305. Memory 303 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0057] Specifically, program 305 can be used to cause processor 301 to execute any of the methods in the foregoing embodiments.

[0058] The specific implementation of each step in program 305 can be found in the corresponding steps and units described in the aforementioned single-line diagram extraction method embodiment, and will not be repeated here. Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the devices and modules described above can be referred to the corresponding process descriptions in the aforementioned method embodiments, and will not be repeated here.

[0059] This application also provides a computer-readable storage medium storing instructions for causing a machine to perform any of the methods described in the various method embodiments herein. Specifically, a system or apparatus equipped with a storage medium storing software program code that implements the functions of any of the embodiments described above, and enabling the computer (or CPU or MPU) of the system or apparatus to read and execute the program code stored in the storage medium.

[0060] In this case, the program code read from the storage medium can itself implement the function of any of the above embodiments, and therefore the program code and the storage medium storing the program code constitute part of this application.

[0061] Examples of storage media used to provide program code include floppy disks, hard disks, magneto-optical disks, and optical disks (such as CD-ROMs).

[0062] CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tape, non-volatile memory cards, and ROM. Optionally, program code can be downloaded from a server computer via a communication network.

[0063] This application also provides a computer program product, including computer instructions that instruct a computing device to perform any corresponding operation in the above-described plurality of method embodiments.

[0064] It should be noted that, depending on the implementation needs, the various components / steps described in the embodiments of this application can be broken down into more components / steps, or two or more components / steps or parts of the operation of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of this application.

[0065] The methods described in the embodiments of this application can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as a CD-ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code downloaded over a network that is originally stored in a remote recording medium or a non-transitory machine-readable medium and will be stored in a local recording medium. Thus, the methods described herein can be processed by software stored on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an ASIC or FPGA). It is understood that the computer, processor, microprocessor controller, or programmable hardware includes storage components (e.g., RAM, ROM, flash memory, etc.) capable of storing or receiving software or computer code that, when accessed and executed by the computer, processor, or hardware, implements the methods described herein. Furthermore, when a general-purpose computer accesses code used to implement the methods shown herein, the execution of the code transforms the general-purpose computer into a dedicated computer for executing the methods shown herein.

[0066] It should be noted that not all steps and modules in the above processes and system structure diagrams are necessary; some steps or modules can be omitted as needed. The execution order of each step is not fixed and can be adjusted as required. The system structure described in the above embodiments can be a physical structure or a logical structure. That is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or they may be jointly implemented by certain components in multiple independent devices.

[0067] In the above embodiments, the hardware modules can be implemented mechanically or electrically. For example, a hardware module may include permanent dedicated circuitry or logic (such as a dedicated processor, FPGA, or ASIC) to perform the corresponding operations. The hardware module may also include programmable logic or circuitry (such as a general-purpose processor or other programmable processor), which can be temporarily configured by software to perform the corresponding operations. The specific implementation method (mechanical, dedicated permanent circuitry, or temporarily configured circuitry) can be determined based on cost and time considerations.

[0068] The present invention has been shown and described in detail above with reference to the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art will know that more embodiments of the present invention can be obtained by combining the code review methods in the different embodiments above. These embodiments are also within the protection scope of the present invention.

Claims

1. A method for extracting a single line diagram, comprising: - converting (101) a low voltage primary main wiring diagram into a binary image; - performing a process of etching followed by expansion (102) on the binary image to obtain a second image; - extracting (103) horizontal lines and vertical lines respectively on the second image to obtain a third image containing only horizontal lines and a fourth image containing horizontal lines and vertical lines; - performing an outer contour extraction operation (104) on the fourth image to obtain a first outer contour set; - determining (105) a first outer contour satisfying a first preset condition in the first outer contour set; - clipping (106) the third image by the first outer contour to obtain a fifth image; - performing an outer contour extraction operation (107) on the fifth image to obtain a second outer contour set; - determining (108) a first group of outer contours satisfying a second preset condition in the second outer contour set; - determining (109) a maximum longitudinal distance between any two outer contours in the first group of outer contours; - extracting (110) a single line diagram in the low voltage primary main wiring diagram based on the two outer contours corresponding to the maximum longitudinal distance.

2. The method of claim 1, wherein, The extracting (103) of horizontal lines and vertical lines respectively on the second image to obtain a fourth image containing horizontal lines and vertical lines comprises: - extracting horizontal lines on the second image to obtain an image containing only horizontal lines; - extracting vertical lines on the second image to obtain an image containing only vertical lines; - merging the image containing only horizontal lines and the image containing only vertical lines to obtain the fourth image containing horizontal lines and vertical lines.

3. The method of claim 1, wherein, The performing an outer contour extraction operation (104) on the fourth image comprises: - extracting an outer contour of a single line segment in the fourth image; - extracting an outer contour of a plurality of sets of intersecting line segments in the fourth image; wherein an outer contour of a set of intersecting line segments comprises a rectangular outer contour that can enclose the set of intersecting line segments.

4. The method of claim 1, wherein, The first preset condition comprises: - containing more than four intersection points and having an area greater than a preset threshold. 5.The method of claim 4, wherein - the extracting (103) of horizontal lines and vertical lines respectively on the second image to obtain a third image containing only horizontal lines and a fourth image containing horizontal lines and vertical lines comprises: - extracting horizontal lines and vertical lines respectively on the second image to obtain a third image containing only horizontal lines, a fourth image containing horizontal lines and vertical lines, and a sixth image containing only vertical lines; - performing an intersection operation on the third image and the sixth image to obtain a seventh image containing intersection points of horizontal lines and vertical lines; - before determining a first outer contour satisfying the first preset condition in the first outer contour set, the method further comprises: - determining a number of intersection points possessed by each outer contour in the first outer contour set based on the seventh image; - calculating an area of each outer contour in the first outer contour set.

6. The method of claim 1, wherein, Before determining (108) a first group of outer contours satisfying a second preset condition in the second outer contour set, the method further comprises: - when a distance between any two outer contours in the second outer contour set is less than a preset threshold, merging the corresponding outer contours to obtain an updated second outer contour set.

7. The method of claim 6, wherein, In the second set of outer contours, determining (108) a first group of outer contours satisfying a second preset condition comprises: - determining a first group of outer contours satisfying a second preset condition in the updated second set of outer contours; wherein the first group of outer contours satisfying the second preset condition comprises N outer contours closest to the longest outer contour in the updated second set of outer contours, wherein N is a positive integer.

8. The method of claim 1, wherein, The outer contour extraction operation (107) in the fifth image comprises: - extracting outer contours of a plurality of horizontal lines in the fifth image; wherein the outer contour of a horizontal line comprises a rectangular outer contour that can enclose the horizontal line.

9. The method of claim 1, wherein, Determining (109) the maximum longitudinal distance in the longitudinal distance between any two outer contours in the first group of outer contours comprises: - calculating the longitudinal distance between any two outer contours in the first group of outer contours to obtain a plurality of longitudinal distances; - determining the maximum longitudinal distance in the plurality of longitudinal distances.

10. The method of claim 1, wherein, The conversion (101) of the low-voltage primary wiring diagram into a binary image comprises: - converting the low-voltage primary wiring diagram into a grayscale image to obtain an eighth image; - applying Gaussian blur to the eighth image to obtain a ninth image; - performing image inversion on the ninth image to obtain a tenth image; - performing image adaptive threshold binarization on the tenth image to obtain a binary image.

11. An electronic device (300) comprising: The processor (301), the communication interface (302), the memory (303), and the communication bus (304), the processor (301), the memory (303), and the communication interface (302) communicate with each other through the communication bus (304); The memory (303) is used to store at least one executable instruction, and the executable instruction causes the processor to execute the operations corresponding to the single-line diagram extraction method in any one of claims 1-10.

12. A computer storage medium having a computer program stored thereon, the program being executed by a processor to implement the single-line diagram extraction method according to any one of claims 1-10.

13. A computer program product tangibly stored on a computer-readable medium and comprising computer-executable instructions that, when executed, cause at least one processor to perform the single-line diagram extraction method according to any one of claims 1-10.

Citation Information

Patent Citations

  • Power system main wiring diagram reading method and system based on Konva

    CN115269505A

  • Image processing apparatus having means for synthesizing binarized image data

    US5138443A