Question: NDVI results from modified camera is inaccurate

ThomasTaufan is asking a question about general
Follow this topic

by ThomasTaufan | June 05, 2020 05:16 | #23780


Hello sir,

I've been using the red filter purchased from Public Lab, and modified my Logitech c920 webcam to be able to capture NIR wavelength. I've attached some of the results taken raw and processed using infragram.

I've done white balance using the red card that has been sent to me too, but the result is not as good as it should be. What should I do to this pictures to improve the NDVI calculation? How am I supposed to do the white balance with the red card?
Is it true that by using the red filter there are some contamination of NIR in the red channel? is that why the NDVI calculation is not accurate?

image description

image description

image description

image description



11 Comments

What should I do to this pictures to improve the NDVI calculation?

There is not much that can be done after the photo is taken to improve its ability to provide good NDVI results.

How am I supposed to do the white balance with the red card?

Many cameras have a feature that allows a custom white balance. If the software for your camera does not allow this, it is not an option for you.

Is it true that by using the red filter there are some contamination of NIR in the red
channel?

Yes.

is that why the NDVI calculation is not accurate?

That is one reason.

A photo that can be converted to NDVI should have about three times more brightness in the NIR channel than in the VIS channel. Your photos have about 1.5 more NIR than VIS. A good candidate photo for NDVI using a red filter should have a color like this for healthy plants:

MobTest-408-24CU.jpg

Below is an NDVI image made with Fiji from your photo. There is some very general plant health information there. Much of the pattern of NDVI is due to brightness and shade, not differences in plant health. It is best to have the scene illuminated evenly by the sun, and even better on bright cloudy days when there are limited shadows. Having the sun behind you helps a lot.

Picture84NDVI.jpg

Chris

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

Reply to this comment...


Many cameras have a feature that allows a custom white balance. If the software for your camera does not allow this, it is not an option for you.

Yes, my camera has the option to manually change the white balance using slider, and I point it to the red card outdoor with bright sunlight. How can I know the white balance is correct using the red card(For example the color is cyan or turqoise), because the configuration is done manually by sliding the value. Is it by trial and error until the color of plant is like the one you provided?

A photo that can be converted to NDVI should have about three times more brightness in the NIR channel than in the VIS channel. Your photos have about 1.5 more NIR than VIS.

Could you tell me how to improve that?

Below is an NDVI image made with Fiji from your photo. There is some very general plant health information there. Much of the pattern of NDVI is due to brightness and shade, not differences in plant health. It is best to have the scene illuminated evenly by the sun, and even better on bright cloudy days when there are limited shadows. Having the sun behind you helps a lot.

This photo is taken outdoor with the scene illuminated evenly by the sun, I don't really understand what you meant of "Much of the pattern of NDVI is due to brightness and shade, not differences in plant health." Could you please explain it more to me?

Thanks Chris

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

Reply to this comment...


How can I use your colormap in MATLAB?

Thanks Chris

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

Reply to this comment...


Is it by trial and error until the color of plant is like the one you provided?

Yes, that would be a good way to do it. What the camera is pointed at when you move the slider might be irrelevant unless you get a live preview.

Could you tell me how to improve that?

Set the white balance so the brightness of the blue channel is exaggerated.

Could you please explain it more to me?

When a photo (or part of a photo) is well exposed, the values for each pixel (DNs) of areas in the scene of interest (plants) will be on either side of the center of the range (0-255). For example blue (NIR) might be 210 and red (VIS) might be 70. If the photo is underexposed, those same pixels might have values of 150 and 10. In both cases, the difference between NIR and VIS is the same (140), but NDVI computed with those values will differ (0.5 vs. 0.875). NIR (210) is three times VIS (70) when the exposure is good, but NIR (150) is 15 times VIS (10) when the plants in the photo are underexposed. Overexposed plants also produce unreliable results.

Every pixel in the photo must be illuminated the same and exposed the same in order for the computed value of NDVI to be comparable among pixels in the same photo. Bright cloudy days might be the only time this is possible. The sun at your back will always help. Comparing NDVI values between two photos is rarely reliable because sun angle, sky color, exposure, etc., will differ among photos.

Your outdoor photo has areas where plants are in the sun and areas where plants are in the shade. Those plants could have identical "health" but dramatically different "NDVI" values.

How can I use your colormap in MATLAB?

I have not used MATLAB for this but others have: https://publiclab.org/search?q=matlab

Chris

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

Reply to this comment...


I have successfully used your color map, but the result is different. What is the equation of NDVI that you used?

colormap2.jpg

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

I used the standard NDVI equation. The histogram of one of the channels was probably stretched (one or more extreme points at either end removed and the rest stretched to fill the 0-255 range).

Chris


Reply to this comment...


The histogram of one of the channels was probably stretched (one or more extreme points at either end removed and the rest stretched to fill the 0-255 range).

Sorry I don't really understand this one, how can I fix that so my result can be as vibrant as yours?

You ever said that the red channel is contaminated by NIR, how can I solve that?

When I point my camera to the card using auto white balance, nothing changed. And when I change it manually, the plant's color couldn't be like your example no matter how I change it. Could you please explain how you usually do the white balancing?

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

The "histogram" is a frequency distribution of brightness values (DNs, 0-255) for all of the pixels in a photo, in this case for one color channel. A graph of the distribution displays how many pixels (y-axis) had each brightness value (x-axis). Changing the shape of the distribution can sometimes allow more information about plant health to be discerned. Stretching the histogram means rescaling all of the DNs so the smallest is 0 and the largest is 255. Sometimes one or more of the smallest and largest DNs are deleted before rescaling the others. This typically spreads out the distribution so it covers more of the range from 0-255. If the histogram is stretched, it should be stretched the same way for all photos that will be compared to each other.

With information about the sensitivity of your camera's sensor to wavelengths from blue to NIR it is possible to estimate how much each channel might be contaminated with visible or NIR light . There is a discussion of how to do this here.

Custom white balancing to exaggerate the brightness of the NIR channel is done differently on different cameras. Many cameras have a custom white balance option. The Mobius camera (which took the turquoise moss photo) allows values to be entered for the brightness of each channel. The RPi camera software has a function called AWB gains which allows values to be entered to modify the brightness of each channel.

Chris

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


Reply to this comment...


I have done white balancing manually with the range from the left to the right I defined as 0% - 100%.

N.png This is taken with WB 0%

N.png This is taken with WB 25%

N.png This is taken with WB 50%

N.png This is taken with WB 75%

N.png This is taken with WB 100%

What is your thoughts about it? I can't produce the image with color of the plant to be turqoise like yours

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

Reply to this comment...


This is the original image

Picture_130.jpg This is taken with WB 0%

Picture_133.jpg This is taken with WB 25%

Picture_132.jpg This is taken with WB 50%

Picture_134.jpg This is taken with WB 75%

Picture_131.jpg This is taken with WB 100%

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

The "WB 0%" photos seem to produce the most meaningful NDVI images for this subject. The photo has a pale version of the turquoise color for plant leaves. The NDVI image does a good job distinguishing foliage from non-foliage. Testing on outdoor subjects in natural light might be more definitive.

Chris


Reply to this comment...


Log in to comment