The paper introduced the importance of image pre-processing based on mathematical morphology in the grain insect image processing. The functions of Matlab image processing are used in the image processing. The image pre-processing and analysis techniques based on mathematical morphology are obtained, and gain the goal of image denoising and smoothening, from which conclusions are drawn. The result of actual computation shows this method may not only keep the image edge characteristics, but also obtain the cleaner image of pests in st...