Segmentation of colour food images using a robust algorithm Domingo Mery a, * , Franco Pedreschi b a Departamento de Ciencia de la Computacion, Pontificia Universidad Catolica de Chile, Av. Vicu~ na Mackenna 4860(183), Santiago de Chile, Chile b Departamento de Ciencia y Tecnolog ıa de Alimentos, Facultad Tecnolog ıca, Universidad de Santiago de Chile (USAH), Av. Ecuador 3769, Santiago de Chile, Chile Received 14 October 2003; accepted 4 April 2004 Abstract In this paper, a robust algorithm to segmenting food image from a background is presented using colour images. The proposed method has three steps: (i) computation of a high contrast grey value image from an optimal linear combination of the RGB colour components; (ii) estimation of a global threshold using a statistical approach; and (iii) morphological operation in order to fill the possible holes presented in the segmented binary image. Although the suggested threshold separates the food image from the background very well, the user can modify it in order to achieve better results. The algorithm was implemented in Matlab and tested on 45 images taken in very different conditions. The segmentation performance was assessed by computing the area A z under the receiver operation characteristic (ROC) curve. The achieved performance was A z ¼ 0:9982. Ó 2004 Elsevier Ltd. All rights reserved. Keywords: Image analysis; Image processing; Segmentation; Colour images 1. Introduction Computer vision is a novel technology for acquiring and analyzing an image of a real scene by computers and other devices in order to obtain information or to con- trol processes. The core technique in computer vision is always related to image analysis/processing, which can lead to segmentation, quantification and classification of images and objects of interest within images. Computer vision has proven successful for online measurement of several food products with applications ranging from routine inspection to the complex vision guided robotic control (Gunasekaram, 1996). Brosnan and Sum (2004) present a review indicating the application of computer vision in certain foods such as bakery products, meat and fish, vegetables, fruits, grains, prepared consumer foods and in food container inspection. As shown in Fig. 1, the steps involved in image analysis are (Gonz- alez & Wintz, 1991): Image formation, in which an image of the food un- der test is taken and stored in the computer. Image pre-processing, where the quality of the digital image is improved in order to enhance the details. Image segmentation, in which the food image is found and isolated from the background of the scene. Measurement, where some significant features of the food image are quantified. Interpretation, where the extracted features are inter- preted using some knowledge about the analysed ob- ject. The segmentation process partitions the digital image into disjoint (non-overlapping) regions (Castleman, 1996). Segmentation is an essential step in computer vision and automatic pattern recognition processes based on image analysis of foods as subsequent ex- tracted data are highly dependent on the accuracy of this operation. In general, the automated segmentation is one of the most difficult tasks in the image analysis (Gonzalez & Wintz, 1991), because a false segmentation will cause degradation of the measurement process and therefore the interpretation may fail. Food image seg- mentation is still an unsolved problem because of its Journal of Food Engineering 66 (2005) 353–360 www.elsevier.com/locate/jfoodeng * Corresponding author. Fax: +56-2-354-4444. E-mail address: dmery@ing.puc.cl (D. Mery). URL: www.ing.puc.cl/~dmery. 0260-8774/$ - see front matter Ó 2004 Elsevier Ltd. All rights reserved. doi:10.1016/j.jfoodeng.2004.04.001