NDVI Post-Processing in Fiji

3689577321?profile=original

A lot of people have been asking me how we post-process imagery coming from one of our, or any other company's, NGB converted cameras. There's a very easy way to run this processing thanks to Fiji and the Photo Monitoring plugin by Ned Horning. I've just written up a quick getting started guide to this software, pasted here for convenience. If you're coming across this post in the future, see this link for the most up to date version.

Images taken with modified NGB cameras need to be processed in order to display information about vegetation health. This process is very easy using Fiji and Ned Horning's Photomonitoring Plugin. First, grab a copy of these software packages - the easiest way to get a copy with the Photomonitoring Plugin is to download a pre-configured pack from Flight Riot, here (Look for the text "Click Here to Download FIJI/IMAGEJ with PHOTO MONITORING PLUGIN pre-configured" just below the third paragraph).


Install this version of Fiji then load the program and open an NGB image. The sample image used in this tutorial is downloadable by clicking here.

PluginOpen.jpg

Open the NDVI processing tool by clicking Single image NDVI from displayed image from the Photo Monitoring dropdown as shown above. Now the NDVI processing tool will open and display several options for how to process your image. Make the following changes to the default settings:

  1. Uncheck "Stretch the visible band before creating NDVI?"
  2. Uncheck "Stretch the NIR band before creating NDVI?"
  3. Change the output color table box to 'ndviClasses_-1_1.lut' as shown below


Variables.jpg

Now just click 'OK' and after a few seconds two images will load. One is the black and white raw NDVI values image and the other is the same image but with the selected lookup table applied. A lookup table (or LUT) simply takes the NDVI values from the first image and applies a color depending on the magnitude. This allows us to visualize the NDVI values more easily. This is just a way of visualizing the data though and does not change the data in any way, you can select other LUT files and experiment to see which display you prefer most. The default output results in the images below.

NDVI_BWLUT1.jpg

This is perfectly usable as it is, but I know this LUT is designed to display the highest values in green. The highest values in this image are only as high as values corresponding to yellow, which is about 0.5. In order to show more depth in the image, we can re-scale the LUT values from -1.0 to 0.5 so that we get the full range of colors across the full range of NDVI values in this image. To make this change, open the NDVI processing tool again and this time enter 0.5 into the box titled "Maximum NDVI value for scaling color NDVI image". Applying that change gives us the following images (note the black and white raw image hasn't changed at all):

NDVI_BWLUT2.jpg

In this version, we can see more levels of differentiation within the leaves, and even some different levels in the snow, likely caused by vignetting in the camera's lens. When making a mosaic, process the mosaic first before calculating the NDVI values as this gives the software a chance to promote image-center pixels over image-edge pixels (as most postprocessing software does). Aside from that, the NDVI image has lost a good deal of the detail that would have been used to match up overlapping images in the mosaic. Fiji can safely handle mosaics up to several dozen megabytes but above that it is less stable, even if you increase the maximum memory it allows itself.

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • Hi  - would it be possible for you to send me one of your images? If I have one of your images I can and I'll try to figure out what the problem is. You can send it to horning@amnh.org

    Ned

  • Those parameters will likely need to be tweaked to show a good full scale image using a Roscoe filter - tighten the min and max NDVI value and probably also add NIR saturation. The filters we use have been updated since this article was written, and are available here: http://www.event38.com/ProductDetails.asp?ProductCode=NGB2
  • The pictures with that scale were processed using a python script I whipped up at the time, haven't used it in a while. I intended to release it but I don't think I ever made it autoscale depending on the size of the picture, plus it was very, very slow in Python!

  • Thanks for these resources

  • Will be of great value to me, thanks.

  • Hi Noli - Some day I might develop additional photo monitoring related plugins for QGIS but for the DIY NDVI work ImageJ/FIJI is more appropriate since the images are not georeferenced and the many tools developed for ImageJ work well for processing photos.

    The NDVI python code you have will work if you have images that are calibrated to reflectance or radiance but for the DIY photos additional processing steps are helpful to improve the results.

    To fix the error you are getting you should read the information on the page that the message suggests. You need to specify how much memory you want Java to use when you run ImageJ.

  • This is the error of ImageJ when I am trying to open my file.

    >>>>>>>>>>>>>>>>>>>>>>>>>>>
    > <Out of memory>
    > <All available memory (530MB) has been>
    > <used. Instructions for making more>
    > <available can be found in the "Memory" >
    > <sections of the installation notes at>
    > <http://imagej.nih.gov/ij/docs/install/>;
    >>>>>>>>>>>>>>>>>>>>>>>>>>>

  • Ned, what do think of this NDVI.py (below) ? Can this use to create NDVI python plugin for QGIS?

    http://www.jeremymsmith.us/davidson/NDVI.py

    Thanks, Noli

  • Ned, it would be good if you can develop, NDVI python plugin in QGIS as well

    Anyway, I know that you are using QGIS as well. There is quick tip how to create in NDVI from CIR mosaicked aerial photos? Anybody know how to this?

    I can not open my CIR mosaicked and orthorectified file in ImageJ. The file is more than 1 Gb.

  • Great to see a nice easy to follow illustrated guide. If folks are interested in the source code or most recent JAR file for the plugin they can be downloaded here: https://github.com/nedhorning/PhotoMonitoringPlugin. There is also another, less attractive, guide on the Github site. 

    nedhorning/PhotoMonitoringPlugin
    Photo monitoring plugin for ImageJ/Fiji. Contribute to nedhorning/PhotoMonitoringPlugin development by creating an account on GitHub.
This reply was deleted.