FOOD INSPECTION: Vision sorts pomegranate seeds
Between October and January each year, Spain produces about 20,000 tons of pomegranate.
Between October and January each year, Spain produces about 20,000 tons of pomegranate. Some of this fruit experiences sunburn or splitting and cannot be marketed. However, since the internal quality and properties of the fruit are not adversely affected, the seeds and surrounding pulp—called arils—can be marketed in a ready-to-eat form. Before this can occur, automatic peeling machines are used to separate any unwanted material and poor quality arils from good quality product. After this process, the arils must be inspected and sorted before packing.
To accomplish this automatically, Jose Blasco and his colleagues at the Agricultural Engineering Centre (www.agroingenieria.ivia.es) of the Valencian Institute of Agricultural Research (Valencia, Spain; www.ivia.es) and the pomegranate producer Frutas Mira Hermanos (Elche, Spain; www.altabix.es) have designed and developed a machine-vision system to automatically inspect and sort pomegranate arils depending on their commercial quality and to remove unwanted materials produced during the extraction of the arils.
In operation, raw material from the extracting machine travels on a 250-mm-wide conveyor belt and drops onto a vibrating tilted plate. This forces the material forward and disaggregates it as it reaches the end of the plate. To separate the different objects, the material is then split onto six 30-mm-wide conveyor belts moving at approximately 1 m/s. This separates the different objects and allows simple image analysis to separate, classify, and expel each object into a corresponding collection bin.
To acquire 512 × 384-pixel RGB images with a resolution of 0.70 mm/pixel, the system uses two progressive-scan cameras whose images are digitized into a 3-GHz Pentium 4 CPU using a single frame grabber. These cameras capture an area of approximately 360 mm along the direction of the conveyor and a width that allows images of fruit traveling along three conveyor belts to be captured simultaneously (see Fig. 1).
To illuminate the conveyor belt, two 40-W daylight compact fluorescent tubes are located on both sides of each of the six conveyor belts. The influence of bright spots caused by this direct lighting on wet surfaces is minimized using cross-polarized filters placed above the lamps and on the camera lenses.
Image analysis software is programmed in C without the use of a commercial machine-vision software package. This ensures real-time system response and a high level of system determinism. This software processes images from one camera as images are being acquired by the second, resulting in increased system throughput.
Image acquisition is triggered by pulses received from an optical encoder attached to the shaft of the conveyor’s carrier roller and connected to the serial port of the computer. Because the cameras are triggered as the belts move incrementally forward by 350 mm, image acquisition is independent of the speed of the belts, ensuring that there are no overlaps or gaps between consecutive images.
To determine which regions of the image correspond to the background and which represent the objects of interest, a pixel-oriented segmentation algorithm is used. Since the conveyor belts are blue, their images consistently return high blue values and low red values. Alternately, the colors of the pomegranate arils vary between white and red and return high red values while the internal membranes, which are mostly white, have high red, green, and blue values. Consequently, the segmentation algorithm used a predefined threshold in the red band and pixels having red coordinates below this threshold were considered to belong to the background (see Fig. 2).
Once the background is removed, each connected region is labeled as a possible object of interest. At the same time, the software estimates the size and centroid of each of these objects and their coordinates. Extremely small or large objects are then classified as unwanted material. Finally, the average color coordinates classify the object into one of four pre-defined categories. After processing each image, the category and position of the object is transmitted to a second computer over TCP/IP, which tracks the object until it is sorted.
To sort the produce, three outlets are placed on one side of each of the conveyor belts. In front of each outlet, air ejectors expel the product. Separation of the arils is controlled by the CPU using an I/O board with 32 digital outputs that manage the air ejectors. After the CPU receives the classification category and the position of each object in image coordinates via TCP/IP, this information establishes which air ejector needs to be fired. Produce of high quality not expelled in these three outlets reaches the end of the machine, falling down by gravity into a fourth outlet.