Abstract:A segmentation method of cucumber disease image with complex background was proposed. Firstly, most of the background in color images was removed by combined method of ExG and OTSU, which retained the green part of the image as much as possible. Then, according to the red component of the disease image, the data item was created automatically. Meanwhile, the differences between the red components of adjacent pixels were set as the smooth item. The threshold-pretreatment-based graph cuts algorithm was constructed based on the above data item and smooth item. The proposed method was used to segment the color images of four kinds of cucumber diseases. The results showed that it could better segment the diseased regions from the color images of cucumber diseases. The mean accuracy of recognition was more than 90%, and the average running speed was 2.12 s. The proposed method could meet the requirement of real-time image processing.