Public Lab Research note


NDVI Research with an Analytical Grow Chamber

by JohnsonC | March 03, 2016 00:11 03 Mar 00:11 | #12768 | #12768

What I want to do

My goal is to develop a series of experiments that accurately prove that the NDVI values of growing leaves change over time compared to that of controls when I introduce a stress on a system.

For instance, compared to a healthy control leaf, I apply a fungal pathogen to the soil that attacks the roots of a test plant. This in turn will decrease the uptake of water and nutrient transport of the xylem and phloem, lower the leaves' pigmentation, and hopefully produce a lower NDVI value. Other stresses that I may work with may include over-watering, drought, heat, pH, or even introducing pests such as thrips.

My goal is not to simply take images and produce a slideshow over time, but to create graphical visualizations that analyses each individual pixel of a NDVI image to better understand the effects of stress upon a plant's leaves.

My experiments are only to be representative of what indoor growers are attempting to do.

My attempt and results

20160129_152452_1_.jpg

Here's a good look at the device I am working with (the chamber on the left). This was at a trade show promoting this project. The cool thing about this device is that it has a lot of 8-bit sensors everywhere so it really lets one tailor their experiments to their own needs. You can measure parameters such as green reflectance, temperature, or humidity amongst others. The ultimate goal is through the use of a bunch of relatively cheap micro-controllers and smart algorithms to be able to do what a really expensive product can do. Something a lot more affordable but accomplishes the same task and then some.

20160107_175226_1_.jpg

Here's a look at the wiring process during the development of the chamber. As you can see there are many LED channels, however I only use select channels when working with NDVI images. The wavelengths of such channels are of the deep red LEDs at 660nm, blue at460nm, IR at 850nm, and UV at 385nm.

20160301_132059_1_.jpg

Above is one of the main cameras that I work with. I believe it is a webcam that is found on the Public Lab Store:

https://store.publiclab.org/collections/spectrometry/products/webcam-dsk-3-0

However I am not 100% sure as I came on the project after all the parts were bought. I was also told that this camera had a pre-installed blue filter.

visible_healthy_mar_1.jpg

I mainly work work with radishes, as they grow fast and their cotyledons are easy to monitor. I usually conclude my experiments after the true leaves begin to emerge as I've found that the requirements for effects on those leaves are different than that of seed leaves.

ndvi_healthy_mar_1.jpg

I use a free webcam software program called Yawcam to create and save time-lapse NDVI images. I used the program to also turn off the auto white balance and be able to toggle the exposure setting.

I've found that using a camera with a blue filter:

-Changing the red LED settings has little effect on a NDVI image

-Changing the blue LED settings has a big effect on a NDVI image (too low relative to IR results in image artifacting; too high results in an increase in negative or neutral NDVI values)

-Changing the IR LED settings has a big effect on a NDVI image (main contributor to the IR reflectivity of a healthy or unhealthy leaf)

-Changing the UVA LED settings has no effect on a NDVI image (used solely for the purpose of better theoretical leaf colouration)

So basically a balance of the IR and blue settings along with proper exposure contribute to good images with my setup.

visible_healthy_mar_1.png

When this image is uploaded to infragram for a quick visualisation, one can see that it is very uniform, yet not possessing much variation. Note that the right side has some scattering. This is mainly due to the placement of the IR LEDs above, so that area should be avoided during analysis (for now).

20160301_152724.jpg

I then took an image of radishes subjected to some heat stress. Clear yellowing of leaves can be observed.

Using the Infragram tool to quickly visualize this :

ndvi_yellow_mar_1.jpg ndvi_yellowing_mar_1.png

Once again little variation between the leaves are seen. This presents a problem, as I was expecting the yellow leaves to have a different NDVI value due to its colouring.

Using a tool that applies the NDVI formula (for blue = (red channel - blue channel)/(red channel + blue channel) upon each pixel of a NDVI image, I then use a visual analytic tool known as Tableau (specifically Tabeau Public), to plot the processed image.

https://public.tableau.com/views/IR10Blue5YellowingRadishesMarch12016/Dashboard1?:embed=y&:display_count=yes&:showTabs=y

This is where I run into my main issue: I am finding that it is difficult to obtain a nice variation in NDVI values even when leaves are are clearly different in their colour. Furthermore, false positives such as exposed soil and shadows present a problem with accuracy when I want to analyse large sections of an image.

Questions and next steps

I may be a little confused on how a blue filter works with the camera used in this setup. So is the "NIR" variable of the equation a summation of both the reflected red and NIR channels when using a blue filter? Because our custom software tool processes each pixel using its 8-bit integer (0-255) of the red and blue, yet when I toggle the red LED brightness my NDVI images hardly change. Or does only NIR become red and red becomes something else?

Is there something I am missing or have gotten wrong that prevents me from getting a nice NDVI image? I find that the really high NDVI values (~0.8-1.0) are only found from false positives such as dirt or shadows.

For my next experiments I plan to alter our tool so that from the start any pixels that are not related to plant matter are removed. So say with an image under white light (visible image), a pixel of an unhealthy leaf that possesses a green value of 161 will be kept, while anything under that would be presumed not to be photosynthetic and thus removed or set to black. Then by superimposing a NDVI image on top and matching the pixels by location (X, Y), removal of the same pixels from the NDVI image will then hopefully provide a more accurate composite.

Why I'm interested

I've never known about NDVI before coming onto this project. Ever since however I have been really intrigued and it is a really useful concept that I think we will see more of in the future with climate change and current implementations on devices such as drones.


15 Comments

Hi, tell me please what kind of tool you use for analyze each pixel of a NDVI image? Thanks!

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


@aldehyde - It's just a python-made program that basically looks at a pixel of an image based on location (X pixel width, Y pixel height). As far as I'm aware each pixel possesses a distinct RGB 8-bit integer value ranging from 0-255, where the red and blue values are then used for the NDVI equation to output a NDVI value for that specific pixel. All data (X,Y coordinates/RGB/NDVI) is then outputted to a csv file for me to plot using a program such as Tableau.

I wasn't the one who wrote the source code so I'm not sure if I am allowed to share it. I can however ask around and see if I can't upload it somewhere and share with the community.

@Claytonb - I was actually looking at that from the "related research notes" links after posting my research note. I have been wondering about the IR leaking into the visible channel so it is interesting that it is considered important enough to compensate. Will definitely design an experiment or to exploring this and will share my results on that afterwards.

Reply to this comment...


Hi JohnsonC,

That is a very intriguing chamber you have. Being able to control the spectral quality of the lighting makes some interesting things possible. Your results suggest that you are getting meaningful response to altering the color of the light. For example,

-Changing the blue LED settings has a big effect on a NDVI image (too low relative to IR results in image artifacting; too high results in an increase in negative NDVI values)

You found that when you flood the scene with blue light, NDVI becomes negative. This makes sense because your system uses the blue channel for visible light (VIS) when it computes NDVI, and increasing the incoming blue light will make the VIS value higher. When the VIS value is similar to the NIR value, NDVI will be near zero. When VIS is larger than NIR, NDVI will be negative. A healthy green leaf will reflect much more NIR than VIS, so if you want NDVI results similar to those derived outside under sunlight, you should adjust the lights so green leaves are several times brighter in the NIR channel than in the VIS channel.

The webcam you are using might not allow any control over white balance, so normally it would be difficult to capture photos that allow direct computation to meaningful NDVI values. However, you have control over the color balance of the photos through your control over the spectral quality of the lighting. As you have found, altering the lighting will alter your NDVI results just as altering white balance does. So you should be able to find a color mix that produces meaningful NDVI even without controlling the camera's white balance setting. You might be confused by how changing your spectral mix affects the photos because the camera might have an auto white balance algorithm. So it might be changing the color balance to try to compensate for the changes you make. Could be fun.

One of the reasons you have not been able to capture the difference between healthy and stressed leaves is that you are using a blue filter so you are using blue light as your VIS value. The amount of blue light reflected from healthy leaves does not differ much from the amount reflected from stressed (or even dead) leaves. See this note: https://publiclab.org/notes/nedhorning/11-01-2013/why-a-red-filter-should-work-well-for-ndvi. If you use a red filter instead, reflected red light will be used as the VIS value, and you will probably get better distinction between green and yellow leaves. Stressed leaves reflect a lot more red than healthy leaves.

liveVdeadGrass.JPG

Chris

Reply to this comment...


@JohnsonC - i will thankful if you can share this program with the community.

Reply to this comment...


@cfastie - That is really interesting to hear and thanks for the link to Ned's note there. I actually have an installed GHI camera that currently acts as my visible, however we've only managed to get it to output QVGA images so it's not really helpful (plus it's quite slow). A fellow programmer that I work with is currently testing out a better camera that will act as an update. We can then print out using a 3D printer a sort of filter mount in front for easy switching between red and blue filters. We have plenty of Roscolux #2007 (Storaro Blue) and #19 (Fire Red) as well. So really looking forward to mounting this new camera.

In terms of white balance, Yawcam does grant me access to such properties:

Screenshot_2016-03-03_14.36.35.png

However I haven't really toggled the white balance except for disabling the auto white balance function which was default. I thought that the default 6500K was a sufficient temperature to use.

Reply to this comment...


Oh, that's great to be able to disable AWB. I don't really know what manual setting would be best for your use.

If you are going to be swapping filters, some other opportunities arise. Neither a red nor blue filter allows both a pure visible and pure NIR channel to be captured. If you can take two photos every time you want to compute NDVI, then you can take one photo that captures only red and another that captures only NIR. If the IR block filter has been removed from the camera, an IR pass filter like Wratten 87 can allow only NIR to be captured. Then use a filter that passes only red to take another photo. Those two photos can be aligned and used to compute NDVI with two channels that are not cross contaminated.

Chris

Reply to this comment...


@cfastie I will reflect on what you have said for my next experiments, thanks for your help!

Reply to this comment...


@cfastie Hi I just have one more quick question while designing my next experiment. If I substitute the IR LEDs with red LEDs in my chamber when I take my NDVI images to act as the NIR variable using my current blue filter, that accomplishes the same thing yes? In other words, I just want to confirm that my red LEDs will act as the main source of IR when using a blue filter (barring contamination)?

Asking because subjecting my plants to only blue and IR light for the purpose of imaging would not be representative of what normal growth (at least for tissue culture propagation) would be under.

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


I am not sure what your question is. I assume the red LEDs emit some NIR, but maybe not very much. With only red and blue LEDs, the amount of NIR reflected from healthy leaves could be very low (because little is impacting the leaves) compared to the amount of blue reflected from healthy leaves. So NDVI values for healthy leaves could be negative. But it depends on how much NIR is emitted by the LEDs used.

A leaf can change its photosynthetic behavior when its environment changes, but taking some photos while some NIR LEDS are on might not have much erroneous effect on the NDVI results. The leaves just reflect most of the NIR.

NDVI is mostly a measure of how much visible light is being absorbed by leaves. One way to quantify that is to shine the same amount of visible and NIR light on the leaves and measure how much of each is reflected. Healthy leaves will reflect several times more NIR than visible. But if the incoming levels of visible and NIR are not similar, the NDVI formula does not give results comparable with legacy (satellite) NDVI. With legacy NDVI, the proportion of visible and NIR shining on the plants is known (it's always sunlight). If you don't reproduce that proportion in your experiment, the NDVI values you get will not be in the range of legacy NDVI.

If your goal is not to compare your results with legacy NDVI, there is nothing wrong with your NDVI values being negative. If you always use the same lights when your photos are taken, you can compare among your results regardless of what absolute values you get for NDVI. But it's important to have some incoming NIR if you are going to use reflected NIR to compare to reflected visible light.

Reply to this comment...


@cfastie I use of Mobius infragam cam (red filter) in Grow Chamber. Light -CFL. Received of infrared image Fig 1 and Fig 2. - after processing in Photomorfing Plugin Fiji (NDVI VGYRM.lut). NDVI index very low. Why? Thanks!

Fig 1. Infrared

IMAG0537-for_public.jpg

Fig. 2. NDVI

IMAG0537-for_public-Color_Index.jpg

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


The red filter in your Mobius is blocking most blue light but passing most of the NIR light in the scene. The blue channel receives little other visible light because the camera's Bayer filters are blocking most red and green. The only light that can be captured by the blue channel is NIR.

Compact fluorescent lamps do not emit much NIR:

Fluorescent_lighting_spectrum_peaks_labelled.svg.png

So if the scene is lit only by a CFL, the blue channel is going to be very dark regardless of what is in the scene. The blue channel is used to represent NIR (when a red filter is used), and when NIR is lower than VIS, NDVI will be negative.

The interpretation of NDVI values is based on the proportion of visible to NIR light in sunlight. When the scene is lit with a very different proportion of VIS:NIR, NDVI values will not be in the "normal" range. You could still make comparisons between stressed and healthy plants, but not with NDVI values from scenes with different lighting.

Chris

Reply to this comment...


@cfastie Hello I'm working on a project in which we see how a person's exposure to plants affects them. Currently we have a wearable sensor with three photo resistors on it. One has an infrared filter, one had green, and the other has no filter. This reads each value every second and records it. We then compare the IR and green values to the levels of visible light to get a reading of how many plants are nearby. My question is weather this method is viable since range is something we are worried about or should we switch to using a camera and just record the NDVI values that it gives.

Reply to this comment...


Reply to this comment...


IMAG0488.JPG

I used of Mobius infragam cam (red filter) in Grow Chamber. Light - RED and BLUE (3:1) LED. As I understand this is due to lack of NIR and lot of RED.

Reply to this comment...


This is a good example of how the spectrum of incident light influences the NDVI of a scene. Leaves reflect about 10 times more NIR than red, but if there is 100 times more red than NIR in the incident light, a camera will see more red than NIR reflected from leaves. Normal NDVI calculations will be very hard to interpret.

BasilHist.JPG

The blue channel records NIR which should be much brighter (farther to the right in the histogram) than the red channel for leaves (small marquee in image). Instead, the red channel is much brighter than the blue channel.

Chris

Reply to this comment...


Login to comment.