# Automatic System for the Detection of Defects on Olive Fruits in an Oil Mill
## 2 Materials and Methods
### Equipment Design and Image Acquisition  
The first step for using images acquired in industrial conditions for the determination of defects in olives is to design an acquisition system capable of obtaining good quality images, coping with the challenges imposed by these conditions. On the one hand, the speed of the conveyor imposes the use of very short acquisition times, which implies demanding requirements for the lighting system; on the other, the height of the olives in the conveyor varies in a sufficiently broad range as to influence the required depth of field and the focal distance of the lenses.  
For this, an image acquisition system was designed for its installation on the conveyors typically employed in the olive oil mill yard for the movement of the olives in the reception, washing and storage processes previous to the milling. The acquisition system was composed of a lighting system, a camera, electronic components to manage the acquisition of the images and their transference to external servers, and mechanical elements to protect the different components and fix the system to the conveyor. For this work, an infrared Dalsa Genie NANO M2590-NIR and a visible spectra Nano C242 with 25 mm optics, along with a 500 W stroboscopic halogen lighting system, were employed. These components were protected by chamber designed in collaboration with ISR, a spin-off company from the University of Jaen. The chamber contained a holder for the camera that located it at approximately 50 cm from the conveyor and prevented its movement, providing a spatial resolution of 10 pixel/mm. Figure 1 shows the system installed in the conveyor of the factory.  
The image acquisition system can be located before or after the fruit cleaning process, since conveyors are used in both stages. The decision to situate it before or after this cleaning process is influenced by the conveyor configuration of the factory. Depending on this configuration, it could be possible to store the fruit in hoppers according to its quality level. In many factories, the storage hopper is determined by the reception line employed, without the possibility of changing it afterwards; however, some other factory configurations do allow to choose the storage hopper independently of the recepction line. In this case, the information obtained from the images could be used to define which hopper should store the olives, which would recommend installing the system before the switch point where the olives are actually routed to one hopper or another. If there is no such possibility, then the detection of defects can be used to penalize the grower that provides a batch with a sub-standard quality level, which would leave the question of whether to install the system before of after the cleaning process open to other considerations.  
For this work, the images employed were acquired in the olive oil factory Industria San Pedro, S.L., located in Jaen, during the season 2020-21. Since the system was not to be used for deciding which hopper the olives should be routed to, considerations related with the simplicity of installation motivated the location of the system in the conveyor that moves the fruit from the washer to the storage hopper. This way, an average of 200 daily images, taken every 10 s and covering the reception of several batches of olives, were taken from 11 January until 26 January. Figure 2 shows some examples of the acquired images using the cameras with different spectra installed on the conveyor. As can be seen in Figure 2a, the infrared camera is a better choice to detect damaged olives. The fruits damaged by insects show stains with a lower gray level that the rest of the surface of the fruit. These stains would not be visible in the images of the color camera shown in Figure 2b.  
Figure 1: Industrial monitorization system installed on the conveyor belt after the olive cleaning process.