Public Lab Research note

Comments and questions on NDVI

by radialmind | February 08, 2014 12:54 08 Feb 12:54 | #10021 | #10021

What I want to do

I have converted a Canon Powershot ELPH 300 HS to use a wratten25A filter and I'm trying out, taking some photographs from vegetation places here and there. I'm evaluating how well these results fit my expectations and I notice some interesting results.

My attempt and results

Here's two photos of a place in Brazil. It has a pool, stone tile area, wooden crossings, vegetation, plants, flowers and some shadows. I calibrated the white balance on a red surface in 4/8 cloud cover, not in bright sunlight.



Questions and next steps

I especially notice a very high correlation of high NDVI values in shadowy areas, which could indicate that the radiation of NIR vs. VIS light is not linear. Because of the formula of (NIR-VIS)/(NIR+VIS) and assuming that NIR == 1, then it's clear that when VIS approximates 0 (towards shadowy areas), you'd expect a higher NDVI. In the results of the images above you can clearly see how strong this correlation works out in practice.

The next question is then why this occurs.

  1. Is my white balance still off? Should I find a better surface to calibrate against which is also directly sunlit?
  2. Does NIR bounce around more than VIS light?
  3. Is the sensor oversensitive to NIR?

Another interesting observation is that even at night I'm getting consistent 'blues' on the sensor, especially when I aim the camera at wooden parts like a wooden dresser over here, a wooden railing and so on. At night I wouldn't expect a lot of NIR light to enter the camera, so I'm wondering if I need to do something special to get better results.

It also seems to have a strong correlation with green items that come out very blue, like a green towel hanging around here.

Why I'm interested

Obviously modified cameras need to demonstrate results where there is a strong correlation between reflected VIS/NIR light in such a way that it doesn't have such strong correlations with the shadow. So I need to find out what's still wrong in the setup. Could still be the white balance, could also be some other settings in the camera. Any help is appreciated.


This is a really good result. Why is NDVI artificially high in the shadows? In really dark parts of a photo, the values representing how bright each color channel is (the digital numbers or DNs), are very small. So the variation in those values due to things other than plant vigor can become much greater than the variation due to plant vigor. With small values, the value for NIR in a particular pixel is just as likely to be larger than the value for VIS as it is to be smaller. So NDVI values for plants in dark parts of photos are never going to be reliable.

However, you have noticed a pattern that is common in single camera and dual camera NDVI systems, that NDVI in dark parts of photos is usually artificially high, and rarely low. So there is a tendency for either (NIR-VIS) to get unreasonably big, or for (NIR+VIS) to get unreasonably small. I think you nailed it with your example: regardless of the value for NIR, as VIS approaches zero, NDVI approaches NIR/NIR which is 1.0 (the maximum value for NDVI). Since NDVI is indeed approaching 1.0 in dark areas, maybe we can assume that VIS approaches zero faster than NIR. I don’t know why this would be, but apparently at low light levels the filter is allowing more NIR into the NIR (blue) channel than it is allowing VIS into the VIS (red) channel. But it could also be related to the color balance, contrast, or exposure algorithms hard wired into these consumer cameras. It may also be an artifact of the custom white balance we do to get realistic NDVI values for well-lit parts of a scene. As you say, there are no guarantees that the response curves in the blue channel (NIR) and red channel (VIS) are linearly related. I tried staring at the first image in this note to glean some wisdom on this topic, but I hadn’t had enough coffee.

It is good to see an otherwise biologically meaningful NDVI result from a camera with a CMOS sensor. I think this might be the very first example I have seen of a Super-Red (Wratten 25A) image from a CMOS camera. It would be good to see more. It would also be good to learn how you processed your photo, and what color table you used to display the NDVI result. This conversation is not going to have much meaning for most people who have little idea what the colors in that NDVI image mean (I am making wild assumptions about what they mean). Did you use a color table that assigns white when NDVI=1 and black when NDVI=-1?

Your custom white balance looks very good. Because you are breaking new ground with a Super-Red CMOS camera, experiments with other white balance colors are called for. Maybe try something red in direct sunlight. Or a red LED. Any results you can report will be very helpful.


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

Reply to this comment...

Chris, thanks for the kind words. Do you see or would you expect noticeable differences with CMOS vs. CCD? and if so, would you expect them to contribute negatively?

I processed this photo with the latest ImageJ (Fiji) using Ned Horning's plugin this time using the LUT16 color table. Using others like the rainbow table don't change the results much.

Here the results are stretched with 2.0 stretching. Meaning it probably goes for the highest and lowest and stretches those results into -1.0 to 1.0. So if NIR reflection is a bit low (or considered low due to white balance), you'd get some really large variations.

I'm also considering that the green channel bleeds into the blue channel somehow, or in a weird kind of way, because the images also from green towels gives me a lot of blues on the greens.

Tomorrow I intend to white balance on a red flower in sunshine (if it appears) near the pool area and then reshoot to see what happens. I'm considering the possibility that white balancing without a lot of NIR present (which is invisible) is skewing results a lot. As we can see a red surface, but not a surface that reflects red and the amount of NIR it reflects, we can't be exactly sure. Basically I'm seeing that it's not just the color of the white balance sheet that makes the difference, but also the material. The material being the closest predictor of how much NIR it reflects to fall into the camera sensor. Eg. how well does origami paper reflect NIR vs. the emissions of NIR of a LED?

What would be a good test is to make a shoebox with an arduino with 2 LED's... One of the correct color and another LED for the NIR range of a certain intensity. Then white balance off that and get back in the field.

I have already accustomed to the fact that these are "data pictures" and that I shouldn't expect cool looking photos. In other articles I see people trying to bring white balance back to 'normal', but this ignores the fact that NIR may be present in completely different amounts. White balance is basically adjusting the camera's interpretation of the environment's lighting conditions to bring it back to the ground truth. So if you have too much yellow or blue, it would compensate for those lighting conditions (which it cannot know in advance). So if you have visible red light and a certain amount of NIR, what should the actual image look like? I think a lot more red than usual (not true in my case), as the presence of NIR is less than the presence of VIS light. This probably greatly offsets my results.

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

Reply to this comment...

CMOS sensors seem to handle IR light differently. There as been some limited comparison of CMOS and CCD Powershots. One hypothesis is that the color filter array which allows only red, green, or blue light to reach each pixel on a CMOS sensor passes more NIR than the CFA (usually a Bayer filter) on CCD cameras. Or maybe the CMOS sensor is more sensitive to NIR. The effect is strongest with inexpensive webcam like cameras which are all CMOS, After the IR block filter has been removed, the R,G, and B channels all seem to record lots of NIR light. This also happens in CCD cameras but to a lesser degree.

At the bottom of the page for the Fiji plugin there are a couple of look up tables that seem to work well for NDVI.

Your idea for an LED white balance device is great. You are right that using various materials under variable sky conditions is rather unpredictable and indefensible. We tried to use LEDs for white balance with good results, but I'm sure if it has been done much.

Sometimes these data pictures can look pretty cool. But I think the objective of the custom white balance is to fool the camera into emphasizing the NIR channel. When we flood the sensor with red light while doing a custom white balance, the white balance algorithm thinks it needs to make a big adjustment to make the photo look normal. This then forces the camera to make photos which de-emphasize the red channel, and emphasize the blue channel, which records almost pure NIR in a Super-Red camera. It sounds simple, but I have not been able to recreate this adjustment after the photo is taken. Just using Photoshop to make the photo more blue does not do the same thing, and it's hard to make good NDVI images from those photos. I wish someone could explain this to me.

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

Reply to this comment...

Well, reading up on the effect of shadows on NDVI, it certainly doesn't come as a surprise anymore. Here's a page demonstrating C3 technology:

Their page on 'shadows', soil and overexposure is enlightening to some extent.

Another reference on shadows:

Pre-processing images sounds like a good idea. It's also interesting to read how NDVI was started. Because absolute NIR / red reflectances don't provide a lot of info on plant health, the initial method was to relate NIR reflectance to the red visible light channel. This however made it possible to increase NDVI without bounds when visible light became very low, so the values were bounded in the formula of the NDVI formula we now know.

I've read some research where they used something called a "shadow index" to compensate for shadowy areas. They claim that they got reasonable results pre-processing photos this way.

Reply to this comment...

Reply to this comment...

Login to comment.