Telegraph pole inclination angle detection method, device and equipment and storage medium
By using a target detection model and horizon calibration method, the measurement deviation problem of pole tilt angle detection in open scenes was solved, achieving higher accuracy and robustness in tilt angle detection.
Patent Information
- Application Number
- CN202511748082.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-02-24
AI Technical Summary
In detecting the tilt angle of utility poles in open environments, existing technologies have failed to effectively overcome measurement deviations caused by camera tilt, especially in the absence of reference objects, resulting in insufficient detection accuracy.
A target detection model is used to detect the bounding box of the utility pole. The pixel coordinate set is obtained by combining the image segmentation algorithm. The tilt angle of the utility pole is corrected by principal direction analysis and horizon tilt angle calibration. The horizon is introduced as an absolute horizontal reference to eliminate shooting tilt angle error.
It significantly improves the detection accuracy and robustness of the pole tilt angle, eliminates systematic errors, and achieves higher accuracy and stability.
Smart Images

Figure CN121564100A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image detection technology, specifically to a method, apparatus, device, and storage medium for detecting the tilt angle of utility poles. Background Technology
[0002] Currently, in power facility inspections and pole verification, accurate measurement of pole tilt angle is a key indicator for ensuring the safe operation of transmission lines. However, pole tilt angle detection in open environments faces challenges such as a lack of ground texture features, absence of obvious reference points in the surrounding area, and low image resolution during manual inspections.
[0003] In existing technologies, a deep learning-based method for detecting the tilt of utility poles (application number CN120634978A) uses a line segment detection (LSD) algorithm to calculate the tilt angle of the utility pole. Another method and apparatus for detecting the tilt of utility poles (application number CN111739011A) first detects straight lines in the image of the optimal candidate bounding box, obtaining the edge segments of the utility pole; then it calculates the two angles between the edge segments on both sides of the utility pole and the ground plane. If the two angles are equal, it is determined that the utility pole is not tilted. However, neither of these methods considers the image tilt caused by the shooting angle, directly equating the image coordinate system with the world coordinate system, which can lead to systematic measurement errors when shooting from a non-perpendicular angle. Summary of the Invention
[0004] At least one embodiment of the present invention provides a method, apparatus, device and storage medium for detecting the tilt angle of a utility pole, which is used to solve the problem of measurement deviation of the tilt angle of a utility pole caused by the tilt of the camera in an open scene where there are no reference objects.
[0005] To solve the above-mentioned technical problems, the present invention is implemented as follows:
[0006] In a first aspect, embodiments of the present invention provide a method for detecting the tilt angle of a utility pole, comprising:
[0007] The target detection model is used to detect utility poles in the first image or the second image to obtain the bounding boxes of the utility poles; the second image is an image after horizontal calibration of the first image based on the tilt angle of the horizon in the first image;
[0008] For the bounding box, the set of pixel coordinates of the utility pole is obtained according to the image segmentation algorithm;
[0009] The tilt angle of the utility pole is obtained by performing a main direction analysis based on the pixel coordinate set.
[0010] Having obtained the bounding box of the utility pole based on the first image, the tilt angle of the utility pole is corrected based on the tilt angle of the horizon in the first image to obtain the corrected tilt angle of the utility pole.
[0011] Optionally, in the aforementioned method for detecting the tilt angle of utility poles, the initial aspect ratio of the bounding box output by the target detection model is obtained by clustering analysis of a set of utility pole image samples.
[0012] Optionally, in the aforementioned method for detecting the tilt angle of utility poles, the loss function of the target detection model is used to indicate the degree of overlap between the boundary prediction box output by the target detection model and the corresponding boundary ground truth box. The loss function is determined based on the square of the distance between the center points of the boundary prediction box and the boundary ground truth box, the square of the difference in aspect ratio between the boundary prediction box and the boundary ground truth box, and the square of the diagonal length of the bounding box. The bounding box includes the boundary prediction box and the boundary ground truth box.
[0013] Optionally, in the method for detecting the tilt angle of a utility pole, the target detection model includes a deep residual network, wherein a first network layer of the deep residual network is used to extract features from the first image or the second image to obtain a first feature map, a second network layer is used to extract features from the first feature map to obtain a second feature map, a third network layer is used to perform deformable convolution on the second feature map to obtain a third feature map, and a fourth network layer is used to perform deformable convolution on the third feature map to obtain a fourth feature map, wherein the fourth feature map is used to obtain the bounding box of the utility pole.
[0014] Optionally, the method for detecting the tilt angle of a utility pole, wherein the first tilt angle of the utility pole is obtained by performing principal direction analysis based on the pixel coordinate set, includes one of the following:
[0015] A covariance matrix is constructed based on the set of pixel coordinates, and the first tilt angle of the utility pole is obtained based on the principal direction eigenvector of the covariance matrix.
[0016] The central axis of the utility pole is extracted based on the set of pixel coordinates, and the first tilt angle of the utility pole is obtained based on the central axis of the utility pole.
[0017] Optionally, in the method for detecting the tilt angle of a utility pole, extracting the central axis of the utility pole based on the set of pixel coordinates includes one of the following:
[0018] The central axis pixel coordinate set of the utility pole is extracted based on the pixel coordinate set, and a straight line is fitted to the central axis pixel coordinate set to obtain the central axis of the utility pole.
[0019] Based on the pixel coordinate set, extract the left edge pixel coordinate set and the right edge pixel coordinate set of the utility pole, construct a point pair set, the first point pair in the point pair set includes the first left edge pixel coordinate and the first right edge pixel coordinate horizontally opposite to the first left edge pixel coordinate, the first left edge pixel coordinate is any one in the left edge pixel coordinate set, the first right edge pixel coordinate is any one in the right edge pixel coordinate set, and obtain the midpoint set based on the midpoint between each point pair in the point pair set, perform straight line fitting on the midpoint set to obtain the central axis of the utility pole.
[0020] Optionally, the method for detecting the tilt angle of the utility pole further includes:
[0021] Perform color space conversion on the first image to obtain the converted first image;
[0022] Cluster analysis is performed on the converted first image to obtain the sky mask corresponding to the sky region in the first image;
[0023] Multi-scale edge detection is performed on the sky mask to obtain the horizon in the first image;
[0024] Inflection point detection is performed on the horizon to obtain multiple inflection points;
[0025] A straight line is obtained by fitting a line based on multiple inflection points;
[0026] The tilt angle of the horizon in the first image is obtained based on the tilt angle of the straight line.
[0027] Optionally, the method for detecting the tilt angle of the utility pole, wherein multi-scale edge detection is performed on the sky mask to obtain the horizon in the first image, includes:
[0028] Perform multi-scale edge detection on the sky mask to obtain the edges of the sky mask;
[0029] Based on the texture features, the edges of the sky mask are adjusted to obtain the adjusted edges of the sky mask;
[0030] Based on the adjusted sky mask edges, the sky contour in the first image is extracted;
[0031] The horizon in the first image is obtained based on the sky outline.
[0032] Optionally, in the method for detecting the tilt angle of the utility pole, before performing multi-scale edge detection on the sky mask to obtain the horizon in the first image, the method further includes:
[0033] The sky mask is subjected to threshold segmentation to obtain the segmented sky mask;
[0034] Perform morphological operations on the segmented sky mask to obtain the manipulated sky mask.
[0035] Secondly, embodiments of the present invention also provide a utility pole tilt angle detection device, comprising:
[0036] The detection module is used to detect utility poles in a first image or a second image according to a target detection model, and obtain the bounding boxes of the utility poles; the second image is an image after horizontal calibration of the first image based on the tilt angle of the horizon in the first image;
[0037] The segmentation module is used to obtain the set of pixel coordinates of the utility pole based on the image segmentation algorithm for the bounding box;
[0038] The identification module is used to perform main direction analysis based on the pixel coordinate set to obtain the tilt angle of the utility pole;
[0039] The correction module is used to correct the tilt angle of the utility pole based on the tilt angle of the horizon in the first image, after obtaining the bounding box of the utility pole based on the first image, so as to obtain the corrected tilt angle of the utility pole.
[0040] Thirdly, embodiments of the present invention also provide a utility pole tilt angle detection device, comprising: a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the processor executes the program or instructions to implement the utility pole tilt angle detection method as described in the first aspect.
[0041] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the pole tilt angle detection method as described in the first aspect.
[0042] Fifthly, embodiments of the present invention also provide a computer program product, including computer instructions, which, when executed by a processor, implement the pole tilt angle detection method as described in the first aspect.
[0043] Compared with existing technologies, this invention provides a method, apparatus, device, and storage medium for detecting the tilt angle of a utility pole. The method involves detecting a utility pole in a first or second image using a target detection model to obtain the bounding box of the pole. The second image is a horizontally calibrated version of the first image based on the tilt angle of the horizon in the first image. For the bounding box, a set of pixel coordinates of the utility pole is obtained using an image segmentation algorithm. Principal direction analysis is performed based on the set of pixel coordinates to obtain the tilt angle of the utility pole. Given the bounding box of the utility pole obtained from the first image, the tilt angle of the utility pole is corrected based on the tilt angle of the horizon in the first image to obtain the corrected tilt angle. By introducing the horizon as an absolute horizontal reference, dynamic perception and compensation of the shooting tilt angle are achieved, eliminating systematic errors caused by the non-horizontal nature of the shooting equipment, significantly improving the detection accuracy of the utility pole tilt angle, and exhibiting advantages of strong robustness and high accuracy. Attached Figure Description
[0044] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0045] Figure 1 This is a schematic flowchart of the pole tilt angle detection method according to an embodiment of the present invention;
[0046] Figure 2 This is a flowchart illustrating one implementation of the pole tilt angle detection method described in this invention.
[0047] Figure 3 This is a flowchart illustrating a second implementation of the pole tilt angle detection method described in this invention.
[0048] Figure 4 This is a schematic diagram of the first image in an embodiment of the present invention;
[0049] Figure 5 This is the first image after color space conversion in this embodiment of the invention;
[0050] Figure 6 This is the first image after cluster analysis in an embodiment of the present invention;
[0051] Figure 7 This is the first image after multi-scale edge detection in this embodiment of the invention;
[0052] Figure 8This is the first image after edge adjustment in this embodiment of the invention;
[0053] Figure 9 This is the first image after inflection point detection in this embodiment of the invention;
[0054] Figure 10 This is a flowchart illustrating a third embodiment of the pole tilt angle detection method described in this invention.
[0055] Figure 11 This is a schematic diagram of the module of the pole tilt angle detection device according to an embodiment of the present invention;
[0056] Figure 12 This is a hardware block diagram of the pole tilt angle detection device according to an embodiment of the present invention. Detailed Implementation
[0057] The terms "first," "second," etc., used in this invention are used to distinguish similar objects, not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first" and "second" are generally of the same class, not limited in number; for example, the first object can be one or more. Furthermore, the "or" in this invention indicates at least one of the connected objects. For example, "A or B" covers three scenarios: Scenario 1: including A but not B; Scenario 2: including B but not A; Scenario 3: including both A and B. The character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0058] See Figure 1 This invention provides a method for detecting the tilt angle of a utility pole. It should be noted that this invention can be used not only for detecting the tilt angle of utility poles, but also for detecting the tilt angle of other vertical pole-shaped objects, such as streetlights and surveillance poles, and is not limited thereto.
[0059] Furthermore, the method includes:
[0060] Step 101: Detect utility poles in the first image or the second image using the target detection model to obtain the bounding box of the utility poles; the second image is an image after horizontal calibration of the first image based on the tilt angle of the horizon in the first image;
[0061] It is understood that the first image is the original image of the tilt angle of the utility pole to be detected, therefore the first image can be called the image to be tested. The second image is the first image after horizontal calibration. In step 101, the bounding box of the utility pole can be obtained directly from the first image, or the bounding box of the utility pole can be obtained from the second image after horizontal calibration of the first image.
[0062] In this embodiment of the invention, the object detection model can be based on Faster R-CNN (Region-based Convolutional Neural Networks). Faster R-CNN is a deep learning-based object detection model that generates candidate regions through a Region Proposal Network (RPN) and uses a convolutional neural network to extract features and classify these candidate regions. It can accurately locate and identify target objects, i.e., the telephone pole in the first image. Moreover, it performs excellently when handling complex backgrounds and multi-scale targets. Faster R-CNN has high robustness and stability and can be applied to various practical application scenarios. Of course, the object detection model can also be based on other models, which are not limited here.
[0063] Here, the object detection model in this embodiment of the invention is illustrated using a Faster R-CNN-based model as an example. The loss function of this object detection model is determined based on the square of the distance between the center points of the predicted bounding box and the ground truth bounding box, the square of the difference in aspect ratio between the predicted bounding box and the ground truth bounding box, and the square of the diagonal length of the bounding box. Compared to the loss function of Faster R-CNN in the prior art, this method can effectively improve the detection accuracy of the tilt angle of utility poles.
[0064] Therefore, the target detection model in this embodiment of the invention is essentially an improved Faster R-CNN, which can adapt to different tilt angles, occlusion conditions and complex backgrounds in different scenarios and has stable detection results.
[0065] Furthermore, the target detection model is open-source and easily integrated, facilitating implementation on different hardware platforms and enabling rapid application in practical utility pole tilt angle detection systems. This target detection model effectively improves the accuracy and robustness of utility pole tilt angle detection.
[0066] In one embodiment, optionally, the initial aspect ratio of the bounding box output by the target detection model is obtained by clustering analysis of a set of utility pole image samples.
[0067] In this embodiment of the invention, utility poles are key detection targets, and their external dimensions vary considerably, especially in terms of aspect ratio. In the prior art, bounding boxes typically use empirically set aspect ratios (such as [0.5, 1, 2]). However, such fixed aspect ratios are difficult to adapt to targets with large shape variations, such as utility poles, thus affecting the overall performance of the detection model.
[0068] Therefore, to improve detection accuracy, this embodiment of the invention can use a bounding box optimization strategy based on the K-Means clustering algorithm. First, the bounding boxes marked in the utility pole image sample set are preprocessed to remove outlier samples, thus improving the reliability of the clustering results. Then, the K-Means clustering algorithm is applied to perform cluster analysis on the aspect ratios of the valid bounding boxes, dividing the utility poles in the image sample set into multiple clusters with significantly different aspect ratios, thereby obtaining the initial aspect ratio of the bounding boxes output by the target detection model.
[0069] For example, aspect ratio clusters are shown below:
[0070] Cluster 1: with an aspect ratio of 0.0529, containing 1855 utility pole image samples;
[0071] Cluster 2: with an aspect ratio of 0.0868, containing 137 utility pole image samples;
[0072] Cluster 3: with an aspect ratio of 0.1654, containing 1043 utility pole image samples.
[0073] This demonstrates that utility poles vary significantly in scale and proportion, making it difficult for existing fixed-ratio bounding boxes to accurately match their distribution. Furthermore, understanding the aspect ratio is a prerequisite for model optimization; all optimization strategies revolve around this premise.
[0074] In one embodiment, optionally, the loss function of the object detection model is used to indicate the degree of overlap between the bounding box predicted by the object detection model and the corresponding ground truth bounding box. It can be called a bounding box regression loss function based on geometric consistency. The loss function is determined based on the square of the distance between the center points of the bounding box and the ground truth bounding box, the square of the difference in the aspect ratio between the bounding box and the ground truth bounding box, the square of the diagonal length of the bounding box, the area of the intersection region of the bounding box and the ground truth bounding box, and the area of the union region of the bounding box and the ground truth bounding box.
[0075] It should be noted that the bounding box regression loss function based on geometric consistency in this embodiment of the invention is used to train the object detection model to optimize the model parameters. Specifically, the predicted bounding box is generated by predicting utility poles from the utility pole image samples using the object detection model, and the ground truth bounding box is generated by labeling the utility poles from the utility pole image samples. Preferably, the bounding box is the smallest bounding box that includes both the predicted bounding box and the ground truth bounding box.
[0076] Faster R-CNN is a classic two-stage object detection framework that generates candidate regions through RPN and then classifies and refines the locations of these candidate regions. In existing technologies, Faster R-CNN uses the Smooth L1 loss function to optimize the coordinate offset of the bounding box in the location regression task. The Smooth L1 loss function is a loss function that combines the L1 loss function and the L2 loss function, as shown in the following formula (1):
[0077] (1)
[0078] in, It is the coordinate difference between the predicted bounding box and the actual bounding box.
[0079] For targets like utility poles, the height is much greater than the width, resulting in a small height-to-width ratio and a distinctly "long and thin" characteristic. In this case, due to the pole's small width and large height, the width offset (dw) may be small, while the height offset (dh) may be large. Using a uniform loss function would lead to the neglect of errors in the width direction, while errors in the length direction would affect the entire loss function, ultimately reducing the model's localization accuracy in the width direction.
[0080] Therefore, this embodiment of the invention improves the loss function of Faster R-CNN and proposes a bounding box regression loss function based on geometric consistency. Specifically, the bounding box regression loss function based on geometric consistency in this embodiment of the invention is shown in the following formula (2):
[0081] (2);
[0082] The first term is used to optimize the overlap area, where IOU is the ratio of the area of the intersection region between the predicted bounding box and the ground truth bounding box to the area of the union region.
[0083] The second term is used to optimize the consistency between the center positions of the predicted boundary boxes and the ground truth boundary boxes. It is the square of the distance between the center point of the predicted bounding box and the center point of the ground truth bounding box;
[0084] The third term is used to optimize the consistency of the aspect ratio between the predicted bounding box and the ground truth bounding box. is the square of the difference between the aspect ratio of the predicted bounding box and the aspect ratio of the ground truth bounding box, and c is the diagonal length of the bounding box. It should be noted that, compared to CIoU in existing technologies, the bounding box regression loss function based on geometric consistency in this embodiment avoids the gradient saturation problem of the arctan function, eliminates the need for complex trigonometric function calculations, and achieves high efficiency. It also avoids two problems present in EIOU in existing technologies: inconsistency between the two scales (positional difference and size difference) and potential gradient direction conflicts.
[0085] Therefore, the bounding box regression loss function based on geometric consistency in this embodiment of the invention has consistent geometric meaning (both are squared Euclidean distances), coordinated gradient directions, and uses a single normalization factor, making it simpler and more direct. The loss function of the object detection model can exhibit better performance in multiple visual tasks, especially in small object detection, while maintaining implementation simplicity and numerical stability.
[0086] In one embodiment, optionally, the target detection model includes a deep residual network, wherein a first network layer of the deep residual network is used to extract features from the first image or the second image to obtain a first feature map, a second network layer is used to extract features from the first feature map to obtain a second feature map, a third network layer is used to perform deformable convolution on the second feature map to obtain a third feature map, and a fourth network layer is used to perform deformable convolution on the third feature map to obtain a fourth feature map, wherein the fourth feature map is used to obtain the bounding box of the utility pole.
[0087] It should be noted that the embodiments of the present invention propose deformable convolution, which introduces deformable convolution into the third and fourth layers of the deep residual network (such as ResNet50) in the target detection model, dynamically adjusting the sampling position of the convolution kernel to enhance the adaptability to geometric deformations, such as tilted or rotated targets.
[0088] In the deep residual network, the features at different levels have different levels of abstraction. The network layers of the deep residual network are described in Table 1 below.
[0089] Table 1: Description of the network layers of the deep residual network
[0090]
[0091] For target objects with specific geometric structures, such as utility poles, their key features (such as slender shape, top structure, and connecting parts) are mainly identified at the high-level semantic level, corresponding to the processing of layers 3 and 4. This allows for better capture of the tilt, occlusion, or irregular shape of the utility pole in complex backgrounds, improving the detection accuracy of complex targets. Consequently, it can significantly optimize the bounding box regression effect and effectively improve the target detection model's accuracy in locating targets.
[0092] Furthermore, the performance of the object detection model is compared with that of Faster R-CNN using Table 2 below:
[0093] Table 2: Comparison of Results
[0094]
[0095] Therefore, as shown in Table 2, the changes in metrics after progressively improving the detection box, the loss function, and the deformable convolution are as follows:
[0096] (1) Optimization of core indicators:
[0097] Significant improvements were observed in mAP@0.5: 0.652, 0.766, and 0.784 (an improvement of 20.2%).
[0098] Breakthrough in high-precision detection: mAP@0.75 achieved a 136% increase (from 0.180 to 0.426);
[0099] The optimized loss was verified to be 0.556, 0.534, and 0.447 (a decrease of 19.6%). This is because the two loss functions are different and cannot be compared.
[0100] (2) Loss function dynamics:
[0101] The RPN localization loss increased by 0.0625, 0.127, and 0.335 (an improvement of 436%). This is due to the cost of the feature diversity of deformable convolution, which reflects the difficulty of localizing targets with extreme aspect ratios.
[0102] ROI localization loss optimization: 0.422, 0.0211, 0.101 (a decrease of 76.1%), indicating that the improved loss function has a significant effect on the fine-tuning stage, and deformable convolution improves feature quality.
[0103] (3) Efficiency balance:
[0104] Total training loss: 0.539, 0.593, 0.471, achieving the best balance (12.6% lower than Faster R-CNN).
[0105] Verify the correlation of mAP: Verify a 15.3% decrease in loss (from 0.556 to 0.447);
[0106] mAP@0.5:0.95: Improvement of 47.4% (from 0.291 to 0.429).
[0107] By employing the improved loss function of this invention, namely the bounding box regression loss function based on geometric consistency, the target detection model improved its key performance indicator (mAP@0.5) from 0.652 to 0.766, an improvement of approximately 17%, and its key performance indicator (mAP@0.75) from 0.180 to 0.213, an improvement of approximately 18%. This demonstrates that the bounding box regression loss function based on geometric consistency of this invention is effective for detecting slender objects, such as utility poles. The target detection model in this invention achieves a 20.2% improvement in the key performance indicator (mAP@0.5) at the cost of a controllable increase in RPN loss, a breakthrough of 136% in high-precision detection (mAP@0.75), and a significant reduction in verification loss of 19.6%. This demonstrates that the combination of the improved loss function and deformable convolution fully leverages the advantages of the bounding box regression loss function based on geometric consistency and deformable convolution, effectively improving the detection accuracy and robustness of utility pole tilt angles, and providing more reliable detection results for utility pole maintenance and management.
[0108] It should be clarified that the object detection model described in this embodiment of the invention is based on Faster R-CNN and improved in three aspects: improving the initial aspect ratio of the bounding box; improving the loss function; and improving the deep residual network, that is, introducing deformable convolutions in the third and fourth layers of the network. The combination of these three improvements effectively improves the detection accuracy and robustness of the object detection model for slender objects, such as utility poles.
[0109] Step 102: For the bounding box, obtain the set of pixel coordinates of the utility pole according to the image segmentation algorithm;
[0110] In this embodiment of the invention, the image segmentation algorithm may be the GrabCut algorithm, which can effectively segment the utility pole from the background of the first image.
[0111] Step 103: Perform main direction analysis based on the pixel coordinate set to obtain the tilt angle of the utility pole;
[0112] Step 104: After obtaining the bounding box of the utility pole based on the first image, the tilt angle of the utility pole is corrected based on the tilt angle of the horizon in the first image to obtain the corrected tilt angle of the utility pole.
[0113] In this embodiment of the invention, if the utility pole in the first image is detected according to the target detection model in step 101 above to obtain the bounding box of the utility pole, then step 104 needs to be executed to correct the tilt angle of the utility pole obtained in step 103 above according to the tilt angle of the horizon in the first image, so as to obtain the corrected tilt angle of the utility pole.
[0114] It is understandable that if the utility pole in the first image is detected in step 101 above using the target detection model to obtain the bounding box of the utility pole, then step 104 is not necessary. The tilt angle of the utility pole obtained in step 103 above is obtained based on the second image. Therefore, the tilt angle of the utility pole obtained in step 103 above has already been corrected based on the tilt angle of the horizon in the first image.
[0115] It should be noted that in open scenes, the horizon is a natural horizontal reference and is suitable as the absolute horizontal benchmark for the first image. This embodiment of the invention uses a horizon detection algorithm to perceive the absolute horizontal benchmark of the scene and calibrates the shooting tilt angle, eliminating systematic errors caused by the non-level shooting equipment, improving the detection accuracy of the utility pole tilt angle, and obtaining more accurate utility pole tilt angle detection results.
[0116] Figure 2 This is a flowchart illustrating one implementation of the pole tilt angle detection method described in this invention. Figure 2 As shown, the method includes:
[0117] Step 201: Detect the tilt angle of the horizon in the first image, obtain the tilt angle of the horizon, and perform horizontal calibration on the first image based on the tilt angle of the horizon to obtain the second image;
[0118] Step 202: Identify utility poles in the second image based on the target detection model;
[0119] Step 203: Calculate the tilt angle of the utility pole;
[0120] Step 204: Output the tilt angle of the utility pole.
[0121] In one embodiment, optionally, the method further includes:
[0122] Perform color space conversion on the first image to obtain the converted first image;
[0123] Cluster analysis is performed on the converted first image to obtain the sky mask corresponding to the sky region in the first image;
[0124] Multi-scale edge detection is performed on the sky mask to obtain the horizon in the first image;
[0125] Inflection point detection is performed on the horizon to obtain multiple inflection points;
[0126] A straight line is obtained by fitting a line based on multiple inflection points;
[0127] The tilt angle of the horizon in the first image is obtained based on the tilt angle of the straight line.
[0128] In this embodiment of the invention, a horizon-based detection algorithm is proposed. First, the sky region is segmented using color space conversion and K-means clustering algorithm. Then, the tilt angle of the horizon is accurately determined through morphological optimization and inflection point fitting.
[0129] In one implementation, optionally, multi-scale edge detection is performed on the sky mask to obtain the horizon in the first image, including:
[0130] Perform multi-scale edge detection on the sky mask to obtain the edges of the sky mask;
[0131] Based on the texture features, the edges of the sky mask are adjusted to obtain the adjusted edges of the sky mask;
[0132] Based on the adjusted sky mask edges, the sky contour in the first image is extracted;
[0133] The horizon in the first image is obtained based on the sky outline.
[0134] In one embodiment, optionally, before performing multi-scale edge detection on the sky mask to obtain the horizon in the first image, the method further includes:
[0135] The sky mask is subjected to threshold segmentation to obtain the segmented sky mask;
[0136] Perform morphological operations on the segmented sky mask to obtain the manipulated sky mask.
[0137] Figure 3 This is a flowchart illustrating a second implementation of the pole tilt angle detection method described in this invention. Figure 4 This is a schematic diagram of the first image in an embodiment of the present invention. Figure 5 This is the first image after color space conversion in this embodiment of the invention. Figure 6 This is the first image after cluster analysis in an embodiment of the present invention. Figure 7 This is the first image after multi-scale edge detection in an embodiment of the present invention. Figure 8This is the first image after edge adjustment in an embodiment of the present invention. Figure 9 This is the first image after inflection point detection in this embodiment of the invention.
[0138] like Figure 3 As shown, the method includes:
[0139] Step 301, as follows Figure 4 As shown, the first image is obtained;
[0140] Step 302, as follows Figure 5 As shown, the first image is converted to a color space to obtain the converted first image. Through color space conversion, it is converted from RGB to HSV, and the three dimensions of hue, saturation and value are separated. The sky area usually has a stable hue range (such as blue series), which is convenient for subsequent segmentation of the sky area in the first image.
[0141] Step 303, as follows Figure 6 As shown, cluster analysis is performed on the converted first image to obtain the sky region and the ground region in the first image, that is, the pixels in the first image are divided into two categories, providing candidate regions for subsequent contour detection;
[0142] Step 304, as follows Figure 7 and Figure 8 As shown, the sky mask corresponding to the sky region can be obtained. The sky mask can be created based on prior knowledge (such as the sky region usually being located at the top of the image) and the clustering results.
[0143] Step 305: Perform threshold segmentation and morphological operations on the sky mask to obtain the processed sky mask. Here, the Otsu algorithm (a threshold segmentation algorithm) can be used for threshold segmentation, followed by morphological operations. First, open operations are performed to remove small noise, and then close operations are performed to fill small holes, in order to optimize the accuracy of the sky mask. Through adaptive threshold segmentation and morphological operations, the boundaries of the sky region are further refined, noise is removed, and defects in the mask are repaired.
[0144] Step 306: Perform multi-scale edge detection on the sky mask after the operation to obtain the edges of the sky mask. Try different Gaussian blur scales (σ=1, 3, 5) to remove noise, suppress small edges, and retain the main structure. Perform Canny edge detection in the mask area to extract the boundary edges of the sky mask. The horizon serves as the boundary between the sky and the ground, and its edge will be identified as a strong gradient region by the Canny algorithm.
[0145] Step 307: Adjust the edges of the sky mask according to the texture features to obtain the adjusted sky mask edges. The texture features include contrast, correlation, energy, and homogeneity, which can adjust the sky mask and improve the boundary accuracy of the sky mask to obtain a more accurate and cleaner sky mask.
[0146] Step 308: Extract the contour based on the edge of the adjusted sky mask to obtain the sky contour in the first image, and obtain the horizon in the first image based on the sky contour. Extract the contour of the adjusted sky mask, filter the contour with a larger area and the position in the upper part of the image, and determine this part as the sky contour.
[0147] Step 309, as follows Figure 9 As shown, inflection point detection is performed on the horizon to obtain multiple inflection points;
[0148] Step 310: Perform line fitting on multiple inflection points to determine whether multiple inflection points form a straight line. Here, the RANSAC (Random Sample Consensus) algorithm can be used to perform line fitting on the generated multiple inflection points, determine the angle change between adjacent inflection points, and determine whether a straight line is formed.
[0149] If the judgment result of step 310 is yes, then proceed to step 311, and obtain the tilt angle of the horizon based on the tilt angle of the straight line.
[0150] If the result of step 310 is negative, return to step 303, that is, if a straight line is not formed, return to step 303. After three iterations, output "These inflection points do not form a straight line".
[0151] Therefore, the horizon-based detection algorithm in this embodiment of the invention has the following advantages:
[0152] (1) Multi-step robust design: using color space conversion to segment the sky region, and further separating the sky region and ground region in the first image through cluster analysis, which can better adapt to complex lighting conditions (such as cloudy or dusk scenes) and effectively improve the robustness and accuracy of segmentation.
[0153] (2) The feedback loop design and clear failure handling mechanism enhance the fault tolerance of the algorithm;
[0154] (3) Morphological optimization: Morphological operations such as opening and closing operations are performed on the sky mask to effectively remove small noise, fill holes and smooth boundaries, further optimizing the segmentation effect of the sky region and providing clearer and more accurate input for subsequent horizon detection;
[0155] (4) Traditional algorithms are lightweight and mainly rely on classic image processing algorithms (such as Canny edge detection, inflection point recognition, etc.). They do not require the high computing resources of deep learning models, have high computing efficiency, are suitable for embedded deployment, and have good real-time performance and practicality.
[0156] Therefore, the horizon-based detection algorithm in this embodiment of the invention, through robust process design, multi-algorithm collaboration and lightweight implementation, achieves efficient, accurate and stable horizon detection in different scenarios, and has good engineering application value.
[0157] In one implementation, optionally, the tilt angle of the utility pole is obtained by performing a principal direction analysis based on the pixel coordinate set, including one of the following methods:
[0158] Method 1: Construct a covariance matrix based on the set of pixel coordinates, and obtain the tilt angle of the utility pole based on the principal direction eigenvector of the covariance matrix.
[0159] Method 2: Extract the central axis of the utility pole based on the pixel coordinate set, and obtain the tilt angle of the utility pole based on the central axis of the utility pole.
[0160] In one embodiment of the invention, method one is a method for detecting the tilt angle of a utility pole based on the GrabCut algorithm and PCA (Principal Component Analysis) algorithm. This method achieves more accurate and stable measurement through image segmentation and orientation analysis, reduces the dependence on resolution, and improves accuracy and robustness.
[0161] GrabCut is an image segmentation algorithm that can effectively segment the utility pole from the background of the first image. After GrabCut segments the utility pole, its pixel coordinates can be obtained using the PCA algorithm.
[0162] The PCA algorithm calculates the covariance matrix of these pixel coordinate sets, and then finds the eigenvalues and eigenvectors of the covariance matrix. The direction of the eigenvector corresponding to the largest eigenvalue is the principal direction of the data distribution, i.e., the principal direction eigenvector, which is the tilt direction of the utility pole. This principal direction is closely related to the tilt angle of the utility pole; by calculating the angle between this principal direction and the horizontal or vertical direction, the tilt angle of the utility pole can be obtained. Furthermore, the PCA algorithm does not depend on the image resolution, but only on the distribution of the segmented feature points, significantly reducing the image resolution requirement compared to existing line fitting methods.
[0163] Suppose that in the image coordinate system, the set of pixel coordinates of the segmented telephone poles is represented as ( , ), =1,2,..., The PCA algorithm first calculates the mean of these pixel coordinate sets. .
[0164] Then, the covariance matrix is constructed as shown in formula (3):
[0165] (3)
[0166] Find the eigenvalues of the above covariance matrix. and and the corresponding feature vectors and eigenvectors Main direction eigenvector, eigenvector The direction is the main direction of the utility pole, that is, the direction of the angle of inclination of the utility pole.
[0167] As a long, straight object, the distribution of pixels on a utility pole exhibits the greatest variance along this principal direction in an image. In other words, the pixel distribution of the utility pole is most dispersed along this principal direction, reflecting its elongated shape. The tilt angle of the utility pole can be obtained by calculating the angle between this principal direction and the horizontal (or vertical) axis.
[0168] In one embodiment, optionally, the central axis of the utility pole is extracted based on the set of pixel coordinates, including one of the following:
[0169] The first step is to extract the set of pixel coordinates of the central axis of the utility pole based on the set of pixel coordinates, and to perform a straight line fitting on the set of pixel coordinates of the central axis to obtain the central axis of the utility pole.
[0170] The second step involves extracting the left edge pixel coordinate set and the right edge pixel coordinate set of the utility pole based on the pixel coordinate set, constructing a point pair set. The first point pair in the point pair set includes a first left edge pixel coordinate and a first right edge pixel coordinate that is horizontally opposite to the first left edge pixel coordinate. The first left edge pixel coordinate is any one of the left edge pixel coordinate set, and the first right edge pixel coordinate is any one of the right edge pixel coordinate set. A midpoint set is obtained based on the midpoint between each point pair in the point pair set, and a straight line is fitted to the midpoint set to obtain the central axis of the utility pole.
[0171] In an embodiment of the present invention, firstly, optionally, the central axis is extracted from the set of pixel coordinates using a skeletonization algorithm or a medial axis transform algorithm to obtain the set of central axis pixel coordinates; then, the central axis of the utility pole is obtained by performing a straight line fitting on the set of central axis pixel coordinates using a random sample consensus (RANSAC) algorithm, a Hough transform algorithm, or a least squares method.
[0172] It should be noted that the embodiments of the present invention use a skeleton extraction algorithm to obtain the skeleton of the utility pole, i.e., the central axis, which can resist the influence of noise such as uneven pole width and small surface protrusions. Moreover, combined with the random sample consensus algorithm, it is robust to isolated noise points.
[0173] The second, optional step, involves using an edge detection algorithm (such as the Canny algorithm) to extract edges from the pixel coordinate set, obtaining the edge pixel coordinate set of the utility pole. Based on the horizontal position of the edge pixel coordinates in this set, the edge pixel coordinate set is divided into a left edge pixel coordinate set and a right edge pixel coordinate set. A set of point pairs is constructed; a midpoint set is obtained from the point pair set; and a straight line is fitted to the midpoint set using the least squares method or a random sample consensus algorithm to obtain the central axis of the utility pole. Here, the method does not rely on perfect image segmentation but rather on clear edges. For utility poles with internal textures or color variations, a more stable central axis can be obtained.
[0174] Figure 10 This is a flowchart illustrating a third embodiment of the pole tilt angle detection method described in this invention. Figure 10 As shown, the method includes:
[0175] Step 1001: Use the object detection model to detect the utility poles in the first image and obtain the bounding boxes of the utility poles;
[0176] Step 1002: Process the bounding box of each utility pole in a loop;
[0177] Step 1003: Use an image segmentation algorithm to segment the utility poles and obtain the pixel coordinates of the utility poles;
[0178] Step 1004: Determine whether the utility pole has been successfully segmented, that is, determine whether the number of pixels of the utility pole is sufficient;
[0179] If the result of step 1004 is negative, proceed to step 1005 and skip the utility pole.
[0180] Step 1006: Calculate the tilt angle of the utility pole based on its pixel coordinates;
[0181] Step 1007: Draw a bounding box and tilt angle text on the first image. Draw the bounding box of the utility pole on the first image and label the tilt angle.
[0182] Step 1008: Save and display the pole tilt angle detection results.
[0183] It should be noted that, based on the application results of more than 2,000 first images, the embodiments of the present invention can still maintain high accuracy when processing images with watermarks and severe light pollution. At the same time, it has low dependence on the bounding boxes of Faster R-CNN. Even if the bounding boxes output by Faster R-CNN exceed the boundary of the telephone pole, the tilt angle can still be accurately read based on the Grabcut algorithm and PCA algorithm. Moreover, it can monitor and analyze the time consumption, process impact and result output of each step in real time.
[0184] In summary, the pole tilt angle detection method described in this invention overcomes the accuracy limitations of single-technology methods by combining deep learning algorithms to extract bounding boxes and integrating computer vision technology. Furthermore, the Grabcut and PCA-based method effectively addresses pole identification under complex environments such as varying lighting, weather, and angles, significantly improving detection accuracy and anti-interference capabilities. The improved Faster R-CNN introduces deformable convolutions and a loss function suitable for utility poles, enhancing the deep learning model's adaptability to targets with extremely small aspect ratios. The horizon-based detection algorithm utilizes HSV color space conversion and K-means clustering analysis, combined with morphological optimization and inflection point detection, to accurately identify and calibrate the horizon, providing an accurate benchmark for subsequent measurements and improving measurement accuracy.
[0185] See Figure 11 This invention also provides a utility pole tilt angle detection device, comprising:
[0186] The detection module 1101 is used to detect utility poles in a first image or a second image according to a target detection model, and obtain the bounding box of the utility poles; the second image is an image after horizontal calibration of the first image based on the tilt angle of the horizon in the first image;
[0187] The segmentation module 1102 is used to obtain the set of pixel coordinates of the utility pole based on the image segmentation algorithm for the bounding box;
[0188] The identification module 1103 is used to perform main direction analysis based on the pixel coordinate set to obtain the tilt angle of the utility pole;
[0189] The correction module 1104 is used to correct the tilt angle of the utility pole based on the tilt angle of the horizon in the first image when the bounding box of the utility pole is obtained based on the first image, so as to obtain the corrected tilt angle of the utility pole.
[0190] Optionally, in the aforementioned utility pole tilt angle detection device, the initial aspect ratio of the bounding box output by the target detection model is obtained by cluster analysis of a set of utility pole image samples.
[0191] Optionally, in the aforementioned pole tilt angle detection device, the loss function of the target detection model is used to indicate the degree of overlap between the boundary prediction box output by the target detection model and the corresponding boundary ground truth box. The loss function is determined based on the square of the distance between the center points of the boundary prediction box and the boundary ground truth box, the square of the difference in aspect ratio between the boundary prediction box and the boundary ground truth box, and the square of the diagonal length of the bounding box. The bounding box includes the boundary prediction box and the boundary ground truth box.
[0192] Optionally, in the utility pole tilt angle detection device, the target detection model includes a deep residual network, wherein network layer one of the deep residual network is used to extract features from the first image or the second image to obtain a first feature map, network layer two is used to extract features from the first feature map to obtain a second feature map, network layer three is used to perform deformable convolution on the second feature map to obtain a third feature map, and network layer four is used to perform deformable convolution on the third feature map to obtain a fourth feature map, wherein the fourth feature map is used to obtain the bounding box of the utility pole.
[0193] Optionally, in the aforementioned pole tilt angle detection device, the identification module 1103 includes one of the following:
[0194] The first recognition unit is used to construct a covariance matrix based on the set of pixel coordinates, and to obtain the tilt angle of the utility pole based on the principal direction feature vector of the covariance matrix.
[0195] The second recognition unit extracts the central axis of the utility pole based on the set of pixel coordinates, and obtains the tilt angle of the utility pole based on the central axis of the utility pole.
[0196] Optionally, in the aforementioned pole tilt angle detection device, the second identification unit is specifically used for one of the following:
[0197] The central axis pixel coordinate set of the utility pole is extracted based on the pixel coordinate set, and a straight line is fitted to the central axis pixel coordinate set to obtain the central axis of the utility pole.
[0198] Based on the pixel coordinate set, extract the left edge pixel coordinate set and the right edge pixel coordinate set of the utility pole, construct a point pair set, the first point pair in the point pair set includes the first left edge pixel coordinate and the first right edge pixel coordinate horizontally opposite to the first left edge pixel coordinate, the first left edge pixel coordinate is any one in the left edge pixel coordinate set, the first right edge pixel coordinate is any one in the right edge pixel coordinate set, and obtain the midpoint set based on the midpoint between each point pair in the point pair set, perform straight line fitting on the midpoint set to obtain the central axis of the utility pole.
[0199] Optionally, the aforementioned pole tilt angle detection device further includes:
[0200] The conversion module is used to perform color space conversion on the first image to obtain the converted first image;
[0201] The clustering module is used to perform cluster analysis on the converted first image to obtain the sky mask corresponding to the sky region in the first image;
[0202] The edge detection module performs multi-scale edge detection on the sky mask to obtain the horizon in the first image;
[0203] The inflection point detection module is used to detect inflection points on the horizon and obtain multiple inflection points;
[0204] The fitting module is used to perform line fitting based on multiple inflection points to obtain a fitted line.
[0205] The module is configured to obtain the tilt angle of the horizon in the first image based on the tilt angle of the straight line.
[0206] Optionally, in the aforementioned pole tilt angle detection device, the edge detection module is specifically used for:
[0207] Perform multi-scale edge detection on the sky mask to obtain the edges of the sky mask;
[0208] Based on the texture features, the edges of the sky mask are adjusted to obtain the adjusted edges of the sky mask;
[0209] Based on the adjusted sky mask edges, the sky contour in the first image is extracted;
[0210] The horizon in the first image is obtained based on the sky outline.
[0211] Optionally, the aforementioned pole tilt angle detection device further includes:
[0212] A segmentation module is used to perform threshold segmentation on the sky mask to obtain the segmented sky mask;
[0213] The operation module is used to perform morphological operations on the segmented sky mask to obtain the operated sky mask.
[0214] It should be noted that the device provided in the embodiments of the present invention can realize all the method steps implemented in the above embodiments of the method for detecting the tilt angle of utility poles, and can achieve the same technical effect. Here, the parts that are the same as those in the method embodiments and the beneficial effects will not be described in detail.
[0215] This invention also provides a device for detecting the tilt angle of utility poles, such as... Figure 12 As shown, it includes:
[0216] The processor 1201, memory 1202, transceiver 1203, and programs or instructions stored in the memory 1202 and executable on the processor 1201; when the processor 1201 executes the programs or instructions, it implements the various processes of the above-described embodiments of the pole tilt angle detection method and achieves the same technical effect. To avoid repetition, these will not be described again here.
[0217] The transceiver 1203 is used to receive and send data under the control of the processor 1201.
[0218] Among them, Figure 12 In this context, the bus architecture can include any number of interconnected buses and bridges, specifically connecting various circuits of one or more processors represented by processor 1201 and memory represented by memory 1202. The bus architecture can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface. The transceiver 1203 can be multiple elements, including transmitters and receivers, providing a unit for communicating with various other devices over a transmission medium. For different user equipment, the user interface 1204 can also be an interface capable of connecting external or internal devices, including but not limited to keypads, displays, speakers, microphones, joysticks, etc.
[0219] The processor 1201 is responsible for managing the bus architecture and general processing, while the memory 1202 can store the data used by the processor 1201 when performing operations.
[0220] This invention also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the various processes of the above-described utility pole tilt angle detection method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0221] This invention also provides a computer program product, including computer instructions. When the computer instructions are executed by a processor, they implement the various processes of the above-described utility pole tilt angle detection method embodiment and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0222] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0223] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0224] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of the present invention.
Claims
1. A method for detecting the tilt angle of a utility pole, characterized in that, include: The utility poles in the first or second image are detected using the target detection model to obtain the bounding boxes of the utility poles. The second image is a horizontally calibrated version of the first image based on the tilt angle of the horizon in the first image; For the bounding box, the set of pixel coordinates of the utility pole is obtained according to the image segmentation algorithm; The tilt angle of the utility pole is obtained by performing a main direction analysis based on the pixel coordinate set. Having obtained the bounding box of the utility pole based on the first image, the tilt angle of the utility pole is corrected based on the tilt angle of the horizon in the first image to obtain the corrected tilt angle of the utility pole.
2. The method according to claim 1, characterized in that, The initial aspect ratio of the bounding box output by the target detection model is obtained by cluster analysis of the utility pole image sample set.
3. The method according to claim 1, characterized in that, The loss function of the object detection model is used to indicate the degree of overlap between the bounding predicted box and the corresponding ground truth bounding box output by the object detection model. The loss function is determined based on the square of the distance between the center points of the bounding predicted box and the ground truth bounding box, the square of the difference between the aspect ratios of the bounding predicted box and the ground truth bounding box, and the square of the diagonal length of the bounding box. The bounding box includes the bounding predicted box and the ground truth bounding box.
4. The method according to claim 1, characterized in that, The target detection model includes a deep residual network. The first network layer of the deep residual network is used to extract features from the first image or the second image to obtain a first feature map. The second network layer is used to extract features from the first feature map to obtain a second feature map. The third network layer is used to perform deformable convolution on the second feature map to obtain a third feature map. The fourth network layer is used to perform deformable convolution on the third feature map to obtain a fourth feature map. The fourth feature map is used to obtain the bounding box of the utility pole.
5. The method according to claim 1, characterized in that, Based on the set of pixel coordinates, a principal direction analysis is performed to obtain the tilt angle of the utility pole, including one of the following: A covariance matrix is constructed based on the set of pixel coordinates, and the tilt angle of the utility pole is obtained based on the principal direction eigenvector of the covariance matrix. The central axis of the utility pole is extracted based on the set of pixel coordinates, and the tilt angle of the utility pole is obtained based on the central axis of the utility pole.
6. The method according to claim 5, characterized in that, The central axis of the utility pole is extracted based on the set of pixel coordinates, including one of the following: The central axis pixel coordinate set of the utility pole is extracted based on the pixel coordinate set, and a straight line is fitted to the central axis pixel coordinate set to obtain the central axis of the utility pole. Based on the pixel coordinate set, extract the left edge pixel coordinate set and the right edge pixel coordinate set of the utility pole, construct a point pair set, the first point pair in the point pair set includes the first left edge pixel coordinate and the first right edge pixel coordinate horizontally opposite to the first left edge pixel coordinate, the first left edge pixel coordinate is any one in the left edge pixel coordinate set, the first right edge pixel coordinate is any one in the right edge pixel coordinate set, and obtain the midpoint set based on the midpoint between each point pair in the point pair set, perform straight line fitting on the midpoint set to obtain the central axis of the utility pole.
7. The method according to claim 1, characterized in that, The method further includes: Perform color space conversion on the first image to obtain the converted first image; Cluster analysis is performed on the converted first image to obtain the sky mask corresponding to the sky region in the first image; Multi-scale edge detection is performed on the sky mask to obtain the horizon in the first image; Inflection point detection is performed on the horizon to obtain multiple inflection points; A straight line is obtained by fitting a line based on multiple inflection points; The tilt angle of the horizon in the first image is obtained based on the tilt angle of the straight line.
8. The method according to claim 7, characterized in that, Perform multi-scale edge detection on the sky mask to obtain the horizon in the first image, including: Perform multi-scale edge detection on the sky mask to obtain the edges of the sky mask; Based on the texture features, the edges of the sky mask are adjusted to obtain the adjusted edges of the sky mask; Based on the adjusted sky mask edges, the sky contour in the first image is extracted; The horizon in the first image is obtained based on the sky outline.
9. The method according to claim 7, characterized in that, Before performing multi-scale edge detection on the sky mask to obtain the horizon in the first image, the method further includes: The sky mask is subjected to threshold segmentation to obtain the segmented sky mask; Perform morphological operations on the segmented sky mask to obtain the manipulated sky mask.
10. A device for detecting the tilt angle of a utility pole, characterized in that, include: The detection module is used to detect utility poles in a first image or a second image according to a target detection model, and obtain the bounding box of the utility poles; The second image is a horizontally calibrated version of the first image based on the tilt angle of the horizon in the first image; The segmentation module is used to obtain the set of pixel coordinates of the utility pole based on the image segmentation algorithm for the bounding box; The identification module is used to perform main direction analysis based on the pixel coordinate set to obtain the tilt angle of the utility pole; The correction module is used to correct the tilt angle of the utility pole based on the tilt angle of the horizon in the first image, after obtaining the bounding box of the utility pole based on the first image, so as to obtain the corrected tilt angle of the utility pole.
11. A device for detecting the tilt angle of a utility pole, characterized in that, include: A processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the processor, when executing the program or instructions, implements the pole tilt angle detection method as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the pole tilt angle detection method as described in any one of claims 1 to 9.
13. A computer program product, characterized in that, The method includes computer instructions that, when executed by a processor, implement the pole tilt angle detection method as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Telegraph pole inclination detection method based on deep learning
CN120634978A