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 sorting
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.