Food is essential for nourishment and sustenance of life. The addition of impurities to food affects the composition and quality of food. The manual method is practical and fast, but lacks the reliability and objectivity required in competitive food industries. Machine vision using morphological features have been reported in numerous studies as an effective solution to detect impurities in food. In this paper we experimented detection of impurities in rice samples using template matching technique. Various image processing techniques have been studied and we’ve concluded that template matching is the best and efficient way to detect the impurities. Using area computation we’ve also identified the broken rice in samples.