A Study of Light Level Effect on the Accuracy of Image Processing-based Tomato Grading

Image processing method has been used in non-destructive tests of agricultural products. Compared to manual method, image processing method may produce more objective and consistent results. Image capturing box installed in currently used tomato grading machine (TEP-4) is equipped with four fluorescence lamps to illuminate the processed tomatoes. Since the performance of any lamp will decrease if its service time has exceeded its lifetime, it is predicted that this will affect tomato classification. The objective of this study was to determine the minimum light levels which affect classification accuracy. This study was conducted by varying light level from minimum and maximum on tomatoes in image capturing boxes and then investigates its effects on image characteristics. Research results showed that light intensity affects two variables which are important for classification, for example, area and color of captured image. Image processing program was able to determine correctly the weight and classification of tomatoes when light level was 30 lx to 140 lx.


Introduction
Post-harvest handling is a chain of activities to maintain and achieve good quality agricultural product. One of the activities is grading in which product is classified according to consumer preferences [1]. Currently, most tomato grading is implemented using manual method mostly based on visual appearance using human eyes. It was observed that this method of grading tends to be subjective [2] and in long working hours may yield inconsistent results [3].
Image processing has long been used in industry mostly for quality control and automation. Although its application in agriculture came later, it is now used in production as well as post-harvest handling. In agricultural production, image processing is used for detecting plant condition and identifying pest [4]; [5]. In post-harvest processing, image processing is applied in the non-destructive test to evaluate the quality of agricultural products such as fruits and vegetables [6]; [7].
Department of Agricultural Engineering, Universitas Padjadjaran (UNPAD) has long been developing automatic tomato grading machine based on image processing to replace human sensory perception. The first prototype of the machine has been capable of using image processing to accurately classify tomatoes according to grading criteria given by a commercial tomato supplier. Nevertheless, their capacity was less than that of human [8]. This prototype has been further developed to improved mostly on its capacity. The last prototype has a capacity of 6000 tomatoes per hour [9]. In any of the grading machines, image of tomatoes is captured in a box furnished with digital camera and fluorescence lamps. This type of lamp is known that it will decrease its lighting ability with time. Because the quality of image is highly dependent on light [10], it is predicted reduced light intensity will affect the accuracy of tomato grading. Therefore, a study of the effect of light level on the accuracy of grading is necessary.

Construction of variable-intensity lighting system and sensor calibration
In previously available image capturing box, the intensity of light could not be varied widely for experiment. Therefore, a new lighting system was developed using high powered LED. To ensure a ripple-free DC current which powered the LED, AC power was converted to DC using step-down transformer, rectifier and capacitor. Four light sensors BH1750 were arranged in four corner of the box and used to measure the emitted light. The data from the sensor were read by a microcontroller and then send to computer (figure 2). Before using the sensor to measure light intensity in image capturing box, the sensors were calibrated using lux meter Lutron EM-900. Calibration processes were conducted one sensor at a time at its respective position.

Image Capturing and Processing
Tomatoes were placed on conveyor and then move manually until they were located near the center of image capturing box. Light intensity was set and image was taken. For this image capturing event, light intensity was varied from 0 to 154 lx. Images were then processed using visual basic program used by the machine to predict tomato weight and calculate normalized green color of tomato. This two values were then used to determine tomato grade. In this respect, normal light was used as reference.  Before used to capture tomato image, distribution of light in the box was measured by calculating luminance value from the RGB of conveyor image without tomato ( figure 4). Distributions of luminance, as well as its histogram, are given in figure 5. Based on the figure, it can be concluded that light was evenly distributed in the box and image taken within it would not be distorted due to its light distribution.

Effect of Light Intensity on Tomato Grading
The effect of light intensity of tomato image area is shown in figure 6. It can be seen from the figure that as the intensity increase, the image area also increase until about 30 lx. After reaching this value, then the image area is nearly constant at about 2200 pixel. Further checking on the image processing pipeline showed that when light intensity was low some parts of tomato edge look darker and image processing program instead of identifying it as tomato, identify it as part of background. Consequently, calculated tomato image area was lower than expected.

Table1. Light intensity levels at various criteria (lx)
Similar results were obtained for tomato weights ( figure 7). The weight of tomato become nearly constant after reaching the value of intensity of 30 lx. This can be understood since the weight of tomato was calculated from tomato image area. The bigger the image area, the heavier the tomato.
The maturity of tomato can be identified by its color. Mature tomato display higher value of red and lower value of green. Previous study had showed that normalized green (g) represent the maturity better than red or blue [11]. Light level also affects color perception of tomato. Value of normalized green in various light intensity are given in figure 8. It is clear that light intensity affects the value of g. At low light intensity, the g value was high and then decrease until light intensity reached a value between 30 to 40 lx. After this light intensity value, then the value of g remain constant.
Currently used program can detect tomato at minimum light level of 11 lx (table 1). At this light level, not all tomatoes can be detected. When the light level was increased to 12.3 lx, all tomato can be detected. Nevertheless, the value of tomato variables pertinent to grading was not right yet. The value of image area close to its reference value started to occur when minimum light level was 18 lx. Similar things occurred to the value of normalized green was at light level of 53.8 lx. These data showed that the light levels affect color perception more than image area. Since grading decision was based on image area and normalized green values, the accurate grading of tomato start to occur when light level of 54 lx. Below this light level, program will read tomato image as background image

Conclusions
Based on findings above, the following conclusions can be drawn: a. Light levels affect the result of both predicted weight and perceived color of processed tomatoes. b. The light levels affect color perception more than tomato image area c. For accurate grading of tomatoes, minimum light level was 54 lx. Below this light level, program tend to classify tomatoes incorrectly.