基于K-means聚类和椭圆拟合方法的白粉虱计数算法

    Whiteflies counting with K-means clustering and ellipse fitting

    • 摘要: 为了能够对害虫的准确计数,该文以白粉虱为例,提出了一种基于K-means聚类和椭圆拟合方法的白粉虱计数算法。该方法首先利用K-means聚类算法对白粉虱图像进行分割,使白粉虱从背景图像中分离,然后利用基于最小二乘法的椭圆拟合方法对分割结果进行椭圆拟合,统计椭圆的个数,提取椭圆中心点的颜色特征值,将其作为新的分类中心,重新对白粉虱图像进行分割和椭圆个数的统计,最后将算法收敛时的椭圆个数作为当前白粉虱的个数。对辣椒、黄瓜、番茄和茄子4种作物叶片上附着的白粉虱进行了计数试验,该算法在这4种作物上的平均计数错误率依次为2.80%,8.51%,5.00%,1.56%,并且分别比阈值化方法和K-means聚类方法的平均计数错误率降低了11.65%和70.18%。试验结果表明:所提方法能够实现对不同作物上白粉虱的准确计数,且算法具有很好的泛化性。该研究结果可为虫害的检测以及采取正确的防治措施提供重要依据。

       

      Abstract: Abstract: Insect pests are one of the important factors leading to crop loss. Accurate insect counts provide an important basis for pest detection, and for proper preventive measures to be taken. At present, the common counting methods are mainly based on computer vision, but this type of technology primarily has the following problems: 1) how to determine the threshold of image segmentation. The effects of the algorithms are unsatisfactory, as their thresholds or parameters are fixed when they are used to segment insect images. 2) Most counting algorithms are mainly aimed at one certain crop for learning and testing. If applied to other crops, their portability is poor, and the counting results are inaccurate. Therefore, how to improve the generalization and accuracy of counting algorithm is an important direction for research on a counting method based on machine vision.To solve the above problems, a novel counting algorithm for whiteflies based on k-means clustering and ellipse fitting method was proposed in this paper. It combined k-means clustering algorithm with ellipse fitting and automatically learned the features of whiteflies and background to segment and count whitefly images accurately. First, whitefly image were segmented by a k-means clustering algorithm to separate the whiteflies from the background, and then the segmentation results were fitted using an ellipse fitting based on least square method and adding up the ellipse number. The color features of the ellipse centers were extracted as new centers of classes. The segmentation and counting was iterated until the difference between two continuous counts met the needs of the algorithm and the convergence ellipse count was output as the number of whiteflies. Moreover, to improve the adaptability of the algorithm to count whiteflies on various crops, the whitefly images to be counted were parted into blocks and the center block was used to learn the features of whiteflies such as color, size, and area. The learned result was set as the initial value of the algorithm. Thus, the accuracy and generalization of the algorithm was improved.To verify the effectiveness of the proposed algorithm, the counting experiment was performed on whitefly images of cayenne peppers, cucumbers, tomatoes, and eggplants respectively. These images were captured in the open environment from Xiao Tang Shan field research and a demonstration base of national precision agriculture in Beijing. The experimental results compared to that of the threshold method and the K-means clustering method showed that: 1) The count results of the proposed method had a high accuracy in cayenne peppers, cucumbers, tomatoes, and eggplants. The error rates of the pepper were 1.54%, 2.86%, and 4.00%; eggplant, 1.56%; tomato, 5.00%; cucumber, 11.30% and 5.71%. 2) The proposed method had better image segmentation results and higher count accuracy, compared to the threshold method and the K-means clustering method. Moreover, the counting error rate was decreased by 12.46% and 70.18% respectively. 3) The adaptive method learns the features of whiteflies such as color, sharpness, and size in the image to be counted, which is propitious for the accurate segmentation and counting of whitefly images. 4) The method makes the most of two important visual features of whiteflies, color and shape, and combines them by image segmentation and ellipse fitting to further increase the accuracy of the count results.

       

    /

    返回文章
    返回