Nothing Special   »   [go: up one dir, main page]

CN115841633A - Power tower and power line associated correction power tower and power line detection method - Google Patents

Power tower and power line associated correction power tower and power line detection method Download PDF

Info

Publication number
CN115841633A
CN115841633A CN202211552072.8A CN202211552072A CN115841633A CN 115841633 A CN115841633 A CN 115841633A CN 202211552072 A CN202211552072 A CN 202211552072A CN 115841633 A CN115841633 A CN 115841633A
Authority
CN
China
Prior art keywords
power
detection
tower
line
power tower
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211552072.8A
Other languages
Chinese (zh)
Inventor
晏子华
王柯
张旭
蔡小波
高广宇
舒亮
胡志会
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Youzhi Chuangxin Technology Co ltd
Beijing Institute of Technology BIT
Original Assignee
Shenzhen Youzhi Chuangxin Technology Co ltd
Beijing Institute of Technology BIT
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Youzhi Chuangxin Technology Co ltd, Beijing Institute of Technology BIT filed Critical Shenzhen Youzhi Chuangxin Technology Co ltd
Priority to CN202211552072.8A priority Critical patent/CN115841633A/en
Publication of CN115841633A publication Critical patent/CN115841633A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

A power tower and power line detection method for power tower and power line correlation correction is characterized in that images of the power tower and the power line are shot from the upper part, and graying pretreatment is carried out on the images; carrying out edge detection on the preprocessed image to obtain a binary edge image; carrying out power line detection and power tower detection by using the edge map to obtain power lines represented by parallel line groups and a power tower area framed by a rectangular frame; mapping the rectangular frame to an edge map, excluding background areas on two sides of the rectangular frame of the power tower, and re-detecting the power lines in the internal area of the rectangular frame of the power tower; and after a new power line detection result is obtained, estimating the ratio of the power tower area in the edge graph according to the left and right widths of the power line distribution area, updating power tower detection parameters, and re-detecting the power tower until the requirements are met or the iteration times are reached. The method does not depend on a large-scale data set, and has higher detection speed and better effect.

Description

一种电力塔和电力线关联矫正的电力塔和电力线检测方法A method for detecting power towers and power lines with correlation correction between power towers and power lines

技术领域Technical Field

本发明属于电力设施安全检测技术领域,涉及电力塔、电力线的巡检,特别涉及一种电力塔和电力线关联矫正的电力塔和电力线检测方法。The present invention belongs to the technical field of power facility safety detection, relates to the inspection of power towers and power lines, and in particular to a power tower and power line detection method for correcting the correlation between power towers and power lines.

背景技术Background Art

传统的电力线巡检主要有人工巡检和直升机巡检等方式。人工巡检是工作人员攀爬电力塔后人为巡视和检查电力线状态的方式。人工巡检存在诸多问题,一方面准确率和效率不高,尤其是针对长距离输电线路还需要耗费大量的人力物力成本;另一方面安全性低,尤其是处于复杂环境的线路,再加上恶劣天气情况的影响,人工巡检会十分困难和危险。直升机巡检则是电力线路的另一种常用巡检方式之一,主要是利用直升机配备专业人员和各种传感设备后,在电力线上空盘旋飞行进行巡检的方式。直升机巡检在一定程度上解决了人工巡检的一部分问题。例如,直升机可以到达人难以前往的峡谷等复杂地形,并且巡检效率大大提升。但是直升机使用不灵活,个头太大而无法进入很多特定区域,巡检和维护成本也较高,使得直升机巡检方式只有在某些特殊情况下才会被采用。综上所述,目前的传统巡检方式已经无法满足越来越庞大的电力线路巡检需求。Traditional power line inspections mainly include manual inspections and helicopter inspections. Manual inspections are a way for workers to manually inspect and check the status of power lines after climbing power towers. There are many problems with manual inspections. On the one hand, the accuracy and efficiency are not high, especially for long-distance transmission lines, which require a lot of manpower and material costs; on the other hand, the safety is low, especially for lines in complex environments, coupled with the influence of bad weather conditions, manual inspections will be very difficult and dangerous. Helicopter inspections are another common inspection method for power lines. They mainly use helicopters equipped with professionals and various sensor equipment to hover over power lines for inspections. Helicopter inspections have solved some of the problems of manual inspections to a certain extent. For example, helicopters can reach complex terrains such as canyons that are difficult for people to reach, and the inspection efficiency is greatly improved. However, helicopters are not flexible to use, are too large to enter many specific areas, and have high inspection and maintenance costs, so helicopter inspections are only used in some special cases. In summary, the current traditional inspection methods can no longer meet the growing demand for power line inspections.

近年来,随着人工智能技术和机器人技术的发展,出现了依靠无人机搭配简单的摄像头采集数据,并通过人工智能技术进行图像理解来进行电力线巡检的技术方案。无人机巡检方式受气候和天气影响小,并且能长时间工作,不仅大大提高了检测频率和巡检质量,也在降低人力成本的同时保证了工人的安全,因此在电力线巡检工作中体现出了明显优势。然而,在无人机搭配摄像头的巡检方式中,关键是如何利用计算机视觉识别技术进行电力线和电力塔的检测识别。In recent years, with the development of artificial intelligence and robotics, there has emerged a technical solution that relies on drones with simple cameras to collect data and use artificial intelligence technology to understand images for power line inspections. The drone inspection method is less affected by climate and weather and can work for a long time. It not only greatly improves the inspection frequency and inspection quality, but also reduces labor costs while ensuring the safety of workers. Therefore, it has obvious advantages in power line inspections. However, in the inspection method of drones with cameras, the key is how to use computer vision recognition technology to detect and identify power lines and power towers.

目前,国内外研究人员对图像中的电力线检测的主要方法可分为传统图像处理方法和数据驱动的机器学习方法两大类。图像处理方法是根据电力线本身的物理和几何特性等,依据人工经验定义电力线的特征模式来对待检测图像做模式识别。例如根据先验知识,将电力线看作一条连续直线,通过经典的线段检测方法来完成电力线检测,例如Hough变换、Radon变换、方向滤波和基于梯度和边缘信息的直线检测算法。传统图像处理方法容易受到噪声干扰,并且其人工经验多针对特定场景,面对不同环境需要频繁调整参数,甚至是重新定义特征模式,才能取得较好的检测效果。数据驱动的机器学习方法,则是通过对大量的有标记数据进行机器学习模型学习和训练,进而获取可有效描述电力线特征的检测模型。机器学习方法中效果较好的是基于深度学习模型(通常是卷积神经网络)的方法。数据驱动的机器学习方法,通常需要大量人工标记的数据集对模型进行训练,并且要利用电力线结构信息对提取的电力线进行后处理优化。At present, the main methods used by researchers at home and abroad for detecting power lines in images can be divided into two categories: traditional image processing methods and data-driven machine learning methods. Image processing methods are based on the physical and geometric characteristics of the power lines themselves, and define the characteristic patterns of the power lines based on artificial experience to perform pattern recognition on the images to be detected. For example, based on prior knowledge, the power lines are regarded as a continuous straight line, and the power line detection is completed through classic line segment detection methods, such as Hough transform, Radon transform, directional filtering, and straight line detection algorithms based on gradient and edge information. Traditional image processing methods are easily interfered by noise, and their artificial experience is mostly targeted at specific scenes. In the face of different environments, parameters need to be adjusted frequently, or even the characteristic patterns need to be redefined, in order to achieve better detection results. Data-driven machine learning methods, on the other hand, learn and train machine learning models on a large amount of labeled data to obtain a detection model that can effectively describe the characteristics of power lines. Among machine learning methods, the method based on deep learning models (usually convolutional neural networks) has a better effect. Data-driven machine learning methods usually require a large number of manually labeled data sets to train the model, and the extracted power lines need to be post-processed and optimized using the power line structure information.

与此同时,对于电力塔的检测目前主要的技术路线是采用计算机视觉领域的目标检测方法。而且,效果较好的方法也是基于深度学习模型的目标检测方法,例如基于FasterR-CNN和Mask R-CNN等两阶段的检测方法和基于YOLO的一阶段目标检测方法。其中,两阶段检测算法精度高,但是检测速度慢,不太适应于无人机实时巡检;基于回归的一阶段目标检测算法,例如YOLO和SSD算法,检测效率较高,但是检测准确率无法保证,误检率和漏检率会更高。At the same time, the main technical route for the detection of power towers is to use the target detection method in the field of computer vision. Moreover, the method with better results is also the target detection method based on deep learning models, such as the two-stage detection method based on FasterR-CNN and Mask R-CNN and the one-stage target detection method based on YOLO. Among them, the two-stage detection algorithm has high accuracy, but the detection speed is slow, and it is not suitable for real-time inspection by drones; the one-stage target detection algorithm based on regression, such as YOLO and SSD algorithms, has high detection efficiency, but the detection accuracy cannot be guaranteed, and the false detection rate and missed detection rate will be higher.

即便如此,目前面向电力巡检等应用的电力线和电力塔检测方法整体检测准确率都有限,而且都不完全满足高可靠性和高可用性的需求。其原因标记训练数据不足导致的机器学习模型训练不充分问题,也有电力线、电力塔和所处环境的复杂性和多样性导致的传统图像处理方法通用性差等挑战。尤其是,电力巡检属于特定领域问题,其可获取的图像数据比较少,标记的图像数据就更少。因此,数据驱动的机器学习方法虽然理论上效果更好,但是缺乏足够的数据去训练获得高可用的检测模型。此外,现有的方法通常都是单独进行电力线检测或电力塔检测,并没有充分地利用电力传输领域的先验知识,例如电力线和塔架之间的关联结构关系等。Even so, the overall detection accuracy of power line and power tower detection methods currently used for applications such as power inspection is limited, and none of them fully meet the requirements of high reliability and high availability. The reasons for this are insufficient labeled training data, which leads to insufficient training of machine learning models, and the complexity and diversity of power lines, power towers, and the environment in which they are located, which leads to the poor versatility of traditional image processing methods. In particular, power inspection is a field-specific problem, and there is relatively little image data available, and even less labeled image data. Therefore, although data-driven machine learning methods are theoretically more effective, they lack sufficient data to train highly available detection models. In addition, existing methods usually perform power line detection or power tower detection separately, and do not fully utilize prior knowledge in the field of power transmission, such as the associated structural relationship between power lines and towers.

发明内容Summary of the invention

为了克服上述现有技术的缺点,本发明的目的在于提供一种电力塔和电力线关联矫正的电力塔和电力线检测方法,以至少解决图像数据少导致的训练不充分问题,复杂环境下的电力塔与电力线的检测准确性不佳等问题中的至少一个。In order to overcome the shortcomings of the above-mentioned prior art, the purpose of the present invention is to provide a method for detecting power towers and power lines with associated correction of power towers and power lines, so as to at least solve at least one of the problems of insufficient training caused by insufficient image data and poor detection accuracy of power towers and power lines in complex environments.

为了实现上述目的,本发明采用的技术方案是:In order to achieve the above object, the technical solution adopted by the present invention is:

一种电力塔和电力线关联矫正的电力塔和电力线检测方法,包括如下步骤:A method for detecting power towers and power lines for correcting the correlation between power towers and power lines comprises the following steps:

步骤1,从上方拍摄电力塔和电力线的图像,并对所述图像进行灰度化预处理;Step 1, taking an image of a power tower and power lines from above, and performing grayscale preprocessing on the image;

步骤2,对预处理后的图像进行边缘检测,得到二值化的边缘图;Step 2, performing edge detection on the preprocessed image to obtain a binary edge map;

步骤3,利用所述边缘图进行电力线检测,依次包括线段检测、合并线段和平行线组聚类,得到平行线组表示的电力线;Step 3, using the edge map to perform power line detection, including line segment detection, merging line segments and parallel line group clustering in sequence, to obtain power lines represented by the parallel line group;

步骤4,利用所述边缘图进行电力塔检测,得到矩形框框定的电力塔区域;Step 4, using the edge map to detect the power tower, and obtaining the power tower area framed by the rectangular frame;

步骤5,将所述矩形框映射至所述边缘图,排除电力塔矩形框两侧的背景区域,对电力塔矩形框内部区域重新检测电力线;待获得新的电力线检测结果后,由电力线分布区域的左右宽度预估电力塔区域在所述边缘图中的占比,进而更新电力塔检测参数,重新检测电力塔,直至满足要求或达到迭代次数。Step 5, mapping the rectangular frame to the edge map, excluding the background areas on both sides of the rectangular frame of the power tower, and re-detecting the power lines in the area inside the rectangular frame of the power tower; after obtaining the new power line detection results, the proportion of the power tower area in the edge map is estimated by the left and right widths of the power line distribution area, and then the power tower detection parameters are updated, and the power tower is re-detected until the requirements are met or the number of iterations is reached.

在一个实施例中,所述步骤1,拍摄的每张图像中,仅包含一个电力塔目标,并包含电力线;所述预处理包括调整图像分辨率、图像灰度化、直方图均衡化以及去噪;其中在灰度化过程中,仅保留红蓝两色通道生成灰度图。In one embodiment, in step 1, each image taken contains only one power tower target and power lines; the preprocessing includes adjusting image resolution, image grayscale, histogram equalization and denoising; wherein in the grayscale process, only the red and blue channels are retained to generate a grayscale image.

在一个实施例中,所述步骤3,使用概率Hough变换检测出所述边缘图中线段的两个端点;然后计算线段中心点坐标、线段斜率和截距,根据线段几何距离进行分组,分组后用最小二乘法将每个组内的线段拟合为直线并延长至贯穿图像,最后将斜率接近的直线归为平行线组;最后依据斜率对平行线组进行聚类,保留聚类结果中计数最多的直线,过滤与电力线斜率相差大的杂乱直线。In one embodiment, in step 3, the two endpoints of the line segment in the edge map are detected using a probabilistic Hough transform; then the coordinates of the center point of the line segment, the slope of the line segment and the intercept are calculated, and the line segments are grouped according to their geometric distances. After grouping, the line segments in each group are fitted into straight lines using the least squares method and extended to run through the image, and finally the straight lines with similar slopes are grouped as parallel lines; finally, the parallel line groups are clustered according to the slopes, the straight lines with the most counts in the clustering results are retained, and the messy straight lines with large differences in slope from the power lines are filtered out.

在一个实施例中,在得到的平行线组表示的电力线中,由最边缘的两条电力线之间的距离D推测电力塔的宽度,再根据电力塔的长宽比估计电力塔所处区域W,按照电力线检测结果将所述边缘图整体旋转α,使图中的电力塔区域水平,其中α为聚类后得到的线组与垂直方向的夹角。In one embodiment, among the power lines represented by the obtained parallel line group, the width of the power tower is inferred from the distance D between the two outermost power lines, and then the area W where the power tower is located is estimated based on the aspect ratio of the power tower. According to the power line detection result, the edge map is rotated as a whole by α to make the power tower area in the map horizontal, where α is the angle between the line group obtained after clustering and the vertical direction.

在一个实施例中,所述步骤4,采用基于曲率尺度空间的角点检测方法对所述边缘图进行角点检测,获得角点分布图;然后通过像素统计投影将所述角点分布图在水平方向和垂直方向上分别进行积分投影,得到水平方向和垂直方向的投影直方图;再通过中值平滑的方式,将水平方向每个投影值替换成左右各相邻的n个投影取的中值,将垂直方向每个投影值替换成上下各相邻的m个投影取的中值,得到平滑的投影直方图;由电力线区域的宽度和高度分别估计电力塔在所述边缘图中的占比,依据占比分别将水平方向和垂直方向的投影直方图图划分为多个小区域,计算每个小区域与相邻区域的落差,落差最大的区域分别存在电力塔的左右边界和上下边界。In one embodiment, in step 4, a corner point detection method based on curvature scale space is used to perform corner point detection on the edge map to obtain a corner point distribution map; then, the corner point distribution map is integrally projected in the horizontal and vertical directions by pixel statistical projection to obtain projection histograms in the horizontal and vertical directions; and each projection value in the horizontal direction is replaced by the median of the n adjacent projections on the left and right, and each projection value in the vertical direction is replaced by the median of the m adjacent projections on the top and bottom to obtain a smoothed projection histogram by median smoothing; the proportion of the power tower in the edge map is estimated by the width and height of the power line area, and the projection histograms in the horizontal and vertical directions are divided into multiple small areas according to the proportion, and the height difference between each small area and the adjacent area is calculated, and the areas with the largest height difference have the left and right boundaries and the upper and lower boundaries of the power tower.

在一个实施例中,所述更新电力塔检测参数,是更新所述小区域的划分个数。In one embodiment, the updating of the power tower detection parameters is to update the number of divisions of the small area.

在一个实施例中,所述步骤5,电力塔迭代检测过程中的结果变化程度使用IoU作为评价指标,并根据IoU决定迭代的次数;所述IoU是两个区域重叠的部分除以两个区域的集合部分得出的结果,用来衡量两次电力塔检测结果的重叠程度;当IoU大于设定的阈值t时,认为两次检测结果一致,输出当前结果为最终结果,结束任务;当IoU小于等于阈值t时,继续进行下一轮迭代检测,如果迭代次数超过给定的最大迭代次数则强制结束任务,输出最后一轮的检测结果。In one embodiment, in step 5, the degree of change of the results during the iterative detection of power towers uses IoU as an evaluation indicator, and the number of iterations is determined based on IoU; the IoU is the result obtained by dividing the overlapping part of two areas by the collective part of the two areas, and is used to measure the degree of overlap of two power tower detection results; when IoU is greater than a set threshold t, the two detection results are considered to be consistent, the current result is output as the final result, and the task is terminated; when IoU is less than or equal to the threshold t, the next round of iterative detection is continued. If the number of iterations exceeds the given maximum number of iterations, the task is forced to end and the detection result of the last round is output.

本发明还提供了一种电力塔和电力线关联矫正的电力塔和电力线检测系统,包括:The present invention also provides a power tower and power line detection system for power tower and power line correlation correction, comprising:

预处理模块,对从上方的拍摄电力塔和电力线的图像进行灰度化预处理;A pre-processing module performs grayscale pre-processing on the images of power towers and power lines taken from above;

边缘检测模块,对预处理后的图像进行边缘检测,得到二值化的边缘图;The edge detection module performs edge detection on the preprocessed image to obtain a binary edge map;

电力线检测模块,利用所述边缘图进行电力线检测,依次包括线段检测、合并线段和平行线组聚类,得到平行线组表示的电力线;A power line detection module, which uses the edge map to perform power line detection, including line segment detection, line segment merging and parallel line group clustering in sequence, to obtain power lines represented by parallel line groups;

电力塔检测模块,利用所述边缘图进行电力塔检测,得到矩形框框定的电力塔区域;A power tower detection module, which uses the edge map to detect power towers and obtains a power tower area defined by a rectangular frame;

关联矫正模块,将所述矩形框映射至所述边缘图,排除电力塔矩形框两侧的背景区域,对电力塔矩形框内部区域重新检测电力线;待获得新的电力线检测结果后,由电力线分布区域的左右宽度预估电力塔区域在所述边缘图中的占比,进而更新电力塔检测参数,重新检测电力塔,直至满足要求或达到迭代次数。The associated correction module maps the rectangular box to the edge map, excludes the background areas on both sides of the rectangular box of the power tower, and re-detects the power lines in the area inside the rectangular box of the power tower; after obtaining the new power line detection results, the proportion of the power tower area in the edge map is estimated by the left and right widths of the power line distribution area, and then the power tower detection parameters are updated, and the power tower is re-detected until the requirements are met or the number of iterations is reached.

在一个实施例中,所述检测系统部署于无人机嵌入式平台,为无人机飞行控制程序提供对电力塔和电力线位置的检测和定位功能;所述电力塔和电力线的图像由所述无人机拍摄获取。In one embodiment, the detection system is deployed on a drone embedded platform to provide the drone flight control program with detection and positioning functions for the positions of power towers and power lines; the images of the power towers and power lines are captured by the drone.

与现有技术对电力线和电力塔独立检测的方法相比,本发明不依赖大规模数据集,检测速度更快,并且将电力线和电力塔检测结果进行关联矫正,检测效果更好。Compared with the prior art method of independently detecting power lines and power towers, the present invention does not rely on large-scale data sets, has a faster detection speed, and correlates and corrects the detection results of power lines and power towers, resulting in better detection effects.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1是本发明检测算法流程图。FIG. 1 is a flow chart of the detection algorithm of the present invention.

图2是本发明聚类后图像中的电力塔和电力线示意图。FIG. 2 is a schematic diagram of power towers and power lines in an image after clustering according to the present invention.

图3是本发明进行矫正之后得到的电力塔区域示意图。FIG3 is a schematic diagram of the power tower area obtained after correction by the present invention.

图4是本发明角点投影示意图。FIG. 4 is a schematic diagram of corner point projection of the present invention.

图5是本发明排除电力塔区域两侧的区域重新检测的电力线示意图。FIG. 5 is a schematic diagram of power lines re-detected excluding areas on both sides of the power tower area according to the present invention.

图6是本发明IOU(交并比)的计算方法得到的检测区域,其中左图为交集,右图为并集。FIG6 is a detection area obtained by the IOU (intersection over union) calculation method of the present invention, wherein the left figure is the intersection and the right figure is the union.

具体实施方式DETAILED DESCRIPTION

下面结合附图和实施例详细说明本发明的实施方式。The embodiments of the present invention are described in detail below with reference to the accompanying drawings and examples.

传统的目标检测方法一方面面临数据少的问题,另一方面在复杂环境下检测准确性仍不高。为此,本发明提供了一种电力塔和电力线检测方法,采用图像处理路线,以有效应对图像数据少的挑战,同时,通过电力线和塔架的关联检测,能更好地应对复杂环境下的电力塔与电力线的检测准确性问题。Traditional target detection methods face the problem of insufficient data on the one hand, and the detection accuracy is still low in complex environments on the other hand. To this end, the present invention provides a power tower and power line detection method, which adopts an image processing route to effectively cope with the challenge of insufficient image data. At the same time, through the associated detection of power lines and towers, it can better cope with the detection accuracy problem of power towers and power lines in complex environments.

本发明电力塔和电力线检测目标是要检测出画面中的电力塔和电力线,其中电力塔用其外围的矩形框框定,电力线则是用直线标注。按照该发明的主要处理流程,参考图1,主要包括如下步骤:The power tower and power line detection of the present invention aims to detect the power tower and power line in the picture, wherein the power tower is framed by a rectangular frame around it, and the power line is marked by a straight line. According to the main processing flow of the present invention, referring to FIG1, it mainly includes the following steps:

步骤1,拍摄电力塔和电力线的图像,并对得到的图像进行必要的预处理,预处理至少应该包括灰度化。一般来说,图像应从电力塔和电力线的上方拍摄。Step 1, take images of power towers and power lines, and perform necessary preprocessing on the obtained images, which should at least include grayscale conversion. Generally speaking, the images should be taken from above the power towers and power lines.

步骤2,对预处理后的图像进行边缘检测,得到二值化的边缘图。Step 2: Perform edge detection on the preprocessed image to obtain a binary edge map.

步骤3,利用所述边缘图进行电力线检测,依次包括线段检测、合并线段和平行线组聚类,得到平行线组表示的电力线。即,检测到线段两端,然后拟合为直线,并按照斜率相似程度进行聚类。Step 3, using the edge map to perform power line detection, including line segment detection, merging line segments and clustering parallel line groups in sequence, to obtain power lines represented by parallel line groups. That is, the two ends of the line segment are detected, then fitted into a straight line, and clustered according to the similarity of the slope.

步骤4,利用所述边缘图进行电力塔检测,得到矩形框框定的电力塔区域。Step 4: Use the edge map to detect the power tower and obtain the power tower area defined by the rectangular frame.

步骤5,将所述矩形框映射至所述边缘图,排除电力塔矩形框两侧的背景区域,对电力塔矩形框内部区域重新检测电力线;待获得新的电力线检测结果后,由电力线分布区域的左右宽度预估电力塔区域在所述边缘图中的占比,进而更新电力塔检测参数,重新检测电力塔,直至满足要求或达到迭代次数。Step 5, mapping the rectangular frame to the edge map, excluding the background areas on both sides of the rectangular frame of the power tower, and re-detecting the power lines in the area inside the rectangular frame of the power tower; after obtaining the new power line detection results, the proportion of the power tower area in the edge map is estimated by the left and right widths of the power line distribution area, and then the power tower detection parameters are updated, and the power tower is re-detected until the requirements are met or the number of iterations is reached.

其中步骤3的电力线检测、步骤4的电力塔检测和步骤5的关联矫正是迭代进行的,如图1所示。The power line detection in step 3, the power tower detection in step 4, and the associated correction in step 5 are performed iteratively, as shown in FIG1 .

本发明的方法主要根据以上方法,本发明首先利用更加高效的传统图像处理方法来实现电力线和电力塔的初始检测;然后利用电力线和电力塔之间的关联关系等电力领域知识,实现线检测和塔架检测逐步迭代的有机融合和相互矫正。最终,同时或至少克服了上述的两个问题之一。The method of the present invention is mainly based on the above method. The present invention first uses a more efficient traditional image processing method to achieve the initial detection of power lines and power towers; then uses the power field knowledge such as the relationship between power lines and power towers to achieve the organic integration and mutual correction of line detection and tower detection in a step-by-step iterative manner. Finally, the above two problems are overcome at the same time or at least one of them is overcome.

与之相应地,本发明提供了一种电力塔和电力线关联矫正的电力塔和电力线检测系统,包括:预处理模块、边缘检测模块、电力线检测模块、电力塔检测模块和关联矫正模块。分别执行上述的步骤1~步骤5,在以下的描述中,预处理模块的执行内容与步骤1一致,边缘检测模块的执行内容与步骤2一致,电力线检测模块的执行内容与步骤3一致,电力塔检测模块的执行内容与步骤4一致,关联矫正模块的执行内容与步骤5一致。Correspondingly, the present invention provides a power tower and power line detection system for power tower and power line association correction, comprising: a preprocessing module, an edge detection module, a power line detection module, a power tower detection module and an association correction module. The above steps 1 to 5 are respectively executed. In the following description, the execution content of the preprocessing module is consistent with step 1, the execution content of the edge detection module is consistent with step 2, the execution content of the power line detection module is consistent with step 3, the execution content of the power tower detection module is consistent with step 4, and the execution content of the association correction module is consistent with step 5.

本发明具体可用于无人机电力巡检采集的图像画面中的电力塔和电力线检测,即,将所述的检测方法或者检测系统部署于无人机嵌入式平台,为无人机飞行控制程序提供对电力塔和电力线位置的检测和定位功能。本发明所述的无人机电力巡检场景为:无人机携带摄像头飞至电力塔和电力线上方后,按照俯视角拍摄下方的电力塔和电力线;考虑到长距离电力输送场景下,电力塔之间的距离非常远,在本发明所述的在无人机视野中,仅包含一个塔架目标,也即,所拍摄的每张图像中,仅包含一个电力塔目标,同时应包含电力线。以下以各模块执行内容为例,对本发明进行详细描述。The present invention can be specifically used for the detection of power towers and power lines in the image pictures collected by unmanned aerial vehicle power inspections, that is, the detection method or detection system is deployed on a drone embedded platform to provide the drone flight control program with the function of detecting and locating the positions of power towers and power lines. The unmanned aerial vehicle power inspection scenario described in the present invention is: after the unmanned aerial vehicle carries a camera and flies above the power towers and power lines, it shoots the power towers and power lines below from a bird's-eye view; considering that the distance between power towers is very far in the long-distance power transmission scenario, the drone field of view described in the present invention only includes one tower target, that is, each image taken includes only one power tower target, and power lines should also be included. The following is a detailed description of the present invention taking the execution content of each module as an example.

1、预处理模块(执行步骤1)1. Preprocessing module (execute step 1)

预处理模块的功能包括调整图像分辨率、图像灰度化、直方图均衡化以及去噪。预处理模块接收无人机拍摄的视频数据,将视频分解为单帧图像进行预处理。通常无人机镜头拍摄的图像为高分辨率的彩色RGB图像,直接处理速度较慢,因此先按照一定比例进行缩放,调整至便于处理的分辨率。The functions of the preprocessing module include adjusting image resolution, graying, histogram equalization, and denoising. The preprocessing module receives video data shot by the drone and decomposes the video into single-frame images for preprocessing. Usually, the images shot by the drone lens are high-resolution color RGB images, which are slow to process directly. Therefore, they are first scaled according to a certain ratio and adjusted to a resolution that is easy to process.

图像灰度化过程中,首先要将RGB图像的三通道进行分离。无人机航拍图像通常是以地面为背景,主要内容包括绿色的植被、黄色的土地、蓝绿色的水域和正常光照条件下呈银白色的电力线。电力线的银白色的颜色组成为RGB(192,192,192),相比背景色包含更多的蓝(B)原色信息。为了排除地面复杂环境对电力线提取的影响,本发明只保留红蓝两色通道生成灰度图即可。In the process of image grayscale conversion, the three channels of the RGB image must first be separated. UAV aerial images are usually based on the ground as the background, and the main content includes green vegetation, yellow land, blue-green waters, and silvery-white power lines under normal lighting conditions. The silvery-white color composition of the power line is RGB (192, 192, 192), which contains more blue (B) primary color information than the background color. In order to eliminate the influence of the complex ground environment on the extraction of power lines, the present invention only retains the red and blue channels to generate a grayscale image.

由于电力线检测是于室外进行,因为环境或光线变化,会引起曝光过度或曝光不足,这样会导致得到的图像整体偏暗,也可能目标直线在图像中对比度不同,影响后期图像分割及电力线提取。因此在处理数字图像过程中利用灰度直方图统计不同灰度级像素出现的次数,该直方图横坐标为0-255个灰度级,纵坐标为不同灰度级像素在图像中出现的个数,图像的灰度直方图可以用来观测该图像的灰度分布状态。直方图均衡化即对图像进行非线性拉伸,重新分配图像中的像元值,以达到在一定区域内像元值数量大致相等的目的。因为在一张图像中当灰度值分布更加均衡时,图像中所包含的信息量越大,即通过直方图均衡化得到的结果颜色层次更加分明,图像中的线性特征也更加具有辨识度。Since the power line detection is carried out outdoors, the environment or light changes may cause overexposure or underexposure, which will cause the overall dark image. It is also possible that the contrast of the target straight line in the image is different, which will affect the later image segmentation and power line extraction. Therefore, in the process of processing digital images, the grayscale histogram is used to count the number of occurrences of pixels with different grayscale levels. The horizontal axis of the histogram is 0-255 grayscale levels, and the vertical axis is the number of pixels with different grayscale levels appearing in the image. The grayscale histogram of the image can be used to observe the grayscale distribution state of the image. Histogram equalization is to stretch the image nonlinearly and redistribute the pixel values in the image to achieve the purpose of roughly equalizing the number of pixel values in a certain area. Because in an image, when the grayscale value distribution is more balanced, the amount of information contained in the image is greater, that is, the color level of the result obtained by histogram equalization is clearer, and the linear features in the image are more recognizable.

随后使用高斯滤波等方式对图像进行平滑处理。高斯滤波是一种线性平滑滤波,适用于消除高斯噪声,广泛应用于图像处理的减噪过程。通俗地讲,高斯滤波就是对整幅图像进行加权平均的过程,对每一个像素点的值,用模板进行卷积计算,尔后用加权平均计算的值代替模板中心的值。The image is then smoothed using methods such as Gaussian filtering. Gaussian filtering is a linear smoothing filter that is suitable for eliminating Gaussian noise and is widely used in the noise reduction process of image processing. In layman's terms, Gaussian filtering is the process of weighted averaging the entire image. For each pixel value, the template is convolved and then the value of the template center is replaced by the value calculated by the weighted average.

2、边缘检测模块(执行步骤2)2. Edge detection module (execute step 2)

边缘检测是一种基于灰度不连续性的并行边界分割技术,是所有基于边界分割方法的第一步。边缘是目标和背景的分界,边缘提取是将目标和背景区分开的重要步骤。一般意义上,边缘检测方法利用背景和目标在颜色、纹理、灰度等特征上的差异来实现。检测边缘计算一般用一阶或二阶导数来完成,但在实际的数字图像中求导是利用差分运算近似代替微分运算。图像中处于边缘两侧的点,其灰度值发生突变,所以这些点将具有较大的微分值,当微分的方向和边界垂直时,微分值最大。根据这种特点即可获得图像边缘。本模块使用的是Canny算子,包括以下步骤:Edge detection is a parallel boundary segmentation technology based on grayscale discontinuity, and is the first step of all boundary segmentation methods. The edge is the boundary between the target and the background, and edge extraction is an important step to distinguish the target from the background. In general, edge detection methods use the differences in color, texture, grayscale and other features between the background and the target to achieve it. Edge detection calculations are generally completed using first-order or second-order derivatives, but in actual digital images, derivatives are approximated by differential operations instead of differential operations. The grayscale values of points on both sides of the edge of the image change suddenly, so these points will have larger differential values. When the direction of the differential is perpendicular to the boundary, the differential value is the largest. Based on this feature, the edge of the image can be obtained. This module uses the Canny operator, which includes the following steps:

1)梯度和方向计算:利用Sobel算子计算每个像素点的梯度和方向。1) Gradient and direction calculation: Use the Sobel operator to calculate the gradient and direction of each pixel.

2)非极大值抑制:消除边缘检测带来的杂散响应。2) Non-maximum suppression: eliminates spurious responses caused by edge detection.

3)双阈值:检测真正和潜在的边缘。3) Double threshold: detect real and potential edges.

4)滞后技术:通过抑制弱边缘来完成边缘检测跟踪边界。4) Hysteresis technique: edge detection and tracking boundaries are completed by suppressing weak edges.

边缘检测有两个作用:电力线图像的边缘是电力线的重要特征,边缘检测是电力线检测的必要步骤;此外,提取图像的边缘后,对边缘进行填充、延伸和平滑处理,就可以根据边缘上像素点的变化率进行角点检测,进而进行电力塔检测。Edge detection has two functions: the edge of the power line image is an important feature of the power line, and edge detection is a necessary step in power line detection; in addition, after extracting the edge of the image, the edge is filled, extended and smoothed, and corner detection can be performed based on the rate of change of pixels on the edge, thereby performing power tower detection.

3、电力线检测模块(执行步骤3)3. Power line detection module (execute step 3)

该模块的输入是边缘检测后得到的二值化的边缘图。电力线检测的步骤主要包括线段检测、合并线段、平行线组聚类。The input of this module is the binary edge map obtained after edge detection. The steps of power line detection mainly include line segment detection, line segment merging, and parallel line group clustering.

1)线段检测采用了概率Hough变换。Hough变换是图像处理中的一种特征提取技术,它通过一种投票算法检测具有特定形状的物体。该过程在一个参数空间中通过计算累计结果的局部最大值得到一个符合该特定形状的集合作为Hough变换结果,是检测图像中线段的常用方法。标准Hough变换本质上是把图像映射到它的参数空间上,它需要计算所有的M个边缘点,这样它的运算量和所需内存空间都会很大。如果在输入图像中只是处理m(m<M)个边缘点,则这m个边缘点的选取是具有一定概率性的,这就是概率Hough变换。在实际无人机拍摄图像中的电力线通常不会显示为清晰、连续的长直线,而是许多较短的断裂线段,而概率Hough变换一个重要的特点就是能够检测出图像中线段的两个端点,确切地定位图像中的直线。因此本发明使用概率Hough变换在传统直线检测算法的基础上结合距离度量完成直线的分组和合并,即检测出边缘图中线段的两个端点,从而能够将断裂线段拟合为一条直线,提高电力线检测的完整性。1) Line segment detection uses probabilistic Hough transform. Hough transform is a feature extraction technology in image processing. It detects objects with specific shapes through a voting algorithm. This process calculates the local maximum of the cumulative results in a parameter space to obtain a set that conforms to the specific shape as the Hough transform result. It is a common method for detecting line segments in images. The standard Hough transform essentially maps the image to its parameter space. It needs to calculate all M edge points, so its computational complexity and required memory space will be very large. If only m (m<M) edge points are processed in the input image, the selection of these m edge points is probabilistic, which is the probabilistic Hough transform. In actual drone images, power lines are usually not displayed as clear, continuous long straight lines, but as many shorter broken line segments. An important feature of the probabilistic Hough transform is that it can detect the two endpoints of the line segment in the image and accurately locate the straight line in the image. Therefore, the present invention uses probabilistic Hough transform combined with distance measurement on the basis of traditional line detection algorithm to complete the grouping and merging of lines, that is, to detect the two endpoints of the line segment in the edge map, so that the broken line segment can be fitted into a straight line, thereby improving the integrity of power line detection.

2)合并线段:通过概率Hough变换获取线段端点坐标后,计算线段中心点坐标、线段斜率和截距,根据线段几何距离进行分组。分组后用最小二乘法将每个组内的线段拟合为直线,并将拟合直线延长至贯穿图像,最后将斜率接近的直线归为平行线组。2) Merge line segments: After obtaining the coordinates of the line segment endpoints through probabilistic Hough transform, calculate the coordinates of the line segment center point, the line segment slope and intercept, and group the line segments according to their geometric distance. After grouping, use the least squares method to fit the line segments in each group into straight lines, and extend the fitted straight lines to run through the image. Finally, the straight lines with similar slopes are grouped as parallel lines.

3)平行线组聚类:在无人机拍摄的图像中,电力线通常呈现出以下特征:近似为直线、具有一定范围的倾斜角度、电力线之间近似平行、贯穿整幅图像、垂直穿过电力塔区域。因此依据斜率对平行线组进行聚类,保留聚类结果中计数最多的直线,可以过滤与电力线斜率相差较大的杂乱直线。3) Clustering of parallel line groups: In images taken by drones, power lines usually present the following characteristics: approximately straight lines, with a certain range of inclination angles, approximately parallel to each other, running through the entire image, and vertically passing through the power tower area. Therefore, clustering parallel line groups based on slopes and retaining the straight lines with the most counts in the clustering results can filter out messy straight lines with large differences in slope from the power lines.

本发明的实施例中,平行线组聚类采用了K-means++算法。K-means是常用的基于欧式距离的聚类算法,其认为两个目标的距离越近,相似度越大,K-means++算法则对初始聚类中心的选择进行了优化。聚类过程大致为:i)先从样本集(平线线组集合,每个样本是一个平线线组)中随机选取K个样本(K个不同斜率的平行线组)作为簇中心,并计算所有样本与这K个“簇中心”的距离;ii)对于每一个样本,将其划分到与其距离最近的“簇中心”所在的簇中,对于新的簇计算各个簇的新的“簇中心”;iii)重复以上过程直至“簇中心”没有移动。In an embodiment of the present invention, the K-means++ algorithm is used for clustering of parallel line groups. K-means is a commonly used clustering algorithm based on Euclidean distance. It believes that the closer the distance between two targets, the greater the similarity. The K-means++ algorithm optimizes the selection of the initial cluster center. The clustering process is roughly as follows: i) first randomly select K samples (K parallel line groups with different slopes) from the sample set (a set of parallel line groups, each sample is a parallel line group) as cluster centers, and calculate the distances between all samples and these K "cluster centers"; ii) for each sample, divide it into the cluster with the "cluster center" closest to it, and calculate the new "cluster center" of each cluster for the new cluster; iii) repeat the above process until the "cluster center" does not move.

如图2所示,在聚类后,计算检测到的电力线组与垂直方向的夹角α用于图像矫正,同时根据电力线分布区域即可以预估电力塔区域的位置和大小。具体如图3所示,在得到的平行线组表示的电力线中,由最边缘的两条电力线之间的距离D可以推测电力塔的宽度,再根据电力塔的长宽比估计电力塔所处区域W。之所以在电力塔检测之前要对图像进行矫正,是因为目标检测任务中通常使用水平边界框来表示图像中目标的大致范围,而无人机图像中的物体通常是任意方向的,使用水平边界框来检测目标会导致这种类型的物体检测框包含许多背景区域,并且无法反映目标对象的尺寸和纵横比。这不仅增加了检测任务的难度,而且会导致目标范围表示不准确。As shown in Figure 2, after clustering, the angle α between the detected power line group and the vertical direction is calculated for image correction, and the position and size of the power tower area can be estimated based on the power line distribution area. Specifically, as shown in Figure 3, among the power lines represented by the obtained parallel line group, the width of the power tower can be inferred from the distance D between the two outermost power lines, and then the area W where the power tower is located can be estimated based on the aspect ratio of the power tower. The reason why the image needs to be corrected before power tower detection is that horizontal bounding boxes are usually used in target detection tasks to represent the approximate range of targets in the image, while objects in drone images are usually in any direction. Using horizontal bounding boxes to detect targets will cause this type of object detection box to contain many background areas and cannot reflect the size and aspect ratio of the target object. This not only increases the difficulty of the detection task, but also leads to inaccurate representation of the target range.

根据电力塔和电力线的结构,多条电力线会垂直穿过一个电力塔区域,而电力塔在无人航拍图像中不会密集分布,图像中只有一个电力塔区域。因此本发明利用这一特征按照电力线检测结果将边缘图整体旋转α,可以使图中的电力塔区域水平,使后续的电力塔检测更加精确。According to the structure of power towers and power lines, multiple power lines will vertically pass through a power tower area, while power towers are not densely distributed in unmanned aerial images, and there is only one power tower area in the image. Therefore, the present invention uses this feature to rotate the edge map as a whole by α according to the power line detection result, so that the power tower area in the image can be horizontal, making the subsequent power tower detection more accurate.

4、电力塔检测模块(执行步骤4)4. Power tower detection module (execute step 4)

电力塔检测模块的输入是边缘检测模块得到的边缘图,该模块对边缘图采用角点检测(如Curvature Scale Space Corner Detection,CSS角点检测方法)获得角点分布图后,再对角点进行水平垂直投影进行阈值判断来确定上下左右边界。其基本原理是电力塔内部存在着复杂的横竖交错的钢架结构,塔架内部的边缘和角点密度明显大于背景区域。因此,可以利用这一特点来实现塔架区域和背景区域的区分。The input of the power tower detection module is the edge map obtained by the edge detection module. This module uses corner detection (such as Curvature Scale Space Corner Detection, CSS corner detection method) on the edge map to obtain the corner distribution map, and then performs threshold judgment on the horizontal and vertical projections of the corners to determine the upper, lower, left and right boundaries. The basic principle is that there is a complex horizontal and vertical staggered steel frame structure inside the power tower, and the edge and corner density inside the tower is significantly greater than the background area. Therefore, this feature can be used to distinguish the tower area from the background area.

事实上,大多数已有的方法会直接使用边缘信息进行边缘点密度分布的统计来进行电力塔检测。但是,这种方法存在一些不足,例如,最常用的Canny边缘检测算子的高、低阈值的选择并不是根据图像特性来进行设定,而是依靠先验经验进行阈值设定。在边缘检测过程如果高、低阈值设定较大,就会造成图像边缘细节遗失较多,从而得到检测边缘间断的结果。而如果高、低阈值设定较小,那么就会造成误检边缘的出现。In fact, most existing methods directly use edge information to perform statistics on the density distribution of edge points for power tower detection. However, this method has some shortcomings. For example, the selection of high and low thresholds of the most commonly used Canny edge detection operator is not set according to image characteristics, but relies on prior experience to set the threshold. If the high and low thresholds are set large during the edge detection process, more image edge details will be lost, resulting in discontinuous edge detection results. If the high and low thresholds are set small, false edge detection will occur.

因此,在本发明中,针对电力塔内部结构,在边缘检测的基础上进一步进行基于曲率尺度空间的角点检测,即,Curvature Scale Space Corner Detection,CSS角点检测算法。算法的步骤如下:首先,利用Canny边缘检测算子等方法提取的图像轮廓,填充二值化边缘轮廓中的缺口;其次,填充后在大尺度下计算轮廓上每个像素点的曲率,如果超过阈值判定为候选角点;最后,在小尺度下追踪候选角点集中的每一像素点,精确定位角点的位置。Therefore, in the present invention, for the internal structure of the power tower, on the basis of edge detection, further corner detection based on curvature scale space is performed, that is, Curvature Scale Space Corner Detection, CSS corner detection algorithm. The steps of the algorithm are as follows: first, the image contour extracted by the Canny edge detection operator and other methods is used to fill the gaps in the binary edge contour; second, after filling, the curvature of each pixel on the contour is calculated at a large scale, and if it exceeds the threshold, it is determined as a candidate corner point; finally, each pixel in the candidate corner point set is tracked at a small scale to accurately locate the position of the corner point.

在获得了图像的角点分布图之后,通过像素统计投影将角点分布图在水平方向上进行投影,得到水平方向的投影直方图。在该投影直方图中,投影的高度便表示了水平方向上的边缘密度,边缘密度大的位置投影高度较高。与此同时,通过中值平滑的方式,将水平方向每个投影值替换成左右各相邻的n个投影取的中值来消除噪声。该平滑过程主要是为了去除图像中孤立的噪声点,同时较好地保留图像的细节。这样就得到了如图4所示,较为平滑的投影直方图。在该投影直方图中,电力塔内部投影柱的高度远大于背景区域,电力塔边缘会有明显的波峰。由电力线区域的宽度可以估计电力塔在边缘图中的占比,依据占比将投影直方图划分为多个小区域,计算每个小区域与相邻区域的落差,落差最大的区域就存在电力塔的左右边界。同理,对垂直方向进行投影可以垂直方向的投影直方图,进而确定电力塔的上下边界。即,通过像素统计投影将角点分布图在垂直方向上进行积分投影,得到垂直方向的投影直方图;再通过中值平滑的方式,将垂直方向每个投影值替换成上下各相邻的m个投影取的中值,得到平滑的投影直方图;由电力线区域的高度估计电力塔在所述边缘图中的占比,依据占比将垂直方向的投影直方图图划分为多个小区域,计算每个小区域与相邻区域的落差,落差最大的区域存在电力塔的上下边界。After obtaining the corner distribution map of the image, the corner distribution map is projected in the horizontal direction by pixel statistical projection to obtain the projection histogram in the horizontal direction. In the projection histogram, the height of the projection represents the edge density in the horizontal direction, and the projection height is higher at the position with large edge density. At the same time, each projection value in the horizontal direction is replaced by the median of the n adjacent projections on the left and right to eliminate noise by median smoothing. The smoothing process is mainly to remove isolated noise points in the image while better retaining the details of the image. In this way, a relatively smooth projection histogram as shown in Figure 4 is obtained. In the projection histogram, the height of the projection column inside the power tower is much greater than the background area, and there will be obvious peaks at the edge of the power tower. The proportion of the power tower in the edge map can be estimated by the width of the power line area. The projection histogram is divided into multiple small areas according to the proportion, and the drop between each small area and the adjacent area is calculated. The area with the largest drop has the left and right boundaries of the power tower. Similarly, the projection histogram in the vertical direction can be projected in the vertical direction to determine the upper and lower boundaries of the power tower. That is, the corner point distribution map is integrally projected in the vertical direction through pixel statistical projection to obtain a projection histogram in the vertical direction; then each projection value in the vertical direction is replaced by the median of the m adjacent projections above and below through median smoothing to obtain a smoothed projection histogram; the proportion of the power tower in the edge map is estimated by the height of the power line area, and the projection histogram in the vertical direction is divided into multiple small areas according to the proportion, and the height difference between each small area and the adjacent area is calculated. The upper and lower boundaries of the power tower exist in the area with the largest height difference.

5、关联矫正模块(执行步骤5)5. Association correction module (execute step 5)

前述模块完成对电力线和电力塔的初次检测后,可以获得平行线组表示的电力线和矩形框框定的电力塔区域。接下来,关联交证模块依据电力塔和电力线的空间结构关联关系进行迭代更新(即迭代执行步骤3、步骤4和步骤5),矫正电力线和电力塔的检测结果。After the above modules complete the initial detection of power lines and power towers, the power lines represented by the parallel line group and the power tower area framed by the rectangular frame can be obtained. Next, the association verification module performs iterative updates (i.e., iterative execution of steps 3, 4, and 5) based on the spatial structural association relationship between the power towers and power lines to correct the detection results of the power lines and power towers.

具体而言,首先将表示电力塔检测结果的矩形框映射至边缘图,排除电力塔矩形框区域两侧的背景区域,对电力塔矩形区域内部区域重新检测电力线,采用的方法与初次检测相同。其次,待获得新的电力线检测结果后,由电力线分布区域的左右宽度预估电力塔区域在图像中的占比,进而更新电力塔检测模块的参数(即电力塔检测模块中的小区域划分个数),重新使用直方图投影法检测电力塔。Specifically, the rectangular box representing the power tower detection result is first mapped to the edge map, the background area on both sides of the power tower rectangular box area is excluded, and the power lines are re-detected in the inner area of the power tower rectangular area, using the same method as the initial detection. Secondly, after obtaining the new power line detection results, the proportion of the power tower area in the image is estimated by the left and right widths of the power line distribution area, and then the parameters of the power tower detection module (that is, the number of small area divisions in the power tower detection module) are updated, and the histogram projection method is used again to detect the power tower.

电力塔迭代检测过程中的结果变化程度使用IoU(Intersection over Union)作为评价指标,并根据IoU决定迭代的次数。IoU是两个区域重叠的部分除以两个区域的集合部分得出的结果,用来衡量两次电力塔检测结果的重叠程度。当IoU大于设定的阈值t时,认为两次检测结果一致,输出当前结果为最终结果,结束任务;当IoU小于等于阈值t时,继续进行下一轮迭代检测,如果迭代次数超过给定的最大迭代次数也强制结束任务,输出最后一轮的检测结果。The degree of change in the results during the iterative detection of power towers uses IoU (Intersection over Union) as an evaluation indicator, and the number of iterations is determined based on IoU. IoU is the result of dividing the overlapping part of two areas by the collective part of the two areas, and is used to measure the degree of overlap of two power tower detection results. When IoU is greater than the set threshold t, the two detection results are considered to be consistent, the current result is output as the final result, and the task is terminated; when IoU is less than or equal to the threshold t, the next round of iterative detection continues. If the number of iterations exceeds the given maximum number of iterations, the task is forced to end and the last round of detection results is output.

下面介绍本检测算法的一次工作流程。此流程为一台小型无人机实时传输画面,算法自动检测电力塔与电力线。The following is a workflow of the detection algorithm. This workflow is a small drone transmitting images in real time, and the algorithm automatically detects power towers and power lines.

首先无人机启动,摄像头与激光雷达开启,悬停在电力塔附近的上空,并拍摄了分辨率为1600×1200像素的图像。接收无人机传输的图像后,预处理模块根据比例将图像缩放至800×600分辨率以便于后续处理。缩放后,将图像RGB三通道分离,提取红蓝通道生成灰度图。对灰度图使用高斯滤波进行去噪。二维高斯函数公式如下:First, the drone was started, the camera and lidar were turned on, and it hovered over the power tower and took images with a resolution of 1600×1200 pixels. After receiving the image transmitted by the drone, the preprocessing module scaled the image to 800×600 resolution according to the ratio for subsequent processing. After scaling, the three RGB channels of the image were separated, and the red and blue channels were extracted to generate a grayscale image. The grayscale image was denoised using Gaussian filtering. The two-dimensional Gaussian function formula is as follows:

二维高斯分布:Two-dimensional Gaussian distribution:

Figure BDA0003981638870000131
Figure BDA0003981638870000131

式中,δ为高斯分布参数,可由滤波核大小计算得到,使用3*3模板对图像进行滤波。In the formula, δ is the Gaussian distribution parameter, which can be calculated from the filter kernel size, and the image is filtered using a 3*3 template.

经过预处理的灰度图像输入至边缘检测模块,使用Canny算法进行边缘检测,检测识别出图像中亮度变化剧烈的像素点构成的集合。Canny算法使用的是Sobel算子。The preprocessed grayscale image is input to the edge detection module, and the Canny algorithm is used for edge detection to detect and identify the set of pixels with drastic brightness changes in the image. The Canny algorithm uses the Sobel operator.

计算卷积核的公式:The formula for calculating the convolution kernel is:

Figure BDA0003981638870000132
Figure BDA0003981638870000132

A为原始图像。A is the original image.

图像的每一个像素的横向及纵向灰度值通过以下公式结合,来计算该点灰度的大小:The horizontal and vertical grayscale values of each pixel in the image are combined by the following formula to calculate the grayscale of the point:

G=|Gx|+|Gy|G=| Gx |+| Gy |

边缘检测后,边缘图分别进行电力线检测和电力塔检测。电力线检测使用概率Hough变换检测线段,通过计算线段斜率与相互距离将重复线段删除、合并,并将平行的线段归类。After edge detection, the edge map is used for power line detection and power tower detection. Power line detection uses probabilistic Hough transform to detect line segments, deletes and merges duplicate line segments by calculating the line segment slope and mutual distance, and classifies parallel line segments.

线段检测和合并的算法流程如下:The algorithm flow of line segment detection and merging is as follows:

1)通过概率Hough变换获取线段端点坐标。1) Obtain the coordinates of the line segment endpoints through probabilistic Hough transform.

2)计算线段中心点坐标、线段斜率和截距,并标记状态为UNUSED。2) Calculate the coordinates of the center point of the line segment, the slope and intercept of the line segment, and mark the status as UNUSED.

3)选取端点中纵坐标最小点所在线段作为初始线段Lj,该点到其他线段Li中心点的几何距离为Di3) Select the line segment with the minimum ordinate among the endpoints as the initial line segment L j , and the geometric distance from this point to the center point of other line segments Li is Di.

4)遍历线段集合中状态为UNUSED线段,设定距离阈值为Wθ,若Di<Wθ,则将该线段存入线段组Kj,将该线段状态置为USED,若遍历完所有线段则重新进行步骤2),直至所有线段状态为USED。4) Traverse the UNUSED line segments in the line segment set, set the distance threshold to W θ , if D i <W θ , store the line segment in the line segment group K j , and set the line segment status to USED. If all line segments are traversed, repeat step 2) until all line segments are USED.

5)获取线段组Kj内各线段的端点坐标,通过最小二乘法对线段进行拟合,得到拟合直线后延长至贯穿整幅图像。5) Obtain the endpoint coordinates of each line segment in the line segment group Kj , fit the line segments using the least squares method, and extend the fitted straight line to run through the entire image.

6)依次比较拟合直线的斜率,斜率差值小于阈值Sθ的直线归为平行线组,用平均斜率代表平行线组。6) Compare the slopes of the fitted lines one by one. The lines whose slope difference is less than the threshold S θ are classified as a parallel line group, and the average slope is used to represent the parallel line group.

归类后依据斜率对平行线组进行聚类,排除干扰直线,最终检测出电力线。聚类使用了Kmeans++算法,步骤如下:After classification, the parallel line groups are clustered according to the slope, interfering straight lines are excluded, and finally the power lines are detected. The clustering uses the Kmeans++ algorithm, and the steps are as follows:

1)选取K个平行线组作为初始聚类中心点{C1,C2,C3,…,Ck},即初始聚集的簇心,其中Ci表示第i个平行线组的斜率。1) Select K parallel line groups as the initial cluster center points {C 1 , C 2 , C 3 ,…, C k }, that is, the initial cluster center, where Ci represents the slope of the i-th parallel line group.

2)分别计算每个平行线组表示的样本点Xi到K个簇心的欧式距离,找到离该点最近的簇心,将它归属到对应的簇,欧氏距离的计算如下:2) Calculate the Euclidean distance from each sample point Xi to the K cluster centers represented by each parallel line group, find the cluster center closest to the point, and assign it to the corresponding cluster. The calculation of the Euclidean distance is as follows:

Figure BDA0003981638870000141
Figure BDA0003981638870000141

3)所有点都归属到簇之后,所有的M个样本点(平行线组)就分为了K个簇{S1,S2,S3,…,Sk}。之后重新计算每个簇的重心(平均距离中心),将其定为新的“簇中心”,“簇中心”的计算如下:3) After all points are assigned to clusters, all M sample points (parallel line groups) are divided into K clusters {S 1 ,S 2 ,S 3, …,S k }. Then recalculate the centroid (average distance center) of each cluster and set it as the new "cluster center". The calculation of the "cluster center" is as follows:

Figure BDA0003981638870000142
Figure BDA0003981638870000142

4)反复迭代2-3步骤,直到“簇中心”不再变化。4) Repeat steps 2-3 until the “cluster center” no longer changes.

理论上来说,在无人机拍摄的画面中,属于电力线的线段数是最多的,而且这些线段的斜率几乎一样。所以,通过上述的聚类过程,最后得到的线段数最多的聚类应该就是对应电力线的线段集合。接下来,在上述的所有簇中选择平行线段最多的一个簇,计算该簇中所有线段的平均斜率α,该斜率即为电力线在当前画面下的倾斜角。随后,根据电力线的斜率α来对图像进行旋转α角度,使电力线垂直于水平方向。与此同时,由于实际场景下电力线应该近似垂直于电力塔的外围矩形框,因此,上述旋转操作后,电力塔区域应该是如图3所示的,电力塔左右两侧平行于垂直方向的视图。Theoretically, in the images taken by drones, the number of line segments belonging to power lines is the largest, and the slopes of these line segments are almost the same. Therefore, through the above clustering process, the cluster with the largest number of line segments should be the set of line segments corresponding to power lines. Next, select a cluster with the most parallel line segments from all the above clusters, and calculate the average slope α of all line segments in the cluster, which is the inclination angle of the power lines in the current picture. Subsequently, the image is rotated by an angle α according to the slope α of the power lines so that the power lines are perpendicular to the horizontal direction. At the same time, since the power lines should be approximately perpendicular to the outer rectangular frame of the power tower in the actual scene, after the above rotation operation, the power tower area should be as shown in Figure 3, with the left and right sides of the power tower parallel to the vertical direction.

与此同时,将原始图像的边缘图也进行相应的旋转,得到旋转矫正后的边缘图,再进行CSS角点检测。角点检测的过程如下:At the same time, the edge map of the original image is also rotated accordingly to obtain the rotation-corrected edge map, and then CSS corner point detection is performed. The process of corner point detection is as follows:

1)针对Canny边缘检测算子提取的边缘轮廓,当边缘点为端点时,如果该端点的邻域内有其他端点,则将两个端点之间的非边缘点替换为边缘点;如果该端点的邻域内有其他边缘线则将其标记为T型节点。1) For the edge contour extracted by the Canny edge detection operator, when the edge point is an endpoint, if there are other endpoints in the neighborhood of the endpoint, the non-edge point between the two endpoints is replaced by the edge point; if there are other edge lines in the neighborhood of the endpoint, it is marked as a T-node.

2)针对每个边缘轮廓,利用大尺度的高斯滤波函数计算轮廓上每个像素点的曲率。2) For each edge contour, a large-scale Gaussian filter function is used to calculate the curvature of each pixel on the contour.

3)如果边缘线上某个像素点的曲率大于预先设置的阈值,且为局部唯一最大值,同时满足其曲率值大于邻域内曲率最小值的两倍,则将该像素点标记为候选角点,曲率的计算如下:3) If the curvature of a pixel on the edge line is greater than the preset threshold and is the only local maximum value, and its curvature value is greater than twice the minimum curvature value in the neighborhood, then the pixel is marked as a candidate corner point. The curvature is calculated as follows:

根据弧长系数u来定义边缘曲线:The edge curve is defined according to the arc length coefficient u:

Γ(u)=(x(u),y(u))Γ(u)=(x(u),y(u))

对提取出的边缘曲线使用一维高斯滤波函数进行平滑去噪得到平滑曲线:The extracted edge curve is smoothed and denoised using a one-dimensional Gaussian filter function to obtain a smooth curve:

Γ(u,σ)=(X(u,σ),Y(u,σ))Γ(u,σ)=(X(u,σ),Y(u,σ))

其中

Figure BDA0003981638870000151
Figure BDA0003981638870000152
表示卷积操作,g(u,σ)表示标准差为σ的一维高斯滤波函数。根据边缘曲线函数可以求得曲线的曲率函数:in
Figure BDA0003981638870000151
Figure BDA0003981638870000152
represents the convolution operation, g(u,σ) represents the one-dimensional Gaussian filter function with a standard deviation of σ. The curvature function of the curve can be obtained according to the edge curve function:

Figure BDA0003981638870000153
Figure BDA0003981638870000153

Figure BDA0003981638870000154
Figure BDA0003981638870000154

Figure BDA0003981638870000155
Figure BDA0003981638870000155

Figure BDA0003981638870000156
Figure BDA0003981638870000156

Figure BDA0003981638870000157
Figure BDA0003981638870000157

其中g′(u,σ)、g″(u,σ)分别是g(u,σ)关于u的一阶导数和二阶偏导数。where g′(u,σ) and g″(u,σ) are the first-order derivative and second-order partial derivative of g(u,σ) with respect to u, respectively.

4)由于2)中使用的大尺度滤波器将曲线高度模糊,得到的只是粗略筛选的候选角点集,因此需要使用小尺度高斯滤波追踪候选角点集中的每一个像素点,精确定位角点的位置,提高角点的定位准确度4) Since the large-scale filter used in 2) highly blurs the curve, only a roughly screened set of candidate corner points is obtained. Therefore, a small-scale Gaussian filter is needed to track each pixel in the candidate corner point set to accurately locate the position of the corner point and improve the accuracy of corner point positioning.

5)对于得到的T型节点和检测到的候选角点,如果两者临近,则删除其中一个。5) For the obtained T-node and the detected candidate corner point, if the two are adjacent, delete one of them.

在通过角点检测获得二值化的角点图后,将角点图在水平和垂直方向分别进行积分投影,得到水平和垂直方向的投影直方图。以垂直方向为例,投影时累加图像每列的角点数量,用柱状高度代表角点数,可以直观地表示垂直方向上角点的分布。After obtaining the binary corner map through corner detection, the corner map is integrally projected in the horizontal and vertical directions to obtain the projection histograms in the horizontal and vertical directions. Taking the vertical direction as an example, the number of corner points in each column of the image is accumulated during projection, and the number of corner points is represented by the column height, which can intuitively represent the distribution of corner points in the vertical direction.

得到积分投影直方图后,采用中值滤波的思想分别对投影直方图进行平滑去噪。例如,使用9像素大小的滑动窗口遍历投影图,将各列投影柱的高度保存下来构成一个序列,将该序列中的投影柱高度按从大到小排序,将位于中间位置的投影柱高度即中值保存,并赋予滑动窗口中间位置的像素点,这样就能得到较为平滑的角点投影图。After obtaining the integral projection histogram, the idea of median filtering is used to smooth and denoise the projection histogram. For example, a sliding window of 9 pixels is used to traverse the projection map, and the heights of the projection columns in each column are saved to form a sequence. The heights of the projection columns in the sequence are sorted from large to small, and the height of the projection column in the middle position, i.e., the median value, is saved and assigned to the pixel point in the middle position of the sliding window. In this way, a relatively smooth corner projection map can be obtained.

由电力线检测可得到电力线分布的宽度为W,W可近似看作电力塔的宽度,结合调整比例后的图像尺寸X0*Y0将去噪后将投影图在横向和纵向上划分为R(x,y)个小区域。计算方式如下:The width of the power line distribution can be obtained from the power line detection as W, which can be roughly regarded as the width of the power tower. Combined with the adjusted image size X 0 *Y 0, the projection image will be divided into R (x, y) small areas in the horizontal and vertical directions after denoising. The calculation method is as follows:

Figure BDA0003981638870000161
Figure BDA0003981638870000161

Figure BDA0003981638870000162
的情况为例,将第一个小区域内每列(行)的角点数量{p00,p01,…,p0m}累加,其中
Figure BDA0003981638870000163
用区域内角点总量P表示该区域的角点密度。角点数量P的计算如下:by
Figure BDA0003981638870000162
Take the case of as an example, the number of corner points in each column (row) in the first small area {p 00 ,p 01 ,…,p 0m } is accumulated, where
Figure BDA0003981638870000163
The total number of corner points in the region, P, is used to represent the corner point density of the region. The number of corner points, P, is calculated as follows:

Figure BDA0003981638870000164
Figure BDA0003981638870000164

得到{P0,P1,P2,…,P19}后计算每个小区域与相邻区域的差的绝对值:After obtaining {P 0 ,P 1 ,P 2 ,…,P 19 }, calculate the absolute value of the difference between each small area and the adjacent area:

Di=|Pi+1-Pi|D i = |P i+1 -P i |

最大差值max{D0,D1,D2,…,Di}对应的两个区域中间就存在电力塔的一侧边界。There is one side boundary of the power tower between the two areas corresponding to the maximum difference max{D 0 ,D 1 ,D 2 ,…,D i }.

同理,对垂直方向进行投影可以确定电力塔的上下边界。Similarly, projection in the vertical direction can determine the upper and lower boundaries of the power tower.

与此同时,对角点图和线段检测得到的若干平行线组进行关联分析,去除无关的平行线组。这里的关联分析主要是考虑到电力线一般是连接到电力塔的某些支架位置的,而这些支架位置通常是一个角点,因此可以通过判断检测的直线是否经过角点图中的角点来进一步剔除不可能是电力线的候选直线。具体来说,对所有的平行线组,通过最小二值化延伸成跨越整个图像的直线后,依次判断该直线是否经过角点图中的任意一个角点。将不经过任何一个角点的平行线去除,不再作为电力线的可能选择。At the same time, several parallel line groups obtained by corner point map and line segment detection are subjected to association analysis to remove irrelevant parallel line groups. The association analysis here mainly takes into account that power lines are generally connected to certain bracket positions of power towers, and these bracket positions are usually a corner point. Therefore, candidate straight lines that cannot be power lines can be further eliminated by judging whether the detected straight line passes through the corner point in the corner point map. Specifically, for all parallel line groups, after being extended into straight lines spanning the entire image through minimum binarization, it is judged in turn whether the straight line passes through any corner point in the corner point map. Parallel lines that do not pass through any corner point are removed and are no longer possible choices for power lines.

电力线和电力塔的初次检测完成后,通过迭代检测对结果进行矫正,迭代的过程如下:After the initial inspection of power lines and power towers is completed, the results are corrected through iterative inspection. The iterative process is as follows:

1)将电力塔检测结果映射至边缘检测图。1) Map the power tower detection results to the edge detection map.

2)如图5所示,排除电力塔区域两侧的区域W1、W2重新检测电力线。2) As shown in FIG. 5 , the power lines are re-detected after excluding the areas W 1 and W 2 on both sides of the power tower area.

3)由电力线分布的左右宽度预估电力塔区域在图像中的占比。3) Estimate the proportion of the power tower area in the image based on the left and right widths of the power line distribution.

4)根据3)的结果重新使用投影法检测电力塔。4) Based on the results of 3), the projection method is used again to detect power towers.

5)电力塔再次检测完成后,计算与前一次电力塔检测结果的IoU值。IoU阈值设定为0.7。矫正后与前一次检测结果对比,如果IoU大于0.7,说明两次检测结果一致,输出结果,结束任务;如果小于等于0.7,说明与前一次检测结果产生了偏差,继续迭代直至结果一致或超出限制迭代次数。B1、B2为如图6所示的两次检测的区域,IoU的计算如下:5) After the power tower is re-detected, the IoU value with the previous power tower detection result is calculated. The IoU threshold is set to 0.7. After correction, compare with the previous detection result. If IoU is greater than 0.7, it means that the two detection results are consistent, output the result, and end the task; if it is less than or equal to 0.7, it means that there is a deviation from the previous detection result, and continue to iterate until the results are consistent or the number of iterations is exceeded. B 1 and B 2 are the areas of the two detections as shown in Figure 6, and the calculation of IoU is as follows:

Figure BDA0003981638870000171
Figure BDA0003981638870000171

Claims (10)

1.一种电力塔和电力线关联矫正的电力塔和电力线检测方法,其特征在于,包括如下步骤:1. A method for detecting power towers and power lines for correcting the association between power towers and power lines, characterized by comprising the following steps: 步骤1,从上方拍摄电力塔和电力线的图像,并对所述图像进行灰度化预处理;Step 1, taking an image of a power tower and power lines from above, and performing grayscale preprocessing on the image; 步骤2,对预处理后的图像进行边缘检测,得到二值化的边缘图;Step 2, performing edge detection on the preprocessed image to obtain a binary edge map; 步骤3,利用所述边缘图进行电力线检测,依次包括线段检测、合并线段和平行线组聚类,得到平行线组表示的电力线;Step 3, using the edge map to perform power line detection, including line segment detection, merging line segments and parallel line group clustering in sequence, to obtain power lines represented by the parallel line group; 步骤4,利用所述边缘图进行电力塔检测,得到矩形框框定的电力塔区域;Step 4, using the edge map to detect the power tower, and obtaining the power tower area framed by the rectangular frame; 步骤5,通过迭代检测对电力线和电力塔的检测结果进行矫正,方法如下:将所述矩形框映射至所述边缘图,排除电力塔矩形框两侧的背景区域,对电力塔矩形框内部区域重新检测电力线;待获得新的电力线检测结果后,由电力线分布区域的左右宽度预估电力塔区域在所述边缘图中的占比,进而更新电力塔检测参数,重新检测电力塔,直至满足要求或达到迭代次数。Step 5, correcting the detection results of power lines and power towers through iterative detection, the method is as follows: mapping the rectangular frame to the edge map, excluding the background areas on both sides of the rectangular frame of the power tower, and re-detecting the power lines in the area inside the rectangular frame of the power tower; after obtaining the new power line detection results, the proportion of the power tower area in the edge map is estimated by the left and right widths of the power line distribution area, and then the power tower detection parameters are updated, and the power tower is re-detected until the requirements are met or the number of iterations is reached. 2.根据权利要求1所述电力塔和电力线关联矫正的电力塔和电力线检测方法,其特征在于,所述步骤1,拍摄的每张图像中,仅包含一个电力塔目标,并包含电力线;所述预处理包括调整图像分辨率、图像灰度化、直方图均衡化以及去噪;其中在灰度化过程中,仅保留红蓝两色通道生成灰度图。2. According to the power tower and power line associated correction method of claim 1, it is characterized in that in the step 1, each image taken contains only one power tower target and power lines; the preprocessing includes adjusting the image resolution, image grayscale, histogram equalization and denoising; wherein in the grayscale process, only the red and blue channels are retained to generate a grayscale image. 3.根据权利要求1所述电力塔和电力线关联矫正的电力塔和电力线检测方法,其特征在于,所述步骤3,使用概率Hough变换检测出所述边缘图中线段的两个端点;然后计算线段中心点坐标、线段斜率和截距,根据线段几何距离进行分组,分组后用最小二乘法将每个组内的线段拟合为直线并延长至贯穿图像,最后将斜率接近的直线归为平行线组;最后依据斜率对平行线组进行聚类,保留聚类结果中计数最多的直线,过滤与电力线斜率相差大的杂乱直线。3. According to the power tower and power line detection method with associated correction of power towers and power lines as described in claim 1, it is characterized in that, in step 3, the two endpoints of the line segment in the edge map are detected using probabilistic Hough transform; then the coordinates of the center point of the line segment, the slope of the line segment and the intercept of the line segment are calculated, and the line segments are grouped according to their geometric distances. After grouping, the line segments in each group are fitted into straight lines using the least squares method and extended to pass through the image, and finally the straight lines with similar slopes are classified into parallel line groups; finally, the parallel line groups are clustered according to the slopes, the straight lines with the most counts in the clustering results are retained, and the messy straight lines with large differences in slope from the power lines are filtered out. 4.根据权利要求3所述电力塔和电力线关联矫正的电力塔和电力线检测方法,其特征在于,在得到的平行线组表示的电力线中,由最边缘的两条电力线之间的距离D推测电力塔的宽度,再根据电力塔的长宽比估计电力塔所处区域W,按照电力线检测结果将所述边缘图整体旋转α,使图中的电力塔区域水平,其中α为聚类后得到的线组与垂直方向的夹角。4. The method for detecting power towers and power lines with associated correction of power towers and power lines according to claim 3 is characterized in that, among the power lines represented by the obtained parallel line group, the width of the power tower is inferred from the distance D between the two outermost power lines, and then the area W where the power tower is located is estimated based on the aspect ratio of the power tower, and the edge map is rotated as a whole by α according to the power line detection result so that the power tower area in the map is horizontal, wherein α is the angle between the line group obtained after clustering and the vertical direction. 5.根据权利要求4所述电力塔和电力线关联矫正的电力塔和电力线检测方法,其特征在于,所述步骤4,采用基于曲率尺度空间的角点检测方法对所述边缘图进行角点检测,获得角点分布图;然后通过像素统计投影将所述角点分布图在水平方向和垂直方向上分别进行积分投影,得到水平方向和垂直方向的投影直方图;再通过中值平滑的方式,将水平方向每个投影值替换成左右各相邻的n个投影取的中值,将垂直方向每个投影值替换成上下各相邻的m个投影取的中值,得到平滑的投影直方图;由电力线区域的宽度和高度分别估计电力塔在所述边缘图中的占比,依据占比分别将水平方向和垂直方向的投影直方图图划分为多个小区域,计算每个小区域与相邻区域的落差,落差最大的区域分别存在电力塔的左右边界和上下边界。5. According to the power tower and power line detection method for power tower and power line association correction described in claim 4, it is characterized in that, in step 4, the edge map is detected by using a corner point detection method based on curvature scale space to obtain a corner point distribution map; then the corner point distribution map is integrally projected in the horizontal direction and the vertical direction by pixel statistical projection to obtain the projection histograms in the horizontal direction and the vertical direction; then each projection value in the horizontal direction is replaced by the median of the n adjacent projections on the left and right, and each projection value in the vertical direction is replaced by the median of the m adjacent projections on the upper and lower sides to obtain a smoothed projection histogram; the proportion of the power tower in the edge map is estimated by the width and height of the power line area, and the projection histograms in the horizontal direction and the vertical direction are divided into multiple small areas according to the proportion, and the height difference between each small area and the adjacent area is calculated, and the area with the largest height difference has the left and right boundaries and the upper and lower boundaries of the power tower. 6.根据权利要求5所述电力塔和电力线关联矫正的电力塔和电力线检测方法,其特征在于,所述基于曲率尺度空间的角点检测方法,包括:首先,利用边缘检测提取的图像轮廓,填充二值化边缘轮廓中的缺口;其次,填充后在大尺度下计算轮廓上每个像素点的曲率,如果超过阈值判定为候选角点;最后,在小尺度下追踪候选角点集中的每一像素点,精确定位角点的位置。6. According to the power tower and power line detection method with associated correction of power towers and power lines as described in claim 5, it is characterized in that the corner point detection method based on curvature scale space includes: first, using the image contour extracted by edge detection to fill the gaps in the binary edge contour; second, after filling, calculating the curvature of each pixel point on the contour at a large scale, and if it exceeds a threshold, it is determined to be a candidate corner point; finally, tracking each pixel point in the candidate corner point set at a small scale to accurately locate the position of the corner point. 7.根据权利要求5所述电力塔和电力线关联矫正的电力塔和电力线检测方法,其特征在于,所述更新电力塔检测参数,是更新所述小区域的划分个数。7. The method for detecting power towers and power lines with correction of power tower and power line association according to claim 5, wherein the updating of power tower detection parameters is to update the number of divisions of the small area. 8.根据权利要求1或6所述电力塔和电力线关联矫正的电力塔和电力线检测方法,其特征在于,所述步骤5,电力塔迭代检测过程中的结果变化程度使用IoU作为评价指标,并根据IoU决定迭代的次数;所述IoU是两个区域重叠的部分除以两个区域的集合部分得出的结果,用来衡量两次电力塔检测结果的重叠程度;当IoU大于设定的阈值t时,认为两次检测结果一致,输出当前结果为最终结果,结束任务;当IoU小于等于阈值t时,继续进行下一轮迭代检测,如果迭代次数超过给定的最大迭代次数则强制结束任务,输出最后一轮的检测结果。8. The method for detecting power towers and power lines with associated correction of power towers and power lines according to claim 1 or 6 is characterized in that, in step 5, the degree of change of the results in the iterative detection process of the power towers is evaluated using IoU as an indicator, and the number of iterations is determined based on IoU; the IoU is the result obtained by dividing the overlapping part of two areas by the collective part of the two areas, and is used to measure the degree of overlap of two power tower detection results; when IoU is greater than a set threshold t, the two detection results are considered to be consistent, the current result is output as the final result, and the task is terminated; when IoU is less than or equal to the threshold t, the next round of iterative detection is continued. If the number of iterations exceeds the given maximum number of iterations, the task is forced to end and the detection result of the last round is output. 9.一种电力塔和电力线关联矫正的电力塔和电力线检测系统,包括:9. A power tower and power line detection system for power tower and power line correlation correction, comprising: 预处理模块,对从上方的拍摄电力塔和电力线的图像进行灰度化预处理;A pre-processing module performs grayscale pre-processing on the images of power towers and power lines taken from above; 边缘检测模块,对预处理后的图像进行边缘检测,得到二值化的边缘图;The edge detection module performs edge detection on the preprocessed image to obtain a binary edge map; 电力线检测模块,利用所述边缘图进行电力线检测,依次包括线段检测、合并线段和平行线组聚类,得到平行线组表示的电力线;A power line detection module, which uses the edge map to perform power line detection, including line segment detection, line segment merging and parallel line group clustering in sequence, to obtain power lines represented by parallel line groups; 电力塔检测模块,利用所述边缘图进行电力塔检测,得到矩形框框定的电力塔区域;A power tower detection module, which uses the edge map to detect power towers and obtains a power tower area defined by a rectangular frame; 关联矫正模块,将所述矩形框映射至所述边缘图,排除电力塔矩形框两侧的背景区域,对电力塔矩形框内部区域重新检测电力线;待获得新的电力线检测结果后,由电力线分布区域的左右宽度预估电力塔区域在所述边缘图中的占比,进而更新电力塔检测参数,重新检测电力塔,直至满足要求或达到迭代次数。The associated correction module maps the rectangular frame to the edge map, excludes the background areas on both sides of the rectangular frame of the power tower, and re-detects the power lines in the area inside the rectangular frame of the power tower; after obtaining the new power line detection results, the proportion of the power tower area in the edge map is estimated by the left and right widths of the power line distribution area, and then the power tower detection parameters are updated, and the power tower is re-detected until the requirements are met or the number of iterations is reached. 10.根据权利要求9所述电力塔和电力线关联矫正的电力塔和电力线检测系统,其特征在于,所述检测系统部署于无人机嵌入式平台,为无人机飞行控制程序提供对电力塔和电力线位置的检测和定位功能;所述电力塔和电力线的图像由所述无人机拍摄获取。10. The power tower and power line detection system for power tower and power line correlation correction according to claim 9 is characterized in that the detection system is deployed on an unmanned aerial vehicle embedded platform to provide the unmanned aerial vehicle flight control program with detection and positioning functions for the positions of power towers and power lines; the images of the power towers and power lines are acquired by photographing the unmanned aerial vehicle.
CN202211552072.8A 2022-12-05 2022-12-05 Power tower and power line associated correction power tower and power line detection method Pending CN115841633A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211552072.8A CN115841633A (en) 2022-12-05 2022-12-05 Power tower and power line associated correction power tower and power line detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211552072.8A CN115841633A (en) 2022-12-05 2022-12-05 Power tower and power line associated correction power tower and power line detection method

Publications (1)

Publication Number Publication Date
CN115841633A true CN115841633A (en) 2023-03-24

Family

ID=85578062

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211552072.8A Pending CN115841633A (en) 2022-12-05 2022-12-05 Power tower and power line associated correction power tower and power line detection method

Country Status (1)

Country Link
CN (1) CN115841633A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116524004A (en) * 2023-07-03 2023-08-01 中国铁路设计集团有限公司 Reinforcement Size Detection Method and System Based on HoughLines Algorithm
CN116843909A (en) * 2023-05-12 2023-10-03 国家电网有限公司华东分部 Power line extraction method and device, storage medium, computer equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116843909A (en) * 2023-05-12 2023-10-03 国家电网有限公司华东分部 Power line extraction method and device, storage medium, computer equipment
CN116843909B (en) * 2023-05-12 2024-03-08 国家电网有限公司华东分部 Power line extraction method and device, storage medium and computer equipment
CN116524004A (en) * 2023-07-03 2023-08-01 中国铁路设计集团有限公司 Reinforcement Size Detection Method and System Based on HoughLines Algorithm
CN116524004B (en) * 2023-07-03 2023-09-08 中国铁路设计集团有限公司 Method and system for detecting size of steel bar based on HoughLines algorithm

Similar Documents

Publication Publication Date Title
CN113160192B (en) Visual sense-based snow pressing vehicle appearance defect detection method and device under complex background
CN109657632B (en) A method of lane line detection and recognition
WO2022100470A1 (en) Systems and methods for target detection
CN104778721B (en) The distance measurement method of conspicuousness target in a kind of binocular image
CN114331986B (en) A dam crack identification and measurement method based on drone vision
CN111126184B (en) Post-earthquake building damage detection method based on unmanned aerial vehicle video
CN108805064A (en) A kind of fish detection and localization and recognition methods and system based on deep learning
CN107330376A (en) A kind of Lane detection method and system
CN114299002B (en) Intelligent detection system and method for abnormal road spillage behavior
CN105373135A (en) Method and system for guiding airplane docking and identifying airplane type based on machine vision
CN114549981A (en) A deep learning-based intelligent inspection pointer meter identification and reading method
CN115841633A (en) Power tower and power line associated correction power tower and power line detection method
CN107301420A (en) A kind of thermal infrared imagery object detection method based on significance analysis
CN110414308B (en) Target identification method for dynamic foreign matters on power transmission line
CN113128507B (en) License plate recognition method and device, electronic equipment and storage medium
CN115131325A (en) Breaker fault operation and maintenance monitoring method and system based on image recognition and analysis
CN106530281A (en) Edge feature-based unmanned aerial vehicle image blur judgment method and system
CN112861654A (en) Famous tea picking point position information acquisition method based on machine vision
US20220128358A1 (en) Smart Sensor Based System and Method for Automatic Measurement of Water Level and Water Flow Velocity and Prediction
CN109919026A (en) A local path planning method for surface unmanned boat
CN116630650B (en) Ridge width identification method and unmanned vehicle device for ridges
CN108416798A (en) A Vehicle Distance Estimation Method Based on Optical Flow
CN113706566B (en) Edge detection-based perfuming and spraying performance detection method
CN110807771A (en) Defect detection method for road deceleration strip
CN108921003A (en) Unmanned plane obstacle detection method based on convolutional neural networks and morphological image

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination