top of page

How to Use Computer Vision for Automatic Estimation of Crop Water Needs?

Over the years, I have come across several publications describing the use of RGB and multispectral imaging to determine crop coefficient based on canopy cover percentage and relating it to crop water use. In almost all of those studies, the authors have described camera setups that are only used to manually capture images. The images are processed later in the lab. I yet to see an affordable automated system that exploits this concept. 


In my opinion, there are two fields that can heavily exploit this: plant breeding (in high-throughput phenotyping) and controlled environment agriculture. However, the jump from manual in-field measurements to the solve-every-problem-using-AI approach has overshadowed simpler, more useful concepts like this one. This is partly because, most data scientists breath, drink and eat Python (or other programming languages), statistics, and ML/DL so heavily that there is no room for basic physics and crop physiology concepts. 


This is partly because, most data scientists breath, drink and eat Python (or other programming languages), statistics, and ML/DL so heavily that there is no room for basic physics and crop physiology concepts. 

The original article I posted in 2021 (about the same topic) was very short. In the current [edited] article I have added some additional information including a link to the GitHub repository holding source code for calculation of actual and potential transpiration. 


The goal of this article is to provide basic information on how one can combine imaging, an ET model, and microclimate data (radiation, RH, air temp, wind speed) to estimate crop water use of plants grown in pots, vegetables, row crops, etc.


ET-based Water Management

Currently, the primary approach for monitoring plant/soil water status and irrigation scheduling is to use moisture sensors. There have been some academic and corporate research on using plant sensors as well, but with little to no success in getting consistent results. The question is if there is an alternative to measuring substrate moisture using sensors to determine the water needs of plants grown in pots? The answers is yes, there is.


A great alternative is ET-based irrigation scheduling or irrigation based on potential crop water use (ETc), which is usually estimated daily using an evapotranspiration (ET) model and a crop coefficient (Kc). Unfortunately, crop coefficient values (or curves) are not established for most crops especially those grown in pots. The solution is to develop your own “crop coefficient curve” (just once) during a growing cycle and use it for future measurements. 


How to Develop Crop Coefficient Curve

Here's one easy way you can determine Kc for your crop:


  1. Choose a number of plant pots (representative of the rest).

  2. To determine the actual water consumption (ETa = actual ET) of your plants, weigh the pots daily for a change in water content divided by the area of the top of the container. Your plants must be maintained well-watered throughout the experiment so ETa and [potential] crop ET (estimated) are the same.

  3. Use microclimate data (radiation, relative humidity, air temperature, wind speed) and the Penman-Monteith evapotranspiration model (Allen et. al, 1998) to calculate the daily potential water use (ETr or ETo = potential ET for alfalfa or grass).

  4. Divide ETa by ETr to calculate your daily Kc. Plot all the values and you will have a crop coefficient curve as a function of days from planting.



Imaging-based Crop Coefficient Curve

If you need more accurate crop ET estimations that are a function of actual crop growth rather than the number of days from planting, take the additional steps described below:


  1. Everyday take a top-view picture of the plant pots and determine the ground cover percentage (C, %). This step requires a RGB or multispectral (preferred) camera and some image processing knowledge (see Figure 1).

  2. Plot C values against the crop coefficient values and develop a ground cover function for your plants, which would be a polynomial equation:

Kc = a x C^2 + b x C + m

EnviTronics Lab, computer vision, controlled environment agriculture
Figure 1. Canopy coverage (%) is converted to crop coefficient (Kc) using a polynomial equation.

Automated ETa Estimation Using a Computer Vision System

If you are interested in automating the whole process, you can do what I did, which is to build a low-cost computer vision system like this one, and embed required crop models into the system. This is appropriate for both indoor and outdoor grow operations. 


In my project, I extracted crop coefficient functions for a few crops including lettuce, garlic and tomatoes from the literature (Bryla et al., 2010) and embedded into the software (Osroosh, 2021). Whenever I need to measure crop ET, I just plug in a commercially available microclimate unit into the system's SDI-12 port, and take a top-view picture of my plants. The system then automatically calculates the crop ET and other useful parameters, geotags and timestamps the results and saves them in a 'csv' file.



EnviTronics Lab, computer vision, controlled environment agriculture
Figure 2. The system automatically estimates daily crop ET using a top-view image of the crop to estimate crop cover (C, %), a polynomial equation that converts C to crop coefficient, and the ET model. Microclimate data is obtained from an external microclimate unit that is plugged into the SDI-12 port.

The same automation approach can be implemented in other imaging platforms such as unmanned aerial vehicles (UAVs) by using embedded systems and doing some coding, or even on a smartphone. However, a low-cost handheld system is more appropriate for research and small scale farming. This removes the latency and allows for better decision-making.



Using Actual and Potential Transpiration Instead of ET

Like any other approach, ET-based water management has some limitations. I have dedicated an article on why the Penman-Monteith ET model does not work in some crops. To summarize, the famous Penman-Monteith (basis for the method described above) model is developed for short, dense grass/alfalfa canopies, which have substantial differences with most other plant canopies. For example, the PM model, does not explain stomatal regulations in response to a high degree of coupling between sparse canopies and humidity of the surrounding. 


This is why I decided to model (biophysical) actual (Ta) and potential (Tp) transpiration (versus ET = evapotranspiration = evaporation + transpiration) as part of a research project in academia. Ta and Tp are useful on their own, and can be also used to calculate crop water stress index (CWSI), which is an indicator of both biotic or abiotic plant stress.



Source Code for Estimation of Ta and Tp

For a long time, I wanted to share the source code (embedded software in C/C++ in Qt; OpenCV) for my computer vision system on GitHub. However, I never had enough time to go through my messy code and make it presentable. Recently, I started to go through the code, reorganize and share some bits and pieces that may be more useful to others.


This piece of code shared on GitHub (repo), in C/C++, includes the theoretical (biophysical) models that take microclimate and plant canopy surface temperature data and calculate actual and potential transpiration.


The code is modular and all equations are organized in a C++ class. This allows for easy integration into another code base. I have included some additional lines of code in separate module as an example and for testing purposes. The code works well, is cleaned up, and optimized for the most part. However, it might appreciate some more love and cleanup.


As mentioned, I wrote the code as part of an embedded software, but I have it in VBA as well. It should not be difficult to convert it to Python if you are not into C/C++, and I can help you with that.



Citation

Osroosh, Y., 2021. How to Use Computer Vision for Automatic Estimation of Crop Water Needs. EnviTronics Lab, April 30.



Reference

Allen, R.G., Pereira, L.S., Raes, D., Smith, M., 1998. Crop evapotranspiration: guidelines for computing crop water requirements. Irrigation and Drainage Paper No. 56. FAO, Rome, Italy, 300 pp.


Bryla, D.R., Trout, T.J. and Ayers, J.E., 2010. Weighing Lysimeters for Developing Crop Coefficients and Efficient Irrigation Practices for Vegetable Crops. HortScience, 45: 1597-1604.




0 comments
bottom of page