Power transmission line extraction method and device and binocular distance measurement method
By employing bilateral filtering, the Laplacian operator, and an improved Canny edge detection algorithm, the problem of high computational resource consumption in UAV power transmission line identification is solved, achieving efficient and accurate power transmission line extraction, which is suitable for UAV inspection.
Patent Information
- Application Number
- CN202211331482.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-28
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2042-10-28
AI Technical Summary
Existing technologies consume significant computational resources in UAV power transmission line identification, making it difficult to meet the requirements of low cost and real-time performance.
The image is smoothed using a bilateral filtering algorithm, sharpened using a Laplacian operator, edge detected using an improved Canny edge detection algorithm, and the transmission line diagram is extracted using a line detection algorithm.
It effectively reduces computing resource consumption, improves the accuracy and real-time performance of power transmission line extraction, and is suitable for UAV inspection.
Smart Images

Figure CN115841632B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to a method and apparatus for extracting power transmission lines and a binocular ranging method. Background Technology
[0002] Using drones to extract and identify power transmission lines can promptly detect anomalies, allowing for timely measures to ensure stable operation. Some experts use artificial intelligence algorithms for target object identification, but this method requires extensive training with numerous target object images and places high demands on the computing system's hardware. To better meet the needs of engineering applications, methods are needed to rapidly identify specific types of target objects while reducing computational load.
[0003] Some scholars have designed an improved chain code algorithm to achieve automatic line detection and implemented automatic line detection based on binocular ranging. Others have used binocular ranging and Hough line detection to achieve safe distance measurement for UAV power line inspection. Still others have achieved automatic identification of towers in aerial transmission lines by fusing the LSD (Line Segment Detector) line detection algorithm with Hough transform.
[0004] While the above methods can recognize linear objects, they consume a significant amount of computing resources. Summary of the Invention
[0005] In view of the shortcomings of the prior art described above, the purpose of this invention is to provide a method for extracting transmission lines that consumes less computing resources.
[0006] To achieve the above and other related objectives, the present invention provides a method for extracting transmission lines, the method comprising the following steps:
[0007] Obtain the original image;
[0008] The original image is smoothed to obtain a denoised image;
[0009] The denoised image is then sharpened to obtain an enhanced image;
[0010] Edge detection is performed on the enhanced image to obtain a contour image;
[0011] The power transmission line diagram is extracted from the contour image using a line detection algorithm.
[0012] In one embodiment of the present invention, the smoothing process of the original image specifically involves using a bilateral filtering algorithm to smooth the original image.
[0013] In one embodiment of the present invention, the sharpening process of the denoised image specifically involves using the Laplacian operator to sharpen the denoised image.
[0014] In one embodiment of the present invention, the edge detection of the enhanced image employs an improved Canny edge detection algorithm, the improved Canny edge detection algorithm comprising:
[0015] The gradient magnitude of the enhanced image is calculated using a differential operator to obtain a gradient image;
[0016] Non-maximum suppression is applied to the gradient magnitude to obtain the edge image;
[0017] The edge image is filtered and connected using a dual threshold algorithm to obtain the contour image;
[0018] The dual thresholds used in the dual threshold algorithm are obtained using the following method:
[0019] A threshold segmentation algorithm is used to calculate the segmentation threshold of the edge image;
[0020] Calculate the low threshold and the high threshold in the dual threshold, satisfying that the low threshold is less than the segmentation threshold and the high threshold is greater than the segmentation threshold.
[0021] In one embodiment of the present invention, the threshold segmentation algorithm is the Otsu algorithm.
[0022] In one embodiment of the present invention, the low threshold is 0.3 to 0.5 times the high threshold.
[0023] In one embodiment of the present invention, the segmentation threshold is the average of the low threshold and the high threshold.
[0024] In one embodiment of the present invention, the method for obtaining the low threshold and the high threshold includes:
[0025] Calculate the threshold fluctuation based on the edge image and the segmentation threshold;
[0026] The high threshold and the low threshold are calculated based on the segmentation threshold and the threshold fluctuation amount;
[0027] The formula for calculating the threshold fluctuation is as follows:
[0028]
[0029] The segmentation threshold divides the edge image into a foreground region and a background region, wherein the pixel grayscale value in the foreground region is less than the segmentation threshold, and the pixel grayscale value in the background region is greater than the segmentation threshold.
[0030] Δt is the threshold fluctuation amount;
[0031] max(img) is the maximum grayscale value of the edge image;
[0032] min(img) is the minimum gray value of the edge image;
[0033] Q1 is the sum of probabilities of all pixels in the foreground region;
[0034] Q2 is the sum of the probabilities of all pixels in the background region;
[0035] m1 is the average gray value of all pixels in the foreground region;
[0036] m2 is the average grayscale value of all pixels in the background region;
[0037] The formulas for calculating the high threshold and the low threshold are as follows:
[0038]
[0039] Among them, T t The segmentation threshold is...
[0040] Among them, T h The high threshold;
[0041] Among them, T l The low threshold is defined as follows.
[0042] To achieve the above and other related objectives, the present invention also provides a transmission line extraction device, comprising:
[0043] The image input module is used to acquire the original image;
[0044] An image noise reduction module is used to smooth the original image to obtain a noise-reduced image;
[0045] The image enhancement module is used to sharpen the denoised image to obtain an enhanced image;
[0046] The contour extraction module is used to perform edge detection on the enhanced image to obtain a contour image;
[0047] The line extraction module is used to extract the power transmission line diagram from the contour image using a straight line detection algorithm.
[0048] To achieve the above and other related objectives, the present invention also provides a binocular ranging method for transmission lines, the binocular ranging method for transmission lines comprising the following steps:
[0049] Optical and depth images of power transmission lines were captured using a binocular camera mounted on a drone.
[0050] The aforementioned transmission line extraction method is used to obtain a transmission line map containing transmission lines;
[0051] By overlaying the depth image and the power transmission line map, the distance from each point on the power transmission line to the UAV is obtained, i.e., the pixel distance.
[0052] The average value of the pixel distances is calculated to obtain the distance between the power transmission line and the drone.
[0053] As described above, the transmission line extraction method, apparatus, and electronic equipment of the present invention have the following advantages: they consume less computing resources. Attached Figure Description
[0054] Figure 1 The diagram shown is a flowchart illustrating the transmission line extraction method of the present invention.
[0055] Figure 2 The image shown is an example of the noise reduction effect obtained using existing techniques.
[0056] Figure 3 The image shown is a diagram illustrating the effect of noise reduction obtained according to an embodiment of the present invention.
[0057] Figure 4 The image shown is an effect diagram of the enhanced image obtained according to an embodiment of the present invention.
[0058] Figure 5a The image shown is a rendering of the contour image obtained using existing technology.
[0059] Figure 5b The image shown is a rendering of the contour image obtained according to an embodiment of the present invention.
[0060] Figure 6a Displayed as processed using existing line detection algorithms Figure 5a The straight line image is obtained from the contour image.
[0061] Figure 6b The display shows that the line detection algorithm of the present invention is used for processing. Figure 5b The transmission line diagram is obtained from the contour image.
[0062] Figure 7 The diagram shown is a structural block diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0063] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, unless otherwise specified, the following embodiments and features described therein can be combined with each other.
[0064] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0065] Using drones to inspect power transmission lines instead of manual labor is a trend in technological development. However, existing artificial intelligence algorithms have high requirements for data volume and computing resources, making it difficult to meet the requirements of drones for low cost and real-time performance.
[0066] The present invention will now be described in detail with reference to the accompanying drawings, so that those skilled in the art can readily implement it. The present invention can be embodied in many different forms and is not limited to the embodiments described herein.
[0067] like Figure 1 As shown, the present invention provides a method for extracting transmission lines, comprising the following steps:
[0068] Step S100: Obtain the original image;
[0069] Step S200: Smooth the original image to obtain a denoised image;
[0070] Step S300: Sharpen the denoised image to obtain an enhanced image;
[0071] Step S400: Perform edge detection on the enhanced image to obtain a contour image;
[0072] Step S500: Using a straight line detection algorithm, extract the power transmission line diagram from the contour image.
[0073] In step S100, the original image captured by the drone can be a color image or a grayscale image. When the original image is a color image, existing technologies can be used to directly perform subsequent smoothing, sharpening, and other processing on the color image; alternatively, existing grayscale conversion methods can be used to convert the color image to a grayscale image before performing subsequent processing on the grayscale image.
[0074] Due to factors such as drone vibration, weather, and lighting, the original image may be blurry, incomplete, or skewed, interfering with subsequent extraction of power transmission lines. Therefore, this invention preprocesses the original image in steps S200 and S300 to improve the accuracy of power transmission line extraction.
[0075] Transmission lines include overhead pipelines (such as pipelines for transporting natural gas, compressed gas, oil, liquids, etc.), power transmission lines, overhead optical cables, signal transmission lines, and other lines.
[0076] Step S200 in this embodiment can employ existing technology. Its main purpose is to suppress certain unwanted deformations in the original image, remove Gaussian noise, salt-and-pepper noise, etc. caused by image sensor and atmospheric pulse interference, and improve the signal-to-noise ratio of the image.
[0077] After step S200, although some interference information is filtered out, the image becomes more blurry. Step S300 in this embodiment can itself adopt existing technology, and its main purpose is to make the image clearer and increase the edge sharpness of the transmission line to facilitate subsequent edge detection.
[0078] Step S500 can employ existing technology and is not considered a key improvement in this embodiment. The transmission line diagram obtained by the straight line detection algorithm may include straight lines corresponding to the transmission line, or it may include other interfering line segments. This embodiment may not process the interfering line segments, or it may refer to existing technology to process the interfering line segments.
[0079] This embodiment combines various commonly used algorithms to extract power transmission lines with low computational resource consumption, which can well meet the requirements of UAVs.
[0080] Optionally, the smoothing process on the original image specifically involves using a bilateral filtering algorithm. Commonly used image smoothing algorithms include mean filtering, Gaussian filtering, bilateral filtering, median filtering, and neighborhood averaging. Gaussian filtering is effective at removing Gaussian noise, but it can easily blur the edges of power transmission lines. To improve the signal-to-noise ratio of the original image without affecting subsequent edge extraction, this embodiment uses a bilateral filtering algorithm to smooth the original image. This method effectively preserves the edge information of the original image while smoothing and denoising it, which helps reduce the false negative rate of subsequent edge detection.
[0081] The actual original image contains backgrounds such as green plants, roads, and buildings. When the background area is dark, the effect is not significant. However, when the background area is light, Gaussian filtering may cause the edges of the power transmission line to fade, affecting subsequent edge extraction. Figure 2 The image shows the effect obtained using Gaussian filtering in existing technologies. Figure 3This is an image showing the effect of bilateral filtering used in this invention. The white background area represents buildings, and the dark diagonal lines represent power transmission lines. (Comparison) Figure 2 , Figure 3 As can be seen, Gaussian filtering causes gradient descent and edge blurring in the transmission line area, which is detrimental to subsequent edge extraction. Bilateral filtering, on the other hand, better preserves the original grayscale and edge information of the transmission line, providing a better foundation for subsequent edge extraction.
[0082] Existing Canny edge detection algorithms immediately calculate gradient magnitude and direction after image smoothing. However, due to the narrow width of power transmission lines, smoothing may cause an overall grayscale shift in the transmission lines. To better recover the edge information of the power transmission lines, this invention also sharpens the denoised image. For example, image enhancement based on histogram equalization, image enhancement based on the Laplance operator, image enhancement based on object Log transform, and image enhancement based on gamma transform.
[0083] Optionally, this embodiment uses the Laplacian operator to sharpen the denoised image. Due to the arbitrariness of the drone's shooting angle, the direction of the power transmission line in different original images is uncertain. The Laplacian operator used in this embodiment can adapt to different power transmission line directions and has a small computational load. Specifically, the enhanced image obtained by sharpening the denoised image using the Laplacian operator is as follows: Figure 4 As shown, this increases the sharpness and contrast of the image. Specifically, the Laplacian operator's convolution kernel is as follows:
[0084]
[0085] Optionally, the edge detection of the enhanced image employs an improved Canny edge detection algorithm, which includes:
[0086] The gradient magnitude of the enhanced image is calculated using a differential operator to obtain a gradient image;
[0087] Non-maximum suppression is applied to the gradient magnitude to obtain the edge image;
[0088] The edge image is filtered and connected using a dual threshold algorithm to obtain the contour image;
[0089] The dual thresholds used in the dual threshold algorithm are obtained using the following method:
[0090] A threshold segmentation algorithm is used to calculate the segmentation threshold of the edge image;
[0091] Calculate the high threshold and low threshold in the dual thresholds, such that the high threshold is greater than the segmentation threshold and the low threshold is less than the segmentation threshold.
[0092] The improvement in this embodiment lies in the selection of dual thresholds. In existing Canny edge detection algorithms, dual thresholds are usually set based on human experience, often resulting in good edge detection performance for certain images but poor performance for others. This invention automatically selects appropriate high and low thresholds based on different backgrounds, exhibiting strong adaptability to various lighting conditions. Specifically, the gradient magnitude is calculated using the Sobel operator. The threshold segmentation algorithm employs the Otsu algorithm. Further, the low threshold is 0.3 to 0.5 times the high threshold, for example, 0.4 times. Further still, the segmentation threshold is the average of the low and high thresholds.
[0093] Otsu's algorithm divides an image into foreground and background regions based on grayscale, using the independent variable t to represent the segmentation threshold. For the foreground region, v0 represents the proportion of pixels occupying the entire image, and u0 represents the average grayscale. For the background region, v1 represents the proportion of pixels occupying the entire image, and u1 represents the average grayscale. u represents the overall average grayscale of the image, and σ is the maximum inter-class variance. The number of pixels with grayscale values less than the threshold t (N0) and the number of pixels with grayscale values greater than the threshold t (N1) are counted. The mathematical relationship is shown in the following formula:
[0094] u=v0*u0+v1*u1 (1)
[0095] σ(t)=v0(t)(u0-u) 2 +v1(t)(u1-u) 2 (2)
[0096] Substituting (2) into equation (1) yields:
[0097] σ(t)=v0(t)v1(t)(u0-u1) 2 (3)
[0098] By iterating through the image, when σ(t) reaches its global maximum, t is the optimal segmentation threshold T. t .
[0099] Optionally, the methods for obtaining the low threshold and the high threshold include:
[0100] Calculate the threshold fluctuation based on the edge image and the segmentation threshold;
[0101] The high threshold and the low threshold are calculated based on the segmentation threshold and the threshold fluctuation amount;
[0102] The formula for calculating the threshold fluctuation is as follows:
[0103]
[0104] The segmentation threshold divides the edge image into a foreground region and a background region, wherein the pixel grayscale value in the foreground region is less than the segmentation threshold, and the pixel grayscale value in the background region is greater than the segmentation threshold.
[0105] Δt is the threshold fluctuation amount;
[0106] max(img) is the maximum grayscale value of the edge image;
[0107] min(img) is the minimum gray value of the edge image;
[0108] Q1 is the sum of probabilities of all pixels in the foreground region;
[0109] Q2 is the sum of the probabilities of all pixels in the background region;
[0110] m1 is the average gray value of all pixels in the foreground region;
[0111] m2 is the average grayscale value of all pixels in the background region;
[0112] The formulas for calculating the high threshold and the low threshold are as follows:
[0113]
[0114] Among them, T t The segmentation threshold is...
[0115] Among them, T h The high threshold;
[0116] Among them, T l The low threshold is defined as follows.
[0117] Contour images obtained by existing technologies, such as Figure 5a As shown, the contour image obtained after processing by the improved Canny edge detection algorithm is as follows: Figure 5b As shown. Figure 5a It was obtained by processing the original image using Gaussian filtering in conjunction with MATLAB's built-in Canny edge detection algorithm. Figure 5b This is obtained by processing the original image using a bilateral filtering algorithm combined with the improved Canny edge detection algorithm of this invention. (Comparison) Figure 5a and Figure 5b It can be seen that the bilateral filtering algorithm of the present invention provides good protection for the edges of transmission lines. On this basis, the high and low thresholds automatically selected by the present invention can filter out most edge information that is not related to the transmission lines, such as edge interference information of green plants and buildings, reducing the data processing volume of subsequent line detection and making it more suitable for UAV operations.
[0118] likeFigure 5b As shown, even after processing with the improved Canny edge detection algorithm of this invention, a small amount of interference information may still exist in the contour image. To further reduce interference information in the contour image, the line detection algorithm of this embodiment includes:
[0119] Step S510: Perform a hough transform on the contour image to filter out non-linear interference information in the contour image and obtain a straight line segment image.
[0120] Step S520: Calculate the slope of each line segment in the line segment image, and group line segments with the same slope into a large group.
[0121] Step S530: Determine if the line segments belonging to the same large group are collinear, group the collinear line segments into a small group, and connect the line segments belonging to the same small group end to end to obtain multiple long straight lines.
[0122] Step S540: Calculate the distance d1 from the two endpoints of each long straight line to the edge of the contour image. Filter out long straight lines whose distance d1 is greater than a first preset distance threshold to obtain multiple through straight lines. Specifically, the first preset distance threshold is 20 pixels. A characteristic of power transmission lines is that they run through the entire image. This step utilizes this characteristic to filter out the contours of other straight objects, such as the contours of utility poles that do not run through the image.
[0123] Step S550: Calculate the distance d2 between two adjacent through lines, and determine the two through lines whose distance d2 is less than the second preset distance threshold as the two sides of a transmission line.
[0124] Step S560: Fill the space between two sides belonging to the same transmission line with the same number of pixels as the through line to obtain the transmission line diagram.
[0125] Figure 6a For existing technologies Figure 5a The image obtained is a straight line image processed using OpenCV's built-in line detection algorithm, based on the given data. (Comparison) Figure 6a and Figure 5a It is known that existing line detection algorithms may lengthen some line segments that belong to interference information, and are not very selective for transmission lines. Figure 6b For the present invention in Figure 5b The transmission line diagram obtained by processing the straight line detection algorithm of the above embodiment is based on this. Comparison Figure 6b and Figure 5b It can be seen that the line detection algorithm of the present invention filters out line segments that belong to interference information and lengthens line segments that belong to transmission lines, thus exhibiting strong selectivity for transmission lines. Figure 6bThe image contains almost no interfering line segments. Therefore, when this invention is applied to binocular vision ranging, the transmission line can be extracted more accurately from the binocular vision ranging image, thus enabling a more accurate measurement of the distance to the transmission line. This avoids excessive measurement errors caused by interference from interfering line segments.
[0126] This invention also provides a transmission line extraction device, which includes an image input module, an image denoising module, an image enhancement module, a contour extraction module, and a line extraction module. The image input module acquires an original image. The image denoising module smooths the original image to obtain a denoised image. The image enhancement module sharpens the denoised image to obtain an enhanced image. The contour extraction module performs edge detection on the enhanced image to obtain a contour image. The line extraction module uses a line detection algorithm to extract the transmission line diagram from the contour image.
[0127] Please see Figure 7 The diagram shows a structural connection schematic of the electronic device of the present invention in one embodiment. Figure 7 As shown, this embodiment provides an electronic device, specifically including: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device performs each step of the transmission line extraction method.
[0128] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0129] The aforementioned memory may include random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device.
[0130] In practical applications, the electronic device may be a computer including all or some of the following components: memory, storage controller, one or more processing units (CPU), peripheral interface, RF circuit, audio circuit, speaker, microphone, input / output (I / O) subsystem, display screen, other output or control devices, and external ports.
[0131] The transmission line diagram obtained through this invention can be used for further binocular ranging. The principle of binocular visual ranging is based on the fact that the positions of objects photographed by both eyes in the camera's field of view are inconsistent during binocular imaging. Therefore, the distance to objects within the field of view can be calculated by using the projection deviation caused by the positional deviation.
[0132] Due to the complex and varied geographical environment near the captured power lines, the background of target objects in the images is often intricate. Therefore, binocular vision ranging needs to extract the power lines from this complex background. The power line extraction method of this invention can improve the real-time performance and accuracy of binocular vision ranging and power line identification.
[0133] The binocular ranging method for transmission lines provided by this invention includes the following steps:
[0134] Optical and depth images of the power transmission lines were captured using a binocular camera mounted on a drone. The optical images were either color or grayscale. The depth images, also known as distance images, were images that used the distance (depth) values of points in the scene captured by the image acquisition device as pixel values.
[0135] The transmission line extraction method described in the above embodiments is used to obtain a transmission line diagram containing transmission lines.
[0136] By overlaying the depth image and the power transmission line map, the distance from each point on the power transmission line to the drone can be obtained, i.e., the pixel distance.
[0137] Calculate the average pixel distance to obtain the distance between the power transmission line and the drone.
[0138] The binocular ranging method for power transmission lines provided by this invention can be applied to lidar ranging. It extracts the power transmission line from the 3D point cloud image captured by lidar, enabling automatic distance measurement between the lidar and the power transmission line. The algorithm proposed in this invention can quickly and in real-time process images captured by drones, inspection robots, etc., thereby rapidly marking the power transmission line from the image. Simultaneously, applying this invention to binocular ranging and lidar ranging can quickly and conveniently obtain the coordinates of the power transmission line in depth images and point cloud images, thus achieving rapid distance measurement. The improved Canny edge detection proposed in this invention can filter out some background in the image while maintaining computational efficiency, resulting in a contour image that is easier for target detection and recognition. This invention obtains distance data of the line from the depth image of binocular ranging, enabling automatic identification and ranging of linear objects, and has significant potential for widespread application in drone inspection work.
[0139] In summary, this invention first preprocesses the original image, then performs edge detection and line extraction. After Laplance image enhancement, an adaptive operator is constructed to perform image convolution by calculating the color regions with a large color proportion in the image, filtering out background colors and thus reducing interference with power transmission line identification. This has high industrial application value.
[0140] The technical features of the embodiments described above can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered to be within the scope of this specification. When technical features of different embodiments are embodied in the same drawing, it can be regarded as the drawing also disclosing examples of combinations of the various embodiments involved.
[0141] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.
Claims
1. A power line extraction method characterized by, The power transmission line extraction method comprises the following steps: obtaining an original image; performing smoothing processing on the original image to obtain a denoising image; performing edge detection on the enhanced image to obtain a contour image; extracting a power transmission line image from the contour image by using a straight line detection algorithm; wherein the edge detection on the enhanced image adopts an improved Canny edge detection algorithm, and the improved Canny edge detection algorithm comprises: calculating the gradient amplitude of the enhanced image by using a differential operator to obtain a gradient image; performing non-maximum suppression on the gradient amplitude to obtain an edge image; performing filtering and connection on the edge image by using a double-threshold algorithm to obtain the contour image; wherein the double thresholds used in the double-threshold algorithm are obtained by the following method: calculating the segmentation threshold of the edge image by using a threshold segmentation algorithm; calculating the low threshold and the high threshold in the double thresholds, which satisfy that the low threshold is less than the segmentation threshold, and the high threshold is greater than the segmentation threshold; the method for obtaining the low threshold and the high threshold comprises: calculating a threshold floating amount according to the edge image and the segmentation threshold; calculating the high threshold and the low threshold according to the segmentation threshold and the threshold floating amount; the calculation formula of the threshold floating amount is as follows: wherein the segmentation threshold divides the edge image into a foreground region and a background region, the pixel gray value in the foreground region is less than the segmentation threshold, and the pixel gray value in the background region is greater than the segmentation threshold; ; max(img) is the maximum gray value of the edge image; is a threshold float amount; min(img) is the minimum gray value of the edge image; Q1 is the probability sum of all pixels in the foreground region; Q2 is the probability sum of all pixels in the background region; m1 is the average gray value of all pixels in the foreground region; m2 is the average gray value of all pixels in the background region; the calculation formula of the high threshold and the low threshold is as follows: the smoothing processing on the original image is specifically performing smoothing processing on the original image by using a bilateral filtering algorithm. ; wherein is the segmentation threshold; wherein is the high threshold value; wherein is the low threshold.
2. The power line extraction method according to claim 1, characterized by, the sharpening processing on the denoising image is specifically performing sharpening processing on the denoising image by using a Laplacian operator.
3. The power line extraction method according to claim 1, characterized by, the threshold segmentation algorithm is Otsu algorithm.
4. The power line extraction method according to claim 1, characterized by, the low threshold is 0.3 times to 0.5 times of the high threshold.
5. The power line extraction method according to claim 1, characterized by, the segmentation threshold is the average value of the low threshold and the high threshold.
6. The power line extraction method according to claim 1, characterized by, comprises:
7. A power line extraction device, characterized by an image input module for obtaining an original image; an image denoising module for performing smoothing processing on the original image to obtain a denoising image; an image enhancement module for performing sharpening processing on the denoising image to obtain an enhanced image; a contour extraction module for performing edge detection on the enhanced image to obtain a contour image; a line extraction module for extracting a power transmission line image from the contour image by using a straight line detection algorithm; wherein the edge detection on the enhanced image adopts an improved Canny edge detection algorithm, and the improved Canny edge detection algorithm comprises: calculating the gradient amplitude of the enhanced image by using a differential operator to obtain a gradient image; Non-maximum suppression is performed on the gradient magnitude to obtain an edge image; The edge image is filtered and connected by using a double-threshold algorithm to obtain the contour image; In the double-threshold algorithm, the double thresholds are obtained by the following method: A threshold segmentation algorithm is used to calculate a segmentation threshold of the edge image; A low threshold and a high threshold in the double thresholds are calculated, and the low threshold is less than the segmentation threshold, and the high threshold is greater than the segmentation threshold; The method for obtaining the low threshold and the high threshold comprises: A threshold floating amount is calculated according to the edge image and the segmentation threshold; The high threshold and the low threshold are calculated according to the segmentation threshold and the threshold floating amount; The calculation formula of the threshold floating amount is as follows: ; The segmentation threshold divides the edge image into a foreground region and a background region, the pixel gray value in the foreground region is less than the segmentation threshold, and the pixel gray value in the background region is greater than the segmentation threshold; is a threshold float amount; max(img) is the maximum gray value of the edge image; min(img) is the minimum gray value of the edge image; Q1 is the probability sum of all pixels in the foreground region; Q2 is the probability sum of all pixels in the background region; m1 is the average gray value of all pixels in the foreground region; m2 is the average gray value of all pixels in the background region; The calculation formula of the high threshold and the low threshold is as follows: ; wherein is the segmentation threshold; wherein is the high threshold value; wherein is the low threshold.
8. A binocular distance measuring method for a power line, characterized by The binocular distance measuring method of the power transmission line comprises the following steps: An optical image and a depth image containing the power transmission line are obtained by using a binocular camera carried by a UAV; The power transmission line extraction method in any one of claims 1-6 is used to obtain a power transmission line image containing the power transmission line; The depth image and the power transmission line image are superimposed to obtain the distance from each point on the power transmission line to the UAV, i.e., the pixel distance; The average value of the pixel distance is calculated to obtain the distance between the power transmission line and the UAV.
Citation Information
Patent Citations
An unmanned aerial vehicle line patrol image power transmission line detection method based on NCC features
CN109410207A
Power transmission line extraction method based on least square de-interference random Hough transform
CN111340833A