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.