A bolt posture detection algorithm for power transmission line maintenance

By combining the Canny edge detection algorithm and the Graham scanning algorithm, the problem of unreliability of traditional edge detection algorithms in high background fusion image processing is solved, and the high accuracy and robustness of bolt pose detection is achieved, adapting to complex environments and lighting conditions.

CN118799258BActive Publication Date: 2025-02-14WUXI UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410738999.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2025-02-14
Estimated Expiration
2044-06-07

AI Technical Summary

Technical Problem

Traditional edge detection algorithms are susceptible to noise and background complexity when processing high background fused images, resulting in unreliable edge detection results and unstable performance at different lighting and shooting angles.

Method used

Using Canny edge detection algorithm combined with Graham scanning algorithm, the accuracy and completeness of bolt profiles are ensured through image preprocessing, edge detection, connection domain analysis, contour extraction and polygon fitting, and the rotation matrix in three-dimensional space is calculated to convert it into a camera. Position in the coordinate system.

Benefits of technology

It improves the accuracy and robustness of bolt position detection, can effectively filter background noise in high noise and complex background environments, accurately extract the edge profile of bolts, and adapt to various complex environments and lighting conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118799258B_ABST
    Figure CN118799258B_ABST
Patent Text Reader

Abstract

The present invention discloses a bolt posture detection algorithm applied to power transmission line maintenance, and relates to the field of image processing technology. The algorithm comprises the following steps: preprocessing the acquired bolt image; performing edge detection on the preprocessed image using the Canny edge detection algorithm; performing connected domain analysis on the edge detection result, removing small noise areas, and retaining only connected domains that match the bolt size; extracting the complete outline of the bolt using the Graham scanning algorithm; performing polygon fitting on the extracted bolt outline to obtain the hexagonal outline of the bolt; performing posture information calculation, and converting the position and posture of the bolt outline in three-dimensional space into the position in the camera coordinate system. The present invention ensures the accuracy and integrity of the outline by designing the Graham scanning algorithm for extracting the complete outline of the bolt, and calculates the rotation matrix in the three-dimensional space, and converts the position and posture of the bolt outline in the three-dimensional space into the position in the camera coordinate system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a bolt posture detection algorithm applied to transmission line maintenance. Background Art

[0002] The bolt posture detection algorithm based on edge detection is a technical means to determine the position, direction and posture of the bolt by detecting and analyzing the edges of objects in the image using computer vision technology. In the intelligent maintenance robot of power transmission lines, this algorithm can help the robot accurately detect the position, direction and state of the bolts on the transmission line, thereby realizing automated maintenance operations, which usually includes steps such as image acquisition, edge detection, feature extraction and posture calculation.

[0003] However, traditional edge detection algorithms such as Sobel or Prewitt methods are easily affected by noise and background complexity when processing high-background fusion images, resulting in unreliable edge detection results. In addition, the performance of the final posture detection algorithm is unstable under different lighting and shooting angles and is easily affected by environmental changes. Summary of the invention

[0004] The purpose of this section is to summarize some aspects of embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the specification abstract and the invention title of this application to avoid blurring the purpose of this section, the specification abstract and the invention title, and such simplifications or omissions cannot be used to limit the scope of the present invention.

[0005] In view of the above-mentioned problems existing in the existing bolt posture detection algorithm applied to transmission line maintenance, the present invention is proposed.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0007] A bolt posture detection algorithm applied to transmission line maintenance includes the following steps:

[0008] S1: preprocessing of the acquired bolt image;

[0009] S2: Use the Canny edge detection algorithm to perform edge detection on the preprocessed image;

[0010] S3: Perform connected domain analysis on the edge detection results, remove small noise areas, and only retain connected domains that match the bolt size;

[0011] S4: Extract the complete profile of the bolt using the Graham scanning algorithm;

[0012] S5: performing polygon fitting on the extracted bolt profile to obtain a hexagonal profile of the bolt;

[0013] S6: Calculate the posture information and convert the position and posture of the bolt profile in the three-dimensional space into the position in the camera coordinate system.

[0014] As a preferred solution of the bolt posture detection algorithm applied to transmission line maintenance described in the present invention, the image preprocessing method is: converting the bolt image into a grayscale image, and then performing Gaussian filtering on the grayscale image to reduce noise.

[0015] As a preferred solution of the bolt posture detection algorithm applied to power transmission line maintenance described in the present invention, the specific steps of the Canny edge detection algorithm are:

[0016] S21: Calculate the gradient of the image;

[0017] S22: Determine the edge using the double threshold method;

[0018] S23: Apply hysteresis threshold method to connect edges.

[0019] As a preferred solution of the bolt posture detection algorithm applied to transmission line maintenance described in the present invention, wherein:

[0020] Assuming the input image is I(x,y), the formula for calculating the image gradient is:

[0021]

[0022] Where S x and S y are the convolution kernels of the Sobel operator in the x direction and the y direction respectively, and the calculation formulas for the gradient amplitude G and the gradient direction θ are:

[0023]

[0024] As a preferred solution of the bolt posture detection algorithm for power transmission line maintenance described in the present invention, the method of using the double threshold method to determine the edge is: through two thresholds T high and T low To determine the edge, above T high Pixels below T are considered edges. low The pixels are suppressed;.

[0025] Define the binarized edge image E(x, y):

[0026]

[0027] As a preferred solution of the bolt posture detection algorithm applied to power transmission line maintenance described in the present invention, the specific method of connecting the edges using the hysteresis threshold method is:

[0028] Through the hysteresis threshold method, the pixels between the two thresholds are connected to the edge. Let C(x, y) be the final edge connection image, then C(x, y) is expressed as:

[0029]

[0030] Among them, N(x, y) represents the neighborhood of the point (x, y).

[0031] The value range of C(x, y) is {0, 1}, which represents the edge image after binarization, where 1 represents an edge and 0 represents a non-edge.

[0032] As a preferred solution of the bolt posture detection algorithm applied to power transmission line maintenance described in the present invention, in which: in the S4 process, the steps of the Graham scanning algorithm are:

[0033] S41: First, use the Canny edge detection result C(x, y) to obtain the edge point set P = {(x i ,y i )|C(x i ,y i )=1};

[0034] S42: Select the point with the smallest y coordinate in the edge point set as the reference point P0;

[0035] S43: Calculate the polar angle of each edge point relative to the reference point, polar angle θ i The calculation formula is:

[0036] θ i =arctan 2(y i -y0,x i -x0);

[0037] S44: sorting the point set according to the polar angle to obtain a sorted point set P′;

[0038] S45: Use the sorted point set P′ to construct the convex hull; define the function cross(O, A, B) to calculate the vector and The cross product of:

[0039] cross(O,A,B)=(A x -O x )·(B y -O y )-(A y -Oy )·(B x -O x );

[0040] S46: Add points to the convex hull starting from the reference point. If adding points will cause the convex hull to rotate counterclockwise, remove the last point from the convex hull. The formula is as follows:

[0041]

[0042] Where H represents the current convex hull point set, H[-1] and H[-2] represent the last point and the second to last point in the current convex hull respectively;

[0043] According to the above steps, we finally get the coordinate set

[0044] Among other things, this set of coordinates represents the finished profile of the bolt.

[0045] As a preferred solution of the bolt posture detection algorithm applied to power transmission line maintenance described in the present invention, the posture information is calculated as follows:

[0046] S61: Select the center point 0 of the bolt as the origin, assume that the outline of the bolt is a regular hexagon, use the hexagon vertex pixels to calculate its posture, set the hexagon vertex coordinates of the bolt to Pi = (xi, yi), and the center point to 0 = (x0, y0); calculate the polar angle θ of each vertex relative to the center point i and radius r i . :

[0047]

[0048] θ i =arctan 2(y i -y0,x i -x0);

[0049] S62: Take the point with the largest ordinate among the vertices of the hexagon, Pmax=(xmax, ymax), and calculate the angle β=arctan 2(ymax) between the line connecting the point and the center point and the horizontal line. max -y0,x max -x0)

[0050] S63: Based on the obtained posture information β, the rotation matrix R is obtained using the Rodriguez formula:

[0051] R=I+sin(θ)K+(1-cos(θ))K 2 ;

[0052] Where K is the antisymmetric matrix of the rotation axis:

[0053]

[0054] Assuming that the origin of the camera coordinate system is Oc, the position Pc of the bolt's contour point in the camera coordinate system is transformed by the rotation matrix as follows:

[0055] P c =R·(PO)+O c .

[0056] Beneficial effects of the present invention:

[0057] 1. The present invention designs a Graham scanning algorithm to extract the complete outline of the bolt, ensuring the accuracy and integrity of the outline, and calculates the rotation matrix in the three-dimensional space to convert the position and posture of the bolt outline in the three-dimensional space into the position in the camera coordinate system. This method not only ensures the accuracy of detection, but also enhances the robustness of the system, enabling it to adapt to various complex environments and lighting conditions;

[0058] 2. By introducing the Canny edge detection algorithm, the present invention can still maintain high-precision edge detection effect under high background fusion conditions, which is difficult to achieve with traditional edge detection algorithms; for example, in high noise and complex background environments, the algorithm can effectively filter out background noise and accurately extract the edge contour of the bolt. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:

[0060] Figure 1 This is a schematic diagram of the flow of a bolt posture detection algorithm for power transmission line maintenance proposed by the present invention. DETAILED DESCRIPTION

[0061] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.

[0062] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0063] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0064] Reference Figure 1 , is an embodiment of the present invention, and provides a bolt posture detection algorithm for power transmission line maintenance, the algorithm comprising the following steps:

[0065] S1: preprocessing of the acquired bolt image;

[0066] Specifically, the image preprocessing method is: converting the bolt image into a grayscale image to simplify subsequent processing, and then performing Gaussian filtering on the grayscale image to reduce noise and improve the effect of edge detection.

[0067] S2: Use the Canny edge detection algorithm to perform edge detection on the preprocessed image;

[0068] S21: Calculate the gradient of the image;

[0069] Assuming the input image is I(x,y), the formula for calculating the image gradient is:

[0070]

[0071]

[0072] Where S x and S y are the convolution kernels of the Sobel operator in the x direction and the y direction respectively, and the calculation formulas for the gradient amplitude G and the gradient direction θ are:

[0073]

[0074] S22: Determine the edge using the double threshold method;

[0075] The method of using the double threshold method to determine the edge is: through two thresholds T high and T low To determine the edge, above T high Pixels below T are considered edges. low The pixels are suppressed;.

[0076] Define the binarized edge image E(x, y):

[0077]

[0078] S23: Apply hysteresis threshold method to connect edges;

[0079] Through the hysteresis threshold method, the pixels between the two thresholds are connected to the edge. Let C(x, y) be the final edge connection image, then C(x, y) is expressed as:

[0080]

[0081] Among them, N(x,y) represents the neighborhood of the point (x,y).

[0082] The value range of C(x,y) is {0,1}, which represents the edge image after binarization, where 1 represents edge and 0 represents non-edge.

[0083] S3: Perform connected domain analysis on the edge detection results, remove small noise areas, and only retain connected domains that match the bolt size;

[0084] S4: Extract the complete profile of the bolt using the Graham scanning algorithm;

[0085] Specifically, the steps of the Graham scanning algorithm are:

[0086] S41: First, use the Canny edge detection result C(x, y) to obtain the edge point set P = {(x i ,y i )|C(x i ,y i )=1};

[0087] S42: Select the point with the smallest y coordinate in the edge point set. If there are multiple points, select the point with the smallest x coordinate as the reference point P0;

[0088] S43: Calculate the polar angle of each edge point relative to the reference point, polar angle θ i The calculation formula is:

[0089] θ i =arctan 2(y i -y0,x i -x0);

[0090] S44: sorting the point set according to the polar angle to obtain a sorted point set P′;

[0091] S45: Use the sorted point set P′ to construct the convex hull; define the function cross(O, A, B) to calculate the vector and The cross product of:

[0092] cross(O,A,B)=(A x -O x )·(B y -Oy )-(A y -O y )·(B x -O x );

[0093] S46: Add points to the convex hull starting from the reference point. If adding points will cause the convex hull to rotate counterclockwise, remove the last point from the convex hull. The formula is as follows:

[0094]

[0095] Where H represents the current convex hull point set, H[-1] and H[-2] represent the last point and the second to last point in the current convex hull respectively;

[0096] According to the above steps, we finally get the coordinate set

[0097] Wherein, this set of coordinates represents the finished profile of the bolt

[0098] S5: performing polygon fitting on the extracted bolt profile to obtain a hexagonal profile of the bolt;

[0099] S6: Calculate the posture information and convert the position and posture of the bolt profile in the three-dimensional space into the position in the camera coordinate system.

[0100] Specifically, the calculation method of posture information is:

[0101] S61: Select the center point O of the bolt as the origin, assume that the outline of the bolt is a regular hexagon, use the hexagon vertex pixels to calculate its posture, assume that the hexagon vertex coordinates of the bolt are Pi = (xi, yi), and the center point is O = (x0, y0); calculate the polar angle θ of each vertex relative to the center point i and radius r i . :

[0102]

[0103] θ i =arctan 2(y i -y0,x i -x0);

[0104] S62: Take the point with the largest ordinate among the vertices of the hexagon, Pmax=(xmax, ymax), and calculate the angle β=arctan 2(ymax) between the line connecting the point and the center point and the horizontal line. max -y0,x max -x0)

[0105] S63: Based on the obtained posture information β, the rotation matrix R is obtained using the Rodriguez formula:

[0106] R=I+sin(θ)K+(1-cos(θ))K 2 ;

[0107] Where I is the 3x3 identity matrix and K is the antisymmetric matrix of the rotation axis:

[0108]

[0109] In the above formula, k x , k y , k z are the components of the rotation axis in the x, y, and z directions.

[0110] Assuming that the origin of the camera coordinate system is Oc, the position Pc of the bolt's contour point in the camera coordinate system is transformed by the rotation matrix as follows:

[0111] P c =R·(PO)+O c .

[0112] Based on the standard Graham scanning algorithm and Rodriguez formula, this formula enhances the accuracy of edge point extraction, posture information calculation and coordinate transformation by introducing integral functions and complex summation functions, ensuring that the accuracy of bolt posture detection can be achieved and improved in practical applications.

[0113] In summary, the present invention ensures the accuracy and integrity of the outline by designing the Graham scanning algorithm for extracting the complete outline of the bolt, and calculates the rotation matrix in the three-dimensional space to convert the position and posture of the bolt outline in the three-dimensional space into the position in the camera coordinate system. This method not only ensures the accuracy of detection, but also enhances the robustness of the system, enabling it to adapt to various complex environments and lighting conditions; by introducing the Canny edge detection algorithm, it can still maintain high-precision edge detection effects under high background fusion conditions, which is difficult to achieve with traditional edge detection algorithms; for example, in high noise and complex background environments, this algorithm can effectively filter out background noise and accurately extract the edge outline of the bolt.

[0114] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A bolt posture detection algorithm applied to transmission line maintenance, characterized in that: The algorithm consists of the following steps: S1: preprocessing of the acquired bolt image; S2: Use the Canny edge detection algorithm to perform edge detection on the preprocessed image; S3: Perform connected domain analysis on the edge detection results, remove small noise areas, and only retain connected domains that match the bolt size; S4: Extract the complete profile of the bolt using the Graham scanning algorithm; The steps of the Graham scanning algorithm are: S41: First, use the Canny edge detection result C(x, y) to obtain the edge point set P = {(x i ,y i )|C(x i ,y i )=1}; S42: Select the point with the smallest y coordinate in the edge point set as the reference point P0; S43: Calculate the polar angle of each edge point relative to the reference point, polar angle θ i The calculation formula is: θ i =arctan2(y i −y0,x i -x0)? S44: sorting the point set according to the polar angle to obtain a sorted point set P′; S45: Use the sorted point set P′ to construct the convex hull; define the function cross(O,A,B) to calculate the vector and The cross product of: cross(O,A,B)=(A x -SHE x )·(B y -SHE y )-(A y -SHE y )·(B x -SHE x ); S46: Add points to the convex hull starting from the reference point. If adding points will cause the convex hull to rotate counterclockwise, remove the last point from the convex hull. The formula is as follows: Where H represents the current convex hull point set, H[-1] and H[-2] represent the last point and the second to last point in the current convex hull respectively; According to the above steps, we finally get the coordinate set Wherein, the coordinate set represents the finished profile of the bolt; S5: performing polygon fitting on the extracted bolt profile to obtain a hexagonal profile of the bolt; S6: Calculate the posture information and convert the position and posture of the bolt profile in the three-dimensional space into the position in the camera coordinate system; The calculation method of posture information is: S61: Select the center point O of the bolt as the origin, assume that the outline of the bolt is a regular hexagon, use the hexagon vertex pixels to calculate its posture, set the hexagon vertex coordinates of the bolt to Pi = (xi, yi), and the center point to O = (x0, y0); calculate the polar angle θ of each vertex relative to the center point i and radius r i : θ i =arctan2(y i −y0,x i -x0)? S62: Take the point with the largest ordinate among the vertices of the hexagon, Pmax=(xmax, ymax), and calculate the angle θ=arctan2(ymax) between the line connecting the point and the center point and the horizontal line. max -y0,x max -x0) S63: Based on the obtained posture information θ, the rotation matrix R is obtained using the Rodriguez formula: R=I+sin(θ)K+(1-cos(θ))K 2 ; Where K is the antisymmetric matrix of the rotation axis: Assuming that the origin of the camera coordinate system is Oc, the position Pc of the bolt's contour point in the camera coordinate system is transformed by the rotation matrix as follows: P c =R·(PO)+O c 。 2. The bolt posture detection algorithm for power transmission line maintenance according to claim 1 is characterized in that: The image preprocessing method is: converting the bolt image into a grayscale image, and then performing Gaussian filtering on the grayscale image to reduce noise.

3. The bolt posture detection algorithm for power transmission line maintenance according to claim 1 is characterized in that: The specific steps of the Canny edge detection algorithm are: S21: Calculate the gradient of the image; S22: Determine the edge using the double threshold method; S23: Apply hysteresis threshold method to connect edges.

4. The bolt posture detection algorithm for power transmission line maintenance according to claim 3 is characterized in that: Assuming the input image is I(x,y), the formula for calculating the image gradient is: Where S x and S y are the convolution kernels of the Sobel operator in the x direction and the y direction respectively, and the calculation formulas for the gradient amplitude G and the gradient direction θ are:

5. The bolt posture detection algorithm for power transmission line maintenance according to claim 4 is characterized in that: The method of using the double threshold method to determine the edge is: through two thresholds T high and T low To determine the edge, above T high Pixels below T are considered edges. low The pixels are suppressed; Define the binarized edge image E(x, y):

6. The bolt posture detection algorithm for power transmission line maintenance according to claim 5 is characterized in that: The specific method of connecting edges using the hysteresis threshold method is: Through the hysteresis threshold method, the pixels between the two thresholds are connected to the edge. Let C(x, y) be the final edge connection image, then C(x, y) is expressed as: Among them, N(x,y) represents the neighborhood of the point (x,y).

Citation Information

Patent Citations

  • A bolt positioning and posture detection method based on monocular and binocular vision cooperation

    CN109035200A