Abstract:Abstract: In order to improve the recognition accuracy of white foreign fibers in cotton, a detection algorithm of white foreign fibers based on improved chaos particle swarm optimization was proposed in this paper. In this algorithm, the image was divided into different classes according to the grey value of image pixels. The variances between adjacent classes were thought of as a particle. All of these particles constituted a particle swarm. The maximum variances between classes were thought of as a fitness function. Therefore, the chaotic particle swarm optimization (PSO) algorithm was applied to image segmentation. The standard particle swarm optimization was easy to fall into a local optimum. Given this problem, this algorithm took the sliding window technology to determine if it falls into a local optimum. This algorithm contrasted the average population fitness in the sliding window with the current population fitness in the sliding window. If the current population fitness was similar to the average population fitness, the algorithm was thought not to fall into the local optimum, continued to evolve, and the sliding window starting position was moved to the current location, the size was set to 1, or it was thought to fall into a local optimum. If the algorithm fell into a local optimum, it used a chaotic mechanism to initialize the population to jump out of the local optimum. The starting position and size of the sliding window dynamic changed according to the judgment result. This method effectively solved the problems of the standard particle swarm optimization (PSO) algorithm that it fell well into a local optimum. In order to test the algorithm, this paper also set up a detection device, including an acA1300-30 gc type color plane array CCD camera, M0814 type lens, HLV-24-1220 type LED light source, and PCI-8ADPF type data acquisition card, then it selected five kinds of common white foreign fibers such as the pieces of plastic bags, white hair, feathers, threads, and synthetic fibers. Each kind had 100 samples. These samples were mixed in the cotton and were photographed. The test identified 500 pictures which contained white foreign fibers. The results showed that the rate of detecting pieces of plastic bags, white hair, feathers, threads, and synthetic fibers could reach 98%, 97%, 100%, 100%, and 98%, and the average rate was 98.6%. By comparison with the standard two-dimensional Otsu algorithm segmentation test found in the fine segmentation of different fibers and fiber and cotton overlap, the algorithm had a higher degree of precision segmentation than the standard two-dimensional Otsu algorithm.