From Open Foris Wiki

Jump to: navigation, search

This script creates a NDVI image using (NIR-VIS) / (NIR + VIS)

Usage: oft-ndvi.bash <input> <output> <R_band> <NIR_band> [mask]

  • Input data is an image stack. User gives the location of Red and NIR band (in regular Landsat TM/ETM 3 and 4)
  • Number of bands is not restricted


You can include a mask_image into this process by using the option [mask]


  • Get Example data set
  • For this exercise following tools are used: oft-ndvi.bash
  • Open your working directory using
cd /OFGT-data/images/
  • Run the command line for calculating the NDVI for your satellite image where landsat_t1.tif is your input image and NDVI_landsat_t1.tif will be your NDVI output image. The numbers <3> and <4> refer to the band numbers for the VIS and NIR bands.
oft-ndvi.bash landsat_t1.tif ../results/NDVI_landsat_t1.tif 3 4
  • Load NDVI_landsat_t1.tif in QGIS
  • Check that all pixels of your NDVI image have the expected values between -1 and 1.
  • Here is an example of how the result looks like:

Zoomed view of the original Landsat image Zoomed view of the NDVI-result using the 'freak out' colour map in QGIS.
File:ndvipre.jpg File:ndvipost.jpg

Back to Open Foris Toolkit Main Page

Back to Tools & Exercises

Personal tools