An improved automatic method of separation and identification of touching kernels and foreign materials in digital images was proposed.At first, the image was filtered and converted into a binary image.Then the touching kernels were separated by using watershed algorithm based on morphological multiscale decomposition(MSD).Next, the morphological and color features from each segmented component and standard kernel were extracted for calculation of Mahalanobis distance between each segmented component’s features and those of standard kernels.Finally foreign materials were identified by comparing Mahalanobis distance with the given threshold.Five kinds of kernels(common rice, rough rice, brown rice, common barley and glutinous barley) were tested and the experimental results showed that the proposed algorithm could separate touching kernels effectively and identify foreign material correctly.