Sag measuring and calculating method and device of distribution line, storage medium and computer equipment
By acquiring the visual image of the distribution line, identifying the edge profile and fitting the curve, using deep learning models and drone camera devices, the problem of inefficient measurement of the distribution line sag position is solved, and efficient and accurate sag measurement is achieved.
Patent Information
- Application Number
- CN202510337688.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-08-15
AI Technical Summary
In the prior art, the measurement efficiency of the sag position of the distribution wire is inefficient and the accuracy is insufficient, making it difficult to meet the power industry's demand for timely update of line parameters.
By acquiring the visual image of the distribution wire, identifying and marking the edge profile, identifying the spatial coordinates of the components, and performing curve fitting to determine the position of the sag, the edge detection is enhanced using deep learning models such as YOLOv5 and EMA attention modules, and the images are collected and calculated in combination with the drone camera device.
It significantly improves the efficiency and accuracy of sag measurement, enhances the measurement ability of the sag position of the distribution line, and meets the rapid development needs of the power system.
Smart Images

Figure CN120495397A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power system monitoring and detection, and in particular to a method, device, storage medium and computer equipment for measuring sag of a distribution line. Background Art
[0002] With the continuous expansion and increasing complexity of power networks, the requirements for power supply reliability and safety are increasing. In modern power systems, poles and towers serve as critical infrastructure supporting distribution lines. Accurately measuring the sag parameters of distribution lines directly affects the safe distance between distribution lines and the ground and obstacles. Accurately obtaining sag position information is of great guiding significance for the planning, design, construction, and daily maintenance and repair of distribution lines. It can help optimize line layout, reasonably arrange the spacing and height of poles and towers, and improve the overall performance of the power system. Conversely, unreasonable sag margin may result in insufficient distance between distribution lines and ground objects, which can easily lead to discharge accidents. This not only affects the stability of power transmission, but can even endanger the safety of surrounding personnel and facilities.
[0003] Currently, traditional sag position measurement is mostly achieved through manual measurement, which typically requires operators to use measuring tools near towers or lines. However, manual measurement is inefficient, especially for long-distance, large-scale distribution lines. The measurement work requires a lot of manpower and time, and is prone to human error, making it difficult to guarantee measurement accuracy. This results in low sag position measurement capabilities for distribution lines, making it difficult to meet the needs of the rapidly developing power industry for timely line parameter updates. Summary of the Invention
[0004] In view of this, the present application provides a method, device, storage medium and computer equipment for measuring the sag of distribution lines, the main purpose of which is to solve the technical problem of low measurement capability of the sag position of distribution lines.
[0005] According to a first aspect of the present invention, a method for calculating sag of a distribution line is provided, the method comprising:
[0006] acquiring a visual image including a power distribution line, and identifying a power distribution line image of the power distribution line in the visual image;
[0007] determining an edge contour of the distribution line in the distribution line image, and marking the edge contour in the visual image to obtain an edge contour image;
[0008] identifying a plurality of distribution line components of the distribution line in the edge contour image, and determining component space coordinates of each of the distribution line components based on positions of the distribution line components in the edge contour image;
[0009] Curve fitting is performed on the spatial coordinates of all the components to obtain a distribution line fitting curve, and the sag position of the distribution line is determined based on the distribution line fitting curve.
[0010] Optionally, identifying the distribution line image of the distribution line in the visual image includes: performing image denoising processing on the visual image to obtain a visual image after image denoising processing; inputting the visual image into a pre-trained image recognition model to identify the distribution line image of the distribution line in the visual image through the image recognition model.
[0011] Optionally, determining the edge contour of the distribution line in the distribution line image includes: calculating the horizontal gradient value and the vertical gradient value of each pixel point in the distribution line image, and determining the gradient amplitude and gradient direction of the pixel point based on the horizontal gradient value and the vertical gradient value; determining whether the gradient amplitude of the pixel point is greater than the gradient amplitude of the adjacent pixel point corresponding to the pixel point, wherein the adjacent pixel point is the pixel point adjacent to the pixel point along the gradient direction of the pixel point; when the gradient amplitude of the pixel point is greater than the gradient amplitude of the adjacent pixel point, determining the pixel point as an edge contour point; and determining all the edge contour points contained in the distribution line image as the edge contour.
[0012] Optionally, before calculating the horizontal gradient value and the vertical gradient value of each pixel in the distribution line image, and determining the gradient amplitude and gradient direction of the pixel based on the horizontal gradient value and the vertical gradient value, the method further includes: performing grayscale processing and noise reduction processing on the distribution line image to obtain the distribution line image after grayscale processing and noise reduction processing.
[0013] Optionally, determining all the edge contour points contained in the distribution line image as the edge contours includes: in the distribution line image, comparing the gradient amplitude of each edge contour point with a preset first gradient threshold value, and when the gradient amplitude of the edge contour point is greater than the first gradient threshold value, determining the edge contour point as a true edge contour point, and determining the edge contour points other than the true edge contour point among all the edge contour points as edge contour points to be selected; comparing the gradient amplitude of each edge contour point to be selected with a preset second gradient threshold value, and when the gradient amplitude of the edge contour point to be selected is greater than the second gradient threshold value, determining whether the edge contour point to be selected is adjacent to the true edge contour point, and when the edge contour point to be selected is adjacent to the true edge contour point, determining the edge contour point to be selected as the true edge contour point; and determining all the true edge contour points contained in the distribution line image as the edge contours.
[0014] Optionally, the visual image is captured by a camera device provided on an aircraft, and when the camera device captures the visual image, the aircraft flies in a direction parallel to the power distribution line.
[0015] Optionally, the acquiring of a visual image containing a distribution line and identifying the distribution line image of the distribution line in the visual image comprises: acquiring a plurality of visual images and identifying the distribution line image of the distribution line in each visual image, wherein the device space position of the camera device is different when the camera device takes each visual image, and each visual image contains the same distribution line; determining the component space coordinates of each distribution line component based on the position of the distribution line component in the edge contour image comprises: determining a component image corresponding to the same distribution line component in each edge contour image, and determining the image position information of the component image in each edge contour image; determining the relative position between the distribution line component and the camera device when the camera device takes the visual image corresponding to the edge contour image based on the image position information; determining the component space coordinates of the distribution line component based on the relative position corresponding to each edge contour image and the device space position of the camera device when taking the visual image corresponding to each edge contour image.
[0016] According to a second aspect of the present invention, there is provided a sag measuring device for a power distribution line, characterized in that the device comprises:
[0017] an image acquisition module, configured to acquire a visual image including a distribution line and identify a distribution line image of the distribution line in the visual image;
[0018] a contour recognition module, configured to determine an edge contour of the distribution line in the distribution line image, and mark the edge contour in the visual image to obtain an edge contour image;
[0019] a position recognition module, configured to recognize a plurality of distribution line components of the distribution line in the edge contour image, and determine a component space coordinate of each of the distribution line components based on a position of the distribution line components in the edge contour image;
[0020] An information output module is used to perform curve fitting on the spatial coordinates of all the components to obtain a distribution line fitting curve, and determine the sag position of the distribution line based on the distribution line fitting curve.
[0021] According to a third aspect of the present invention, there is provided a storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the above-mentioned method for measuring the sag of a power distribution line.
[0022] According to a fourth aspect of the present invention, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for measuring the sag of distribution lines when executing the program.
[0023] The present invention provides a method, device, storage medium and computer equipment for measuring the sag of a distribution line. First, a camera device installed at an aircraft such as a drone can be used to capture a visual image containing the distribution line, and the distribution line image of the distribution line can be determined in the visual image; then, the edge contour of the distribution line is determined in the distribution line image, and the edge contour is marked in the visual image so that the edge contour is displayed in the visual image to obtain an edge contour image; then, multiple distribution line components of the distribution line, such as spacers and other components, are identified in the edge contour image, and based on the position of the distribution line components in the edge contour image, the component spatial coordinates of each distribution line component in space are determined; finally, curve fitting is performed on the spatial coordinates of all components to obtain a distribution line fitting curve that can characterize the distribution line, so as to depict the actual shape of the distribution line in space, and the sag position of the distribution line can be determined on the distribution line fitting curve. The technical solution provided in the present application more accurately extracts the coordinate information of the distribution line components in the distribution line and performs spatial curve fitting, thereby solving the distribution line fitting curve, and then determining the sag position information of the distribution line based on the distribution line fitting curve; compared with the existing manual measurement method, this technical solution can significantly improve the efficiency and accuracy of sag measurement, thereby significantly enhancing the ability to measure the sag position of the distribution line.
[0024] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0026] Figure 1 A schematic flow chart of a method for calculating sag of a distribution line provided by an embodiment of the present invention is shown;
[0027] Figure 2A schematic diagram of determining a shooting angle of a component image provided by an embodiment of the present invention is shown;
[0028] Figure 3 A schematic structural diagram of a sag measuring device for a distribution line provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0029] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that, unless there is a conflict, the embodiments and features in the embodiments of the present application can be combined with each other.
[0030] Currently, traditional sag position measurement is mostly achieved manually, typically requiring operators to use measuring tools near towers or lines. However, manual measurement is inefficient, especially for long-distance, large-scale distribution lines. The measurement process is labor-intensive and time-consuming, and is subject to human error, making it difficult to guarantee accurate measurements. This results in limited sag position measurement capabilities for distribution lines, making it difficult to meet the rapidly developing power industry's demand for timely line parameter updates.
[0031] In order to solve the above problems, in one embodiment, Figure 1 As shown, a method for calculating the sag of a distribution line is provided. The method is described by taking the application of the method to computer equipment as an example, and includes the following steps:
[0032] 101. Acquire a visual image containing a distribution line, and identify the distribution line image of the distribution line within the visual image. Here, a binocular camera or other imaging device installed on a drone can be used to capture at least two stable, high-quality visual images of the same section of the distribution line while the drone flies along the direction in which the distribution line extends, thereby obtaining a visual image containing the distribution line.
[0033] Furthermore, after obtaining the visual image containing the distribution lines, the visual image is subjected to image noise reduction processing to obtain the visual image after image noise reduction processing; specifically, the median filtering method can be used to remove the noise points in the visual image, so as to make the visual image clearer and cleaner without destroying the original characteristics of the visual image, thereby further improving the image quality of the visual image.
[0034] Furthermore, the denoised visual image is input into a pre-trained image recognition model, and the distribution line image of the distribution line is identified in the visual image through the image recognition model, that is, the position of the distribution line image of the distribution line in the visual image is identified, and then the distribution line image of the distribution line is highlighted in the visual image to identify the distribution line image of the distribution line in the visual image.
[0035] Among them, the training method of the image recognition model includes: first, obtaining multiple sample images containing distribution lines, and screening the sample images to retain sample images with good image quality; then, marking the distribution lines in the sample images, and normalizing and denoising the marked sample images; then, using the normalized and denoised sample images as sample sets to train the image recognition model, and obtain an image recognition model that can identify distribution lines in images.
[0036] 102. Determine an edge contour of the distribution line in the distribution line image, and mark the edge contour in the visual image to obtain an edge contour image.
[0037] Specifically, the edge points of the distribution line in the distribution line image can be determined, and all edge points can be combined into the edge contour of the distribution line; further, based on the position of the distribution line image in the visual image and the position of the edge contour in the distribution line image, the edge contour can be marked to the position of the distribution line in the visual image to obtain an edge contour image.
[0038] 103. Identify a plurality of distribution line components of the distribution line in the edge contour image, and determine component space coordinates of each distribution line component based on positions of the distribution line components in the edge contour image.
[0039] Among them, the coordinate system where the component space coordinates are located has the bottom of the first tower where the distribution line is installed as the origin, the coordinate axis extending upward from the bottom of the tower as the vertical coordinate axis, and the coordinate axis extending horizontally from the first tower to the second tower where the distribution line is installed as the horizontal coordinate axis.
[0040] Specifically, the edge contour image can be input into a pre-trained deep learning model for object detection to identify multiple distribution line components within the edge contour image. These components can include components such as spacers on the distribution line. Furthermore, the deep learning model for object detection can be a YOLOv5 network model that incorporates the Efficient Multi-scale Attention (EMA) module to enhance the YOLOv5 model's processing of the attention features of the spacers and distribution lines.
[0041] Here, by reshaping some channels of the YOLOv5 network model to the batch dimension and dividing the channel dimension into multiple sub-features, we can fully preserve the information contained in each channel while effectively reducing the amount of computation, thereby reducing computational cost. Furthermore, to aggregate multi-scale spatial structural information, a 3×3 convolution kernel and a 1×1 convolution kernel branch are used in parallel to obtain fast responses. The use of feature grouping and multi-scale structural patterns facilitates the establishment of short-term and long-term dependencies, thereby achieving better model performance.
[0042] Specifically, assume that the input edge contour image x∈R is used as the feature map C*H*W , where C is the number of channels, H and W are the height and width of the feature map, respectively. First, the feature map is divided into M sub-features along the channel dimension to learn different semantic information and strengthen the feature representation of the region of interest in each sub-feature. EMA extracts the attention weights of the grouped feature maps through three parallel routes. Two parallel paths encode the channels along two spatial directions on a 1×1 branch, concatenate the two encoded features along the image height direction, and share a 1×1 convolution without reducing the dimensionality of the 1×1 branch. To achieve feature interaction between the two parallel paths, two nonlinear Sigmoid functions are used to fit the linear convolution to aggregate the attention maps of the two channels. At the same time, the third path captures multi-scale feature representations through a 3×3 convolution on a 3×3 branch.
[0043] Then, two-dimensional global average pooling is used to encode the global spatial information of the 1×1 and 3×3 branch outputs respectively. Before the channel feature joint activation mechanism, the output of the minimum branch is directly converted into the corresponding dimensional shape through Formula 1:
[0044]
[0045] Where C is the number of channels, Z C is the global average pooling result of the Cth channel, H and W are the height and width of the feature map, respectively, and i and j are sequence constants. Furthermore, to improve computational efficiency, the output features processed by the two-dimensional global average pooling are fitted with the nonlinear function Softmax of the two-dimensional Gaussian map to perform linear transformations. The output of the above parallel processing is multiplied by the matrix dot product to obtain the first spatial attention map containing spatial information of different scales. On this basis, a second spatial attention map is further generated that retains the entire precise spatial position information. Finally, the two spatial attention weight values generated for each set of output feature maps are aggregated using the Sigmoid function. The final output attention weight map is consistent with the original feature size and covers the global context information of the pixel.
[0046] This approach, based on the improved YOLOv5 network model using EMA attention weighting, can allocate more attention to distribution line components and the areas where they are located, thereby improving the model's ability to learn and express useful information. In actual use, the input edge contour image first undergoes grayscale conversion and edge enhancement. The enhanced image then passes through the CSPDarknet53 backbone network, consisting of a series of convolutional layers and a residual structure, for feature extraction. The enhanced image is then input into the EMA attention module to enhance target weights. Multi-scale feature fusion is then completed through the neck network, and the image is then input into the detection head network to perform a probability assessment of the presence of target areas in candidate areas, resulting in detection results for distribution line components and distribution lines.
[0047] Furthermore, after identifying multiple distribution line components of the distribution line in the edge contour image, the relative position between each distribution line component and the camera device that captures the visual image is determined based on the position of each distribution line component in the edge contour image.
[0048] Specifically, the position information of the camera device when capturing the visual image can be determined, and the relative position between the distribution line components and the camera device can be determined based on the edge contour image. Here, the camera device can be installed on an aircraft such as a drone. When the camera device captures the visual image, the geographic location information of the aircraft at that time, such as coordinate information including three-dimensional coordinates, can be recorded and bound to the visual image to serve as the position information of the camera device when the visual image was captured. Furthermore, based on the actual size of the distribution line components, combined with imaging principles and camera parameters, the position and depth of the distribution line components in three-dimensional space can be estimated, thereby determining the relative position between each distribution line component and the camera device that captured the visual image.
[0049] Furthermore, based on the pre-recorded position information of the camera device when capturing the visual image corresponding to the edge contour image, and the relative position between each distribution line component and the camera device capturing the visual image, the component space coordinates of each distribution line component are determined.
[0050] 104. Perform curve fitting on the spatial coordinates of all the components to obtain a distribution line fitting curve, and determine the sag position of the distribution line based on the distribution line fitting curve.
[0051] Specifically, if the coordinate system in which the component's spatial coordinates are located has a ray extending from the base of the first tower to the sky as the vertical axis, and a coordinate axis extending horizontally from the first tower where the distribution line is installed to the second tower as the horizontal axis, then the coordinate point corresponding to the minimum value of the vertical coordinate in the distribution line fitting curve can be determined, and the coordinate value of the coordinate point in the coordinate system can be determined as the sag position of the distribution line.
[0052] The sag measurement method for distribution lines provided in this embodiment can be based on visual positioning and deep learning technology. It can more accurately extract the coordinate information of the distribution line components in the distribution line and perform spatial curve fitting to solve the distribution line fitting curve, and then determine the sag position information of the distribution line based on the distribution line fitting curve that can characterize the shape of the distribution line. Compared with the existing manual measurement method, this technical solution can significantly improve the efficiency and accuracy of sag measurement, thereby significantly enhancing the measurement capability of the sag position of the distribution line.
[0053] In an optional embodiment, the method of determining the edge contour of the distribution line in the distribution line image includes:
[0054] First, the horizontal gradient value and the vertical gradient value of each pixel in the distribution line image are calculated, and the gradient amplitude and the gradient direction of the pixel are determined based on the horizontal gradient value and the vertical gradient value; wherein the horizontal gradient value and the vertical gradient value are the grayscale gradients of the distribution line image in the horizontal and vertical directions, respectively.
[0055] Specifically, the distribution line image can be grayscale processed to obtain a grayscale processed distribution line image. Furthermore, the distribution line image can be spatially smoothed using Gaussian filtering to reduce the impact of noise on edge detection. Here, the distribution line image can be smoothed based on Formula 2:
[0056] I smooth (x,y)=I(x,y)*G(x,y,σ)(2)
[0057] Among them, I smooth (x, y) is the distribution line image after smoothing, I(x, y) is the original distribution line image, G(x, y, σ) is the Gaussian filter function, σ is the standard deviation, x is the pixel in the horizontal direction, and y is the pixel in the vertical direction.
[0058] Furthermore, the first-order discrete differential operator Sobel can be used to calculate the horizontal gradient value and vertical gradient value of each pixel of the smoothed distribution line image. Furthermore, the gradient amplitude of each pixel is calculated based on Formula 3:
[0059]
[0060] Among them, G is the gradient amplitude of the pixel point, G x is the horizontal gradient value of the pixel point, G y is the vertical gradient value of the pixel. Further, the gradient direction of each pixel is determined according to Formula 4:
[0061]
[0062] Among them, θ is the gradient direction, G x is the horizontal gradient value of the pixel point, G y is the vertical gradient value of the pixel.
[0063] Then, it is determined whether the gradient amplitude of the pixel point is greater than the gradient amplitude of the adjacent pixel point corresponding to the pixel point, wherein the adjacent pixel point is the pixel point adjacent to the pixel point on the power distribution line image along the gradient direction of the pixel point.
[0064] Specifically, the gradient direction of each pixel can be determined, and a preset number of other pixels arranged before and after the pixel along the gradient direction can be identified as adjacent pixels. It is then determined whether the gradient magnitude of the pixel is greater than the gradient magnitude of the adjacent pixels. The value of the preset number can be determined based on actual conditions.
[0065] Then, when the gradient magnitude of the pixel point is greater than the gradient magnitude of the adjacent pixel point, the pixel point is determined as an edge contour point.
[0066] Specifically, after a pixel is determined to be an edge contour point, the location of the edge contour point in the power distribution line image can be marked. If the gradient amplitude of the pixel is less than or equal to the gradient amplitude of the adjacent pixel, the pixel is determined to be a non-edge contour point.
[0067] Finally, all the edge contour points contained in the distribution line image are determined as the edge contour. The embodiment provided by the present application can compare the gradient amplitude of each pixel point in the distribution line image with the gradient amplitude of the adjacent pixel points. If the gradient amplitude of a certain pixel point is the gradient amplitude of the local maximum, then the pixel point is marked as an edge contour point; conversely, if the gradient amplitude of a certain pixel point is not the gradient amplitude of the local maximum, then the pixel point is marked as a non-edge contour point, and then by refining the edge value, a more accurate single-pixel edge is obtained, and then the edge contour of the distribution line in the image is accurately detected, providing more accurate information for subsequent feature extraction, and improving the measurement accuracy of sag.
[0068] In an optional embodiment, the method of determining all the edge contour points contained in the distribution line image as the edge contours includes: first, comparing the gradient amplitude of each of the edge contour points with a preset first gradient threshold; when the gradient amplitude of the edge contour point is greater than the first gradient threshold, determining the edge contour point as a true edge contour point; and determining the edge contour points other than the true edge contour points among all the edge contour points in the distribution line image as edge contour points to be selected.
[0069] The value of the first gradient threshold may be determined according to actual conditions, and the gradient amplitude of an edge contour point is the gradient amplitude of a pixel point corresponding to the edge contour point.
[0070] Then, the gradient amplitude of each of the to-be-selected edge contour points is compared with a preset second gradient threshold value. When the gradient amplitude of the to-be-selected edge contour point is greater than the second gradient threshold value, it is determined whether the to-be-selected edge contour point is adjacent to the true edge contour point. When the to-be-selected edge contour point is adjacent to the true edge contour point, the to-be-selected edge contour point is determined to be the true edge contour point.
[0071] The value of the second gradient threshold can be determined according to actual conditions, and the value of the second gradient threshold is smaller than the value of the first gradient threshold.
[0072] Finally, all of the true edge contour points contained in the distribution line image are determined as the edge contour, so that an edge contour is formed by combining all of the true edge contour points. The embodiments provided herein can filter out edge contour points with excessively low gradient amplitudes, thereby avoiding determining pixels at non-edge locations of the distribution line as edge contour points, thereby improving the accuracy of identifying the edge contour of the distribution line.
[0073] In an optional embodiment, the method of obtaining a visual image containing a distribution line and identifying the distribution line image of the distribution line in the visual image further includes: obtaining multiple visual images and determining the distribution line image of the distribution line in each visual image through an image recognition model, wherein the spatial position of the camera device is different when the camera device takes each visual image, and each visual image contains the same distribution line.
[0074] Specifically, when the camera device captures a visual image containing a distribution line, the aircraft can fly in a direction parallel to the distribution line, that is, the aircraft flies in a straight line parallel to the two towers on which the distribution line is installed, and captures multiple visual images containing the distribution line.
[0075] Then, for each visual image, the edge contour of the distribution line can be determined in the distribution line image within each visual image, and the edge contour can be marked in the visual image to obtain multiple edge contour images. Furthermore, for each edge contour image, multiple distribution line components of the distribution line can be identified in each edge contour image.
[0076] Furthermore, determining the component space coordinates of each of the distribution line components based on the position of the distribution line components in the edge contour image includes:
[0077] First, a component image corresponding to the same power distribution line component is determined in each of the edge contour images, and image position information of the component image in each of the edge contour images is determined.
[0078] Specifically, each component image of a distribution line component in the first edge contour image can be identified in the edge contour image, and each component image in the first edge contour image can be labeled with a specific number. Furthermore, each component image of a distribution line component in the edge contour image can be identified in other edge contour images, and it can be determined whether the identified component image belongs to the same distribution line component as a component image labeled in the first edge contour image. If the component image identified in the other edge contour images belongs to the same distribution line component as a component image labeled in the first edge contour image, the component images belonging to the same distribution line component in multiple edge contour images are labeled with the same number, so that the component image corresponding to the same distribution line component can be determined in each edge contour image.
[0079] Furthermore, the image position information of the component images belonging to the same power distribution line component in each edge contour image can be determined. Figure 2 As shown, the image center 211 of the edge contour image 210 can be determined, wherein the image center 211 can be the center point of the edge contour image 210; further, the image center point of the component image 212 in the edge contour image is determined, and the angle value between two rays extending from the camera lens 221 of the camera 220 and pointing to the image center 211 and the image center point of the component image 212 respectively is determined, and the angle value is determined as the shooting angle, and the shooting angle is determined as the image position information of the component image 212 in the edge contour image 210.
[0080] Then, based on the image position information, the relative position between the distribution line component and the camera device is determined when the camera device captures the visual image corresponding to the edge contour image; specifically, the angle between the camera lens of the camera device and the horizontal plane where the camera device is located can be determined when the camera device captures the visual image corresponding to the edge contour image, that is, the angle between the ray projected outward from the lens center point of the camera lens along the direction of the lens center axis and the horizontal plane where the camera device is located, and the angle of the angle is determined; further, the angle value between the distribution line component and the horizontal plane where the camera device is located is determined through the shooting angle and the angle, and the angle value is determined as the relative position between the distribution line component and the camera device.
[0081] Finally, based on the relative position corresponding to each edge contour image and the device spatial position of the camera device when capturing the visual image corresponding to each edge contour image, the component spatial coordinates of the distribution line component are determined.
[0082] Here, the coordinate system where the spatial coordinates of the device are located is a three-dimensional coordinate system. The three-dimensional coordinate system uses the ray extending from the bottom of the first tower to the sky as the vertical axis, and the coordinate axis extending horizontally from the first tower where the distribution line is installed to the second tower as the horizontal axis. The ray that is perpendicular to both the vertical and horizontal axes and projected toward the location of the camera device is used as the third-dimensional coordinate axis (i.e., the Z axis).
[0083] Furthermore, the three-dimensional coordinates of the aircraft on which the imaging device is mounted are obtained in the three-dimensional coordinate system when the imaging device captures each visual image, and the three-dimensional coordinates are determined as the spatial position of the imaging device when the imaging device captures the visual image corresponding to the edge contour image. Furthermore, the relative position corresponding to each edge contour image is obtained, that is, the angle between the distribution line component and the imaging device when the imaging device captures the visual image corresponding to the edge contour image. Based on the relative position corresponding to each edge contour image and the spatial position of the imaging device corresponding to each edge contour image, the three-dimensional spatial coordinates of the distribution line component in the three-dimensional coordinate system are determined.
[0084] Furthermore, the Z-axis coordinates in the three-dimensional space are reset to zero, obtaining the spatial coordinates of the distribution line components in the form of two-dimensional coordinate information. The embodiments provided herein can determine the two-dimensional coordinates of distribution line components based on multiple edge contour images, providing a computational basis for subsequent curve fitting.
[0085] Furthermore, the two-dimensional coordinates of each distribution line component of the distribution line segment can be obtained by the above method. Furthermore, a mathematical simulation can be performed based on the two-dimensional coordinates of each distribution line component of the distribution line segment between two towers. The two-dimensional coordinates of each distribution line component are respectively substituted into Formula 5 to obtain the fitting formula corresponding to each distribution line component:
[0086] u=a0+a1v+a2v 2 (5)
[0087] Wherein, u is the vertical coordinate of the two-dimensional coordinate, v is the horizontal coordinate of the two-dimensional coordinate, and a0, a1 and a2 are curve fitting coefficients.
[0088] Furthermore, based on Formula 6, the least squares method can be used to find the minimum value of the sum of squared errors:
[0089]
[0090] Where t is the number of components in the distribution line, E is the sum of squared errors, and u t is the vertical coordinate of the two-dimensional coordinate, v t is the horizontal coordinate of the two-dimensional coordinate, and a0, a1, and a2 are the curve fitting coefficients. Specifically, the fitting formula of each distribution line component of this section of distribution line is substituted into Formula 6, and the partial derivatives of a0, a1, and a2 are calculated based on Formula 7:
[0091]
[0092] Where t is the number of components in the distribution line, E is the sum of squared errors, and u t is the vertical coordinate of the two-dimensional coordinate, v t is the horizontal coordinate of the two-dimensional coordinate, and a0, a1, and a2 are the curve fitting coefficients. Furthermore, solve Equation 7 to obtain the values of a0, a1, and a2. These values are then substituted into Equation 5, making Equation 5 a function of the distribution line's fitting curve. Furthermore, on the fitting curve, determine the point where the vertical coordinate u of the two-dimensional coordinate reaches its minimum value. This point's coordinate value is then determined as the sag coordinate of the distribution line.
[0093] The sag measurement method for distribution lines provided in this embodiment uses the YOLOv5 network model as the basic detection model to identify distribution line components such as spacers in the edge contour image; at the same time, the Canny edge detection operator and the EMA attention module are introduced to perform target enhancement processing on the distribution lines and the information of distribution line components. By more accurately extracting the center coordinates of the distribution line components and combining the bundle adjustment method to further obtain the spatial information of the spacers, the sag position is solved by establishing a spatial curve fitting model. Compared with the existing manual measurement method, the efficiency and accuracy of the sag measurement can be significantly improved, thereby significantly enhancing the measurement capability of the sag position of the distribution line.
[0094] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, storage, and display, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. In addition, the numbers corresponding to the various steps in the above embodiments serve only as identifiers and do not limit the order in which the steps are executed. The order in which the steps are executed in each embodiment can be set according to actual circumstances.
[0095] Further, as Figure 1 The specific implementation of the method shown in this embodiment provides a sag measurement device for distribution lines, such as Figure 3As shown, the device includes: an image acquisition module 31 , a contour recognition module 32 , a position recognition module 33 and an information output module 34 .
[0096] The image acquisition module 31 is configured to acquire a visual image including a distribution line and determine a distribution line image of the distribution line in the visual image;
[0097] A contour recognition module 32 is configured to determine an edge contour of the distribution line in the distribution line image and mark the edge contour in the visual image to obtain an edge contour image;
[0098] a position recognition module 33, configured to recognize a plurality of distribution line components of the distribution line in the edge contour image, and determine a component spatial coordinate of each distribution line component based on a position of the distribution line component in the edge contour image;
[0099] The information output module 34 may be used to perform curve fitting on the spatial coordinates of all the components to obtain a distribution line fitting curve, and determine the sag position of the distribution line based on the distribution line fitting curve.
[0100] In a specific application scenario, the image acquisition module 31 can be specifically used to perform image denoising on the visual image to obtain a visual image after image denoising; the visual image is input into a pre-trained image recognition model so that the image recognition model can identify the distribution line image of the distribution line in the visual image.
[0101] In a specific application scenario, the contour recognition module 32 can be specifically used to calculate the horizontal gradient value and the vertical gradient value of each pixel point in the distribution line image, and determine the gradient amplitude and gradient direction of the pixel point based on the horizontal gradient value and the vertical gradient value; determine whether the gradient amplitude of the pixel point is greater than the gradient amplitude of the adjacent pixel point corresponding to the pixel point, wherein the adjacent pixel point is the pixel point adjacent to the pixel point along the gradient direction of the pixel point; when the gradient amplitude of the pixel point is greater than the gradient amplitude of the adjacent pixel point, the pixel point is determined as an edge contour point; and all the edge contour points contained in the distribution line image are determined as the edge contour.
[0102] In a specific application scenario, the contour recognition module 32 may be further configured to perform grayscale processing and noise reduction processing on the distribution line image to obtain a distribution line image after grayscale processing and noise reduction processing.
[0103] In a specific application scenario, the contour recognition module 32 can also be used to compare the gradient amplitude of each edge contour point with a preset first gradient threshold value. When the gradient amplitude of the edge contour point is greater than the first gradient threshold value, the edge contour point is determined to be a true edge contour point, and all the edge contour points except the true edge contour point are determined to be selected edge contour points; the gradient amplitude of each of the to-be-selected edge contour points is compared with a preset second gradient threshold value. When the gradient amplitude of the to-be-selected edge contour point is greater than the second gradient threshold value, it is determined whether the to-be-selected edge contour point is adjacent to the true edge contour point. When the to-be-selected edge contour point is adjacent to the true edge contour point, the to-be-selected edge contour point is determined to be a true edge contour point; all the true edge contour points contained in the distribution line image are determined to be the edge contours.
[0104] In a specific application scenario, the image acquisition module 31 can be used to obtain multiple visual images and identify the distribution line image of the distribution line in each visual image. When the camera device takes each visual image, the spatial position of the camera device is different, and each visual image contains the same distribution line.
[0105] In a specific application scenario, the position identification module 33 can be specifically used to determine the component image corresponding to the same distribution line component in each edge contour image, and determine the image position information of the component image in each edge contour image; based on the image position information, determine the relative position between the distribution line component and the camera device when the camera device captures the visual image corresponding to the edge contour image; based on the relative position corresponding to each edge contour image, and the device spatial position of the camera device when capturing the visual image corresponding to each edge contour image, determine the component spatial coordinates of the distribution line component.
[0106] It should be noted that for other corresponding descriptions of the functional units involved in the sag measurement device for distribution lines provided in this embodiment, please refer to Figure 1 The corresponding description in will not be repeated here.
[0107] Based on the above Figure 1 The method shown in FIG. 1 is a method for performing the above-mentioned operation. Accordingly, this embodiment further provides a storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned Figure 1 、 Figure 2 The sag calculation method for distribution lines shown in FIG.
[0108] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product. The software product to be identified can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each implementation scenario of the present application.
[0109] Based on the above Figure 1 The method shown, and Figure 3 The embodiment of the sag measurement device for distribution lines shown in the figure, in order to achieve the above purpose, this embodiment also provides a computer device for sag measurement of distribution lines, which can be a personal computer, server, smart phone, tablet computer, smart watch, or other network device, etc. The computer device includes a storage medium and a processor; the storage medium is used to store computer programs and operating systems; the processor is used to execute computer programs to achieve the above Figure 1 The method shown.
[0110] Optionally, the computer device may further include an internal memory, a communication interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a Wi-Fi module, a display, an input device such as a keyboard, etc. Optionally, the communication interface may further include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a Wi-Fi interface), etc.
[0111] Those skilled in the art will understand that the computer device structure for identifying an operation action provided in this embodiment does not constitute a limitation on the computer device, and may include more or fewer components, or a combination of certain components, or different component arrangements.
[0112] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the computer device hardware and the software resources to be identified, supporting the execution of the information processing program and other software and / or programs to be identified. The network communication module is used to enable communication between components within the storage medium and with other hardware and software in the information processing computer device.
[0113] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus the necessary general hardware platform, or by hardware. By applying the technical solution of the present application, first, a visual image containing a distribution line is obtained, and the distribution line image of the distribution line is identified in the visual image; then, the edge contour of the distribution line is determined in the distribution line image, and the edge contour is marked in the visual image to obtain an edge contour image; then, a plurality of distribution line components of the distribution line are identified in the edge contour image, and based on the position of the distribution line component in the edge contour image, the component space coordinates of each distribution line component are determined; finally, curve fitting is performed on all the component space coordinates to obtain a distribution line fitting curve, and the sag position of the distribution line is determined based on the distribution line fitting curve. Compared with the prior art, the ability to measure the sag position of the distribution line can be significantly enhanced.
[0114] Those skilled in the art will understand that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily required to implement the present application. Those skilled in the art will understand that the modules in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the implementation scenario description, or can be changed accordingly and located in one or more devices different from the implementation scenario. The modules of the above-mentioned implementation scenario can be combined into one module, or can be further split into multiple sub-modules.
[0115] The serial numbers of the above application are for descriptive purposes only and do not represent the advantages or disadvantages of the implementation scenarios. The above disclosure only discloses several specific implementation scenarios of the present application, but the present application is not limited thereto. Any changes that can be conceived by those skilled in the art should fall within the scope of protection of the present application.
Claims
1. A method for measuring sag of a distribution line, characterized in that: The method comprises: acquiring a visual image including a distribution line, and identifying a distribution line image of the distribution line in the visual image; determining an edge contour of the distribution line in the distribution line image, and marking the edge contour in the visual image to obtain an edge contour image; identifying a plurality of distribution line components of the distribution line in the edge contour image, and determining component space coordinates of each of the distribution line components based on positions of the distribution line components in the edge contour image; Curve fitting is performed on the spatial coordinates of all the components to obtain a distribution line fitting curve, and the sag position of the distribution line is determined based on the distribution line fitting curve.
2. The method according to claim 1, characterized in that The identifying the distribution line image of the distribution line in the visual image includes: Performing image noise reduction processing on the visual image to obtain a visual image after image noise reduction processing; The visual image is input into a pre-trained image recognition model so as to recognize the distribution line image of the distribution line in the visual image through the image recognition model.
3. The method according to claim 1, characterized in that The determining the edge contour of the distribution line in the distribution line image includes: Calculating a horizontal gradient value and a vertical gradient value of each pixel in the power distribution line image, and determining a gradient magnitude and a gradient direction of the pixel based on the horizontal gradient value and the vertical gradient value; Determining whether the gradient magnitude of the pixel point is greater than the gradient magnitude of an adjacent pixel point corresponding to the pixel point, wherein the adjacent pixel point is a pixel point adjacent to the pixel point along the gradient direction of the pixel point; When the gradient amplitude of the pixel point is greater than the gradient amplitude of the adjacent pixel point, determining the pixel point as an edge contour point; All the edge contour points included in the power distribution line image are determined as the edge contour.
4. The method according to claim 3, characterized in that Before calculating the horizontal gradient value and the vertical gradient value of each pixel in the power distribution line image and determining the gradient amplitude and the gradient direction of the pixel based on the horizontal gradient value and the vertical gradient value, the method further includes: Grayscale processing and noise reduction processing are performed on the distribution line image to obtain a distribution line image after grayscale processing and noise reduction processing.
5. The method according to claim 3, characterized in that The step of determining all edge contour points contained in the power distribution line image as the edge contour comprises: comparing the gradient amplitude of each edge contour point with a preset first gradient threshold, and determining the edge contour point as a true edge contour point when the gradient amplitude of the edge contour point is greater than the first gradient threshold, and determining the edge contour points other than the true edge contour points among all the edge contour points as candidate edge contour points; comparing the gradient magnitude of each of the candidate edge contour points with a preset second gradient threshold, and determining whether the candidate edge contour point is adjacent to the true edge contour point when the gradient magnitude of the candidate edge contour point is greater than the second gradient threshold, and determining the candidate edge contour point as the true edge contour point when the candidate edge contour point is adjacent to the true edge contour point; All the real edge contour points contained in the power distribution line image are determined as the edge contour.
6. The method according to claim 1, characterized in that The visual image is captured by a camera installed on an aircraft. When the camera captures the visual image, the aircraft flies in a direction parallel to the power distribution line.
7. The method according to claim 6, characterized in that The acquiring of a visual image including a distribution line and identifying the distribution line image of the distribution line in the visual image comprises: Acquire a plurality of the visual images, and identify the distribution line image of the distribution line in each of the visual images, wherein the camera device is located at a different device spatial position when capturing each of the visual images, and each of the visual images includes the same distribution line; The determining of the component space coordinates of each of the distribution line components based on the position of the distribution line components in the edge contour image comprises: determining a component image corresponding to the same distribution line component in each of the edge contour images, and determining image position information of the component image in each of the edge contour images; determining, based on the image position information, a relative position between the distribution line component and the camera device when the camera device captures the visual image corresponding to the edge contour image; The component space coordinates of the power distribution line component are determined based on the relative position corresponding to each of the edge contour images and the device space position of the camera device when capturing the visual image corresponding to each of the edge contour images.
8. A sag measuring device for a power distribution line, characterized in that: The device comprises: an image acquisition module, configured to acquire a visual image including a distribution line and identify a distribution line image of the distribution line in the visual image; a contour recognition module, configured to determine an edge contour of the distribution line in the distribution line image, and mark the edge contour in the visual image to obtain an edge contour image; a position recognition module, configured to recognize a plurality of distribution line components of the distribution line in the edge contour image, and determine a component space coordinate of each of the distribution line components based on a position of the distribution line components in the edge contour image; The information output module is used to perform curve fitting on the spatial coordinates of all the components to obtain a distribution line fitting curve, and determine the sag position of the distribution line based on the distribution line fitting curve.
9. A storage medium having a computer program stored thereon, 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.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: 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.