Tree species identification method and device for power transmission line corridor based on spatial topological constraint
Patent Information
- Application Number
- CN202611498640.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-24
- Publication Date
- 2026-10-30
AI Technical Summary
[0005]本发明提供了一种基于空间拓扑约束的输电线路走廊树种识别方法及装置,用以解决如何提高复杂气象与地理环境下输电线路走廊的树种识别精度的技术问题
1、植被特征可分性大幅提升:暗通道先验结合导向滤波精确估计透射率场,避免全局参数导致的局部过增强;自适应白平衡基于植被响应动态调整通道增益,使阔叶、针叶、竹类等树种的叶色及纹理差异在特征空间中进一步拉开。
Smart Images

Figure CN123015963A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent operation and maintenance technology for power systems, and in particular to a method and apparatus for identifying tree species in transmission line corridors based on spatial topology constraints. Background Technology
[0002] High-voltage transmission line corridors often traverse dense forest areas, and different tree species (such as fast-growing eucalyptus and slow-growing pine) pose significantly different threats to the safety distance of the conductors. Traditional tree obstacle detection relies on manual inspection or simple image edge detection, which is inefficient and highly subjective. With the development of deep learning, tree species recognition based on RGB images has become a research hotspot. However, transmission line corridor scenarios generally suffer from problems such as haze interference, drastic changes in lighting, complex geographical environments, and thin and weak conductor targets, resulting in poor performance of existing algorithms in feature extraction and background suppression.
[0003] In existing technologies, for image enhancement based on traditional physical models, the DCP (Dark Channel Prior) dehazing algorithm can mitigate the impact of haze. However, in inspection images with high vegetation coverage and uneven lighting, it is prone to color shifts, local over-enhancement, or loss of canopy details, affecting the stable representation of leaf color and texture features of different tree species. In target detection based on convolutional neural networks, conductor segmentation results under conditions of long distance, low contrast, and canopy occlusion are prone to holes and breaks of different scales, making it difficult to directly form a continuous and reliable bilateral conductor topology. Without a stable conductor reference, subsequent corridor region construction and tree species target space selection are prone to deviations, leading to the misretention of trees outside the corridor or the omission of targets inside the corridor. In other words, existing methods for identifying tree species in transmission line corridors typically face the challenges of insufficient preservation of vegetation color and details after dehazing and unstable corridor space determination due to conductor breaks. In the field of high-resolution image segmentation, BiRefNet (Bilateral Reference Network) performs well, but it has not yet been applied to the field of intelligent operation and maintenance of power systems.
[0004] Therefore, a new technical solution is urgently needed to address the technical problem of improving the accuracy of tree species identification in power transmission line corridors under complex meteorological and geographical conditions. Summary of the Invention
[0005] This invention provides a method and apparatus for identifying tree species in power transmission line corridors based on spatial topology constraints, in order to solve the technical problem of how to improve the accuracy of tree species identification in power transmission line corridors under complex meteorological and geographical environments.
[0006] To achieve the above objectives, this invention provides a method for identifying tree species in transmission line corridors based on spatial topology constraints, comprising: The inspection images are dehazed using DCP and adaptive white balance to obtain enhanced images; tree species detection boxes are obtained by combining the enhanced images with the target detection model; the wires are segmented at the pixel level using BiRefNet based on the enhanced images, and continuous and complete wire trajectories are obtained through morphological processing, skeleton extraction and catenary fitting. Construct the ROI region of the transmission line corridor based on the conductor trajectory; calculate the overlap between each tree species detection box and the ROI region based on the tree species detection box set, and output the tree species detection boxes whose overlap meets the preset conditions.
[0007] Preferably, DCP defogging includes: The initial transmittance is calculated based on the inspection images, atmospheric scattering model, and prior statistical laws of the dark channel; the initial transmittance is smoothed and optimized using guided filtering to obtain the smoothed transmittance. Calculate the dark channel of the inspection image; sort the dark channels of the inspection image in descending order of brightness, and select the pixels with the highest brightness in the first preset percentage as candidate atmospheric light pixels; calculate the average of the weighted gray values of the RGB three channels of the inspection image at each candidate atmospheric light pixel to obtain the global atmospheric light value. A fog-free image is obtained based on smoothed transparency, global atmospheric light value, and atmospheric scattering model.
[0008] Preferably, adaptive white balance includes: Calculate the mean values of the RGB three channels of the haze-free image; using the mean value of the green channel as a benchmark, calculate the gain coefficients of the red and blue channels based on the mean values of the RGB three channels to obtain the three-channel gain coefficients; The haze-free image is corrected pixel-by-pixel and channel-by-channel based on the three-channel gain coefficients to obtain an enhanced image.
[0009] Preferably, the set of tree species detection boxes obtained by combining the enhanced image with the target detection model includes: YOLO11 was selected as the detection model; the default classification loss of the detection head in YOLO11 was replaced with the focus loss, and the proportion of the focus loss in the total loss of YOLO11 was increased by a preset classification enhancement coefficient; YOLO11 was trained according to the pre-constructed training set to obtain the object detection model; The enhanced image is input into the target detection model. After confidence filtering and non-maximum suppression, the output is a set of tree species detection boxes. The set of tree species detection boxes includes the category, bounding box coordinates and detection confidence of each tree species detection box.
[0010] Preferably, pixel-level segmentation of the conductor is performed based on the enhanced image using BiRefNet, and a continuous and complete conductor trajectory is obtained through morphological processing, skeleton extraction, and catenary fitting, including: The enhanced image is input into BiRefNet, which performs pixel-level segmentation on the wires to obtain the wire probability mask; The wire probability mask is binarized to obtain the wire binary mask; the wire binary mask is then subjected to a morphological closing operation of dilation followed by erosion to fill the voids and connect the broken wire segments, resulting in the closing operation wire mask. The skeleton of the closed-operation conductor mask is extracted using the Zhang-Suen thinning algorithm to obtain the skeleton point set. Each skeleton point in the skeleton point set is clustered into a subset of skeleton points belonging to each conductor. A local coordinate system is established for each subset of skeleton points. In the local coordinate system, the catenary function is used to describe the smooth bending trend of each conductor. The fitting parameters are solved, fitted, and mapped back to the image coordinate system to obtain the continuous and complete conductor trajectory of each conductor.
[0011] Preferably, the process before constructing the ROI region also includes: The trajectories of all conductors are sampled row by row according to the vertical coordinate of the image coordinate system. For rows not directly covered by the visible skeleton, interpolation or extrapolation is performed based on the fitting results. When there are multiple sampling points with the same vertical coordinate, the point with the smallest horizontal distance from the selected point in the previous row is selected to maintain the continuity of the same conductor trajectory. The row closest to the bottom of the image within the common coverage area of all conductor trajectories is used as the reference row. The reference rows are sorted in ascending order of their horizontal coordinates and continuously tracked vertically to obtain the horizontal coordinate functions of the left and right conductors.
[0012] Preferably, the ROI area for constructing the transmission line corridor based on the conductor trajectory includes: By combining the x-coordinate functions of the left and right traverses, the ordinate of the far intersection is obtained; the image range is limited based on the ordinate of the far intersection, and the effective starting row of the ROI is calculated according to the preset retention ratio; The unilateral expansion width at each vertical coordinate within the effective starting row range of the ROI is calculated based on the baseline width at the far end of the image perspective distance, the preset ROI width adjustment coefficient, and the perspective adjustment factor. For each vertical coordinate within the effective starting row range of the ROI, the unilateral expansion width is expanded to the left and right respectively with the left and right conductors as references to obtain the left and right boundaries of the ROI region at each vertical coordinate. The left and right boundaries of the ROI region at each vertical coordinate are connected to obtain the ROI region of the transmission line corridor.
[0013] Preferably, the overlap between each tree species detection box and the ROI region is calculated based on the tree species detection box set, and the tree species detection boxes whose overlap meets the preset conditions are output, including: The overlap ratio is obtained by calculating the ratio of the intersection area between the tree species detection box and the ROI region to the area of the tree species detection box itself. The overlap of each tree species detection box is compared with a preset retention threshold. If it is less than the preset retention threshold, the tree species detection box is removed. If it is greater than or equal to the preset retention threshold, the tree species detection box is output.
[0014] The present invention also provides a tree species identification device for power transmission line corridors based on spatial topology constraints, the device being used to implement the method of the present invention.
[0015] The present invention has the following beneficial effects: The method for identifying tree species in transmission line corridors based on spatial topology constraints of the present invention has the following beneficial effects: 1. Significantly improved vegetation feature separability: Dark channel prior combined with guided filtering accurately estimates the transmittance field, avoiding local over-enhancement caused by global parameters; Adaptive white balance dynamically adjusts channel gain based on vegetation response, further widening the differences in leaf color and texture among broadleaf, coniferous, and bamboo species in the feature space.
[0016] 2. Topological continuity of conductors and geometric fit of ROI are guaranteed: The BiRefNet bilateral reference mechanism can capture the boundaries of slender conductors, and the fracture interval is reconstructed by least-squares fitting of catenary. The average Hausdorff distance between the adaptive width ROI region constructed based on the bilateral conductors and the envelope of the real tree line hazard can be controlled within a very small number of pixels.
[0017] 3. Spatial constraints reduce false alarms and redundant work orders: The pixel-level spatial membership filtering mechanism establishes the association between the detection box and the corridor area at the geometric topology level. When the overlap is less than the preset retention threshold, it is directly rejected, which can avoid edge misjudgment caused by traditional center point threshold determination.
[0018] 4. The method of the present invention can solve the problems of insufficient preservation of vegetation color and details in the process of identifying tree species in power transmission corridors, as well as the instability of corridor space determination caused by broken conductors.
[0019] The tree species identification device for transmission line corridors based on spatial topology constraints of the present invention, when used in the method of the present invention, has the same beneficial effects as the method of the present invention.
[0020] In addition to the objectives, features, and advantages described above, the present invention has other objectives, features, and advantages. The invention will now be described in further detail with reference to the accompanying drawings. Attached Figure Description
[0021] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings: Figure 1 This is a schematic diagram of the method flow of a preferred embodiment of the present invention.
[0022] Figure 2 The smooth transmittance of the preferred embodiment of the present invention A visual representation of the results.
[0023] Figure 3 This is a schematic diagram of the dark channel of a foggy image according to a preferred embodiment of the present invention.
[0024] Figure 4 This is a schematic diagram of a fog-free image according to a preferred embodiment of the present invention.
[0025] Figure 5 This is an enhanced image schematic diagram of a preferred embodiment of the present invention.
[0026] Figure 6 This is a schematic diagram of the result of the Zhang-Suen thinning algorithm processing according to a preferred embodiment of the present invention.
[0027] Figure 7 This is a schematic diagram of the result of fitting a catenary to each conductor after segmenting and clustering the skeleton points according to a preferred embodiment of the present invention.
[0028] Figure 8 This is a schematic diagram of the ROI region according to a preferred embodiment of the present invention.
[0029] Figure 9 This is a schematic diagram of the output results of a preferred embodiment of the present invention. Detailed Implementation
[0030] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings, but the present invention can be implemented in many different ways as defined and covered by the claims.
[0031] See Figure 1 In a preferred embodiment of the present invention, a method for identifying tree species in a transmission line corridor based on spatial topology constraints is provided, comprising: Q1. Perform DCP dehazing and adaptive white balance on the inspection image to obtain an enhanced image; obtain a set of tree species detection boxes based on the enhanced image and the target detection model.
[0032] In a preferred embodiment of the present invention, during the image acquisition stage, the UAV flies along the extension direction of the power transmission line, and the airborne camera takes pictures along the front of the flight path, so that the power transmission corridor presents a deep perspective in the image: the far end of the corridor is located at the top of the image, and the near end of the corridor is located at the bottom of the image. Subsequent conductor fitting, corridor region construction, and corridor overlap rate filtering are all based on this shooting view. The captured inspection image is the foggy image to be processed.
[0033] In a preferred embodiment of the present invention, the atmospheric scattering model is defined as follows: Foggy image imaging follows the classical atmospheric scattering model, and its mathematical expression is: ; in, For the observed hazy image at the pixel level RGB value at; For the fog-free, clear image to be recovered, in pixels RGB value at; The scene transmittance, with a value range of [0,1]. The denser the fog, the higher the transmittance. The smaller; The global atmospheric light value represents the intensity of atmospheric scattered light in a foggy environment, with a value range of (0, 255). In this embodiment, a uniform scalar value is used throughout the image, and the same value is used in the three RGB channels. Based on atmospheric scattering models, the core objective of dehazing is to remove haze from hazy images. In the middle, solve for the fog-free image transmittance With atmospheric light .
[0034] In a preferred embodiment of the present invention, defining the dark channel includes: For fog-free, clear images Its secret passage Defined as: ; in, These are the pixel coordinates in the image; For clear images In pixels The dark channel value at that location is a single-channel scalar. For color channel indexes, the set of values is: These correspond to the three color channels: red, green, and blue. For clear images In pixels First The intensity values of each color channel, ranging from... ; For neighborhood windows Pixel position coordinates within; In pixels A square local neighborhood window centered on the local neighborhood is recommended, with a recommended window side length of [missing information]. The odd number of pixels within the range are selected based on the image resolution.
[0035] The meaning of a dark passage is: first in the neighboring region For each pixel, take the minimum value of its three channels, and then take the spatial minimum value within its neighborhood. The result is the pixel. The dark channel value at that location.
[0036] In a preferred embodiment of the present invention, the prior statistical law of the dark channel includes: in non-sky areas of a fog-free outdoor image, the pixel value of the dark channel approaches 0, i.e. In contrast, in foggy images, the pixel values in the dark channel increase significantly due to atmospheric light scattering.
[0037] In a preferred embodiment of the present invention, DCP defogging includes: The initial transmittance is calculated based on the inspection images, atmospheric scattering model, and prior statistical laws of the dark channel; the initial transmittance is smoothed and optimized using guided filtering to obtain the smoothed transmittance. Calculate the dark channel of the inspection image; sort the dark channels of the inspection image in descending order of brightness, and select the pixels with the highest brightness in the first preset percentage as candidate atmospheric light pixels; calculate the average of the weighted gray values of the RGB three channels of the inspection image at each candidate atmospheric light pixel to obtain the global atmospheric light value. A fog-free image is obtained based on smoothed transparency, global atmospheric light value, and atmospheric scattering model.
[0038] In a preferred embodiment of the present invention, the calculation of the initial transmittance based on the inspection image, the atmospheric scattering model, and the prior statistical law of the dark channel includes: Assuming local neighborhood The internal transmittance is approximately constant, denoted as The value ranges from [0,1]. Both sides of the atmospheric scattering model are simultaneously divided by the global atmospheric light value. The normalized form is obtained as follows: ; in, For the observed hazy image at the pixel level RGB value at; For the fog-free, clear image to be recovered, in pixels The RGB value at that location.
[0039] Apply dark channel operation to both sides of the above normalization equation (first in the neighborhood). Take the minimum value in the inner space, and then take the minimum value among the three color channels. Because... It is a constant within the neighborhood and can be extracted from the minimum operator: ; in, For foggy images In pixels First The intensity values of each color channel, ranging from... ; According to the prior statistical law of dark channels, the dark channel of a clear image without fog approaches 0, that is... ,and Therefore, the first term on the right side of the above equation approaches 0, which simplifies to: ; Rearranging the terms yields the estimation formula for the initial transmittance, and the fog retention coefficient is then introduced. : ; in, The recommended value range for the fog retention coefficient is [value range missing]. When the fog is dense, a larger value can be used within this range; when more depth of field needs to be preserved, a smaller value can be used. This tends to completely remove the fog, which may appear unnatural due to the loss of depth of field; This indicates that the calculation result will be truncated to... This avoids the transmittance exceeding the limit caused by a small number of bright pixels when the candidate atmospheric light is estimated by mean.
[0040] In a preferred embodiment of the present invention, guided filtering is used to smooth and optimize the initial transmittance, resulting in a smoothed transmittance including: The initial transmittance is based on the assumption of a constant local window, but block effects exist at points of abrupt depth change (such as the boundary between the tree canopy edge and the sky, or the intersection of the guide line and the background). Therefore, guided filtering is used to smooth and optimize the initial transmittance. (1) Construction of the guide graph With foggy images grayscale image As a guide diagram. The image is obtained by fusion of the RGB three channels of the hazy image using a perceptual weighting method based on brightness: ; in, , and Images with fog In pixels The intensity values for the red, green, and blue channels are all within the specified range. ; For a grayscale image of a hazy image, in pixels The grayscale value at that point is normalized to 0.299, 0.587, and 0.114 are standard gray-level weighting coefficients that conform to the brightness perception characteristics of the human eye; the denominator 255 is used to normalize the gray-level values to... .
[0041] The grayscale image of the foggy image itself is chosen as a guide because it is consistent with the depth structure of the scene: the edges in the grayscale image (tree canopy outline, wire direction) are the locations where the transmittance changes, and using them as a guide can align the optimized transmittance edges with the edges of real objects.
[0042] (2) Local linear model Guided filtering assumes that the output transmittance is in pixels local window centered Inside, with the guide map Satisfies a linear relationship: ; in, The center pixel position of the local window; In pixels A square local window centered on the center, with a recommended window radius value within the range of [value missing]. Pixel; For window For pixels The given local transmittance estimate; and For window The linear coefficients to be solved are constants within the same window; This linear relationship guarantees That is, the gradient of the local transmittance estimation is proportional to the gradient of the guide map. The transmittance only changes abruptly at the edges of the guide map, and the transmittance is also smooth at flat areas of the guide map, thus achieving edge preservation and smoothing.
[0043] (3) Solving for coefficients linear coefficients , The objective of the solution is: in the window Within, local estimation With initial transmittance The difference should be minimized, i.e., the following cost function should be minimized: ; in, To fit the error term, the output transmittance is constrained to be faithful to the initial transmittance; This is a regularization term that penalizes excessively large coefficients. To prevent overfitting and control the smoothing intensity; For regularization parameters, the recommended value range is [value range missing]. , The larger the value, the stronger the smoothness. The above cost function is about , The quadratic convex function, respectively for , Taking the partial derivative and setting it to zero, we obtain the closed-form solution: ; in, For window Total number of pixels within; For guiding diagrams In the window The mean within; For guiding diagrams In the window within variance; Initial transmittance In the window The mean within.
[0044] (4) Average of overlapping windows Because the sliding window moves pixel by pixel across the image, any pixel... It will be covered by multiple windows from different centers simultaneously, each covered window Based on the aforementioned linear relationship, a transmittance estimate is given. And the coefficients of each window They are all different. If the result of a single window is taken directly, adjacent pixels may belong to different windows, resulting in new blocky discontinuities. Therefore, for the covered pixels... The final smoothed transmittance is obtained by averaging the estimates from all windows. : ; in, Indicates all covered pixels Window center Summation; To cover pixels The total number of local windows, used to distinguish the number of pixels in a single window. ; This means that the windowed average result is truncated to the effective transmittance range; The range of values for the optimized smooth transmittance is... .
[0045] In a preferred embodiment of the present invention, the significance of smoothing optimization lies in: ① the transmittance of each pixel is jointly determined by the estimates of multiple windows, eliminating the block effect caused by the boundary of a single window; ② the average result of the overlapping windows changes smoothly with the pixel position, while the guiding image... Preserve transitions at the edges of objects, therefore Maintain depth transitions at the tree canopy edge and conductor outline to avoid halo artifacts after defogging.
[0046] In a preferred embodiment of the present invention, smooth transmittance See the visualization results. Figure 2 The smoothed transmittance is visualized in grayscale in the figure. Pixel grayscale values are directly proportional to transmittance; higher brightness indicates greater transmittance (thinner fog, more sufficient scene light penetration), while lower brightness indicates lower transmittance (denser fog, higher atmospheric scattering). Specifically: The near-ground vegetation areas at the bottom and sides of the image are highlighted (transmittance close to 1), indicating that the foreground is less affected by fog and texture details can be effectively restored. The sky and distant mountains at the top of the image are dark (transmittance close to 0), indicating severe atmospheric scattering in the distance. This area will be difficult to restore due to the lower limit of transmittance. To protect against numerical distortion, the outlines of the tower and multiple slender wires visible in the center of the image remain clear and continuous in the transmittance map, without any blurring or diffusion.
[0047] In a preferred embodiment of the present invention, the global atmospheric light value The estimates include: Global atmospheric light value The estimation method, guided by the dark channel, follows this logic: the pixels with the densest fog have the highest brightness in the dark channel of a foggy image, and these pixels receive almost all the light from atmospheric scattering, thus they can be considered the source of atmospheric light. Specifically, this includes: (1) Calculate the dark channel of the hazy image I: Based on the definition of the dark channel mentioned above, the sharp image Replace with a foggy image ,Right now: ; in, For foggy images In pixels The dark channel value at that location is a single-channel scalar, and its value range is... The value reflects the pixel Fog concentration at a given location: The denser the fog, the stronger the atmospheric scattering. The larger the fog, the thinner it is. The smaller.
[0048] In a preferred embodiment of the present invention, the dark channel of the hazy image is described below. Figure 3 In the image, the non-sky vegetation areas are generally low grayscale, while the sky and areas with strong scattering have higher grayscale, which is consistent with the statistical characteristics of dark channel priors.
[0049] (2) Select candidate atmospheric light regions: exist Sort by brightness in descending order, and select the one with the highest brightness and the highest percentage of total pixels in the image. The pixels constitute the candidate atmospheric light pixel set. Recommended in The range is selected based on image resolution and fog area: ; in, The set of candidate atmospheric light pixels is a proportion of the total number of pixels in the image. ; For the candidate atmospheric light pixel ratio, the recommended value range is: ,Right now to ; for of quantile threshold, which makes the dark channel value the highest approximately Pixels of a certain proportion are added to the candidate set.
[0050] The reason for selecting the brightest point in the dark channel as the candidate region is that the brightest pixel in the dark channel corresponds to the location with the highest fog concentration and the largest proportion of atmospheric scattering. The light in this location is almost entirely contributed by atmospheric scattering, making it a natural source of atmospheric light. This strategy uses fog concentration as a guide, rather than simply selecting the brightest pixel globally in the image, thereby avoiding misclassification of white objects (such as white buildings, bare ground, and snow) or bright non-fog areas as atmospheric light.
[0051] (3) Estimate scalar atmospheric light: In the candidate atmospheric light pixel set In the middle, take the hazy image The average of the RGB three-channel weighted grayscale values at these locations is used as atmospheric light: ; in, For the candidate set The arithmetic mean of the grayscale values of all pixels within the range is taken. For set The total number of pixels.
[0052] The above formula replaces the maximum value operation in the traditional dark channel prior method with the gray-scale mean of the candidate set. The advantages are: ① Candidate set The vast majority of pixels are in the areas with the densest fog (their pixel values are already close to the real image). Taking the average value can synthesize the statistical information of the entire candidate set, avoiding the inclusion of a single outlier pixel (such as a very small number of non-foggy white objects that may be mixed in with the candidate set). ① Increase; ② The mean is statistically more stable than the maximum, and the estimation results fluctuate less between different foggy images, making it more applicable to engineering projects. This embodiment uses a scalar in an inspection scenario where the fog color is approximately neutral. As an engineering approximation, to simplify subsequent transmittance estimation and channel-by-channel recovery; for scenes with obvious colored illumination, this can be achieved without changing the processing flow. It is expanded to RGB three components.
[0053] In a preferred embodiment of the present invention, obtaining a haze-free image based on smoothed transmittance, global atmospheric light value, and atmospheric scattering model includes: Substituting the smoothed transmittance and global atmospheric light value into the atmospheric scattering model, we obtain a haze-free image: ; in, Indicates taking and The larger of the values is taken as the transmittance used in practice; This is the lower limit of transmittance; the recommended value range is [value range missing]. In areas of dense fog (such as the sky and distant mountains). If the value approaches 0 and is directly used as the denominator, it will cause the recovered result to overflow and the noise to be amplified sharply. Therefore, a lower limit should be set. This can prevent the denominator from approaching 0 and ensure the numerical stability of the recovered image.
[0054] By performing the above formula pixel-by-pixel and channel-by-channel operations and truncating the results to [0, 255], a clear, fog-free image can be recovered from a foggy image.
[0055] In a preferred embodiment of the present invention, the fog-free image is shown below. Figure 4 Compared to the original foggy image, the contrast of distant mountains, tree canopies, and guide lines is significantly enhanced after defogging. The gray-white occlusion caused by the fog is reduced, and the boundary between the slender guide lines and the background is clearer. This result serves as input for adaptive white balance correction.
[0056] In a preferred embodiment of the present invention, adaptive white balance includes: Image after dehazing Color shifts may still occur due to uneven lighting, so an adaptive white balance algorithm was designed to correct these shifts and restore the true colors of the vegetation.
[0057] Correcting image color shift can be represented by applying gain coefficients to each color channel of the dehazed image: ; in, Image after dehazing In pixels First The intensity values of each color channel, ranging from... ; For the white balance corrected image at the pixel level First The intensity values of each color channel; For the first The gain coefficients for each color channel need to be adaptively calculated. , , These are the gain coefficients for the red, green, and blue channels, respectively.
[0058] Calculate the mean values of the RGB three channels of the haze-free image respectively: ; in, , , This represents the mean values of the red, green, and blue channels of the dehazed image. The total number of pixels in the image, which is the product of the image width and height; To determine the positions of all pixels within the image Summation; , , Image after dehazing In pixels The intensity values of the red, green, and blue channels, with a range of values. .
[0059] Using the average value of the green channel as a baseline, the gain coefficients of the red and blue channels are calculated based on the average values of the RGB three channels, resulting in the three-channel gain coefficients: The power transmission corridor scene is dominated by vegetation. Vegetation reflects green light most strongly, resulting in the richest green channel information in the image and minimal impact from color cast. Therefore, the average value of the green channel is used. Based on: ; in, , , These are the gain coefficients for the red, green, and blue channels; To prevent the channel mean from being zero, which would result in a positive stable term divided by zero, the recommended value range is [value range missing]. .
[0060] The physical meaning of the above three-channel gain coefficients is: if the overall image is reddish ( (too large), then Suppress the red channel; if the overall color is bluish ( (too large), then The blue channel is suppressed, while the green channel remains unchanged. The gain adapts adaptively to the image's own statistics, requiring no manual setting.
[0061] The haze-free image is corrected pixel-by-pixel and channel-by-channel based on the three-channel gain coefficients to obtain the enhanced image: ; in, To enhance the image at the pixel level First The intensity values of each color channel exceed The value is truncated to the boundary; For the first Gain coefficients for each color channel; Image after dehazing In pixels First The intensity values of each color channel; This means limiting the channel gain calculation results to the effective image intensity range. Inside.
[0062] The enhanced image possesses both dehazing clarity and true vegetation color, providing high-quality input for subsequent tree species identification and wire segmentation.
[0063] In a preferred embodiment of the present invention, the enhanced image is shown below. Figure 5 The image shows the result of the dehazed image after adaptive white balance correction: the overall color cast introduced by the dehazing process is eliminated, the vegetation is restored to its natural green hue, the differences in leaf color among different tree species (dark green needles, yellow-green broad leaves, etc.) are realistically presented, and the crown texture and guide lines are clear, providing high-quality input with color fidelity for subsequent YOLO11 tree species recognition.
[0064] In a preferred embodiment of the present invention, the set of tree species detection boxes obtained by combining the enhanced image with the target detection model includes: YOLO11 was selected as the detection model; the default classification loss of the YOLO11 detection head was replaced with a focus loss, and the proportion of focus loss in the total YOLO11 loss was increased by a preset classification enhancement coefficient; YOLO11 was trained based on a pre-constructed training set to obtain the object detection model; the enhanced image was input into the object detection model, and after confidence filtering and non-maximum suppression, a set of tree species detection boxes was output; the set of tree species detection boxes includes the category, bounding box coordinates, and detection confidence of each tree species detection box. Specifically, it includes: A dataset of tree species for power transmission line corridors was constructed, including common tree species such as eucalyptus, poplar, pine, camphor, fir, and bamboo, covering complex scenes such as smog, backlight, and shadow. A total of 10,000 images were labeled and divided into training, validation, and test sets in an 8:1:1 ratio.
[0065] The bounding box localization loss in YOLO11 uses the default model configuration without changing its calculation method. To address the issues of imbalanced tree species sample numbers in power transmission corridors, similar appearances among different tree species, and the tendency for minority class samples to be dominated by the majority class, this invention replaces the default classification loss of the detection head with a focal loss and increases the relative contribution of the classification term to the total loss through a classification enhancement coefficient. The adjusted training loss is expressed as: ; in, This represents the total loss during model training. Loss of focus; Use the default bounding box localization loss for YOLO11 and continue using the model's default configuration during training; These are the baseline weights for the classification items in the YOLO11 training framework; The classification enhancement coefficient is relative to the baseline classification weights, and the recommended value range is [value range missing]. When confusion between similar tree species is significant or the recall rate of a few classes is low, the value can be appropriately increased within this range. When classification enhancement leads to a significant decrease in the bounding box localization index, the value can be appropriately decreased.
[0066] The formula for calculating focus loss is: ; in, The category number of the sample used in the classification loss calculation; The total number of valid samples—category items—used in this classification loss calculation; For the model to the first The predicted probability of the true label of each sample category item, with a value range of... The larger the value, the easier it is to classify the item. For the first Each sample—the category balance factor corresponding to the category item; for positive label items, the category benchmark factor is taken. For negative label items, take ,in Recommended in The range is adjusted based on the proportion of training samples for each tree species to increase the loss contribution of positive samples from the minority class; For the difficult case focusing factor, the recommended value range is [value range missing]. , The larger the value, the stronger the suppression of loss for easily classified samples; For the first Focus loss for each sample—category item; The classification loss is obtained by averaging the focus loss over all valid samples—category items. It is the natural logarithm function; This is a difficult example modulation factor used to reduce the dominant role of easily classified samples in gradient updates, making the training process focus more on tree species targets that are similar in appearance, have obvious occlusion, or have a small number of samples.
[0067] During training, select jointly within the above recommended intervals. Various categories and The selection criteria were based on the macro-average F1 score of the validation set, the recall rate of each tree species, and the mean precision. This adjustment does not change the bounding box localization structure of YOLO11; the task-oriented design is reflected in the replacement of the classification loss and the interval configuration of the relative weights of classification items and localization items.
[0068] Enhance the image Input a pre-trained YOLO11 model, filter by confidence and suppress non-maximum values, and output the class label for each tree species target. Bounding box coordinates With detection confidence . Indicates the index of the detected target. , The total number of tree species detected in a single image; detection confidence. The value range is [0,1]; For the first The x and y coordinates of the top left corner of the bounding box in the image coordinate system; For the first The horizontal and vertical coordinates of the bounding box at the bottom right corner of the image coordinate system.
[0069] Q2. Based on the enhanced image and BiRefNet, pixel-level segmentation of the conductor is performed, and a continuous and complete conductor trajectory is obtained through morphological processing, skeleton extraction, and catenary fitting. Q2 specifically includes: The enhanced image is input into BiRefNet, which performs pixel-level segmentation of the wires to obtain the wire probability mask. BiRefNet is used to classify high-resolution images into two categories: target and background. This embodiment does not change the BiRefNet network structure, nor does it design a separate model fine-tuning method; it only enhances the image. As input, read the single-channel wire probability map output by the model. Let BiRefNet be denoted as the mapping function. Its output is represented as: ; in, To maintain the original network structure of BiRefNet image segmentation mapping; For pixels The probability of a conductor at a given location, with values ranging from 1 to 10. The larger the value, the more likely the pixel is to belong to a wire.
[0070] Binarize the conductor probability mask to obtain the conductor binary mask: The probability mask output by BiRefNet Binarization is performed to obtain the binary mask of the wire: ; in, This is a binary mask, where 1 indicates that the pixel is identified as a wire and 0 indicates the background. The value range is for the binarization threshold. The threshold is determined adaptively by the Otsu algorithm. The Otsu algorithm traverses the candidate thresholds and selects the threshold that maximizes the inter-class variance of the pixels in the "wire class" and "background class", without the need for manual setting. A morphological closing operation, involving dilation followed by erosion, is performed on the binary conductor mask to fill voids and connect broken conductor segments, resulting in a closed conductor mask: Due to canopy shading, residual fog, and low contrast at long distances, the wires in the binary mask may contain small holes and short breaks. Morphological closing operations (dilation followed by erosion) are performed on the binary mask to fill the holes and connect the broken wire segments. ; in, For morphological expansion operations, the structuring element is swept across the mask, causing the foreground of the conductor to expand outward and bridge the adjacent breaks; This is a morphological erosion operation that shrinks the expanded foreground back to its original width, eliminating the boundary expansion introduced by the expansion. For square structuring elements used in morphological closing operations, the recommended side length is [missing information]. The odd number of pixels within, and selected based on the apparent width of the wire; For closed-loop wire masks, small holes are filled, short breaks are connected, and the main width of the wire remains basically stable.
[0071] The skeleton of the closed-operation conductor mask is extracted using the Zhang-Suen thinning algorithm to obtain a skeleton point set. Each skeleton point in the set is clustered into a subset belonging to each conductor. A local coordinate system is established for each subset, and a catenary function is used to describe the smooth curvature trend of each conductor within this local coordinate system. Fitting parameters are solved, and the results are mapped back to the image coordinate system to obtain the continuous and complete conductor trajectory. Specifically, this includes: (1) Skeleton extraction The skeleton of the wire mask Sclosed after the closing operation is extracted using the Zhang-Suen thinning algorithm: ; in, The Zhang-Suen thinning operation iteratively removes foreground boundary pixels, thinning a wire region with a width of multiple pixels into a center line with a width of one pixel, while maintaining the connectivity and direction of the wire. For a single-pixel-wide wire skeleton point set, it is represented as ; For the first The x and y coordinates of each skeleton point in the image coordinate system, with the top left corner of the image as the origin; For the skeleton point number, ; This represents the total number of points in the conductor skeleton.
[0072] In a preferred embodiment of the present invention, the result of the Zhang-Suen thinning algorithm is shown below. Figure 6 Multi-pixel-wide conductor regions are refined into single-pixel-wide centerlines, while maintaining the integrity of conductor orientation and connectivity, providing a skeleton point set for catenary fitting.
[0073] (2) Association of skeleton segments of a single conductor For clarity, we will first use any real conductor in the image as an example. Tree canopy occlusion may cause the conductor to appear as multiple visible segments that are disconnected from each other in the skeleton diagram; the task of this step is to identify which segments belong to the same conductor and to group the skeleton points of these segments into the same set of points. This process only determines the line affiliation of segments and does not fill in the geometric gaps between segments in this step.
[0074] Step 1: Obtain the visible skeleton fragments. For the skeleton... Perform 8-neighborhood connectivity analysis to divide the skeleton points that are interconnected into the same initial segment, thus obtaining the initial segment set. .in, For the first One initial skeleton segment ( , (This represents the total number of initial segments). For the current conductor, its visible portion may correspond to one complete initial segment or multiple broken initial segments.
[0075] Step 2: Correlation of adjacent segments along the same line. For any two initial segments... and If the distance between the adjacent endpoints of two segments is small and their directions at the endpoints are consistent, then they are determined to belong to the same conductor, and the skeleton points of the two segments are assigned to the same subset. The determination condition is: ; in, For the initial segment The coordinates of the endpoint along the direction of the traverse; For the initial segment Coordinates of the starting and ending points along the direction of the traverse; The Euclidean distance between the two endpoints measures the spatial proximity of the two segments. The endpoint distance threshold is recommended to have a range of values. The pixel size is selected based on the image resolution and the apparent scale of the conductor to allow for gaps in the skeleton caused by canopy shading. , For the initial segment , The tangent direction angles at their respective adjacent endpoints are obtained by least-squares straight-line fitting of the skeleton points near the endpoints; It is the absolute value of the difference between the direction angles of two tangents, measuring the consistency of their orientation; The recommended value range for the direction angle threshold is [value range missing]. The conductor is a gradually changing curve, and the directions on both sides of the break should be basically the same. Although the endpoints of the intersecting conductors are close, their direction angles are very different. This condition can be used to exclude them and avoid accidental merging.
[0076] Step 3: Curve consistency verification for long discontinuous segments. For endpoint distances that do not meet the requirements... However, long-distance fractures may be formed by large-area canopy shading. The local orientation is estimated using the skeletal segments on both sides and extrapolated outwards along the fracture interval. When the lateral deviation of the two extrapolated trajectories at the same longitudinal position is less than the curve consistency threshold... Furthermore, the difference in direction between the two tangent segments is still less than [the value of the tangent]. When the time comes, the skeleton points of the two segments are grouped into the same subset. The recommended value range is Pixels. This avoids the inability to correlate large-span breaks by relying solely on a single fixed endpoint distance threshold.
[0077] Step 4: Form a subset of skeleton points for the current traverse. After completing the association of neighboring segments and the verification of long discontinuous segments, record all visible skeleton points belonging to the current traverse as follows: Among them, subscript Used to identify the wire currently being processed; same It may contain multiple spatially discontinuous initial segments, which are not yet continuous traverse trajectories, but rather a set of observation points used for subsequent fitting.
[0078] (3) Fitting the continuous trajectory of a single conductor The following are subsets of each skeleton point Perform a fitting. The goal is to utilize... The visible skeleton points in the model determine the smooth curve model of the conductor, and the continuous trajectory is reconstructed at the gaps created by the canopy shading.
[0079] Step 1: Establish a local coordinate system along the direction of the conductor. Under the aforementioned shooting viewpoint, the current conductor extends from the near end at the bottom to the far end at the top in the image, with its main direction approaching longitudinal, and may also exhibit tilt and curvature. To ensure that curve fitting is unaffected by the coordinate axis direction of the original image, [the following steps are taken]. Establish a local coordinate system consistent with its main orientation. Let the centroid of the subset be... The unit principal direction vector is obtained from principal component analysis. Its normal unit vector is For skeleton points ,definition: ; in, For the first The longitudinal coordinates of each skeleton point along the main direction of the traverse; For the first The lateral offset of each skeleton point perpendicular to the main direction of the conductor; , For the first The principal direction and normal unit vector of a conductor; For skeleton point subset The centroid; T represents the transpose operation; Step 2: Establish the catenary projection model. To complete the occluded broken sections based on the visible skeleton points of the same conductor, a catenary function is used in the local coordinate system to describe the smooth bending trend of the conductor. Specifically, Indicates the position along the main direction of the conductor. This indicates the offset perpendicular to this direction; the function gives various... Location corresponding This forms a continuous conductor curve. Direction sign. Used to characterize the curve's bending towards the local positive or negative normal direction, to accommodate the conductor's bending direction under different shooting postures: ; in, For the shape parameters of the catenary, The larger the value, the flatter the curve. Let be the coordinates of the extreme points of the curve along the main direction of the traverse. For the curve in The normal coordinates at that point, due to subtracting 1 from the formula, That is, the coordinates of the extreme point, not the additional offset; This is a symbol for the direction of curve curvature, used to be compatible with the downward orientation of the image coordinate vertical axis and different shooting postures; It is a hyperbolic cosine function.
[0080] Step 3: Solve for the fitting parameters. Solve for the optimal parameters for all skeleton points within the area: ; in, for The total number of skeleton points within the area. When solving, let... and For continuous parameters , , The Levenberg-Marquardt algorithm is used iteratively, retaining the set of parameters with the smallest sum of squared residuals; the recommended stopping threshold for parameter increments is [missing information]. Select from the range.
[0081] Step 4: Reconstruct the continuous traverse trajectory. The generated local coordinate points are obtained through , and Map back to the image coordinate system. Within the fracture intervals between visible skeleton segments, sample according to the fitted curve to fill the skeleton gaps: short fractures are preferentially bridged by the aforementioned closing operation, while long fractures are reconstructed by extrapolation of the catenary in this step. This yields the continuous trajectory corresponding to each conductor.
[0082] (4) Expansion of multiple conductors For the remaining lines in the image, repeat the above "skeleton segment association - continuous trajectory fitting" process to obtain skeleton point subsets respectively. And its corresponding continuous traverse trajectory. Among them, The number of identified conductors; each conductor is independently associated and fitted, and the skeleton points of different conductors are not merged into the same curve.
[0083] In a preferred embodiment of the present invention, the result of fitting the catenary to each conductor after segmented clustering of the skeleton points is shown in the figure. Figure 7 Each skeleton point is assigned to its corresponding traverse subset. The fitted curve is continuous and smooth. Broken intervals caused by occlusion are filled by the catenary model, thus reconstructing the complete traverse trajectory.
[0084] Q3. Construct the ROI region of the transmission line corridor based on the conductor trajectory; calculate the overlap between each tree species detection box and the ROI region based on the tree species detection box set, and output the tree species detection boxes whose overlap meets the preset conditions.
[0085] In a preferred embodiment of the present invention, the method further includes the following steps before constructing the ROI region: The trajectories of all guide lines are sampled row by row according to the ordinate of the image coordinate system. For rows not directly covered by the visible skeleton, interpolation or extrapolation is performed based on the fitting results. When multiple sampling points exist for the same ordinate, the point with the smallest lateral distance from the selected point in the previous row is selected to maintain the continuity of the same guide line trajectory. The row closest to the bottom of the image within the common coverage area of all guide lines is used as the reference row. The reference rows are sorted in ascending order of their x-coordinates and continuously tracked vertically to obtain the x-coordinate function of the left guide line. and the x-coordinate function of the right-hand conductor . The vertical coordinate of the image is taken as an integer. ; =0 corresponds to the far top of the image. The corresponding area is near the bottom of the image; H is the image height (number of pixels). At the far end of the image, the projections of the left and right guide lines may intersect at the extension lines inside or outside the image. Areas near the intersection point that are too far apart and have too small a spacing between the guide lines are difficult to form stable corridor areas with practical inspection significance, so they are not included in the ROI area.
[0086] In a preferred embodiment of the present invention, constructing the ROI region of the transmission line corridor based on the conductor trajectory includes: By combining the x-coordinate functions of the left and right traverse lines, we obtain... (v)= (v), the ordinate of the far intersection is obtained by solving. If multiple solutions exist, the solution closest to the top of the image is selected. If no solution exists within the image, two fitted curves are extrapolated along the far end to find the solution. If no solution is found, parameters are defined. =0, to be used later.
[0087] Image range is limited based on the far-end intersection ordinate, and the effective starting row of the ROI is calculated according to the preset retention ratio: In seeking At that time, the image range is limited to obtain parameters. If the result is not obtained, the aforementioned method is used directly. =0. With Based on the vertical distance to the near end of the image, set the retention ratio. To obtain the valid starting row of the ROI: ; in, The recommended value range for the retention ratio from the intersection point to the near end of the interval is [0.6, 0.9]; in this embodiment, we take... =0.8, meaning that from the intersection point downwards, the first 20% of the excessively far region is skipped, and the remaining 80% of the region near the bottom of the image is retained for constructing the ROI. Ultimately, only in... Generate ROI within the specified range.
[0088] Calculate the unilateral expansion width at each vertical coordinate within the effective starting row range of the ROI based on the baseline width at the far end of the image perspective distance, the preset ROI width adjustment coefficient, and the perspective adjustment factor: The unilateral expansion width of the ROI region dynamically adjusts with the perspective distance of the guide wire: wider at closer (bottom of the image) and narrower at farther (top of the image), as expressed mathematically: ; in, y-axis The single-sided expansion width (pixels) of the ROI region; : Effective far-end reference width, i.e., effective starting line (v= The recommended value for the single-sided expansion width at () is [30, 80] pixels; H is the image height (number of pixels), and H>1; This is the perspective adjustment factor, with a value range of [0,1]. It is 0 at the beginning of the valid row and 1 at the bottom near the bottom of the image. To control the adjustment factor for the ROI width increasing from the effective far end to the near end, a value range of [0.3, 0.8] is recommended, with the width at the effective starting row being... The width of the bottom near end reaches (1+ ).
[0089] For each vertical coordinate within the effective starting row range of the ROI, the single-sided expansion width is extended to the left and right, respectively, using the left and right conductors as references, to obtain the left and right boundaries of the ROI area for each vertical coordinate; connecting the left and right boundaries of the ROI area for each vertical coordinate yields the ROI area of the transmission line corridor. Specifically, this includes: For each ordinate v within the effective range (i.e. (Adaptive width, expanding leftward based on the left guideline and rightward based on the right guideline) Generate the left and right boundaries of the ROI region: ; in, y-axis The x-coordinate of the left boundary of the ROI region; y-axis The x-coordinate of the right boundary of the ROI region; , y-axis The x-coordinates of the left and right guide lines; The input image width (in pixels); the max and min operations are used to limit the ROI boundary to the horizontal range of the image. Inside.
[0090] Connect the left boundary points corresponding to each ordinate within the effective range. , ) and the right boundary point ( , This forms a closed transmission line corridor ROI area. : ; Where (u,v) are the x and y coordinates of a pixel in the image; When actually generating the pixel mask, the boundary coordinates are rounded to the nearest pixel and restricted to the effective coordinate range of the image.
[0091] The ROI region dynamically bends with the direction of the conductor and adaptively scales with the perspective distance, enabling geometric modeling of the power transmission corridor.
[0092] In a preferred embodiment of the present invention, the ROI region is described in detail below. Figure 8 The highlighted area in the figure is the transmission corridor ROI area generated according to the above process based on the fitted conductors on both sides: first, the intersection of the conductors on both sides at the far end and the excessively far area thereafter are removed, and then within the effective range, the boundary of the area is made to bend with the trend of the fitted conductor, and the width gradually increases from the effective far end to the near end below, which is consistent with the perspective shape of the shooting view downwards, and provides geometric criteria for subsequent corridor overlap rate filtering.
[0093] In a preferred embodiment of the present invention, the overlap between each tree species detection box and the ROI region is calculated based on the tree species detection box set, and tree species detection boxes whose overlap meets preset conditions are output, including: The overlap ratio is obtained by calculating the ratio of the intersection area between the tree species detection box and the ROI region to the area of the tree species detection box itself. For the Tree species detection box With corridor area Define corridor overlap rate The ratio of the intersection area of the detection frame and the corridor area to the area of the detection frame itself: ; in, This is the index of the target number for detection. , This represents the total number of tree species detected in a single image; For the first Tree species detection box, The coordinates of the top left corner of the box. The coordinates of the bottom right corner of the box; The intersection of the detection frame and the corridor area, i.e., the part of the tree canopy that falls within the corridor; This represents the area of the region, which is the total number of pixels within that region. For the first The corridor overlap rate of each tree species detection frame, with a value range of... , This indicates that the detection frame is completely located inside the corridor area. This indicates that the detection frame is completely separated from the corridor area, while something in between indicates that the tree canopy has encroached on the corridor.
[0094] The overlap of each tree species detection box is compared with a preset retention threshold. If the overlap is less than the preset retention threshold, the tree species detection box is removed; if it is greater than or equal to the preset retention threshold, the tree species detection box is output. Specifically, this includes: Set corridor overlap rate retention threshold The recommended value range is The threshold is selected based on the false negative and false positive rates on the validation set. If the threshold is too low, trees outside the passage with only slight overhang of the canopy will be misjudged as potential hazards. If the threshold is too high, dangerous trees with most of their canopies outside the passage but with branches already encroaching may be missed.
[0095] when At that time, the test result was retained, and the trees were identified as dangerous trees within the passageway; when If the test result is invalidated, the vegetation outside the passageway will be deemed safe.
[0096] This mechanism uses the overlap rate between the tree canopy and the power transmission corridor as the sole criterion, avoiding the misjudgment problem of the traditional center point threshold judgment (which only considers whether the center of the detection box falls into the area) when the tree canopy straddles the edge of the corridor.
[0097] The output retains the tree species information after filtering, including tree species category labels, bounding box coordinates, and detection confidence scores, thus achieving accurate tree species identification along the transmission line corridor. See the schematic diagram of the output results. Figure 9 .exist Figure 9 The corresponding labels in the image show the filtered results and the retained pine and bamboo trees, with the category and confidence level displayed in the upper left corner of the detection box.
[0098] This invention presents a method for identifying tree species in transmission line corridors based on spatial topological constraints. By combining dark channel priors with guided filtering to accurately estimate the transmittance field, it avoids local over-enhancement caused by global parameters. Adaptive white balance dynamically adjusts channel gain based on vegetation response, further highlighting the differences in leaf color and texture among broadleaf, coniferous, and bamboo species in the feature space. The BiRefNet bilateral reference mechanism captures the boundaries of slender conductors, and, in conjunction with least-squares fitting of catenary lines, reconstructs fracture intervals. The adaptive width ROI region constructed based on the bilateral conductors maintains an average Hausdorff distance within a very small pixel range from the envelope of actual tree line hazards. A pixel-level spatial membership filtering mechanism establishes the association between the detection box and the corridor region at the geometric topology level. Detections are directly removed when the overlap is less than a preset retention threshold, avoiding edge misjudgments caused by traditional center-point thresholding.
[0099] A preferred embodiment of the present invention also provides a tree species identification device for transmission line corridors based on spatial topology constraints, the device being used to implement the method of the present invention.
[0100] The tree species identification device for transmission line corridors based on spatial topology constraints of the present invention, when used in the method of the present invention, has the same beneficial effects as the method of the present invention.
[0101] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for identifying tree species in transmission line corridors based on spatial topology constraints, characterized in that, include: The inspection images are dehazed using DCP and subjected to adaptive white balance to obtain enhanced images; A set of tree species detection boxes is obtained by combining the enhanced image with the target detection model; Based on the enhanced image, the conductor is segmented at the pixel level using BiRefNet, and a continuous and complete conductor trajectory is obtained through morphological processing, skeleton extraction and catenary fitting. The ROI region of the transmission line corridor is constructed based on the conductor trajectory; The overlap between each tree species detection box and the ROI region is calculated based on the set of tree species detection boxes, and tree species detection boxes whose overlap meets the preset conditions are output.
2. The method for identifying tree species in transmission line corridors based on spatial topology constraints according to claim 1, characterized in that, DCP defogging includes: The initial transmittance is calculated based on the inspection images, atmospheric scattering model, and prior statistical laws of the dark channel; the initial transmittance is then smoothed and optimized using guided filtering to obtain smooth transmittance. Calculate the dark channel of the inspection image; sort the dark channels of the inspection image in descending order of brightness, and select the pixels with the highest brightness in the first preset percentage as candidate atmospheric light pixels; calculate the average of the weighted gray values of the RGB three channels of the inspection image at each candidate atmospheric light pixel to obtain the global atmospheric light value. A fog-free image is obtained based on the smoothed transparency, the global atmospheric light value, and the atmospheric scattering model.
3. The method for identifying tree species in transmission line corridors based on spatial topology constraints according to claim 2, characterized in that, Adaptive white balance includes: Calculate the mean values of the RGB three channels of the haze-free image respectively; using the mean value of the green channel as a benchmark, calculate the gain coefficients of the red and blue channels based on the mean values of the RGB three channels to obtain the three-channel gain coefficients; The enhanced image is obtained by performing pixel-by-pixel and channel-by-channel correction on the haze-free image based on the three-channel gain coefficients.
4. The method for identifying tree species in transmission line corridors based on spatial topology constraints according to claim 3, characterized in that, The tree species detection box set obtained by combining the enhanced image with the target detection model includes: YOLO11 is selected as the detection model; the default classification loss of the detection head in YOLO11 is replaced with the focus loss, and the proportion of the focus loss in the total loss of YOLO11 is increased by a preset classification enhancement coefficient; YOLO11 is trained according to the pre-constructed training set to obtain the target detection model; The enhanced image is input into the target detection model, and after confidence filtering and non-maximum suppression, the tree species detection box set is output; the tree species detection box set includes the category, bounding box coordinates and detection confidence of each tree species detection box.
5. The method for identifying tree species in transmission line corridors based on spatial topology constraints according to claim 4, characterized in that, Based on the enhanced image, pixel-level segmentation of the conductor is performed using BiRefNet, and a continuous and complete conductor trajectory is obtained through morphological processing, skeleton extraction, and catenary fitting, including: The enhanced image is input into BiRefNet, which performs pixel-level segmentation on the wires to obtain the wire probability mask; The wire probability mask is binarized to obtain a wire binary mask; the wire binary mask is then subjected to a morphological closing operation of first dilation and then erosion to fill the voids and connect the broken wire segments, resulting in a closing operation wire mask. The skeleton of the closed-operation conductor mask is extracted using the Zhang-Suen thinning algorithm to obtain a skeleton point set. Each skeleton point in the skeleton point set is clustered into a subset of skeleton points belonging to each conductor. A local coordinate system is established for each subset of skeleton points. In the local coordinate system, the catenary function is used to describe the smooth bending trend of each conductor. The fitting parameters are solved, fitted, and mapped back to the image coordinate system to obtain the continuous and complete conductor trajectory of each conductor.
6. The method for identifying tree species in transmission line corridors based on spatial topology constraints according to claim 5, characterized in that, Before constructing the ROI region, the following steps are also included: The trajectories of all conductors are sampled row by row according to the vertical coordinate of the image coordinate system. For rows not directly covered by the visible skeleton, interpolation or extrapolation is performed based on the fitting results. In the case where there are multiple sampling points for the same vertical coordinate, the point with the smallest horizontal distance from the selected point in the previous row is selected to maintain the continuity of the same conductor trajectory. The row closest to the bottom of the image within the common coverage area of all conductor trajectories is used as the reference row. The reference rows are sorted in ascending order of their horizontal coordinates and continuously tracked vertically to obtain the horizontal coordinate functions of the left and right conductors.
7. The method for identifying tree species in transmission line corridors based on spatial topology constraints according to claim 6, characterized in that, The ROI region for constructing the transmission line corridor based on the conductor trajectory includes: By combining the x-coordinate functions of the left and right guide lines, the y-coordinates of the far intersection are obtained; the image range is limited based on the far intersection y-coordinates, and the effective starting row of the ROI is calculated according to the preset retention ratio; The unilateral expansion width at each vertical coordinate within the effective starting row range of the ROI is calculated based on the baseline width at the far end of the image perspective distance, the preset ROI width adjustment coefficient, and the perspective adjustment factor. For each vertical coordinate within the effective starting row range of the ROI, the unilateral expansion width is extended to the left and right respectively with the left and right conductors as references to obtain the left and right boundaries of the ROI region at each vertical coordinate. The left and right boundaries of the ROI region at each vertical coordinate are connected to obtain the ROI region of the transmission line corridor.
8. The method for identifying tree species in transmission line corridors based on spatial topology constraints according to claim 7, characterized in that, The overlap between each tree species detection box and the ROI region is calculated based on the set of tree species detection boxes, and the tree species detection boxes whose overlap meets the preset conditions are output, including: The overlap ratio is obtained by calculating the ratio of the intersection area between the tree species detection box and the ROI region to the area of the tree species detection box itself. The overlap of each tree species detection box is compared with a preset retention threshold. If it is less than the preset retention threshold, the tree species detection box is removed. If it is greater than or equal to the preset retention threshold, the tree species detection box is output.
9. A tree species identification device for transmission line corridors based on spatial topology constraints, characterized in that, The apparatus is used to implement the method according to any one of claims 1 to 8.
