Public Lab Research note


Red vs. blue filters for NDVI

by nedhorning | October 30, 2013 19:07 30 Oct 19:07 | #9691 | #9691

While working on calibration techniques to improve the quality of DIY NDVI images I noticed that after calibrating the blue and near-infrared (NIR) bands from InfraBlue photos there was not as much difference between green grass and non-photosynthetic material like leaves, dead grass, wood and cardboard as I would have expected. To understand why this was happening I looked at the reflectance spectra for different materials and noticed that when using blue wavelengths instead of red the contrast in NDVI between photosynthetic and non-photosynthetic material is greatly reduced. In remote sensing contrast is very important to improve photo interpretation and classification. This discovery was a little perplexing since some of the InfraBlue images I had seen in the past year seemed to produce half-decent NDVI images. It also got me thinking that perhaps blue filters were not ideal for making NDVI images.

To better understand the differences between NDVI images produced using blue and red filters I purchased a 3” x 3” sheet of Wratten 25A from eBay and cut a small rectangle which was inserted in a Canon A2200. I decided to compare images acquired using this red filter with images acquired using Chris Fastie's Canon A810 with a blue Rosco 2008 filter. The initial results using photos acquired with Chris Fastie's help are posted below.

Wratten25ATransmission.gif

Transmission curve for Wratten 25A filter (copied from: http://astronomy.activeboard.com/forum.spark?aBID=58381&p=3&topicID=49503185)

To start with, here is a table showing the difference in NDVI values one would expect when using a blue and red filter. The NDVI values in the table were calculated using reflectance data from different online spectral libraries - more about that in a forthcoming research note. For the “Blue” NDVI I used 450 nm (blue) and 840 nm (NIR) wavevlengths and for the “Red” NDVI I used 660 nm (red) and 840 nm (NIR). The typical formula for NDVI is: NDVI = (NIR – Red) / (NIR + Red). For “Blue” NDVI calculations I substituted blue reflectance for red.

Material | Blue NDVI (840/450) | Red NDVI (840/660) ----------- | ------------------------- | --------------- pine board | 0.59 |0.08 Cardboard | 0.65 | 0.24 Tar paper | 0.12 | 0.05 Green grass | 0.85 | 0.82 Dead grass | 0.47 | 0.15 Table of NDVI values using the blue (450 nm) and the red (660 nm) wavelengths

As you can see the NDVI value for green grass is very similar regardless if blue or red reflectance was used. On the other hand, there are significant differences for the other materials. When I create NDVI images by first calibrating individual bands to reflectance and then calculating NDVI the results support the observation that contrast between photosynthetic and non-photosynthetic material is reduced with the blue filter.

All of the blue filter images below were recorded with a Canon A810 with a blue Rosco 2008 filter mounted over the lens using a custom white balance set using blue origami paper in the shade. All of the red filter images were recorded with a Canon A2200 with a red Wratten 25A filter mounted inside the camera over the sensor – in place of the hot mirror. The custom white balance for the “red” camera was a concrete block in the sun. The lookup table displays NDVI values less than or equal to 0 as black and NDVI values of 1 as white. The patch of grass on the upper right corner of the tar paper was cut two days before the photos were taken. Apparently that freshly cut grass has high NDVI values.

targetsBlockExposure0.JPG

Photo from the red filter camera

Apple2008-263.jpg

Photo from the blue filter camera

LUT.jpg targetsBlockExposure0_NDVI.jpg

Calibrating individual bands to reflectance before calculating NDVI for the red filter photo

Apple2008-263_NDVI1.jpg

Calibrating individual bands to reflectance before calculating NDVI for the blue filter photo

My interpretation is that NDVI from the red filter camera is significantly better at differentiating photosynthetic from non-photosynthetic material. There is greater contrast in the NDVI image created with the red filter photo. You will note that in the red filter NDVI image many of the pixels have higher NDVI values than one would expect (saturated at 1). I expect that is due to the way I selected sample pixels for the regression. I selected pixels from a large rectangular patch of grass at the top-center of the photo and correlated the average pixel value from that patch with the green grass reference NDVI value. I am fairly certain that the average NDVI value for the patch of grass I selected was significantly lower than the “ideal” reference grass.

Normally I would have been tempted to stop there and conclude that the blue filter is a poor choice for monitoring vegetation health but over the last year or so I had seen some pretty convincing NDVI images created using InfraBlue cameras so I explored a little further. The next two images are NDVI create using the Fiji photo-monitoring plugin. The one used the bands without stretching and the other applied the default stretch using a saturation value of 2.

LUT.jpg

Apple2008-263_NDVI_NoStretch.jpg

NDVI created by using the Fiji plugin with no stretch for the blue Rosco 2008 filter

Apple2008-263_NDVI_WithStretch2.jpg

NDVI created by using the Fiji plugin with a stretch (saturation = 2) for the blue Rosco 2008 filter

These uncalibrated images look better. Why is that? This question still needs some work but my initial guess is that even though the blue band is not as sensitive to changes in vegetation vigor/health as the red band the white balance setting Chris uses when he's shooting with a blue filter helps amplify those differences. Calibrating the images to reflectance before calculating NDVI reduces the impact of the white balance "enhancement" thereby lowering NDVI contrast for the reasons noted above.

Based on these results I think red filters need some serious consideration as a replacement for blue filters for the production of NDVI images. In addition to the advantage of increased contrast between photosynthetic and non-photosynthetic material red wavelengths are less effected by haze which can be important for kite or balloon photography. The red filter is also more similar to the red band that is used to calculate NDVI from satellite and multi-spectral aerial photos which should make comparisons easier and more reliable. This needs more testing but these initial results are encouraging.

In the next few days I'll try to post a research note to more clearly explain why red wavelengths are better suited than blue for recording differences in photosynthetic activity.


32 Comments

Wow, this is an exciting development. I had wondered about using red instead of blue, but your results are compelling. I also wonder if this would enable us to use cheaper cameras which had not been working for infrablue conversions...

Reply to this comment...


Interesting work. Thanks Ned.

Reply to this comment...


One drawback of using the red filter is that the red part of the bayer filter passes more NIR than the blue or green parts. I'm looking into ways to reduce that effect but the problem seems a bit more complex than I first expected. Just another challenge, not a show stopper.

Reply to this comment...


Dear Ned et al.,

I am pretty new to all this and on my way to convert my camera for NDVI mapping. After reading this post I am little confused: blue or red? Even though the NDVI values you present are highly correlated (r = 0.75) and thus should produce similar maps if calibrated/streched there is some non-linearity between the NDVI values of the blue and red filters (the pine board is either between dead grass and card board or between tar paper and dead grass). Hence, I am wondering if a dual-camera NIR setup with a blue filter for one camera and red filter for the other as well as some fancy LUTs and/or equations would result in even better NDVI estimates?

Regards, Thorsten

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

Reply to this comment...


Hi Thorsten, Sorry for the confusion. Some of the non-linearity between the response of the red and blue filter should be explained in the post I did on Friday: http://publiclab.org/notes/nedhorning/11-01-2013/why-a-red-filter-should-work-well-for-ndvi

With the red filter there is a bigger difference between green grass and dead grass when compared with a blue filter. If it's still not clear just ask again I'll see if I can do a better job explaining the difference.

If your application can accommodate a dual camera system that will almost certainly produce better results but it comes with the drawback of being a little more cumbersome and you need to deal with parallax. With a dual-camera setup you will have 4 data points on a spectral curve (R,G,B,NIR) instead of two and you also eliminate the problem of NIR light leaking into the visible bands. And, you also get a normal color photo which can be useful.

Reply to this comment...


Ned, thanks! Confusion is good in most cases! :-)

I think I'll give it a try and report.

For such a setup do you propose the filters you used (blue Rosco 2008 and red Wratten 25A) or a specif combination of other blue and red filters?

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

Reply to this comment...


If you use a dual-camera setup I suggest using an unmodified camera and a NIR-pass (visible cutoff) filter for the other camera. Some people use unexposed developed film for the NIR filter and that seems to work pretty well. It leaks a little visible light but I don't think it's too bad. If you search the research notes here you'll find some about dual-camera setups.

Reply to this comment...


Ned, The NDVI image made from the Rosco 2008 photo by stretching the histograms is surprisingly similar to your calibrated NDVI image from the red filter photo. The two images have just about the same amount of information about plant vs non-plant. This is good news for all the people starting to use a Rosco blue filter, because it is a lot easier to stretch the histograms than to include a calibration target in your photos and then compute regression equations. What is the main message to people making decisions about what filter material and workflow to use? What do you really gain by using a red filter? What are the real advantages of making calibrated NDVI images? Is it possible for a typical user to reduce the considerable obstacles to making calibrated NDVI images?

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

Reply to this comment...


Chris, So many questions... I think more testing is necessary but I'll take a shot at answering each question. I'd like to hear what other folks think.

What is the main message to people making decisions about what filter material: At this point I am pretty convinced that a red filter is superior to a blue filter if your intent is to monitor vegetation health. It appears to be more sensitive to changes plant productivity. A blue filter will still work but if you have a choice I think you're better off with a red filter.

and workflow to use? The workflow depends on the goal. If you just want to see changes in an image then doing custom stretches is probably easiest. If you want to compare your results with other measurements then some sort of calibration protocol would be helpful.

What do you really gain by using a red filter? The primary gain with regard to monitoring vegetation health/productivity is that a red filter will be more sensitive to changes across a photo and over time. On top of that is the improved clarity due to less scattering of red light and using a red band is the defacto standard for calculating NDVI so it's easier / more accurate to compare with other NDVI products.

What are the real advantages of making calibrated NDVI images? Calibration has the advantage of producing a product that should more accurately represent physical measurements. If we calibrate each band the measurement is reflectance and if we calibrate to NDVI then the measurement is NDVI. Manually stretching histograms can also produce good results but the output will be more subjective.

Is it possible for a typical user to reduce the considerable obstacles to making calibrated NDVI images? I think it's up to us (the atypical users) to figure out a way to reduce the obstacles. Calibration of most instruments is a bit of a bother but only because it requires a few extra steps. The calibration seems confusing now because we're still experimenting but my goal is to have a protocol that is easy to follow. I might be posting more details than I should. Hopefully by Spring we'll have something easy to use.

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

Reply to this comment...


Ned, I followed your advice and now have processed my first dual camera images (RGB and 850nm IR) using your PhotoMonitoring plugin, which works like a charm. Unformunately, I cannot post images in the comments, because I have a question about the color schemes of your PhotoMonitoring plugin. It looks (to me) that the color scales of both NDVI and NRG are inverted. Green vegetation is bluish in the NRG and bare soil is more red. I will take some more images and investigate further when it ever stops raining. The second thing I am wondering about is which channel is best to use for IR, i.e. which of the RGB channels is most sensitive to IR. I assume this depends on the sensor. Sometimes there are more green pixels. However, red seems to be most logical - or? Thanks again in advance, Thorsten PS: there is no metadata-extractor-2.6.2.zip in the download folder on github, just the jar file. Hence, xmpcore.jar is missing.

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

Reply to this comment...


Hi Thorsten,

Glad to hear you're making progress. When you run the plugin are you specifying that the channel from the visible image to use for the red band is "red" and the channel from the IR image to use for the IR band is "blue"? You can use other channels for the IR image but I think most people use the blue band. You can try others channels and see what works best for you. If you are using these settings make sure you are not mixing up the visible and NIR images.

Thanks for letting me know about the missing xmpcore.jar file. I posted it to the GitHub site so it should be there now. If you need to you should be able to get the zip file from here:http://code.google.com/p/metadata-extractor/downloads/list

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

Reply to this comment...


I am thinking of getting a modified DSLR for NDVI imaging and am having trouble deciding between two different options - camera with Schott BG3 filter replacing the stock IR filter - camera with filter removed and using lens filters

The second option seems much more flexible as it would be easy to change filters and adjust the spectral range, however, I am sure there is some good optics reason why a lens filter may be inferior to a sensor filter, maybe to do with focusing?

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

Reply to this comment...


I don't have experience with lens mounted filters but you might get some feedback if you post your question on the plots-infrared list at http://publiclab.org/wiki/mailing-lists.

Reply to this comment...


I had no problems with using lens filters so far. But it would be interesting if there is some reason to better replace the IR Filter instead.

Reply to this comment...


Ned,

Our company is supposed to be writing an article for Vision System Design magazine regarding uses for dual band filters. I realize that the red filter is not a dual band filter, but none-the-less would like to possibly include subject matter that you address here and put it in the article. I do not feel particularly qualified to write about this subject. We have time constraints as well. Would you possibly be interested in contributing to this portion of the article as an author and photographer as well? If the asnswer is "maybe" and you would like to discuss it, I can be reached at 847-359-3550 x103. Thanks in advance for giving this some consideration... Barry Warzak

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

Reply to this comment...


Hi Sorry for the trouble but how did you proceed to calibrate individual bands to reflectance before calculating NDVI? Did you use "dark object subtraction"? I can calibrate to reflection satellite images but I don't know how to do it in photographs from my modified canon with a r25A filter. Thanks for the trouble, and any advice possible. Best regards, Rita

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

Reply to this comment...


Hi Ned thanks for your research! Is great this information. i have two doubts. First if i use a red filter how should be the formula (blue - red) / (blue+red) ? Because i'm not shure but in the red chanel we have red +nir data?? And the second doubt is wich software you are using to calculate the indexs? Regards Agustín

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

Reply to this comment...


Hi Agustin,

The formula you wrote is what I use. I typically use the PhotoMonitoring plugin which can be found here: https://github.com/nedhorning/PhotoMonitoringPlugin but you can also use the Infragram web site:http://infragram.org/. The Infragram web site would be an easy way to test subtracting blue from red before calculating NDVI.

When I am creating NDVI form JPEG images I typically do not compensate for the NIR energy recorded by the red detectors but when I calibrate the images I do. For calibration I subtract some of the blue band (e.g. 80%) from the red band before calculating NDVI. The PhotoMonitoring plugin doesn't have this capability yet but I plan to add functionality to the plugin for calibrating before calculating NDVI and that will have an option to subtract some or all of the blue band from the red band. I have a research note in the works that explains my plan and I hope to post that in the next few days. Good luck. Ned

Reply to this comment...


Could something like this (blue- (red-blue)) /(blue-(red-blue)) ?? To extract the nir data in the red chanel. Regards.

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

Reply to this comment...


Sorry is should be (blue- (red-blue)) /(blue+(red-blue)) ?? To extract the nir data in the red chanel. Regards.

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

Reply to this comment...


Hi Agustin - Your second equation is one option. Another is: (blue- (red-blue0.8)) /(blue+(red-blue0.8))

You can play around with the factor I added (0.8 in the example). Using a factor greater than one might make sense if the red filter is a broad band filter that includes red through the NIR. This red correction approach works better when working with raw images and in some cases it might not work well with JPEG depending on the white balance you use but it's worth playing around with it.

Reply to this comment...


It looks like the computed index will no longer be between -1 and +1 if you adjust the red value that way. Do you then have to rescale the index somehow?

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

Reply to this comment...


Chris - Thanks for pointing that out. I typically clip the values so anything greater than 1 becomes 1 and anything less than -1 become -1.

Reply to this comment...


Cfastie and Agustin If we try to change de index co-dominium? I mean 0 to 1. And the equation of NDVI index must be.. NDVI 1= (1/2)(NDVI+1) = (1/2){(NIR-R)/(NIR+R)+1}. So if we resolve this equation we must get.. NDVI 1=NIR/(NIR+R). If we remove the hot filter from the camera in the three channels we get the three colors plus the NIR. Then, the denominator index we obtain directly from the red channel and de NIR signal from de Green or blue channel directly. To obtain again the NDVI index we get again with (NDVI=2 NDVI 1-1), in order to arrange of the new index (-1<NDVI< 1) is just a easy way. Who agreed with me. Lo podemos discutir en español Agustin.

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

Reply to this comment...


Dear Ned, Recently i have been going through your interesting works on Infragram NDVI and calibration. I was wondering if you had any published journals, which i could cite for my related works. I searched by your name in google scholar however, i didnt find any publications.

Please share me any related publications you have made.

Thank you. Keep up this great work my friend. Really very helpful for beginners like us.

Reply to this comment...


I do not have any peer-reviewed papers related to this work - sorry.

Ned

Reply to this comment...


Since these cheap consumer cameras have a lot of NIR crosstalk, especially with small sensor cameras like the GoPro, would it be better to subtract NIR from the visual channel?

I'm using a red filter on an SJCam. I have an ImageJ macro that subtracts the blue NIR channel from the red channel before computing NDVI with Ned's Photo Monitoring plugin. I haven't done any calibration yet but I find the resulting NDVI images to be clearer and with better separation.

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

Reply to this comment...


I have just been going through a peer reviewed journal paper named 'Monitoring plant condition and phenology using infrared sensitive consumer grade digital cameras' by Wiebe Nijland et al 2013 and their conclusion stated on using a red -rejection dual band-pass filter ( ie. blue, green and infrared sensitivity ) for largely overcoming the poor band separation. Any ideas for the available dual band pass filters at our public labs. I am planning to buy a 6 mm security lens mobius action cam with such available dual band pass filters. Please give suggestions

Reply to this comment...


Some blue filters including Wratten 47, Schott BG3, and Rosco 2007 are dual bandpass red-rejection filters. They require that blue light be used for visible (the red channel captures NIR) so certain distinctions among live and dead plants are made poorly compared to red filters. I could not get the Rosco 2007 filter to work well with the Mobius camera, but a red filter worked okay. The blue filters above have very wide bands in the blue and NIR. A dichroic filter with two narrow bands might work with the Mobius, but I don't know if anyone has tried that.

Chris

Reply to this comment...


I agree with Chris. Narrower bands, when they are optimally centered, logically will work better, particularly because - virtually inherent with interference filters - they will therefore also have steeper cut-on and cut-off slopes. Not only do the above-mentioned (or any) absorptive filters have very wide bands, their cut-on and cut-off slopes are very gradual. Very broad passbands together with gentle (lazy?) slopes translate into much poorer contrast/definition. Another factor is where you will be mounting any interference-type filter. Most consumer cameras have fairly short focal length (wide angle) lenses. Particularly if the lens focal length is, say, anything under 8mm, an interference-type filter mounted on the front of the lens will be subject to significant short-shifting - especially out toward the edges of the image - imposed on the filter by the angular field of view of the lens. If you will be doing this, it's probably best that the passband(s) be centered a little on the longer side of your desired nominal. Better still will be if you can mount the filter behind the lens/directly in front of the sensor. Something on the order of 0.5 - 1.0mm overall filter thickness would probably be best in that case. The angular shifting phenomena should then not be an issue.

MAPIR (mapir.camera) offers various lenses with a host of different single and dual-band filter options. The filters are generally mounted at the back of their lenses. Midwest Optical Systems (midopt.com) offers various stock single and dual band filters either in mounts or custom cut/sized to suit any lens or camera.

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

Reply to this comment...


This is excellent work here!

I was wondering how software could help eliminate the tedious task of installing a red/blue filter. If an IR enabled security camera could capture the RGB and NIR spectra, what difficulties might one face segregating these through a computer program?

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

Reply to this comment...


Sid,

Pretty big difficulties. The sensor does not know what hit it. Each pixel produces a value for brightness (for one channel) which depends on how many photons impacted the pixel. The pixel does not know whether the photons are visible or NIR light. The processor knows what color light (RGB) it expects in each channel, but we never tell the processor that we removed the IR cut filter. So there is no way of knowing how much of the brightness value is due to visible light versus NIR light.

If you had two cameras, one unmodified and one with no IR cut filter, and took the same photo with exactly the same settings, then the difference between the brightness values for paired pixels would be due to the additional photons of NIR light (also additional UV photons that the IR cut filter might block). You would have to capture raw image files and control all settings manually.

Hey, that might be a really good way to do it.

Chris

Reply to this comment...


Login to comment.