Sweet - Citrus - Fruit - Detection - in - Thermal - Images - Using
Sweet - Citrus - Fruit - Detection - in - Thermal - Images - Using
Abstract—In agriculture, intelligent systems applications have In this scenario, the improvement of the various tasks involved
generated great advances in automating some processes in the in the pre-harvest; using for example precision agriculture
production chain. To improve the efficiency of those systems is techniques in the harvest and post-harvest activities; it is
proposes a vision algorithm to estimate the amount of fruits
in sweet orange trees. This study proposes a computer vision important to the Brazil citrus producers because it can reduce
system based on the capture of thermal images and fuzzy costs and optimize the entire industry supply chain. Especially
image processing. A bibliographical review has been done to in the state São Paulo, the country’s largest citrus producer.
analyze the state-of-the-art of the different systems used in fruit
recognition, and also the different applications of thermography
in agricultural systems. The algorithm developed for this project Thus, the need to improve the quality of agricultural prod-
uses the intensification operator to contrast-enhanced and the ucts and increase production capacity in agriculture places a
fuzzy divergence for segmentation and Hough transform for huge interest in the research for new technologies that can
fruit identification. It estimates the numbers of fruits in the
tree, a task that is currently manually performed. In order to improve these processes. An example is the harvest of oranges
validate the proposed algorithm a database was created with on farms in São Paulo state. This is a task that has a direct
images of sweet orange acquired in the Maringá Farm. The impact on industry costs, nearly 30% of citrus production
validation process indicated that the variation of the tree branch costs are related to harvesting activities [1]. Thus, the focus
and the fruit temperature is not very high, making it difficult of this work is the development of a vision system that can be
to segment the images using a temperature threshold. Errors
in the segmentation algorithm could mean the increase of false further embedded in a vehicle and perform the identification
positives in the fruit-counting algorithm. Recognition of isolated fruits task. Bulanon et. al [2] developed a survey to assess
fruits with the proposed algorithm presented an overall accuracy changes in orange canopy using thermal imaging for the
of 93.5 percent and grouped fruits accuracy was 80 percent. The fruit detection. Their results suggest that the largest variation
experiments show the need of other image hardware to improve in temperature between the tree and fruit happens between
the recognition of small temperature changes in the image.
Index Terms—agricultural systems, citrus, fuzzy image pro-
16:00 and midnight. Such temperature difference facilitated
cessing, thermal images the fruit recognition using method proposed. The following
year Bulanon et. al [3] proposed the fusion thermal and visible
I. I NTRODUCTION images to detect fruit (more specifically, oranges).
B. Image Acquisition
This study uses a thermal camera FLIR® A35s with a micro
bolometer detector VOX type uncooled. It has a sensitivity
0.05 °C, fixed focus, resolution of 320 x 256 pixels a spectral
range from 7.5 to 13 nm, an accuracy ±5 °C or ±5% in
reading and a dynamic range of 14 bits. TCP/IP protocol is
used of communication between the camera and acquisition
software. We used TESTO-175 model to monitor the environ-
ment. It is an instrument used to store and perform the reading
of a series of measures. To acquire thermal imaging we used
the camera’s manufacturer software FLIR: FLIR Tools+. This
choice was based on the fact that this software allows the
user to easily configure various parameters, such as emissivity,
reflected temperature, the distance between the camera and
Fig. 1. Fruit identification methodology
the subject, atmospheric temperature and relative humidity.
In addition, the software allows selection of areas of interest
A. Thermal emissivity and reflected temperature in the image and calculates the average temperature in the
The first step of the methodology is orange fruit emissivity selected area.
determination. According to the literature, it is important The image acquisition system was mounted on Mirã
to know the emissivity value of study object to improve (Fig. 2). This mobile robot was developed to be a modular
the accuracy of temperature value measured by the thermal platform for test different sensor configurations and to perform
cameras. The emissivity and reflected temperature are used to basic maneuvers to navigate with ease in the crops. To develop
configure the thermal camera parameters. This setup shall be this study the robotic platform was used to make the sequential
carried out before the images acquisition. capture of images in the farm. The tripod was adapted on top
The proposed experiment for determining thermal emissiv- of the robot.
ity of sweet orange fruit is based on experiments proposed
by [10] and [2]. The method used on this research is based
on a adhesive marker in the fruit surface as object emitter
of reference. For this initial study images were acquired every
two minutes in a closed environment with a controlled temper-
ature of 19 °C. Thermal variations of the acquired images were
analyzed using dedicated software for processing of thermal
images supplied by the manufacturer. Furthermore, a room
temperature sensor enabled a finer control of the variables that
affect the temperature measurement using thermal cameras.To
determine emissivity, the samples were placed on a flat surface
approximately 0.35m from the camera vertically. Over the fruit
sample, an isolating tape tab (3M Scotch 33+) was placed,
whose emissivity is 0.95 [2]. This experimental setup is based
on the emissivity measurement method proposed in [11]. The
images were acquired in periods of two minutes for each of Fig. 2. Platform to images acquisition [12]
TABLE I
C AMERA PARAMETERS R
RAW = B
(3)
Name Type of variable Description tempR
+F −O
R Integer Constant R
Constant B. ε: Emissivity value of the object
B Float
Range: 1300-1600 tempR : Reflected temperature
Constant F.
F Float
Range: 0.5-2 2) Contrast enhanced with fuzzy intensification operator:
Off-set Constant O. The algorithm used for the segmentation is based on the
O Float
Only positive values. work proposed by [13]. After acquiring the images, Eq. (4),
S Integer Digital Signal 14bits.
proposed by [2], is used to convert the temperature values
measured in degrees Kelvin to gray levels.
!
The image database was collected in field 111 of Maringá T(i,j) − min T(i,j)
I(i,j) = 255 (4)
Farm, located in Gavião Peixoto - SP, the trees were the variety max T(i,j) − min T(i,j)
Ruby (Citrus sinensis (L.) Osbeck) and they were planted in
Where:
November 2010 (the date of the last harvest was 17-26 June
2014). Each orange tree produces on average 2.5 boxes of 40.8 T(i,j) : Temperature value at position i, j
kilograms per year, which is about 600 fruits. 561.600 images I(i,j) : Gray level intensity for the position i, j
were acquired on days 58 and 133 of year, at different times After obtaining the gray-scale image is used the contrast
of day (morning, afternoon and evening). From this database, improvement method using enhancement operator.
50 images of trees with completely visible fruits in the frame Equation. (5) shows the membership function used to con-
were selected. The recorded video used for the experiments struct this operator for a gray-scale image of size (mxn).
had 98 trees: some of them had no fruit, and some others had −Fe
max (g) − g(mn)
been ripped out because of greening disease. The images were µ(mn) = 1 + (5)
obtained in natural lighting conditions, the relative humidity Fd
and temperature parameters were adjusted for each image. Where:
During the experiments, the distance from the camera to the g: Gray level in the image
tree varied between 1 m and 2 m, to cover a larger area of the Fd : Denominational fuzzifier
tree. Fe : Exponential fuzzifier
The fuzzifiers controls the amount of grayness ambiguity.
C. Image Processing
The values of the membership function defined by Eq. (5)
The image processing methodology has four steps: Temper- that are higher than 0.5 are converted to much higher values
ature to gray-scale image conversion, contrast enhanced with and values lower that 0.5 to much lower, which improves the
an fuzzy intensification operator, image segmentation using contrast in the image. The intensifier operator is shown in Eq.
the minimum fuzzy divergence value and fruit detection using (6) and Eq. (7).
Circle Hough Transform. Below, the details of each step are
2
describe. µ0mn = 2 [µmn ] 0 ≤ µmn ≤ 0.5 (6)
1) Temperature to gray-scale image conversion: The con-
version of the temperature values acquired by the thermal
2
camera to gray levels was implemented using MATrix LABo- µ0mn = 1 − 2 [1 − µmn ] 0.5 ≤ µmn ≤ 1 (7)
ratory (MATLAB). The conversion was carried out using Eq.
After applied the intensification operator is used the inverse
(1) provided by FLIR, where known measuring ranges are
function shown in Eq. (8) to transformed the gray values to
employed; the registers related to gain modes are shown in
spatial domain.
Tab. I. The Temperature value is measured in degrees Kelvin.
− 1
h i
0
B gmn = max(g) − Fd (µ0mn ) Fe − 1 (8)
T emperature = R
(1)
Ln (S−O)+F 3) Segmentation using Fuzzy divergence: For the segmen-
tation, it was used the method proposed by [13], whose
The emissivity is another important parameter for correct
membership function is known as Gamma function. This
measurement of temperature. In Eq. (1), emissivity parameter
function is used to find the values of the member function
is not displayed as a parameter for the conversion, but the S
for each pixel in the image, and to facilitate the calculation
parameter can be changed in Eq. (1) by the Robj parameter
of fuzzy divergence for selection of the appropriate level for
in Eq. (2) when the emissivity ε and the reflected temperature
threshold.
tempR are known. The first step to use this technique is choose the regions
S(1 − ε)RAW number that must be segmented. For each of these regions the
Robj = (2) average gray levels is calculated using the Eq. (9).
ε
Ptx oranges belonged to a commercial orchard of Ruby orange
f =0 f · count(f ) grafted on Swingle rootstock. Six samples of orange fruit were
mx = Ptx (9)
collected from each tree: two in the cup, two in the lower part
f =0 count(f )
and another two from inside. In total, 240 fruits from 40 orange
Where: trees were randomly selected from a 95 hectare orchard. The
mx : Mean of gray levels of the region x first emissivity measurement was performed on the day of
tx : Threshold to the region x sampling and additional measurements were performed over
f : Gray level value the following two days. The obtained emissivity was 0.94 ∓
count(f): Number of occurrences of the gray level f in 5%; with 95% a confidence interval.
the image
b: Maximum gray level in the image. B. Image processing
The gamma function is used to classify the pixels in the The following are the results for each of the processing
image considering the mean values of each region. The general steps. For the development of the proposed algorithm a
equation for the probability density function of the gamma database of 50 was used to validate the proposed algorithm.
distribution is shown in Eq. (10). This group of images was divided into two subgroups: images
taken in the afternoon and images taken at night. The separa-
γ−1 tion of the images was performed after observing temperature
x−b
β exp − x−b
β changes related to the period of the day, between the fruits and
f (x) = x ≥ b; γ, β > 0 (10) the other structures of the tree. Morning images were discarded
Γ(γ)
because it was not possible to differentiate objects.
γ: Shape parameter Figure 3 shows that oranges are hardly recognizable in the
b: Location parameter image because in different parts of the tree there is a relative
β: Scale parameter thermal equilibrium. Note that higher temperatures are met in
Γ: Gamma function the areas of tree that are exposed to direct sunlight, the white
For the case of region segmented, the parameters are defined areas representing the highest temperature read by the camera
as: b 6= 0, β = 1 and γ = 1. Then, the Eq. (10) take the form correspond to the ground.
shown in Eq. (11).
ACKNOWLEDGMENT
The authors express their acknowledgment to CNPq,
CAPES, EMBRAPA, CITROSUCO and EESC-USP for sup-
porting the research project and this article.