The chapter contains two parts of picture distillation; in the first part, the GrabCut algorithm  is used to extract yellow sticky board image from complex background and correct it to the same size and position by perspective correction method in order to extract aphid image ; in the second part, the method of weighted average gray scale is used to make the yellow sticky board image preprocessing, single image difference method is used to eliminate the influence of illumination, and OSTU threshold segmentation and morphological erosion method is used to extract yellow sticky board image, laying the ground work for the subsequent counting program.
So this paper uses the OSTU threshold segmentation method which has a clear and integrated contour as the binarization method.
In Section 3, we present the greater detail on our improved Ostu algorithm.
In the following section, we will introduce our improved Ostu's method for image thresholding.
In order to export our improved Ostu's method, we firstly introduce the traditional Ostu method .
Using discriminant analysis, Ostu defined the betweenclass variance of the thresholded image :
For bilevel thresholding, Ostu verified that the optimal threshold t* is chosen so that the between-class variance [[sigma].sup.2.sub.B] is maximized; that is,
For general image, the traditional Ostu method can be easily used to obtain thresholding of this image.
(7) obtain the improved Ostu threshold, as the value of [k.sup.*.sub.1] and [k.sup.*.sub.2], for [[sigma].sup.2.sub.B] ([k.sup.*.sub.1], [k.sup.*.sub.2]) which is maximum.