|Abstract:In order to realize the accurate segmentation of cotton leaf under natural conditions, a new image segmentation algorithm was put forward based on particle swarm optimization (PSO) algorithm and K-means clustering algorithm. Firstly, we denoised the cotton leaf images by the two-dimensional convolution filter in the RGB color space model; Secondly, we converted the processed color image from RGB to the Q component , the super G component and the a* component, which had the largest difference between the target and the background in 3 color components; Again, in one dimension data space of K means clustering, we searched for subspace of solutions to the global pixel by using the PSO algorithm, through the iterative search, we could receive global optimal solution and make sure optimal clustering center, so that we could improve the convergence effect of K means clustering; Finally, we divided the pixels, which come from cotton leaf images, into clusters to obtain the results of cotton leaf segmentation. Considering the effects of different weather conditions and different backgrounds on imaging, we took 1200 pictures of cotton leaves under various imaging conditions, and evaluated the segmentation performance of the proposed algorithm on these images. Experimental results showed that, for the images taken in sunny day, cloudy day and after raining, the accuracies of segmentation of the algorithm reached 92.39%, 93.55% and 88.09% respectively, the whole average segmentation accuracy is 91.34% . Though comparing with the traditional K means algorithm, the whole average segmentation accuracy of the proposed algorithm had improved by 5.41% than the traditional K means algorithm. Segmentation results showed that, the proposed algorithm from this paper can accurately segment the cotton leaf images, which combined with 3 weather(sunny day, cloudy day and rainy day) and 4 complex background features(white ground membrane, black film, straw, soil). The algorithm in this paper can provide support for the subsequent processing of feature extraction and identification of plant diseases and insect pests.