An image processing software package was developed to classify wheat varieties. In processing digitized wheat, image spots and dust particles may significantly decrease the performance of an edge detection algorithm. The software employs the median filtering technique to remove such impurities and to smooth out the surface of wheat grains. it also employs the range-order filtering technique to detect grain boundaries. The extracted boundary is fitted to an ellipse and the feature parameters are determined. The features determined by the fitting procedure, as well as those determined from direct extraction, are used in the classification. The results showed that an overall 69% classification was achieved on a total of 31 bread wheat varieties used in this work. (C) 1998 Elsevier Science Limited. All rights reserved.