Colorimetry and Computer Vision for Color Characterization by Image , Applied to Integrated Fruit Production

Résumé. L'utilisation de contrôles automatisés dans l'industrie agricole et alimentaire est désormais une solution commune pour l'analyse finale de la qualité du produit. Les caractéristiques évaluées incluent les aspects dimensionnels, mais aussi ses caractéristiques de couleur, de texture et de forme. De nombreux de pays utilisent des normes pour la classification, l'étiquetage et l'emballage afin de standardiser la qualité des produits commercialisés et de répondre aux demandes des consommateurs. La classification de fruits englobe différents paramètres tels que l’état de maturité, la quantité, la taille, etc. Ainsi, le but de cet article est de présenter une méthodologie de test utilisant des techniques non destructives de colorimétrie et de visualisation par ordinateur pour caractériser les couleurs par l’image, appliquée à la production fruitière intégrée. Afin d'atteindre l'objectif proposé, la banane (Musa sapientum) a été choisie comme étude de cas pour le développement de cette recherche. En conséquence, une nouvelle méthodologie a été développée pour caractériser les étapes de maturation de la banane à partir de l'analyse colorimétrique et proposer une norme pour le secteur. Cette norme comprend la classification des stades de maturation, la définition d’un système d'éclairage plus efficace et de la meilleure couleur de fond à utiliser, et une proposition pour l'étalonnage du système.


Introduction
Visual inspection, despite being an old technique, is a non-destructive test still widely used to evaluate a products' quality conditions, since it is easy to perform, inexpensive and generally requires no special equipment and is regarded as a primary method in quality control programs.Visual inspection requires good vision, good lighting condition and experience of the technician to recognize defects.
With the advent of new technologies, the use of automated inspections in agriculture and food industry is becoming an increasingly interesting solution in the final analysis of product quality, which considers characteristics of color, texture and shape, which are usually the criteria used by the consumer when acquiring a product [1].
The purpose of this work is to present an Image Metrology System (IMS) involving a non-destructive testing methodology for monitoring banana ripening subclasses using techniques from Colorimetry combined with Computer Vision for color imaging characterization, which can be applied to the fruits integrated production.The main focus is on the standardization of measurements, considering important issues such as the lighting conditions, environmental characteristics, types of illuminants, observers, etc., in addition to providing, for the automatic inspection system, traceability and color definition standards for fruit production industry.According to Ceagesp's classification [2], banana ripening has seven subclasses that are used when rating for export, which are: C1 (solid green), C2 (green with yellow dashes), C3 (more green than yellow), C4 (more yellow than green), C5 (yellow with green tip), C6 (yellow) and C7 (yellow with brown spots).The results obtained with an IMS are compared with a traditional color system [2,3].

Metodology
In the development of a non-destructive testing methodology for color characterizing from a digital image, spectral measurements were made from the fruit's peel in order to monitor and spectrally characterize their ripening stages [2,3].Subsequently, a system was developed to analyze the influence of lighting and background color in the characterization of banana ripening subclasses, and finally from the acquired digital images, the peel color was analysed using the developed software.

Acquisition
The first step in an automated visual inspection is the acquisition of the image, which consists on choosing a camera and a lighting system suited to the specific problem.
In this work, a 10 Megapixels digital camera, with CMOS sensor has been used for the acquisition of images of fruits.The camera is in symmetrical position to a spectrocolorimeter, at an angle of 45 ° (Figure 1).

Acquisition system calibration
The calibration of a digital camera is necessary in order to convert between different color systems and then compare with a calibrated standard to provide traceability to the system.The color system commonly used in laboratories is the CIEXYZ, a system developed by the CIE [6,7] to be used in colorimetry, which is able to mathematically determine color.From this system, other color systems may be used according to the application.For example, in the industry, the most commonly color system used is CIEL * a * b * (or CIELAB) because it is closer to human perception.
In order to assess the accuracy of the acquisition system, images were acquired using colorimetric standards, on top of a black background color (chromaticity coordinates x = 0.4545, y = 0.4088 and Y = 1.26%) and a source of tubular high-pressure metal halide lighting HCI-TS 150W / NDL 942 (TCC = 3544 K and Ra = 97).
From the images of the red, green and blue standards, the chromaticity coordinates are calculated to verify the accuracy from the color measurement of the SMI using a program developed in Matlab.The RGB values calculated [6] for the standards were plotted against values measured by the spectrocolorimeter to verify the measurement system linearity and the camera sensor response.
After the colorimetric sensitivity correction of the digital camera, a linear relationship has been obtained with a good correlation between the tradicional CIEXYZ values and the image XYZ values.Thus, the XYZ values from digital image have been corrected using Equation set (1).

Image color analysis of the banana peel
Banana images were acquired simultaneously with the spectral colorimetric measurements for analysis and determination of color, and subsequent characterization of the ripening subclass [1,2].
The images used were obtained under the same light source with which the IMS has been validated.From the fruit's acquired image in each ripening subclass, the CIEL * a * b coordinates were calculated [7].

System calibration
Chromaticity coordinate values were calculated according to [6] and [7], after correction of the camera sensor's response using Equation set (1).
The results, shown in Table 1, are considered satisfactory, presenting the effectiveness of the the digital camera's colorimetric sensitivity correction from the measurement of the color standards.The worst result was obtained for the x coordinate on the red standard, which, even with the correction, presents a higher error compared to the other deviations found for the other standards.For better assessment of the measurements' accuracy, it is necessary to estimate the color measurement uncertainty of the IMS.

Measurement uncertainty
The camera acquires the image and from this the tristimulus XYZ values and chromaticity coordinates CIExy 1931 [5,6,7] are calculated.The characteristics contributing to the chromaticity coordinates' uncertainty are: chromaticity coordinates' calculation, reference standard uncertainty and repeatability.
Chromaticity coordinates calculation -the uncertainty of the chromaticity coordinates (x, y) corresponds to the uncertainty of the calculation method, defined from the accuracy of the colorimeters' measurements.Uncertainty of the reference standardis the indicated uncertainty from of standard plates' certificate used in the calibration system.Repeatability -For the repeatability analysis, chromaticity coordinate calculations are performed in three different regions of the plate surface, to verify the homogeneity of the calculations.The standard deviation values found are used in the final uncertainty calculation.The largest uncertainties estimated for the image color measurement using the IMS were: U x = 0.0551 (red), U y = 0.0187 (green) and U Y% = 5.04% (blue), with a coverage factor k = 1.96.
From the estimated uncertainty values, the coordinates calculated by the IMS were compared with values measured by the colorimetric system (COL) for the three plate standards, in order to determine the deviation between the values and the standard error, by comparing the two estimated uncertainties (Table 1).It can be observed that all measurements have satisfactory standard errors (SE < 1), confirming the accuracy of the system with the calibrated standards.This results show that the IMS provides reliable measurements that can be used to determine the fruit peel's color.

Color analysis of a banana peel by image analysis
As previously described in item 2.3, from the acquired images for each fruit ripening subclass, the coordinates CIE L*a*b* were calculated by the image analysis software, developed in Matlab, for later correlation with the ripening subclasses, as shown in Table 2.When comparing the results of the two systems (conventional and by image), some color differences in certain ripening subclasses can be noticed.These differences can be attributed to a greater influence of the illumination system in the IMS rather than in the traditional measurement using a colorimeter in order to evaluate the color image.
It is worth noting that the light source used has a tendency to green/blue, which is common for high CCT values (color correlated temperature).This once again highlights the importance of proper lighting in the image acquisition and color evaluation, particularly in systems where the reproduction or comparison of color standards are required.
To improve the characterization of the camera sensor, it is suggested to use more color standards during system calibration.
The results demonstrate the importance in evaluating the characteristics of interest to define the parameters to be used in the image acquisition so as to obtain a better image and a better accuracy in image color measurements.To improve the results, the following steps are suggested when developing an image acquisition system for color analysis: studying the sample, studying the best background color, studying the best light source and the calibration of the measurement system under the established conditions (Figure 2).

Conclusion
Several methods have been proposed with the aim of characterizing products using Computer Vision in order to optimize the inspection process and minimize losses.Many studies have been developed to increasingly improve the production systems and the product's quality.
An IMS comprises, in general, the five stages of a well-defined computer vision system.However, the strategies and tools both in image acquisition and in processing are not consensual and need to be specified according to each application.
In this paper a study for color imaging characterization was presented.As a result, a new methodology was developed to characterize the banana ripening steps using colorimetric analysis, proposing a standardization to the industry regarding the ripening stages' classification, a more efficient lighting system, a better background color to be used, and a system calibration proposal.New studies are being developed to improve the accuracy of the proposed IMS and improve the displayed measurement methodology.

Measurement system calibration
Color Evaluation Background Analysis
[7]e items calculated and presented in table are: chromaticity coordinates x, y and luminance factor Y%[7].

Table 2 .
CIEL*a*b* bananas results calculated by IMS.