Feature Generation and Extraction: This section will cover how to generate canopy features, such as Canopy Cover (CC), Excess Green Index (ExG), and Normalized Difference Vegetation Index (NDVI). Additionally, it will cover how to extract these features using previously created grids or plot boundaries.
Most common vegetation indices used in agriculture:
Normalized Difference Vegetation Index (NDVI)
NDVI = (NIR − Red)/(NIR + Red)
Enhanced Vegetation Index (EVI)
EVI = 2.5 × ((NIR − Red)/(NIR + 6 × Red − 7.5 × Blue + 1))
Soil-adjusted Vegetation Index (SAVI)
SAVI = ((NIR − Red)/(NIR + Red + L)) × (1 + L)*
*L Varies from -1 to +1 depending on the green vegetation density in the questioned area.
Normalized Difference Red Edge (NDRE)
NDRE = (NIR − Red − Edge)/(NIR + Red − Edge)
Modified Soil-adjusted Vegetation Index (MSAVI)
MSAVI = 0.5 × ((2 × NIR + 1) − sqrt((2 × NIR + 1)2 − 8 × (NIR − Red)))
More vegetative indexes can be found here:
Feature Generation
- Open QGIS.
- Drag and drop mosaic layer, previously generated using structure from motion, into QGIS.
Make sure mosaic includes desired bands needed for the feature to be generated. - Cick on “Raster” in the top menu > Open Raster Calculator..
- In the “Raster Calculator Expression” box, using the bands from the “Raster Bands” box, write the necesary equation for the desired feature to be generated.
Make sure you are using parenthesis if needed and they are closed accordingly. - Click on “…” from “Output layer” > Go to the desired folder to save the feature > Specify the name > Click on “Save.”
- If the formula was correctly written, click “OK.”
- Wait for the process to be completed.
Once the new layer with the desired feature has been generated, you can proceed to Read/Extract values from it. - After the process has finished, you can now close QGIS.
- If prompted, click “YES” > On the second prompt, click “Discard.”
Read/Extract Layer Values
- Open QGIS.
- Drag and drop layer to read values from and plots or grids boundary file (.shp) into QGIS.
- Open Processing Toolbox.
Make sure you have imported into QGIS the grid or plot boundary shapefile created previously. - Search for “Zonal statistics” > Double-click on the tool.
- On the Parameters tab:
- Raster layer: Select layer to read values from
- Statistics to calculate “(…)” > Select desired statistics. For example, mean or standard deviation. > “OK.”
- Click “Run.”
- After the process has finished, click “Close.”
- You can see calculated values in the attribute table of the Zonal Statistics layer.
- After the process has finished, you can now close QGIS.
- If prompted, click “YES” > On the second prompt, click “Discard.”