The main objective of this module is to estimate the vegetation health of an examined field region by calculating a set of Vegetation Indices (VIs). To achieve that, an input RGB image is processed in order to extract the following VIs:
Vegetation Index | Name | Formula |
---|---|---|
VARI | Visible Atmospheric Resistant Index | |
GLI | Green Leaf Index | |
NGRDI | Normalized Green Red Difference Index | |
NGBDI | Normalized Green Blue Difference Index |
Table 1. Available VIs, where G, R and B denote the green, red and blue band of the RGB input, respectively.
Each one of the four selected VIs represents the actual reflectance of the examined field’s vegetation in different color bands and thus, it can reflect different measures of crop health.
The output of Vegetation Indices
module is the calculated index (numpy array) and an image representation (tif file) of it. The extracted files are named according to the name of the input image and the name of VI, e.g. img_name_VARI.npy. Τhe *.npy
files are necessary for the Problematic Areas Detection
module. In Figure 1, we present an overview of the developed module.
Figure 1. Workflow of the Vegetation-Indices module.
- Clone this repo
- Open terminal on ~REPO_PATH
- Run:
python3 index_calculation.py --input_image ~IMAGE_PATH --output_path ~OUTPUT_PATH --vis ~ABBREVIATIONS_OF_VIs
ARGUMENTS
--input_image
: corresponds to the path of the input image--output_path
: refers to the path where the extracted VIs arrays (*.npy files) and their corresponding image representations (*.tif files) are saved.--vis
: corresponds to the selected VIs to be estimated. By default, the four VIs of Table 1 are calculated.
For example:
python3 index_calculation.py --input_image ./input_image.tif --output_path ./output_folder --vis vari gli
(a) Input image | (b) VARI | (c) GLI | (d) NGRDI | (e) NGBDI |
Figure 2. Image representations of the four calculated VIs (b)-(e) based on a given image (a).
The estimated VI maps are displayed with a red-green color-map by using the appropriate scale, where lower index values correspond to red color while higher index values correspond to green color. Each VI map is unique as takes into account different aspects of plant health.
Install all the neccecary dependencies using pip3 install <package name>
Required packages:
- numpy (version >= 1.21.3)
- matplotlib (version >= 3.2.2)
- opencv-python (version >= 4.5.3)
- argparse (version >= 1.1)
- osgeo (version >= 3.2.3)
(not published yet)
This research has been financed by the European Regional Development Fund of the European Union and Greek national funds through the Operational Program Competitiveness, Entrepreneurship and Innovation, under the call RESEARCH - CREATE - INNOVATE (T1EDK-00636).