Development of a machine for the automatic sorting of pomegranate (Punica granatum) arils based on computer vision J. Blasco a, * , S. Cubero a , J. Gómez-Sanchís a , P. Mira b , E. Moltó a a Centro de Agroingeniería, Instituto Valenciano de Investigaciones Agrarias, IVIA, Cra. Moncada-Náquera, Km 5, 46113 Moncada, Valencia, Spain b Frutas Mira Hermanos, S.L. Partida de Asprillas P2 No. 48, 03292, Elche, Alicante, Spain article info Article history: Received 11 February 2008 Received in revised form 21 May 2008 Accepted 30 May 2008 Available online 12 June 2008 Keywords: Image analysis Real-time Fruit sorting Machinery Quality Inspection abstract The pomegranate is a fruit with excellent organoleptic and nutritional properties, but the fact that it is difficult to peel affects its commercialisation and decreases its potential consumption. One solution is to market the arils of pomegranate in a ready-to-eat form. However, after the peeling process, unwanted material, such as internal membranes and defective arils, is extracted together with good arils and must be removed on the packing line because the presence of such material shortens the shelf life of the product or deteriorates its appearance. For different reasons, the commercial sorting machines that are currently available for similar commodities (cherries, nuts, rice, etc.) are not capable of handling and sort- ing pomegranate arils, thus making it necessary to build specific equipment. This work describes the development of a computer vision-based machine to inspect the raw material coming from the extraction process and classify it in four categories. The machine is capable of detecting and removing unwanted material and sorting the arils by colour. The prototype is composed of three units, which are designed to singulate the objects to allow them be inspected individually and sorted. The inspection unit relies on a computer vision system. Two image segmentation methods were tested: one uses a threshold on the R/G ratio and the other is a more complex approach based on Bayesian Linear Discriminant Analysis (LDA) in the RGB space. Both methods offered an average success rate of 90% on a validation set, the former being more intuitive for the operators, as well as faster and easier to implement, and for these reasons it was included in the prototype. Subsequently, the complete machine was tested in industry by working in real conditions throughout a whole pomegranate season, in which it automatically sorted more than nine tons of arils. Ó 2008 Elsevier Ltd. All rights reserved. 1. Introduction Spain produces about 20,000 tons of pomegranate (Punica gra- natum L.) fruits per year and production is concentrated in the per- iod between October and January. This fruit is affected in the orchards by particular physiological disorders, such as sunburn or the splitting of ripe fruit ( Melgarejo et al., 2004), which do not influence its internal quality and properties, but do degrade its external appearance and, thus preventing the affected fruits from being marketed. However, manual peeling and extraction of the ar- ils is difficult, and this gives rise to a certain degree of rejection by the consumer in favour of other fruits that are easier to eat. On the other hand, the nutritional and anticarcinogenic properties of pomegranates have been widely demonstrated (Schubert et al., 1999; Gil et al., 2000; Malik et al., 2005; Lansky and Newman, 2007). Furthermore, pomegranate trees do not require water or other agricultural inputs (fertilisers, phytosanitary products and so forth) in large quantities and this makes growing them easier in arid and semi-arid climates. One way of increasing the consumption of this fruit is to sell ready-to-eat arils, which have a very high added value in an increasingly health conscious society. Several machines for extracting the arils are already on the mar- ket, but their descriptions lie beyond the scope of this work. One of their main problems, however, is that fragments of internal mem- brane or skin and other unwanted material are released during the extraction process. Moreover, some defective arils (broken, abnor- mally shaped or with different physiological disorders) may ap- pear, together with arils of different colours ranging from white to red. Defective arils may shorten the shelf life of the product, and arils with different colours in the same package may degrade the appearance of the product and hence reduce its price. For all these reasons, it is crucial for manufacturers of ready-to eat pome- granate arils to find automatic solutions to inspect and sort the product. 0260-8774/$ - see front matter Ó 2008 Elsevier Ltd. All rights reserved. doi:10.1016/j.jfoodeng.2008.05.035 * Corresponding author. Fax: +34 956 01 6411. E-mail address: blasco_josiva@gva.es (J. Blasco). Journal of Food Engineering 90 (2009) 27–34 Contents lists available at ScienceDirect Journal of Food Engineering journal homepage: www.elsevier.com/locate/jfoodeng