Agricultural Water Management Web application for ...

1 downloads 0 Views 4MB Size Report
Aug 12, 2016 - database (Oracle Corporation Redwood City, California, USA); and ..... of the tool: crop specific parameters and description, allomet-.
Agricultural Water Management 183 (2017) 136–145

Contents lists available at ScienceDirect

Agricultural Water Management journal homepage: www.elsevier.com/locate/agwat

Web application for analysis of digital photography in the estimation of irrigation requirements for lettuce crops J.M. González-Esquiva a , G. García-Mateos b,∗ , J.L. Hernández-Hernández c , A. Ruiz-Canales d , D. Escarabajal-Henerajos a , J.M. Molina-Martínez a,∗ a

Food Engineering and Agricultural Equipment Department, Technical University of Cartagena, 30203 Cartagena, Spain Computer Science and Systems Department, University of Murcia, 30100 Murcia, Spain Academic Unit of Engineering, Autonomous University of Guerrero, Chilpancingo, 39087 Guerrero, Mexico d Engineering Department, University Miguel Hernandez, Orihuela, 03312 Alicante, Spain b c

a r t i c l e

i n f o

Article history: Received 9 June 2016 Received in revised form 9 August 2016 Accepted 10 August 2016 Available online 12 August 2016 Keywords: Allometric functions Color segmentation WAMP servers Color clustering Crop water management

a b s t r a c t Different studies in the field of agricultural engineering have successfully related irrigation needs of plants with the percentage of green cover in crop images, by using simple allometric equations. Therefore, the problem of segmenting plants from soil in digital images becomes a key component of many water management systems. The development of automatic computer vision algorithms avoids slow and expensive procedures which require the supervision of human experts. In this sense, color analysis techniques have shown to yield the best results in accuracy and efficiency. This paper describes the design and development of a new web application with two different color segmentation techniques to estimate the percentage of green cover. The system allows a remote monitoring of crops, including functionality to upload images, analyze images, database storage, and graphical visualization of the results. An extensive experimental validation of this tool has been carried out on a lettuce crop of variety ‘Little Gem’. The two segmentation methods – based on probabilistic color models using histograms, and clustering in the RGB space using the fuzzy c-means algorithm – are compared with respect to a manual segmentation technique which allows the human expert to validate the outcome of the process for each image. The experimental results demonstrate the feasibility of these two automatic methods as substitutes of the supervised process. The first method achieves a relative error below 2.4% in the obtained segmentation, while the second method has an error below 4.8%. Both techniques require less than 1 s of processing time in the server. Equations to compute the crop coefficient parameter are also included and validated for the same kind of crop. © 2016 Elsevier B.V. All rights reserved.

1. Introduction It is well-known that the parameters typically used to measure the size of plants and other living organisms – such as the volume, weight, area, height, root depth, etc. – are closely interrelated. The branch of biology that deals with the study of these relationships is called allometry (Huxley and Teissier, 1936). In agricultural engineering, the availability of these allometric functions allows to obtain precise estimates of parameters which are difficult to measure directly, such as the biomass or evapotranspiration coef-

∗ Corresponding author at: Dpto. de Informática y Sistemas, Facultad de Informática, Campus de Espinardo, Universidad de Murcia, 30100 Murcia, Spain. E-mail address: [email protected] (J.M. Molina-Martínez). http://dx.doi.org/10.1016/j.agwat.2016.08.014 0378-3774/© 2016 Elsevier B.V. All rights reserved.

ficients, by using other easily measurable values, such as the plant height, diameter or surface (Neukam et al., 2016; Pastor et al., 1984). In the literature, there are numerous studies that relate irrigation needs of crops with other variables that are directly related to evapotranspiration (ETc), which is defined as the sum of evaporation and plant transpiration. This ETc is calculated as the product of the reference evapotranspiration (ETo) by the crop coefficient (Kc) (Allen and Pereira, 2009). Other authors have analyzed the relationship between Kc and the percentage of green coverage (PGC), also referred as the fraction of coverage (Fc), thus providing satisfactory estimates for ETc (Escarabajal-Henarejos et al., 2015a). PGC is defined as the fraction of soil covered by the crop canopy in a top view of the ground. Besides, other allometric studies in agronomy have resulted in approximate methods to obtain the plant height (Grant et al., 2012; Xu et al., 2010), or the root depth (EscarabajalHenarejos et al., 2015b), also by means of the PGC.

J.M. González-Esquiva et al. / Agricultural Water Management 183 (2017) 136–145

Therefore, the computation of PGC is a widely studied problem in the field of agricultural engineering research. Many techniques have been proposed so far to estimate it by using non-invasive and low-cost image processing and artificial vision methodologies. Among others, the approaches based on color segmentation have proved to perform best in applications on water management systems (García-Mateos et al., 2015). As stated before, the value of PGC is mainly related to the canopy of the plant (Odi-Lara et al., 2016). This canopy regulates mass and energy exchanges and controls the behavior of physiological processes in a plant (Ruthrof et al., 2016). The PGC is used to represent different functions of crop growth and development. With the use of digital photography in irrigation control and scheduling it is possible to obtain the related parameters for crop growth modelling and water requirements. Moreover, with this technology it is possible to analyze deficiencies in management and to quantify the excess in irrigation, among others (Escarabajal-Henarejos et al., 2015a,b). The aim of the present research is to develop an executable web application that integrates color segmentation techniques for the calculation of the PGC, followed by the estimation of the crop coefficient and evapotranspiration using allometric functions previously calibrated for a crop of lettuce. Although there are many tools for image analysis and water management in agriculture, they are usually presented as PC programs or portable apps, without the benefit of having a centralized server for information storage and Internet access. The main novelty of the proposed approach is the integration of image processing, crop coefficients computations, centralized storage and remote access in a web server application. This application allows monitoring of the plants throughout the cropping cycle, being easily usable by the farm managers. In the feasibility analysis of this application, not only the accuracy of the measured parameters are considered, but also other important aspects that influence their practical applicability, such as cost, flexibility, automation and scalability, for the irrigation control of a real commercial farming. The rest of the paper is organized as follows. In Section 2, the technologies used in the development of the web application, and the computer vision algorithms applied for the estimation of the parameters are presented. Then, Section 3 describes the proposed web application, and the experimental validation that has been carried out. Finally, the main conclusions and future research lines are outlined in Section 4. 2. Materials and methods This section presents the methodological aspects in the design of the proposed system, and the materials and resources used on its development. First, the technical features and tools of the web solution are described. Then, the two methods considered for the segmentation of plants and soil in crop images, in order to estimate the percentage of green cover (PGC), are introduced. These techniques constitute the image analysis core of the process. Finally, the methodology used for the validation of the web application is presented, with a description of a manually supervised way for assessing the obtained PGC values. 2.1. Tools and technologies used in the web application The web application runs on an average off-the-shelf PC with an AMD Quad Core Processor at 2 Ghz and 8 Gbytes of RAM, with a WAMP server installed (Agrawal and Gupta, 2014; Ramana and Prabhakar, 2005). This kind of servers consist of four main components: a Windows operating system (Microsoft Corporation, Redmond, Washington, USA); an Apache web server (The Apache Software Foundation, Forest Hill, Maryland, USA); a MySQL

137

database (Oracle Corporation Redwood City, California, USA); and a PHP interpreter (PHP: Hypertext Processor, the PHP Group). The system has been programmed in PHP, which is mainly focused on the programming of server-side scripts. PHP code is embedded into HTML pages, allowing web developers to write dynamically and quickly complex web pages. This feature enables performing actions such as collecting form data, generating dynamic page content, managing databases, or sending and receiving data in an easy way. For these reasons, it has become the open source scripting language of the world’s most popular websites (Achour et al., 2015). Additionally, in order to improve data exchange of the PHP module, the library CURL (Curl Corporation, 2008) has been used. This library is capable of handling input data in JSON format (JavaScript Object Notation) that can be read by any programming language, thus enabling the exchange of information between different technologies in clients and servers. The flexibility of PHP language allows executing scripts remotely. This way, crop photographs can be captured in the field and transmitted via HTML, in a POST format, to the WAMP server. The server is responsible for processing the images and managing data, without needing to have a computer system in situ. All the data is stored on a MySQL database in the server, and can be consulted using the developed web application. Finally, PHP facilitates the importation of libraries developed in any programming language. This capability will be the basis to incorporate into the website libraries for image processing and segmentation, which are necessary to obtain PGC parameters from the photographs. For image editing purposes, the native PHP extension Imagick will be used for displaying, converting, and editing raster and vector image files. It can read and write over 200 image file formats through the ImageMagick API (ImageMagick Studio LLC). Regarding the algorithms for color segmentation of plants and soil, two different techniques have been added to the program. The first technique, developed in the research group, is based on a probabilistic classification using color histogram models (Hernández-Hernández et al., 2016). The second technique is an adaptation of the unsupervised classification algorithm with fuzzy c-means (Bezdek, 1973). Since these methods are the core of the proposed application, they are described in detail in the following subsections. 2.2. Probabilistic classification with color histogram models The software ACPS (Automatic Classification of Plants and Soil) implements the color segmentation technique using histogram models proposed by García-Mateos et al. (2015) and is distributed by Telenatura E.B.T. ACPS is an intuitive and user-friendly tool for agricultural image analysis, which includes image trimming and color models training (Hernández-Hernández et al., 2016). The program contains several generic color models for plant/soil processing, and new models can be created by the user. For this purpose, the human expert must select between 2 and 10 sample images under the same conditions of the future use, and mark some regions of interest for each class defined. The training process is iterative, allowing the user to refine the result successively. The color space is not fixed in advance, but the optimum space is selected among the 9 color spaces considered: HLS, HSV, I1I2I3, L*a*b*, L*u*v*, TSL, XYZ, YCrCb and YUV. Another interesting feature is that the model only has to be trained once for each type of crop and capture conditions, not for every individual image. Fig. 1 depicts an example of the training process of the color model using ACPS software. In essence, the process consists in testing the 9 color spaces, and the 7 possible combinations of 1, 2 or 3 channels. For example, in the XYZ space the combinations are {X; Y; Z; X-Y; X-Z; Y-Z; X-YZ}. Each of the 63 possibilities is validated in a cross-correlation

138

J.M. González-Esquiva et al. / Agricultural Water Management 183 (2017) 136–145

Fig. 1. Two views of the software ACPS for the creation of plant/soil color segmentation models. (a) Manual selection of some plant and soil samples done by the expert in the training process. (b) Histogram color models for the I1I2I3 color space obtained during training.

procedure, obtaining the corresponding error measure. The space and channels with less error are shown to the user, who can inspect the results and select the most adequate model, as in Fig. 1b. The best color spaces are usually HSV, L*a*b* and YCrCb, although it can depend on each particular scenario. The color model resulting from the training process usually occupies around 30 Kbytes, since only two histograms have to be stored. The classification algorithm is based on a probabilistic approach with a non-parametric modeling of the probability density functions using color histograms. The process performs a pixel-by-pixel classification applying the histograms of the model obtained as described above. The algorithm is complemented with a mathematical morphology stage, which is applied to improve the outcome. Summing up, the process to classify an image consists of the following steps: • Convert the input image to the selected color space, and extract the selected channels. • Apply a backprojection of the plant and soil histograms of the model to the previously converted image. This calculation consists in substituting each pixel with the corresponding histogram entry. Since the histograms are normalized to area 1, the result is a pair of probability images for the plant and the soil classes. • For each pixel, it is initially considered as plant if the probability of plant is greater than the probability of soil. If both values are equal, the pixel is considered as soil. • Finally, apply morphology operators to remove spurious pixels. First, morphological operator open with k iterations is performed, and then operator close with k iterations. The value for k is also selected by the expert during the training process. As a result, the PGC parameter is computed as the number of plant pixels divided by the total number of pixels in the image. In brief, this probabilistic algorithm for color segmentation using histograms is shown in Fig. 2.

its implementation. However, the program must be modified if the object of interest is changed. Although the method is computationally expensive, the required time can be largely lowered by reducing the size of images without causing a significant loss in the estimation of PGC. The method is based on an analysis of the maxima of the color histograms, and the application of the c-means clustering algorithm on the three channels of RGB space. For the experiments, the open source library Imagick, which provides a wrapper to the ImageMagick library, has been used. The segmentation process consists of the following steps: • • • •

• •







Apply a smoothing filter to reduce noise in the image. Resize the image to a predefined small resolution. Calculate a 1D histogram for each channel in the RGB space. For each histogram, successive application of a space-scale filtering and construction of an interval tree of zero crossings of the second derivative at each scale. Space-scale analysis to determine which peaks or valleys in the histogram are predominant, thus determining the main intervals. Set the classes at the main intervals in each color component, assigning each pixel to a class if it falls within the given ranges; in this case, it is labelled as classified, and otherwise as pending. The groups of pending pixels that are bigger than a certain size (indicated by the user) are assigned to a class using the fuzzy c-means technique. Assign each class to either plant or soil, considering the predominant average channel. If the predominant channel is green, it is considered as plant, otherwise soil. Apply mathematical morphology operators erode and dilate, to remove small groups of spurious pixels.

Again, the PGC is computed as the proportion of plant pixels with respect to the total. A sample application of this algorithm can be found in Fig. 3. 2.4. Methodology for the validation of the web application

2.3. Unsupervised classification with fuzzy c-means The fuzzy c-means algorithm has been already applied successfully in various color segmentation problems. Among them, applications to the plant/soil segmentation of crop images can also be found (González-Esquiva et al., 2016). The main advantage of this approach is that it does not require human intervention for

For the experimental validation of the proposed tool, a total of 169 images of lettuce crops were used. These photographs correspond to different plots of commercial crops of lettuce of Little Gem variety, low vigor (Lactuca sativa L. cv ‘Little Gem’), that were monitored between 2011 and 2012 during two periods: four plots in the spring season located in Pozohondo

J.M. González-Esquiva et al. / Agricultural Water Management 183 (2017) 136–145

139

Fig. 2. Example application of the color classification technique using histogram models. First, the RGB image is converted to the selected color space, in this case L*a*b*. Then, the normalized histogram models are backprojected, obtaining the probability images for plant, Pplant , and soil, Psoil . In this example, the model uses channels a*–b*. The argmax is applied (white for plant, and black for soil) to obtain the maximum probability. And finally, operators open and close are run to clean up the results.

(38◦ 39 20 N, 1◦ 47 14 W), Albacete, Spain; and four plots in San Javier (37◦ 47 04 N, 0◦ 49 34 W), Murcia, Spain. Capture was done at regular intervals between 2 and 4 days using a digital highresolution camera Nikon Coolpix S3300. The images show a top view of the crop, in order to allow a correct computation of the PGC. All the photographs have a minimum resolution of 3000 × 2000 pixels. These images were trimmed according to a pattern physically located on the ground. This assures that the area under study is always the same. The main purpose of these experiments is to validate the accuracy and computational efficiency of the two methods applied to obtain estimates of the PGCs, in their implementation on the web application. Since the correct PGC values of the images are unknown, an alternative supervised process was taken as the ground-truth for comparison. The reason is that all the results of this process are manually inspected by an expert, so they are assumed to be near to the actual PCG values. In (García-Mateos et al., 2015), the accuracy of the manual classification procedure was estimated to be of 99.7%. This process makes use of the software ENVI® (ENvironment for Visualizing Images) version 4.0, which is a commercial program developed by Research Systems Inc., Boulder, CO, USA. It is a very powerful tool oriented to image analysis and processing in scientific research in general, and land imagery in particular. The main features of this classification method, as compared to the two automatic classifiers described above, are presented in Table 1. A sample view of the program execution is shown in Fig. 4. For each image analyzed, the expert must define the classes of interest (plant and soil), marking some sample regions of interest

in the image. Then a pixel by pixel segmentation based on maximum likelihood classification in the RGB color space is performed. The program includes other classifiers based on minimum distance to the classes, planar decision boundaries, Mahalanobis distance, neural networks and decision trees. The maximum likelihood technique, which performed best in our experiments, assumes that the distribution of the pixel color in each channel (red, green and blue) has a normal distribution. Making use of the training data provided by the user, the mean and variance of each channel for each class is estimated. Then, the probability that a certain color (r,g,b) belongs to a class can be easily calculated with: 2

2

P (class| (r, g, b)) = e e

−(b−b,class )

2

−(r−r,class ) / 2

/ 2 b,class

r,class

·e

−(g−g,class ) / 2

g,class

· (1)

where class can be plant or soil; (r,class , g,class , b,class ) is the mean RGB color of the class for the given training samples; and ( 2 r,class ,  2 g,class ,  2 b,class ) is the variance of RGB values of the class. The obtained result is supervised by the expert user, who performs a progressive refinement process. That is, if there is a significant amount of classification error, the samples of the classes can be marked again, adding and/or removing some of them. The maximum likelihood classification is repeated and shown again to the user. The process is iterated indefinitely until the expert is satisfied with the result. This procedure ensures a very accurate result, but at a high cost in terms of manual work of the human operator for each individual image.

140

J.M. González-Esquiva et al. / Agricultural Water Management 183 (2017) 136–145

Fig. 3. Segmentation of a lettuce crop image using the fuzzy c-means algorithm. First, the 1D histograms of the RGB channels are computed. The second derivative of these histograms is used to select the predominant intervals in each color channel. This produces a color reduction, which is improved applying the fuzzy c-means algorithm on it. Each resulting class is assigned either to plant (green) or to soil (red), and then morphology is used to reduce false classifications (in blue, pixels corrected to plant; in yellow, pixels corrected to soil). In the final result, the original color is shown for plant pixels for visualization purposes. (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.)

Table 1 Main features of the three classification techniques compared. ENVI: supervised color classification using ENVI software. ACPS: probabilistic classification using color histogram models. FCM: unsupervised classification using the fuzzy c-means method.

Classification technique Requires supervision Can be automated Usable in other domains Process cost Color spaces Adaptable to multiclass

ENVI

ACPS

FCM

Probabilistic, max likelihood Individual, for each image No, manual process Yes High (human expert) RGB Yes

Probabilistic, histogram models Group, for each kind of culture Yes Yes Low cost per image 9 color spaces Possible

Clustering with c-means and fuzzy logic Not required Yes Requires adaptation Medium cost per image RGB Possible

Let PGCMETHOD (i) be the percentage of green cover (in a range from 0 to 100) estimated for image i using a given METHOD, which can be ENVI, ACPS or FCM. The absolute error of a method is calculated as the average difference between the ground-truth PGC and the PGC estimated for that technique. That is: 1 abs (PGCENVI (i) − PGCMETHOD (i)) N N

ERRabs (METHOD) =

(2)

i=1

where N is the total number of images. The relative error is defined as the fraction of error relative to the ground-truth PGC, averaged for all the images. That is: 1  abs (PGCENVI (i) − PGCMETHOD (i)) ERRrel (METHOD) = N PGCENVI (i)

RAM, running Windows 8. The measures include I/O operations for image reading and writing the results. Additionally, the obtained PGC values are used to estimate the crop coefficient, Kcest , which is a basic parameter in water balance computation, as discussed above. The equations corresponding to lettuce crops of Little Gem variety were obtained applying the methodology developed by Fernández-Pacheco et al. (2014), which was calibrated subsequently by Escarabajal-Henarejos et al. (2015a). The process consists of two main steps. First, plant height, hest , is estimated using the following allometric relation with respect to the PGC: hest = 4.484·e0.017·PGC

N

(4)

(3)

i=1

In both cases, the maximum errors produced for the test set are also reported for each technique. Computational times have been measured on an average PC with an Intel i5 at 2.27 GHz and 4 Gb of

where the constants are the result of a calibration and verification procedure. Second, Kcest is estimated using PGC and hest : Kcest = 0.163·ln(PGC/hest) + 0.779

(5)

J.M. González-Esquiva et al. / Agricultural Water Management 183 (2017) 136–145

141

Fig. 4. Sample view of the manual classification process using software ENVI. (a) Execution windows of ENVI, showing the classes marked by the user, and the obtained binary result. (b) Original image to process. (c) Finally obtained result.

These equations are included in the web application, which allows a modification of the calibration parameters for other kinds of crops. 3. Results and discussion The results obtained for the present research are divided into two parts. First, the functionality and user interface of the developed web application are presented. Then, the experimental validation of the underlying techniques is described. The accuracy of the proposed algorithms for plant/soil segmentation and their computational efficiency are measured and compared. 3.1. Description and functionality of the web application Fig. 5 contains two sample views of the web application developed, in a typical use case. The system consists of three main modules: • Configuration module. This is the first interface that appears to the user when using the web application. It contains functionality to access the database and manage the basic parameters of the tool: crop specific parameters and description, allometric functions used to relate different crop parameters, resolution of the images, and the segmentation technique to apply on the images. The technique can be fuzzy c-means (FCM), color histograms (ACPS), or an average of them.

• Acquisition module. This module allows the user to upload the captured crop photographs through the web interface. Subsequently, the segmentation algorithm selected in the previous module will be executed on the images. The results of the analysis are stored in the database, along with the information relative to time and location of capture. • Monitoring module. By using any device with Internet access and a web browser, the user can visualize all the results and other data available in the database. The information is shown in different ways that can be easily read by the user: graphs of evolution of the parameters of the crop obtained in the analysis; animated GIF images showing the growth of the cultures; and tables containing a detailed historical record. With this module, the user can check on the water needs of the crop, being able to export data in a format predetermined by the irrigation manager. 3.2. Experimental validation and discussion In this subsection, a comparison on the accuracy and efficiency of the two automatic methods described for color segmentation is presented. The obtained results are presented in Table 2. In the case of ENVI, the average time per image required by the human expert to classify each image was around 2 min. On the other hand, in order to compare the evolution of the estimates returned by the three techniques, Fig. 6 depicts these values produced for the 4 plots in San Javier. After obtaining the PGC values, Eqs. (4), (5) were applied to get estimates of the Kc parameter. In this case, ground-truth data was

142

J.M. González-Esquiva et al. / Agricultural Water Management 183 (2017) 136–145

Fig. 5. Two sample views of the web application developed. Left: sample results of the processing of a single lettuce crop image. Right: graph and tabular data for the evolution of a plot along the cropping cycle.

Table 2 Comparative results in the estimation of PGC for the two proposed methods: probabilistic color models (ACPS), and fuzzy c-means (FCM). ERRabs : average absolute error. MAXabs : maximum absolute error. ERRrel : average relative error. MAXrel : maximum relative error. Time (s): average time required per image, in seconds. Method

ERRabs

MAXabs

ERRrel

MAXrel

Time (s)

ACPS FCM

0.27 0.40

1.19 2.04

2.37% 4.77%

20.52% 31.40%

0.24 0.65

calculated using a Bowen station (Bowen, 1926), which allows a precise computation of water balance by measuring water inputs and outputs. The evolution of the average Kc for the four plots in San Javier, for the three methods based on PGC and the ground-truth, is presented in Fig. 7. It can be observed that all methods achieved accurate results near the expected values. The experimental results show that the two automatic methods yield very similar estimates to the manually supervised procedure, with absolute errors of PGC below 1.2% and 2.1%, respectively for ACPS and FCM. A detailed analysis of these errors shows that in 95% of the images, the FCM method has an absolute error below 1%. Misclassifications are mainly due to the appearance of large and highly contrasted shadows, usually in images taken in the sunset, which are incorrectly segmented as plants. The probabilistic method is more robust to these situations, by using a color space where the influence of color brightness is reduced.

Regarding relative errors, it can be seen in Fig. 6 that the most significant errors are committed during the first 20 days of the cropping cycle. This is due to the small size of the plants, producing small leaves that in some cases are suppressed by the morphological operators. Also, as the actual PGC is smaller, the errors are higher expressed in relative terms. For example, the maximum relative error in FCM (31.4%) is produced in an image with an actual PGC of 1.18, which was estimated as 0.81 (i.e., an absolute error of only 0.37). The average relative errors in PGC, for these experiments, are below 2.4% and 4.8%, respectively for ACPS and FCM. These results are similar to those available in (HernándezHernández et al., 2016), where a 2.08% error was reported in the estimation of PGC. Moreover, in (González-Esquiva et al., 2016) it was shown that these errors in the first stages of growth have a very little influence on the calculation of crop coefficient, Kc, since the evapotranspiration of the plant is very reduced. This fact can also be observed in Fig. 7. Concerning the computational efficiency of the methods, Table 2 indicates that both of them have a very low cost, with times below 1 s per image. This makes them very suitable for use in an automatic monitoring and management crop irrigation system. An additional experiment was carried out to measure the relation between execution time and image size. In this case, times are measured integrated into all the processes of the web application, between the click of the user and the reception of the answer. In the case of ACPS method, the process of executing an external program which imple-

J.M. González-Esquiva et al. / Agricultural Water Management 183 (2017) 136–145

143

Fig. 6. Comparison of the evolution of the PGC estimated with the three methods (FCM, ACPS and ENVI) in the 4 plots in San Javier, with respect to the day of capture.

Fig. 7. Comparison of the estimated Kc values using the three methods (FCM, ACPS and ENVI) in the average of the 4 plots in San Javier, as compared to the actual values measured with a Bowen station, with respect to the day of capture.

ments the method increases the required time around 1.5 s; while in FCM method, a part of the process is currently performed in PHP code, which could be optimized using a compiled language. The obtained results are shown in Fig. 8. It can be clearly observed that the time in FCM increases quadratically with the number of pixels in the images, which makes it prohibitive for megapixel images. The order of complexity of ACPS is linear with the number of pixels and much lower since it is compiled C/C++ code. In order to reduce the cost, images can be reduced before applying the classifiers. Additional experiments have shown that FCM can admit images down to 22 Kpixels (around 150 × 150 pixels), with no significant reduction in the accuracy of the computed PGC, yielding a relative error of 5%. However, ACPS is more sensitive to image reduction, being optimum with images of

160 Kpixels (400 × 400 pixels) or higher. The use of low resolution images not only has benefits in the time, but also in the memory required to store the images in the database, and the bandwidth to upload them. Besides, cheaper and simpler cameras can be used to monitor crops.

4. Conclusions The proposed system is a feasible and economical solution for crop monitoring, allowing estimating automatically the crop coefficient from digital images. It offers similar results compared to those obtained manually by a human expert, or to more complex solutions using Bowen stations. In this way, the program automates a highly laborious process which requires a supervised classifica-

144

J.M. González-Esquiva et al. / Agricultural Water Management 183 (2017) 136–145

Fig. 8. Execution times of color segmentation with fuzzy c-means (FCM) and probabilistic color models (ACPS) using the web application, with respect to the size of the images used.

tion, and presents a powerful interface for data visualization and database management. The system can be used either with capture equipment installed in the field, or by using the images taken by a human operator with a camera, thus reducing hardware costs. The use of PHP programming language embedded into HTML code enables access to the application from any device with a web browser in a fast and easy way. If the device has a built-in camera, then the user can capture images of the crop and send them remotely using the corresponding module of the website. The evolution of plant growth can be monitored and visualized in a graphical or tabular form, either in the portable device or in the central offices of the agricultural business, where adequate decisions on irrigation management would be taken. Regarding the experimental validation of the two underlying computer vision techniques, the obtained results have evidenced that both algorithms are able to produce accurate estimations of the PGC parameter, which is later used to calculate the crop coefficient Kc. In adequate working conditions, the probabilistic color segmentation using histograms achieves a relative error below 2.4%, while the classifier based on fuzzy c-means clustering produces less than 4.8% error. In general terms, FCM is more suitable when image resolution is very low (such as 150 × 150 pixels or below), while ACPS is faster and more accurate for higher resolutions. In addition, these results are applicable to other types of crop, since the techniques do not include specific peculiarities of lettuce. The proposed tool can be included in an irrigation management system. A previous calibration of the relation between the PGC values obtained by digital image processing and irrigation water consumption in a crop has to be developed. In a subsequent new season, and taking fixed photographs along the growing of a crop, it will be possible to predict the quantity of water needed by the crop. Then, the valve of the irrigation system could be automatically opened to provide the predicted water dose. On the other hand, the experiments have shown that the efficiency of image analysis could be greatly improved with a better implementation, since both algorithms are very fast by themselves. Also, although the accuracy obtained is satisfactory, some methods could be applied to improve it further, such as using multispectral images, or changing the color space in FCM. Multiclass segmentation could also be interesting in applications that require more than two classes, such as the distinction of plants, fruits and soil. Finally, another interesting branch for future research is to incorporate in the tool information such as climatic data of temperature, humidity and rain; culture data such as the type of crop, variety, area and

kind of soil; and crop models for the allometric relations required for the computation of irrigation needs. Acknowledgments The authors wish to acknowledge, with gratitude, the technical assistance provided by Telenatura EBT, S.L. This work was supported by the Spanish MINECO, as well as European Commission FEDER funds, under grant TIN2015-66972-C5-3-R, and by the teacher improvement program (PROMEP) of Mexico with reference UAGro-196. References Achour, M., Betz, F., Dovgal, A., Lopes, N., Olson, P., Richter, G., Vrana, J., 2015. PHP Manual. PHP documentation group. Agrawal, S., Gupta, R.D., 2014. Development and comparison of open source based web GIS frameworks on WAMP and Apache Tomcat web servers. Int. Arch. Photogramm. Remote Sens. Spatial Inf. Sci. 40 (4), 1. Allen, R.G., Pereira, L.S., 2009. Estimating crop coefficients from fraction of ground cover and height. Irrig. Sci. 28, 17–34. Bezdek, J.C., 1973. Fuzzy Mathematics in Pattern Classification. Cornell University, Ithaca, NY. Bowen, I.S., 1926. The ratio of heat losses by conduction and by evaporation from any water surface. Phys. Rev. 27 (6), 779. Escarabajal-Henarejos, D., Molina-Martínez, J.M., Fernández-Pacheco, D.G., Cavas-Martínez, F., García-Mateos, G., 2015a. Digital photography applied to irrigation management of Little Gem lettuce. Agric. Water Manage. 151, 148–157. Escarabajal-Henarejos, D., Molina-Martínez, J.M., Fernández-Pacheco, D.G., García-Mateos, G., 2015b. Methodology for obtaining prediction models of the root depth of lettuce for its application in irrigation automation. Agric. Water Manage. 151, 167–173. Fernández-Pacheco, D.G., Escarabajal, D., Ruiz-Canales, A., Conesa, J., Molina-Martínez, J.M., 2014. A digital image-processing-based method for determining the crop coefficient of lettuce crops in the southeast of Spain. Biosyst. Eng. 117, 23–34. García-Mateos, G., Hernández-Hernández, J.L., Escarabajal-Henarejos, D., Jaén-Terrones, S., Molina-Martínez, J.M., 2015. Study and comparison of color models for automatic image analysis in irrigation management applications. Agric. Water Manage. 151, 158–166. González-Esquiva, J.M., Hernández-Hernández, J.L., García-Mateos, G., Ruiz-Canales, A., Molina-Martínez, J.M., 2016. Estudio y comparación de técnicas de segmentación por color para la estimación de la fracción de cobertura vegetal. II Simposio Nacional de Ingeniería Hortícola, Almería. Grant, O.M., Davies, M.J., Longbottom, H., Harrison-Murray, R., 2012. Evapotranspiration of container ornamental shrubs: modelling crop-specific factors for adverse range of crops. Irrig. Sci. 30 (1), 1–12. Hernández-Hernández, J.L., García-Mateos, G., González-Esquiva, J.M., Escarabajal-Henarejos, D., Ruiz-Canales, A., Molina-Martínez, J.M., 2016. Optimal color space selection method for plant/soil segmentation in agriculture. Comput. Electron. Agric. 122, 124–132. Huxley, J.S., Teissier, G., 1936. Terminology of relative growth. Nature 137 (3471), 780–781.

J.M. González-Esquiva et al. / Agricultural Water Management 183 (2017) 136–145 Neukam, D., Ahrends, H., Luig, A., Manderscheid, R., Kage, H., 2016. Integrating wheat canopy temperatures in crop system models. Agron. Basel 6 (1), 7. Odi-Lara, M., Campos, I., Neale, C.M.U., Ortega-Farias, S., Poblete-Echeverria, C., Balbontin, C., Calera, A., 2016. Estimating evapotranspiration of an apple orchard using a remote sensing-based soil water balance. Remote Sens. 8, 3. Pastor, J., Aber, J.D., Melillo, J.M., 1984. Biomass prediction using generalized allometric regressions for some northeast tree species. For. Ecol. Manage. 7 (4), 265–274. Ramana, U.V., Prabhakar, T.V., 2005. Some experiments with the performance of LAMP architecture. The Fifth International Conference on Computer and

145

Information Technology, 916–920. Ruthrof, K.X., Bader, M.K.F., Matusick, G., Jakob, S., Hardy, G.E.S., 2016. Promoting seedling physiological performance and early establishment in degraded Mediterranean-type ecosystems. New For. 47 (3), 357–376. Xu, X., Wang, J., Li, C., Song, X., Huang, W., 2010. Estimating growth height of winter wheat with remote sensing. Proceedings of the SPIE 7824, Remote Sensing for Agriculture, Ecosystems, and Hydrology XII.