lunes, 29 de diciembre de 2014

Exploiting NDVI data from aerial image with Fiji (ImageJ)


Perhaps after all the work of making and calibrating your multicopter, you prepare your modified NIR camera, test the filters, stitch all the images together and get the final NDVI image through the PhotoMonitoring plugin and you may feel a bit dissapointed with the result. It was a hard work, the picture is beautiful, nice colors, etc.. but I feel there is something there but I couldn't tell what. At least this was my case, but it was before discovering the wonderful power of ImageJ. So I encourage you to go one step forward and exploit a little more that NDVI image so you can talk a bit more about it.

The features you may need depend on what is your photo about, but probably you may need to count specific elements in your photo (number of trees), or you may need to distinguish one type of elements from others (crop vs weed) and get differenciated measurements for each type.


Here I present a simple sample of some of the feautures for a olive grove photo. This is the original NIR photo and the simple direct NDVI obtained with PhotoMonitoring Plugin of Fiji.




It is not easy to get much information from this NDVI image, the plugin maps from NDVI values ranging -1 to 1 to 0-255 and that values to color using the LUT. Healthy plants have NDVI values between 0.3 and 0.7, so we could limit the NDVI values to that range and map that range to 8bit color image, that way with the same color range (LUT) we could distinguish better the differences between the plants appearing in the photo. That is the most I expect to do, as I cannot trust the NDVI absolute values of this camera.


The floating point image containing NDVI information is a 32 bit depth grey scale image which we can easily threshold in Fiji to distinguish photosynthetic elements from the rest. The threshold feature classify gray scale images (there is also a color threshold) so values inside the threshold range are in in one group and the values outside it are in other group, so you can obtain statistics and use other features based on this classification.


32bit gray scale NDVI image [-1,1]

When applying the threshold (Image->Adjust-> Threshold) you are going to see the histogram of the image and two sliders for the bottom and top limits of the threshold (remember these are ndvi values as calculated by the plugin). I select just the zone of interest so I am sure that the values I am using for threshold correspond to the plants I want to study. There are several algorithms to be used but for now the default one is good. Mark "Dark background" if the elements of interest are brighter than the background, as in this case and choose the output colors for the thresholded image (B&W in this case). 


Threshold window

I think it is good to inspect the image with the mouse to have an idea of the values you are working with, I saw that in this image the trees never had values less than 0.1, so that gave me an idea of the lower limit for the threshold, with that in mind you can move the low limit slider until you see that just the trees an plants are visible, the top limit I leave it in 1.

NDVI thresholded image to [0.1,1]

Once the image is thresholded you will see a window with the results, that contains the information you are looking for, the lower and top limits of the NDVI values in the plants [0.106, 0.460], so I will use that range in the plugin to get a more easily interpretable color range in my result image:

Photomonitoring plugin values
I don't stretch the bands as all the information I have is meaninful and I don't want to remove any pixel. 

This is the new result, where it is more easily interpretable some zones in the grove where the ndvi values are higher than in others (more yellow and red colors)

Color index image


4 comentarios:

  1. Thanks a lot for this post. I'm trying to improve in this field and it is very interesting. I have a question: how can calculate the results that you posted in picture n. 5?
    I did not find this plugin on imageJ.
    Thanks
    Pietro

    ResponderEliminar
    Respuestas
    1. Hi Pietro, it is not an special plugin, just select the area of interest and use standard ImageJ analysis menus, I can't remenber the exact name of the menu but you sure will find. As is NVDI image each pixel is just direct NDVI value.

      Eliminar
  2. Respuestas
    1. Hi Carlos, I tried to elaborate a image as you did but the results aren't so clear. I don't understand how to choose the white background as you did in the last picture of your post and another doubt is if I must use for the analysis the NDVI image or the color index image that I get after the photomonitoring plugin use. May be my results depend on the image that I'm using; for that reason I send to you a link with it and if you can give a look I'm grateful. Sorry for disturbing I know that they are simple question but I'm improving with this tools.
      Thank you very much
      Pietro
      https://www.dropbox.com/s/j0i5uujuxst2j5j/IMG_2664.JPG?dl=0

      Eliminar