Power transmission line defect detection method, device, equipment and medium
By graying and segmenting the transmission line images, combined with symmetry pre-screening and transmission line defect recognition models, the low efficiency problem of traditional inspection methods is solved, and efficient and accurate detection of transmission line defects is achieved, which is suitable for drone inspections.
Patent Information
- Application Number
- CN202510880171.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-09-26
AI Technical Summary
Traditional manual inspection methods are time-consuming and inefficient, making it difficult to meet the requirements for reliable and efficient management of transmission lines, and are unable to promptly detect potential hazards such as broken or scattered strands.
By gray-scaling the transmission line image, extracting and segmenting the transmission line image, performing symmetry pre-screening, and evaluating anomalies using a preset distance threshold, the type of transmission line defect can be identified by combining the pre-trained transmission line defect recognition model.
It improves the accuracy and efficiency of transmission line defect detection, is suitable for real-time processing of embedded devices, and is applicable to drone inspections, achieving a balance between detection efficiency and accuracy.
Smart Images

Figure CN120707961A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of transmission line detection, and in particular to a method, apparatus, computer equipment, and computer-readable storage medium for transmission line defect detection. Background Art
[0002] Broken and scattered strands in transmission lines can easily develop into a complete disconnection, compromising power transmission safety. In the daily operations of power systems, enormous manpower, material, and financial resources are expended annually on inspections to monitor line operating conditions and promptly address potential hazards. Traditional inspection management methods are no longer sufficient for line management. Regular manual line inspections are labor-intensive, time-consuming, and inefficient. Some line sections, constrained by terrain, are even impossible to inspect. The current specialized transmission line inspection model is no longer able to meet the requirements of reliable, efficient, and lean management.
[0003] Therefore, there is an urgent need for a new, intelligent and efficient transmission line detection method to improve the operation and maintenance management of transmission lines, which is of great significance to ensuring the safe and stable operation of the power system. Summary of the Invention
[0004] Based on this, it is necessary to provide a transmission line defect detection method, device, computer equipment and computer-readable storage medium that can accurately identify transmission line defects in order to address the above technical problems.
[0005] In a first aspect, the present application provides a method for detecting defects in a transmission line, comprising:
[0006] Acquire an image containing a power transmission line to be detected; grayscale the image and obtain each pixel edge segment in the grayscale image, and obtain a power transmission line image using each pixel edge segment;
[0007] Determining the axis of the power line in the power line image, and dividing the power line into a plurality of power line segments to be detected in the axis direction based on a preset segment length; obtaining a first distance between pixel vectors on both sides of the axis of the current segment of the power line to be detected, and determining whether the current segment of the power line to be detected is symmetrical based on the first distance;
[0008] In a case where the current section of the transmission line to be detected is asymmetric, obtaining a first abnormality assessment result according to the first distance and a first preset distance threshold;
[0009] When the current section of the transmission line to be detected is symmetrical, obtaining a second distance between the pixel vector of the current section of the transmission line to be detected and the pixel vector of an adjacent section of the transmission line to be detected, and obtaining a second anomaly assessment result based on the second distance and a second preset distance threshold;
[0010] According to the first abnormality evaluation result and the second abnormality evaluation result, the transmission line to be detected that is evaluated as abnormal is obtained, and the transmission line to be detected that is evaluated as abnormal is input into a pre-trained transmission line defect recognition model to obtain the defect recognition result of the transmission line to be detected that is evaluated as abnormal; the defect recognition result is at least one of normal, symmetrical scattered strands, asymmetrical broken strands, asymmetrical scattered strands, transmission line crossing and other interferences.
[0011] In one embodiment, graying the image and obtaining edge segments of each pixel in the grayed image, and using the edge segments of each pixel to obtain a power line image, includes:
[0012] grayscale the image using a color conversion function to obtain a grayscale image;
[0013] Using a line segment detection algorithm to obtain edge line segments of each pixel in the grayscale image, and taking an image pixel area surrounded by two parallel pixel edge line segments that meet a preset inter-segment distance threshold as a transmission line segment;
[0014] Using Gestalt perception laws to connect the transmission line segments to obtain an initial transmission line;
[0015] The initial transmission lines whose centerline lengths are less than a preset length threshold are removed to obtain a transmission line image.
[0016] In one embodiment, determining the axis centerline of the transmission line in the transmission line image includes:
[0017] The midline of two pixel edge segments that are parallel and meet a preset distance threshold between the segments is obtained, and the midline is used as the axis of the power transmission line in the power transmission line image.
[0018] In one embodiment, dividing the transmission line into multiple transmission line segments to be inspected in the axis direction based on a preset segment length includes:
[0019] Obtaining the length of a current transmission line segment in the transmission line image, and obtaining a sliding frame step size corresponding to the current transmission line segment according to the length of the current transmission line segment and the preset segment length;
[0020] Performing a sliding frame screenshot of the current transmission line segment along the axis direction according to the sliding frame step size to obtain multiple transmission line segments to be detected;
[0021] The process of obtaining the sliding frame step size corresponding to the current transmission line segment according to the length of the current transmission line segment and the preset segment length is as follows:
[0022]
[0023] Among them, S is the sliding frame step size corresponding to the current transmission line segment; L is the length of the current transmission line segment; T is the preset segment length; int() represents the rounding function.
[0024] In one embodiment, obtaining a first abnormality assessment result based on the first distance and a first preset distance threshold includes:
[0025] When the first distance is greater than the first preset distance threshold, the current section of the transmission line to be detected is evaluated as an abnormal transmission line to be detected.
[0026] In one embodiment, obtaining a second abnormality assessment result based on the second distance and a second preset distance threshold includes:
[0027] When the second distance is greater than the second preset distance threshold, the current section of the transmission line to be detected and the adjacent section of the transmission line to be detected are both evaluated as abnormal transmission lines to be detected.
[0028] In one embodiment, the step of obtaining the pre-trained transmission line defect recognition model includes:
[0029] Acquire pre-prepared training samples; the samples are multiple images containing a section of a transmission line, and the samples each contain a label, wherein the label is one of normal, symmetrical scattered strands, asymmetrical broken strands, asymmetrical scattered strands, transmission line crossing, and other interference;
[0030] The pre-prepared training samples are used to train the transmission line defect recognition model to be trained, thereby obtaining a trained transmission line defect recognition model.
[0031] In a second aspect, the present application further provides a transmission line defect detection device, comprising:
[0032] An image acquisition module is configured to acquire an image containing a power transmission line to be detected; grayscale the image and obtain edge segments of each pixel in the grayscale image, and obtain an image of the power transmission line using the edge segments of each pixel;
[0033] a symmetry determination module, configured to determine the axis of the transmission line in the transmission line image, segment the transmission line into multiple segments of transmission line to be detected in the axis direction based on a preset segment length; obtain a first distance between pixel vectors on both sides of the axis of the current segment of the transmission line to be detected, and determine whether the current segment of the transmission line to be detected is symmetrical based on the first distance;
[0034] an anomaly assessment module, configured to obtain a first anomaly assessment result based on the first distance and a first preset distance threshold when the current section of the transmission line to be detected is asymmetric; and to obtain a second distance between a pixel vector of the current section of the transmission line to be detected and a pixel vector of an adjacent section of the transmission line to be detected when the current section of the transmission line to be detected is symmetric, and to obtain a second anomaly assessment result based on the second distance and a second preset distance threshold;
[0035] A defect identification module is used to obtain a transmission line to be detected that is evaluated as abnormal based on the first abnormality evaluation result and the second abnormality evaluation result, and input the transmission line to be detected that is evaluated as abnormal into a pre-trained transmission line defect identification model to obtain a defect identification result of the transmission line to be detected that is evaluated as abnormal; the defect identification result is at least one of normal, symmetrical scattered strands, asymmetrical broken strands, asymmetrical scattered strands, transmission line crossing and other interference.
[0036] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method described in the first aspect when executing the computer program.
[0037] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the method described in the first aspect when the computer program is executed by a processor.
[0038] The above-mentioned transmission line defect detection method, device, computer equipment and computer-readable storage medium extract the transmission line image after grayscale processing of the transmission line image, then segment the transmission lines in the transmission line image, and then perform symmetry pre-screening. For different situations of symmetry and asymmetry, anomaly assessment is performed according to different standards. Finally, only the abnormal transmission lines to be detected are sent to the transmission line defect recognition model to obtain defect recognition results. Among them, the suspected anomalies are first determined by segmentation processing and symmetry pre-screening, and the defect type is further determined by the transmission line defect recognition model, which can improve the accuracy of transmission line defect detection. In addition, by reducing the data input to the transmission line defect recognition model after segmentation processing and symmetry pre-screening, the calculation amount of the transmission line defect recognition model can be reduced, and the detection efficiency can be improved. Therefore, the present application solution is suitable for real-time processing of embedded devices, such as application to drone inspection. By combining traditional image processing and deep learning, a balance between detection efficiency and detection accuracy in transmission line defect detection is achieved, which can be suitable for large-scale power grid automation inspection scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.
[0040] Figure 1 1 is a flow chart of a method for detecting defects in a transmission line according to an embodiment;
[0041] Figure 2 A flowchart illustrating the steps of gray-scaling the image to obtain edge segments of each pixel in the gray-scaling image, and using the edge segments of each pixel to obtain an image of a power transmission line in one embodiment;
[0042] Figure 3 is a flow chart of a method for detecting defects in a transmission line according to another embodiment;
[0043] Figure 4 A schematic diagram of merging two near-sighted parallel line segments that meet a distance condition into a midline of parallel lines in one embodiment;
[0044] Figure 5 A schematic diagram of connecting two line segments that meet conditions using Gestalt perception laws in one embodiment;
[0045] Figure 6 A schematic diagram of a sliding frame screenshot along a transmission line in one embodiment;
[0046] Figure 7 A schematic diagram of correcting a sliding frame so that a transmission line segment in the sliding frame is perpendicular to a horizontal line in one embodiment;
[0047] Figure 8 Schematic diagram of a scanning method in which a sliding frame is divided into left and right sides and pixels on the left and right sides are scanned respectively in one embodiment;
[0048] Figure 9 A schematic diagram of a scanning method for pixels in a current sliding frame power line area and a previous sliding frame power line area in one embodiment;
[0049] Figure 10 A schematic diagram of using broken and scattered strand defect data and non-defective data to train a CNN classification network in one embodiment;
[0050] Figure 11 Schematic diagram of an application of a CNN classification network in one embodiment;
[0051] Figure 12 is a structural block diagram of a transmission line defect detection device in one embodiment;
[0052] Figure 13 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0054] In one embodiment, Figure 1 As shown, a method for detecting defects in power transmission lines is provided. This embodiment uses the method applied to a server as an example for illustration. It is understood that the method can also be applied to a terminal, or to a system including a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0055] Step S202 , obtaining an image containing a power transmission line to be detected; graying the image to obtain edge line segments of each pixel in the grayed image, and using the edge line segments of each pixel to obtain a power transmission line image.
[0056] The image containing the power transmission line to be inspected can refer to an image captured by a camera or other device, containing the power transmission line to be inspected for defects such as broken or loose strands. This image serves as the starting data for the entire inspection process. For example, during a power transmission line inspection, a drone can capture images containing power transmission lines. Grayscaling can refer to the process of converting a color image into a grayscale image containing only luminance information. Grayscaling removes color information, simplifies subsequent image processing, and facilitates feature extraction. Pixel edge segments can refer to edges formed by sudden changes in pixel grayscale values in an image. These segments, formed through algorithmic processing, can reflect edge information of objects in the image and, in this embodiment, can be used to extract segments related to power transmission lines. A power transmission line image can refer to an image containing the main body (power transmission line) extracted from the original image containing the power transmission line through the aforementioned processing. Subsequent defect detection is performed based on this image.
[0057] For example, the server can collect images of the transmission line in real time through an image acquisition device installed on an inspection device (such as a drone, a pole tower camera, etc.). The server first uses a color conversion function to convert the color image into a grayscale image to reduce the interference of color information; then uses a line segment detection algorithm to detect pixel edge segments in the grayscale image; and then uses each pixel edge segment to perform interference removal and line segment connection processing to obtain a transmission line image.
[0058] Step S204: determine the axis of the transmission line in the above-mentioned transmission line image, and divide the above-mentioned transmission line into multiple segments of transmission lines to be detected in the axis direction based on a preset segment length; obtain the first distance between the pixel vectors on both sides of the axis of the current segment of the transmission line to be detected, and determine whether the current segment of the transmission line to be detected is symmetrical based on the above-mentioned first distance.
[0059] Among them, the axis line may refer to a virtual line located at the geometric center position of the transmission line in the transmission line image. The preset segment length may refer to a fixed length value that is set, which can be determined based on actual detection requirements and transmission line characteristics, and is used to divide the transmission line into different segments along the axis line direction. The transmission line to be inspected may refer to the segments of the transmission line segmented from the transmission line image based on the preset segment length, and each segment is subject to defect detection. A pixel vector may refer to a vector formed by arranging pixels in a certain order in a specific area of the image, for example, a vector obtained by arranging pixel vectors on one side of the axis line of the transmission line to be inspected in the image in a certain order. The first distance may refer to the distance between pixel vectors on both sides of the axis line of the current segment of the transmission line to be inspected in the same cross-section, that is, the distance between the pixel vectors on both sides of the axis line, which may represent a measure of the difference between the pixel vectors on both sides, reflecting the lateral symmetry of the transmission line. Symmetry may refer to the similar pixel distribution on both sides of the axis line of the current segment of the transmission line to be inspected. If the pixel vector distance is within a certain range, it is considered to be symmetrical.
[0060] Exemplarily, the server can determine the axis of the transmission line in the above-mentioned transmission line image through the pixel edge segments located on both sides of the transmission line, and then obtain the length of the transmission line. According to the preset segment length and the length of the above-mentioned transmission line, the actual segment length of the transmission line is determined, and then the transmission line is segmented according to the actual segment length to obtain multiple segments of the transmission line to be detected; the server uses the axis as the boundary of the current segment of the transmission line to be detected, extracts pixels on both sides respectively, and arranges them into pixel vectors in a certain order (such as from left to right or from top to bottom, etc.), uses a preset distance calculation method (such as Mahalanobis distance) to calculate the distance between the two vectors, and determines whether the current segment of the transmission line to be detected is symmetrical based on the comparison of the distance with the preset symmetry judgment standard.
[0061] Step S206: When the current section of the transmission line to be detected is asymmetric, a first abnormality assessment result is obtained based on the first distance and the first preset distance threshold.
[0062] The first preset distance threshold may refer to a pre-set distance value used for comparison with the first distance to determine whether the current section of the transmission line to be inspected is abnormal. The first preset distance threshold may be determined based on experiments or actual experience. For example, the first preset distance threshold may be used to address scenarios where the transmission line is significantly asymmetric, such as a broken strand resulting in a single-sided loss. The first abnormality assessment result may refer to an assessment conclusion regarding whether the current section of the transmission line to be inspected is abnormal, derived from a comparison of the first distance with the first preset distance threshold.
[0063] Exemplarily, when it is determined that the current section of the transmission line to be detected is asymmetric, the server obtains a first abnormality assessment result based on a comparison between the first distance and a first preset distance threshold.
[0064] Step S208, when the current section of the transmission line to be detected is symmetrical, obtain the second distance between the pixel vector of the current section of the transmission line to be detected and the pixel vector of the adjacent section of the transmission line to be detected, and obtain the second abnormality assessment result based on the second distance and the second preset distance threshold.
[0065] The second distance may refer to the distance between the pixel vectors of the current segment of the transmission line to be inspected and the pixel vectors of the adjacent segment of the transmission line to be inspected. This distance may represent a measure of difference between the two pixel vectors, reflecting the longitudinal continuity of the transmission line and used to determine whether the current segment and the adjacent segment of the transmission line have abnormalities such as symmetrical strand breakage or stray strands. It should be understood that the current segment of the transmission line to be inspected is symmetrical, so the distance between the pixel vectors of the adjacent segment of the transmission line to be inspected on the same side as the current segment of the transmission line to be inspected can be used to represent the difference or similarity between the current segment of the transmission line to be inspected and the adjacent segment of the transmission line to be inspected. The second preset distance threshold may refer to another pre-set distance value used for comparison with the second distance to determine whether the current segment of the transmission line to be inspected and the adjacent segment of the transmission line to be inspected are abnormal. The second preset distance threshold may be determined based on experiments or actual experience. For example, the first preset distance threshold may be used to address scenarios involving longitudinal deformation of the transmission line, such as stray strands causing a gradual change in the transmission line's cross-section. The second abnormality assessment result may refer to an assessment conclusion regarding whether the current segment of the transmission line to be inspected and the adjacent segment of the transmission line to be inspected are abnormal, based on the comparison of the second distance with the second preset distance threshold.
[0066] Exemplarily, when determining that the current section of the transmission line to be detected is symmetrical, the server obtains the pixel vector of the current section of the transmission line to be detected and the pixel vector of the adjacent section of the transmission line to be detected, calculates the second distance between the two pixel vectors, and then obtains the second abnormality assessment result based on the comparison result of the second distance and the second preset distance threshold.
[0067] Step S210: Based on the first abnormality evaluation result and the second abnormality evaluation result, the transmission line to be detected that is evaluated as abnormal is obtained, and the transmission line to be detected that is evaluated as abnormal is input into a pre-trained transmission line defect recognition model to obtain the defect recognition result of the transmission line to be detected that is evaluated as abnormal; the defect recognition result is at least one of normal, symmetrical scattered strands, asymmetrical broken strands, asymmetrical scattered strands, transmission line crossing and other interferences.
[0068] The transmission line to be inspected that is assessed as abnormal may refer to an image of a transmission line segment to be inspected that is suspected of having defects, determined based on the first and second abnormality assessment results. A pre-trained transmission line defect recognition model is used to identify the defect type of the transmission line to be inspected that is assessed as abnormal. The defect recognition result may refer to the output of the transmission line defect recognition model after identifying the transmission line to be inspected that is assessed as abnormal, indicating the status of the transmission line to be inspected, such as normal, symmetrically scattered strands, or asymmetrically broken strands.
[0069] Exemplarily, the server integrates the first abnormality assessment result and the second abnormality assessment result to determine an image of the transmission line to be inspected that is assessed as abnormal, inputs the image of the transmission line to be inspected that is assessed as abnormal into a pre-trained transmission line defect recognition model, and the model outputs a defect recognition result, and determines the specific defect type of the transmission line to be inspected that is assessed as abnormal, such as normal, symmetrical scattered strands, asymmetrical broken strands, asymmetrical scattered strands, transmission line crossing, and other interference defect types. In some embodiments, the server can display the defect recognition result, and at the same time, can send the defect recognition result and the detailed location of the section of the transmission line corresponding to the defect recognition result to relevant personnel, who will conduct on-site composite confirmation so that if a real fault is confirmed, timely repairs can be carried out.
[0070] In the above-mentioned method for detecting defects in transmission lines, the transmission line image is extracted after grayscale processing of the transmission line image, and then the transmission lines in the transmission line image are segmented, followed by symmetry pre-screening, and abnormality assessment is performed according to different standards for different symmetric and asymmetric situations. Finally, only the abnormal transmission lines to be detected are sent to the transmission line defect recognition model to obtain defect recognition results, wherein the suspected abnormalities are first determined by segmentation processing and symmetry pre-screening, and then the defect type is further determined by the transmission line defect recognition model, which can improve the accuracy of transmission line defect detection. In addition, by reducing the data input to the transmission line defect recognition model after segmentation processing and symmetry pre-screening, the calculation amount of the transmission line defect recognition model can be reduced, and the detection efficiency can be improved. Therefore, the present application scheme is suitable for real-time processing of embedded devices, such as application to drone inspections. By combining traditional image processing and deep learning, a balance between detection efficiency and detection accuracy in transmission line defect detection is achieved, which can be suitable for large-scale power grid automation inspection scenarios.
[0071] In an exemplary embodiment, Figure 2 As shown, the above-mentioned grayscale image is converted to obtain each pixel edge segment in the grayscale image, and the transmission line image is obtained using each pixel edge segment, which may include the following steps. Among them:
[0072] Step S302: grayscale the image using a color conversion function to obtain a grayscale image.
[0073] The color conversion function refers to a function that converts a color image into a grayscale image, which can retain structural information and suppress color interference.
[0074] Step S304 , using a line segment detection algorithm to obtain each pixel edge segment in the grayscale image, and taking the image pixel area surrounded by two parallel pixel edge segments that meet a preset inter-segment distance threshold as a transmission line segment.
[0075] Among them, the line segment detection algorithm refers to an algorithm that can detect pixel edge segments in an image, such as the LSD (Line Segment Detector) algorithm, which is used to extract a set of pixel-level edge segments from a grayscale image. The preset inter-segment distance threshold can refer to a manually set distance value, which is used to determine whether two pixel edge segments are close enough to determine whether the two pixel edge segments are the two side edges of the transmission line. Only the area enclosed by two parallel pixel edge segments whose distance is less than the preset segment distance threshold is considered a transmission line segment. In actual applications, the value of the preset segment distance threshold can be determined based on the actual diameter of the transmission line. A transmission line segment can refer to a strip area defined by two parallel pixel edge segments, representing a local segment of the transmission line.
[0076] Exemplarily, a line segment detection algorithm is applied to process the grayscale image, detect the edge segments of each pixel, traverse all line segments, find two parallel line segments whose distance is less than a preset distance threshold between line segments, and determine the image area surrounded by them as the transmission line segment.
[0077] Step S306: connect the above transmission line segments using the Gestalt perception law to obtain an initial transmission line.
[0078] The perceptual principles of Gestalt psychology are used in image processing to connect related line segments. In this embodiment, because power lines can be curved, the detected line segments may be discontinuous. This principle is used to connect related line segments into a more complete representation of the power line.
[0079] For example, according to the Gestalt perception law, the detected transmission line segments are analyzed, and the segments that meet certain conditions (such as segment direction, positional relationship, etc.) are connected to form a more continuous transmission line representation, namely the initial transmission line.
[0080] Step S308 , removing the initial transmission lines whose centerline lengths are less than a preset length threshold, to obtain a transmission line image.
[0081] The preset length threshold can refer to the minimum physical length (or pixel length) of a valid transmission line. Line segments below the preset length threshold are considered noise. It should be understood that real transmission lines are unlikely to contain extremely short fragments, and initial transmission lines shorter than the preset length threshold may be tree branches or other linear interference objects.
[0082] Exemplarily, the length of the initial transmission line can be calculated, for example, by calculating the length of the axis of the initial transmission line as the length of the initial transmission line, and then discarding the part of the initial transmission line whose length is less than a preset length threshold, and the remaining part is the transmission line image.
[0083] In this embodiment, the image is grayscaled to eliminate interference from colored objects (such as birds, vegetation, etc.) while retaining structural features. After line segment detection, parallel constraints are used to eliminate non-transmission line edges (such as interference from tower truss slashes, tree branches, etc.). The Gestalt perception law is then used to complete the line segments caused by the bending of the transmission line to detect broken line segments and obtain the real transmission line. The isolated short lines generated by tree branches are then filtered using a preset length threshold. Based on the above, this embodiment can more accurately extract the transmission line image, reduce interference, and provide a more reliable data basis for subsequent defect detection, thereby improving the accuracy of the entire detection method.
[0084] In an exemplary embodiment, the above-mentioned determination of the axis centerline of the transmission line in the above-mentioned transmission line image may specifically include: obtaining the center line of two parallel pixel edge segments that meet a preset distance threshold between line segments, and using the above-mentioned center line as the axis centerline of the transmission line in the above-mentioned transmission line image.
[0085] The center line may refer to a virtual line located in the middle of two parallel pixel edge segments that meet a preset distance threshold between the two segments, and is used as the axis line of the transmission line in the transmission line image.
[0086] For example, for two parallel pixel edge segments identified as the edges of a power line that meet a preset inter-segment distance threshold, their spatial midpoint is calculated to obtain a virtual midline, which serves as the axis of the power line in the power line image. For example, if the endpoint coordinates of the two parallel segments are known, the midline can be determined by calculating the average of these endpoint coordinates.
[0087] In this embodiment, the centerline of the transmission line is determined by obtaining the centerline. This method of determining the centerline based on two parallel pixel edge segments is simple and intuitive, and provides an accurate benchmark for subsequent segmented defect detection of the transmission line based on the centerline, which helps to improve the accuracy and efficiency of detection.
[0088] In an exemplary embodiment, the above-mentioned segmentation of the transmission line into multiple segments to be inspected in the axis direction based on the preset segment lengths includes the following steps:
[0089] Step S11, obtaining the length of the current transmission line segment in the transmission line image, and obtaining the sliding frame step size corresponding to the current transmission line segment according to the length of the current transmission line segment and the preset segment length.
[0090] The length of the current transmission line segment may refer to the actual length of a transmission line segment obtained from the transmission line image. This length information is used to calculate the sliding frame step length. The sliding frame step length may refer to the distance of each slide when sliding the frame along the axis of the transmission line.
[0091] For example, the length of the current transmission line segment in the transmission line image is obtained by image processing technology, such as calculating the distance between the segment endpoints; and then the sliding frame step size is calculated based on the preset segment length and the length of the current transmission line segment. The process can be as follows:
[0092]
[0093] Among them, S is the sliding frame step size corresponding to the above-mentioned current transmission line segment; L is the length of the above-mentioned current transmission line segment; T is the above-mentioned preset segment length; int() represents the rounding function.
[0094] Step S12: Slide frame screenshots are taken on the current transmission line segment along the axis direction according to the slide frame step size to obtain multiple transmission line segments to be detected.
[0095] The sliding frame screenshot may refer to intercepting the current transmission line segment along the axis direction according to the calculated sliding frame step size, and obtaining an image area of the transmission line to be detected each time.
[0096] Exemplarily, with the calculated sliding frame step size as the interval, the current transmission line segment is successively screenshotted along the axis direction of the transmission line, and each screenshot obtains an image area of a transmission line to be detected, thereby dividing the transmission line into multiple transmission lines to be detected.
[0097] In this embodiment, the sliding frame step size is dynamically adjusted according to the length of the transmission line segment to perform sliding frame screenshots. Compared with the fixed step size method, the transmission line can be segmented more flexibly and reasonably, so that the length of each section of the transmission line to be inspected is more in line with the actual inspection requirements, and it is compatible with curved transmission lines, which helps to improve the accuracy and specificity of defect detection and avoid defect omission or misdetection due to unreasonable step size.
[0098] In an exemplary embodiment, the first abnormality assessment result is obtained based on the above-mentioned first distance and the first preset distance threshold, including: when the above-mentioned first distance is greater than the above-mentioned first preset distance threshold, the above-mentioned current section of the transmission line to be detected is evaluated as an abnormal transmission line to be detected.
[0099] Exemplarily, the calculated first distance between the pixel vectors on both sides of the axis of the current section of the transmission line to be inspected is compared with a pre-set first preset distance threshold. If the first distance is greater than the first preset distance threshold, the current section of the transmission line to be inspected is determined to be abnormal, and a first abnormality assessment result is obtained.
[0100] In this embodiment, by setting clear abnormality judgment criteria, transmission line sections that may have defects such as asymmetric broken strands and loose strands can be quickly and effectively identified, providing a screening basis for further determining the defect type, improving the efficiency and accuracy of the detection process, and reducing the workload of manual investigation.
[0101] In an exemplary embodiment, the second abnormality assessment result is obtained based on the second distance and the second preset distance threshold, including: when the second distance is greater than the second preset distance threshold, the current section of the transmission line to be detected and the adjacent section of the transmission line to be detected are both assessed as abnormal transmission lines to be detected.
[0102] Exemplarily, a second distance is calculated between the pixel vectors of the current segment of the transmission line to be detected and the adjacent segment of the transmission line to be detected, and the second distance is compared with a pre-set second distance threshold. If the second distance is greater than the second preset distance threshold, both the current segment of the transmission line to be detected and the adjacent segment of the transmission line to be detected are determined to be abnormal, thereby obtaining a second abnormality assessment result. It should be understood that if the second distance is greater than the second preset distance threshold, it indicates that the current segment of the transmission line to be detected and the adjacent segment of the transmission line to be detected are significantly different. However, it is not possible to determine which segment of the transmission line to be detected is abnormal at this time. Because the transmission line to be detected obtained after segmentation in the aforementioned step is already a small-sized segment, further determining which segment of the transmission line to be detected is abnormal through an algorithm would inevitably consume more computing resources. In this case, both the current segment of the transmission line to be detected and the adjacent segment of the transmission line to be detected are assessed as abnormal. This allows for further accurate identification in subsequent model processing, and can also be combined with the two small-scale segments for verification during subsequent on-site verification. In other words, the aforementioned steps improve detection efficiency without affecting detection accuracy.
[0103] In this embodiment, in order to detect possible defects such as symmetrical broken or scattered strands, anomalies are determined by comparing the pixel vector distances of adjacent sections of the transmission line, thereby expanding the scope of anomaly detection. Compared with only detecting a single section of the transmission line, the symmetrical defects of the transmission line can be more comprehensively identified, further improving the accuracy and reliability of detection, and ensuring the safe operation of the transmission line.
[0104] In an exemplary embodiment, the step of obtaining the pre-trained transmission line defect recognition model includes:
[0105] Step S21, obtaining pre-prepared training samples; the above samples are multiple images containing a section of power transmission line, and the above samples all contain labels, and the above labels are one of normal, symmetrical scattered strands, asymmetrical broken strands, asymmetrical scattered strands, power transmission line crossing and other interference.
[0106] Step S22: using the above-prepared training samples to train the transmission line defect recognition model to be trained, to obtain a trained transmission line defect recognition model.
[0107] Among them, the training samples can refer to multiple pre-prepared images containing a section of transmission line, each image has a label, and the label represents the state of the transmission line, such as normal, symmetrical loose strands, asymmetrical broken strands, etc., which are used to train the transmission line defect recognition model to be trained.
[0108] For example, a large number of images of power lines in different states (normal, symmetrically scattered, asymmetrically broken, asymmetrically scattered, crossing, and other interference) are manually collected. Each image is annotated with its corresponding power line state to form a training sample set. The server inputs the prepared training samples into the power line defect recognition model to be trained. Using a suitable training algorithm (such as stochastic gradient descent), the server adjusts the model parameters (such as weights and biases) through multiple iterations of training to enable the model to accurately classify power line images in different states, ultimately obtaining a trained power line defect recognition model.
[0109] In this embodiment, by using a large number of representative training samples to train the model, the model can learn the characteristics of different transmission line states, thereby improving the accuracy of the transmission line defect recognition model in identifying the transmission line defect type.
[0110] In an exemplary embodiment, the present application also provides a method for detecting broken strands and loose strands of a transmission line. The method is divided into two stages: extraction of suspected transmission lines and defect detection. Figure 3The figure shows a flow chart of the method for detecting broken and scattered strands in transmission lines. In the suspected transmission line extraction stage, the LSD (Line Segment Detector) algorithm is first used to detect line segments in the image. Parallel line segments that meet distance requirements are merged, then connected using Gestalt perception principles. Finally, a length threshold is used to filter out interference from shorter connecting lines (non-transmission lines) to identify suspected transmission lines. In the broken and scattered strand defect detection stage, a sliding frame with the transmission line as the perpendicular bisector is slid along the transmission line. The distance between pixel vectors in the two halves of the sliding frame (on either side of the perpendicular bisector) is calculated to determine whether the transmission line has suspected asymmetric broken and scattered strand defects. The distance between pixel vectors in adjacent sliding frames (on the same transmission line segment) is calculated to determine whether the transmission line has suspected symmetrical broken and scattered strand defects. If an anomaly is detected, a rectangular screenshot is taken and the screenshot is input into a lightweight CNN classifier to classify and determine whether the anomaly is a defect such as broken and scattered strands. This method improves detection speed while maintaining detection accuracy.
[0111] The above-mentioned method for detecting broken and loose strand defects in transmission lines may specifically include the following process:
[0112] In step S31, the video image is grayscaled, and then the LSD line segment detection algorithm is used to detect line segments. Parallel line segments that meet the distance conditions are merged, and then the Gestalt perception law is used to connect the line segments. Finally, the length threshold is used to filter out the interference of shorter connecting lines (non-transmission lines) to obtain suspected transmission lines.
[0113] Step S32: Use a sliding frame with the transmission line as a perpendicular bisector to slide along the transmission line.
[0114] Among them, the step size of the above-mentioned sliding box can be adjusted according to the length of the transmission line segment. A fixed step size threshold T is set. When the length L of the transmission line segment is less than twice the fixed step size threshold T, the step size S of the sliding box is 1 / 2 the length of the transmission line segment. When the length of the transmission line segment is greater than twice the fixed step size threshold T, the step size S of the sliding box is calculated by the following formula.
[0115]
[0116] Among them, S is the step size of the sliding box (the sliding box step size corresponding to the current transmission line segment); L is the length of the above-mentioned current transmission line segment; T is the preset segment length (fixed step size threshold); int() represents the rounding function.
[0117] Step S33 , calculating the distance between the pixel vectors in the two halves of the sliding frame (on both sides of the vertical bisector of the transmission line) to determine whether there is a suspected asymmetric broken strand defect in the transmission line.
[0118] Step S34 , calculating the distance between pixel vectors in adjacent sliding frames (on the same transmission line segment) to determine whether there is a suspected symmetrical broken strand defect in the transmission line.
[0119] The distance between two pixel vectors calculated in step S33 and step S34 may be calculated using the Mahalanobis distance, which is as follows:
[0120]
[0121] in, is the two pixel vector whose distance is to be calculated, is the covariance matrix.
[0122] In step S35, the image with suspected broken strands defect is input into a lightweight CNN classification network for classification, and finally determines whether there is a broken strand defect.
[0123] The lightweight CNN classification network can utilize lightweight upgraded network models such as mobilenetV1 (Mobile Neural Network Version 1). Training and application of this lightweight CNN classification network can involve manually collecting sufficient screenshots of normal power transmission lines, power transmission line intersections, broken power lines, scattered power lines, and other power transmission line environments as training and test sets. During application, the screenshots to be classified (images with suspected broken or scattered power lines) are fed into the lightweight CNN classification network for classification, resulting in a classification of the power transmission line condition.
[0124] Specifically, the above-mentioned method for detecting broken and loose strand defects in a transmission line may include the following steps:
[0125] In step S311 , the image to be detected is grayscaled using the color conversion function of OpenCV (Open Source Computer Vision Library) to obtain a grayscale image.
[0126] Step S312: Use the line segment detection method LSD algorithm of OpenCV to directly detect all line segments in the grayscale image to be detected.
[0127] Step S313: The transmission line contains two edges, and two line segments are detected (e.g. Figure 4 Therefore, the two parallel segments that meet the distance condition are merged into the midline of the parallel lines (as shown in the red line in the figure). Figure 4 The center line represents the transmission line segment.
[0128] In step S314, the transmission line is not always a straight line, but may be curved. Therefore, after the LSD algorithm detects the line segments, there will be segments one by one. Therefore, the Gestalt perception law is used to connect two line segments that meet the conditions, such as Figure 5 As shown. For a line segment set containing multiple line segments, if you want to connect the broken edge line features, you must first study the connection between the two line segments; the process of connecting two line segments is relatively simple, and the two endpoints that are farther apart can be taken as the two endpoints of the new line segment, but the premise is to determine whether the two line segments should be connected. In order to determine whether two line segments should be connected, this paper uses the Gestalt Perception Low (Gestalt Perception Low) principle of proximity, continuity, and collinearity for judgment. Proximity, continuity, and collinearity are described as formulas:
[0129] ds1, s2 <dthr1
[0130] |θ1-θ2|<θtnr1
[0131] dv <dthr2
[0132] Among them, Figure 5 As shown in the figure, L1 and L2 are two line segments close to each other; s1 and s2 are the two endpoints of L1 and L2 that are close to each other; s3 and s4 are the two endpoints of L1 and L2 that are far away from each other; ds1 and s2 are the Euclidean distances of points s1 and s2; dthr1 is a given distance threshold; θ1 and θ2 are the angles between L1 and L2 and the horizontal axis, respectively, and their values range from 0° to 180°; θtnr1 is a given angle difference threshold; dv is the distance between s2 and the foot of the perpendicular on L1; if two line segments meet the above three judgment conditions, the two endpoints of the two line segments that are far away from each other are used as the endpoints of a new line segment, and are connected to form a new line segment.
[0133] In step S315, overhead power lines generally run through the entire image, so a length threshold is set and lines shorter than the threshold are discarded, which can reduce most non-power line interference.
[0134] Step S321: Detect abnormal conditions of the sliding frame along the transmission line. Figure 6 As shown, the sliding frame initialization step size T is set (fixed step size threshold T), and the length L of the transmission line segment is calculated. When the length L of the transmission line segment is less than twice the sliding frame initialization step size T, the sliding frame step size S is 1 / 2 the length of the transmission line segment (as shown in Figure 6 Transmission line segment AB), the sliding frame step size S is calculated by the following formula. When the length of the transmission line segment is greater than twice the sliding frame initialization step size T (such as Figure 6 Transmission line segment CD), the step size S of the sliding frame is calculated by the following formula.
[0135]
[0136] Among them, S is the step size of the sliding box (the sliding box step size corresponding to the current transmission line segment); L is the length of the above-mentioned current transmission line segment; T is the (fixed step size threshold) sliding box initialization step size; int() represents the rounding function.
[0137] Step S322: Correct the sliding frame so that the transmission line segment in the sliding frame is perpendicular to the horizontal line. Figure 7 As shown, from left to right are schematic diagrams of normal, symmetrical scattered strands, asymmetrical broken strands, and asymmetrical scattered strands transmission line sliding frame screenshots.
[0138] Step S331, the sliding frame is divided into left and right sides, and the pixels on the left and right sides are scanned respectively. The scanning method is as follows: Figure 8 As shown, the pixels on the left and right sides are resized into one-dimensional vectors, and finally the distance between the vectors is calculated using the following formula.
[0139]
[0140] in, is the two pixel vector whose distance is to be calculated, is the covariance matrix.
[0141] If the calculated distance is less than a pre-set symmetry judgment distance threshold, the vector similarity corresponding to the pixels on the left and right sides is high, and it can be determined that this section of the transmission line is symmetrical; if the distance is greater than the pre-set symmetry judgment distance threshold, the section of the transmission line is asymmetric; if the distance is further greater than the first preset distance threshold, there is an abnormality in this section of the transmission line.
[0142] Step S341: When it is determined that the transmission line section (current sliding frame transmission line) is symmetrical, the pixels of the current sliding frame transmission line area and the previous sliding frame transmission line area are scanned respectively. The scanning method is as follows: Figure 9 As shown, the pixels of the two adjacent sliding frames are resized into a one-dimensional vector, and finally the distance between the vectors is calculated using the distance calculation formula. If the distance is greater than the second preset distance threshold, the transmission line section and the adjacent sliding frame are both determined to have an abnormality.
[0143] Step S351: Manually collect enough screenshots of normal, symmetrical scattered strands, asymmetrical broken strands, asymmetrical scattered strands, power line crossings, and other interferences, of which 90% are used as training sets and 10% as test sets. Use MobilenetV1 to build a classification network, where the input is 128*128 and the output is 5 categories. Use the training set and test set in step S341 to train and test the classification network, as shown in the following example: Figure 10As shown in Figure 1, the defect-free data includes screenshots of power line crossings, screenshots of non-power line interference, and screenshots of normal power lines. A rectangular screenshot is taken of the abnormal situation obtained in step S331 and step S341 to obtain a screenshot to be classified. The screenshot to be classified is then input into the MobilenetV1 classification network for classification to determine the defect category. Finally, the location and category information of the defect are returned based on the abnormal area and defect category, as shown in Figure 1. Figure 11 shown.
[0144] The above-mentioned method for detecting broken and scattered strands of transmission lines can collect images of overhead transmission lines in real time through a camera carried by a patrol robot or a patrol drone, and execute the above-mentioned method for detecting broken and scattered strands of transmission lines through the patrol robot or the patrol drone to perform real-time detection and promptly feedback the detection results, or the patrol robot or the patrol drone collects the image of the overhead transmission line and remotely transmits it to the background server, and the background server then executes the above-mentioned method for detecting broken and scattered strands of transmission lines to realize broken and scattered strand defect detection. This method has high accuracy and fast running speed; it can improve the accuracy and efficiency of broken and scattered strand detection of transmission lines, reduce false alarms and missed alarms, and reduce the degree of manual intervention.
[0145] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily performed in sequence in the order indicated by the arrows. Unless clearly stated herein, the execution of these steps is not strictly limited in order, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of the steps or stages in other steps or other steps. It is understandable that the various steps in different embodiments can be freely combined as needed, and the various non-contradictory schemes formed by the combination all fall within the scope of protection of this application.
[0146] Based on the same inventive concept, embodiments of the present application also provide a transmission line defect detection device for implementing the aforementioned transmission line defect detection method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more of the following embodiments of the transmission line defect detection device can be found in the aforementioned limitations of the transmission line defect detection method and will not be further elaborated here.
[0147] In an exemplary embodiment, Figure 12As shown, a transmission line defect detection device 900 is provided, comprising: an image acquisition module 901, a symmetry judgment module 902, an abnormality assessment module 903 and a defect recognition module 904, wherein:
[0148] The image acquisition module 901 is configured to acquire an image containing a power transmission line to be detected; grayscale the image and obtain edge segments of each pixel in the grayscale image; and obtain an image of the power transmission line using the edge segments of each pixel;
[0149] Symmetry determination module 902 is configured to determine the axis of the transmission line in the transmission line image, segment the transmission line into multiple transmission line segments to be detected along the axis based on a preset segment length; obtain a first distance between pixel vectors on both sides of the axis of the current transmission line segment to be detected, and determine whether the current transmission line segment to be detected is symmetrical based on the first distance;
[0150] Anomaly assessment module 903 is configured to obtain a first anomaly assessment result based on the first distance and a first preset distance threshold when the current segment of the transmission line to be detected is asymmetric; and to obtain a second distance between the pixel vector of the current segment of the transmission line to be detected and the pixel vector of the adjacent segment of the transmission line to be detected when the current segment of the transmission line to be detected is symmetric, and to obtain a second anomaly assessment result based on the second distance and a second preset distance threshold;
[0151] The defect identification module 904 is used to obtain the transmission line to be detected that is evaluated as abnormal based on the above-mentioned first abnormality evaluation result and the above-mentioned second abnormality evaluation result, and input the above-mentioned transmission line to be detected that is evaluated as abnormal into a pre-trained transmission line defect identification model to obtain the defect identification result of the transmission line to be detected that is evaluated as abnormal; the above-mentioned defect identification result is at least one of normal, symmetrical scattered strands, asymmetrical broken strands, asymmetrical scattered strands, transmission line crossing and other interference.
[0152] In an exemplary embodiment, the image acquisition module 901 is further used to grayscale the image using a color conversion function to obtain a grayscale image; obtain each pixel edge segment in the grayscale image using a line segment detection algorithm, and use the image pixel area surrounded by two parallel pixel edge segments that meet a preset inter-segment distance threshold as a transmission line segment; connect each of the above transmission line segments using the Gestalt perception law to obtain an initial transmission line; remove the initial transmission lines whose line length is less than a preset length threshold from the initial transmission lines to obtain a transmission line image.
[0153] In an exemplary embodiment, the symmetry judgment module 902 is further configured to obtain the center line of two parallel pixel edge segments that meet a preset distance threshold between the segments, and use the center line as the axis of the transmission line in the transmission line image.
[0154] In an exemplary embodiment, the symmetry judgment module 902 is further configured to obtain the length of the current transmission line segment in the transmission line image, and obtain a sliding frame step corresponding to the current transmission line segment based on the length of the current transmission line segment and the preset segment length; and perform a sliding frame screenshot of the current transmission line segment along the axis direction based on the sliding frame step to obtain multiple transmission line segments to be detected; wherein, the sliding frame step corresponding to the current transmission line segment is obtained based on the length of the current transmission line segment and the preset segment length, and the process is as follows:
[0155]
[0156] Among them, S is the sliding frame step size corresponding to the above-mentioned current transmission line segment; L is the length of the above-mentioned current transmission line segment; T is the above-mentioned preset segment length; int() represents the rounding function.
[0157] In an exemplary embodiment, the abnormality assessment module 903 is further configured to assess the current section of the transmission line to be detected as an abnormal transmission line to be detected when the first distance is greater than the first preset distance threshold.
[0158] In an exemplary embodiment, the above-mentioned abnormality assessment module 903 is also used to assess the above-mentioned current section of the transmission line to be detected and the above-mentioned adjacent section of the transmission line to be detected as abnormal transmission lines to be detected when the above-mentioned second distance is greater than the above-mentioned second preset distance threshold.
[0159] In an exemplary embodiment, the above-mentioned transmission line defect detection device also includes a model training module for obtaining pre-prepared training samples; the above-mentioned samples are multiple images containing a section of transmission line, and the above-mentioned samples all contain labels, and the above-mentioned labels are one of normal, symmetrical scattered strands, asymmetrical broken strands, asymmetric scattered strands, transmission line crossing and other interferences; the above-mentioned pre-prepared training samples are used to train the transmission line defect recognition model to be trained to obtain a trained transmission line defect recognition model.
[0160] Each module in the aforementioned transmission line defect detection device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in hardware form, or stored in a computer device memory in software form, so that the processor can call and execute the corresponding operations of each module.
[0161] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 13As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for detecting defects in a transmission line is implemented.
[0162] Those skilled in the art will understand that Figure 13 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0163] In one embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0164] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0165] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0166] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, artificial intelligence (AI) processors, and the like.
[0167] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0168] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A method for detecting defects in a transmission line, characterized in that: The method comprises: Acquire an image containing a power transmission line to be detected; grayscale the image and obtain edge line segments of each pixel in the grayscale image, and obtain a power transmission line image using the edge line segments of each pixel; Determining the axis of the power line in the power line image, and dividing the power line into a plurality of power line segments to be detected in the axis direction based on a preset segment length; obtaining a first distance between pixel vectors on both sides of the axis of the current segment of the power line to be detected, and determining whether the current segment of the power line to be detected is symmetrical based on the first distance; In a case where the current section of the transmission line to be detected is asymmetric, obtaining a first abnormality assessment result according to the first distance and a first preset distance threshold; When the current section of the transmission line to be detected is symmetrical, obtaining a second distance between the pixel vector of the current section of the transmission line to be detected and the pixel vector of an adjacent section of the transmission line to be detected, and obtaining a second anomaly assessment result based on the second distance and a second preset distance threshold; According to the first abnormality evaluation result and the second abnormality evaluation result, the transmission line to be detected that is evaluated as abnormal is obtained, and the transmission line to be detected that is evaluated as abnormal is input into a pre-trained transmission line defect recognition model to obtain the defect recognition result of the transmission line to be detected that is evaluated as abnormal; the defect recognition result is at least one of normal, symmetrical scattered strands, asymmetrical broken strands, asymmetrical scattered strands, transmission line crossing and other interferences.
2. The method according to claim 1, characterized in that The step of graying the image and obtaining edge segments of each pixel in the grayed image, and obtaining a power line image using the edge segments of each pixel, comprises: grayscale the image using a color conversion function to obtain a grayscale image; Using a line segment detection algorithm to obtain edge line segments of each pixel in the grayscale image, and taking an image pixel area surrounded by two parallel pixel edge line segments that meet a preset inter-segment distance threshold as a transmission line segment; Using Gestalt perception laws to connect the transmission line segments to obtain an initial transmission line; The initial transmission lines whose centerline lengths are less than a preset length threshold are removed to obtain a transmission line image.
3. The method according to claim 2, characterized in that Determining the axis centerline of the transmission line in the transmission line image includes: The midline of two pixel edge segments that are parallel and meet a preset distance threshold between the segments is obtained, and the midline is used as the axis of the power transmission line in the power transmission line image.
4. The method according to claim 3, characterized in that The step of dividing the transmission line into a plurality of transmission line segments to be inspected in the axis direction based on a preset segment length includes: Obtaining the length of a current transmission line segment in the transmission line image, and obtaining a sliding frame step size corresponding to the current transmission line segment according to the length of the current transmission line segment and the preset segment length; Performing a sliding frame screenshot of the current transmission line segment along the axis direction according to the sliding frame step size to obtain multiple transmission line segments to be detected; The process of obtaining the sliding frame step size corresponding to the current transmission line segment according to the length of the current transmission line segment and the preset segment length is as follows: Among them, S is the sliding frame step size corresponding to the current transmission line segment; L is the length of the current transmission line segment; T is the preset segment length; int() represents the rounding function.
5. The method according to claim 1, wherein Obtaining a first abnormality assessment result according to the first distance and a first preset distance threshold includes: When the first distance is greater than the first preset distance threshold, the current section of the transmission line to be detected is evaluated as an abnormal transmission line to be detected.
6. The method according to claim 1, wherein Obtaining a second abnormality assessment result according to the second distance and a second preset distance threshold includes: When the second distance is greater than the second preset distance threshold, the current section of the transmission line to be detected and the adjacent section of the transmission line to be detected are both evaluated as abnormal transmission lines to be detected.
7. The method according to claim 1, characterized in that The step of obtaining the pre-trained transmission line defect recognition model includes: Acquire pre-prepared training samples; the samples are multiple images containing a section of a transmission line, and the samples each contain a label, wherein the label is one of normal, symmetrical scattered strands, asymmetrical broken strands, asymmetrical scattered strands, transmission line crossing, and other interference; The pre-prepared training samples are used to train the transmission line defect recognition model to be trained, thereby obtaining a trained transmission line defect recognition model.
8. A transmission line defect detection device, characterized in that: The device comprises: An image acquisition module is configured to acquire an image containing a power transmission line to be detected; grayscale the image and obtain edge segments of each pixel in the grayscale image, and obtain an image of the power transmission line using the edge segments of each pixel; a symmetry determination module, configured to determine the axis of the transmission line in the transmission line image, segment the transmission line into multiple segments of transmission line to be detected in the axis direction based on a preset segment length; obtain a first distance between pixel vectors on both sides of the axis of the current segment of the transmission line to be detected, and determine whether the current segment of the transmission line to be detected is symmetrical based on the first distance; an anomaly assessment module, configured to obtain a first anomaly assessment result based on the first distance and a first preset distance threshold when the current section of the transmission line to be detected is asymmetric; and to obtain a second distance between a pixel vector of the current section of the transmission line to be detected and a pixel vector of an adjacent section of the transmission line to be detected when the current section of the transmission line to be detected is symmetric, and to obtain a second anomaly assessment result based on the second distance and a second preset distance threshold; A defect identification module is used to obtain a transmission line to be detected that is evaluated as abnormal based on the first abnormality evaluation result and the second abnormality evaluation result, and input the transmission line to be detected that is evaluated as abnormal into a pre-trained transmission line defect identification model to obtain a defect identification result of the transmission line to be detected that is evaluated as abnormal; the defect identification result is at least one of normal, symmetrical scattered strands, asymmetrical broken strands, asymmetrical scattered strands, transmission line crossing and other interference.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium 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.