Public Lab Research note


Improvements in Infragram NDVI with test cameras

by warren | August 01, 2013 06:39 | 3,748 views | 10 comments | #8950 | 3,748 views | 10 comments | #8950 01 Aug 06:39

Read more: unstable.publiclab.org/n/8950


I'd had a lot of trouble getting good infragram photos due to the blue channels leaking a lot of infrared light, meaning that the red and blue channels we compare to measure chlorophyll were not well differentiated. Chris Fastie posted some great notes about how histograms can be used to assess how differentiated channels are, on a whole-image basis, which is not the same as per-pixel, but is a good rough gauge. (i.e. red and blue could have similar histograms but not share any pixels, and it'd still be well differentiated, but this is not super likely)

normal.png

Anyhow... I noticed that even with the blue-light-leaking infragram photos I was taking with a more affordable point & shoot (same as in the post above, about trouble with infragram photography), there was a different amount of red and blue (see the histogram in the main image -- the red peak is a bit more intense). This was already a different result than before, and I think it may be due to the very diffuse light I was taking photos in. So perhaps these more affordable cameras can work in some circumstances... the infrapix web app output what seems to be a reasonable separation of foliage from non-veg:

normal-output.png

However, I also noticed that when I increased the saturation of the original image (in a basic image editing program), the histogram showed markedly clearer separation of red and blue. Of course, it's not creating new information, but it's just exaggerating the small difference I'd seen earlier.

saturated-2.png

Just to try it out, I ran that through Infrapix as well:

infrapix-saturated.png

While it doesn't seem clearly better, it was an interesting result, but it highlighted one more thing -- the Infrapix app seems to have a sliding scale as to what is represented as an NDVI value of 0... whoops! Well, I'm sure that'll be resolved soon.

There's a lot here. For one, it seems the white balance and/or exposure is quite variable on these affordable point & shoots, dramatically affecting whether you can see useful results. Second, 'increasing saturation' may help to amplify tough-to-distinguish differentiation. Third, we need to standardize how we generate color maps. But take a look at the lead image, generated with a $29 camera! Promising.


10 Comments

Jeff -- great, promising set of experiments here! Re: the color settings on the Infrapix app -- sorry, now I see (from your note, and in conversation with Chris just now) that having a particular color associated with a particular NDVI value is the better way to go, so that we can develop an common NDVI value-color association across pictures. Instead, I'd set things up so that the app maximized the color differences among NDVI values in the image (which we could perhaps offer as a non-default option). I'll change things over; and because I believe that previous infragram images should all be nicely stored on the server, I could also look into retroactively processing previous images ...

Reply to this comment...


Update -- I've changed the infrapix code so that it always displays a color table that spans the full range of possible NDVI values (-1 to 1). Note: in order to generate a new analysis of an already-opened image, it seems like it works best to rename the file you're submitting. E.g., I took your example above, renamed it as "sat1.png", and processed it, with this result. With these settings, the relationship between a given NDVI value and a particular color should always be consistent. Let me know if it works for you? (And if this is really what we want ... maybe a different color table would be appropriate ... though I guess we want to hone in on one particular one soon, to facilitate comparison across images ...)

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

Reply to this comment...


Follow-up -- the downside with having a set colortable for NDVI, from -1 to 1, is that a lot of the images are going to look pretty boring. One idea might be to generate both "-1 to 1" and autoscale, side-by-side, as a default? With some language below, explaining what each one is ... ?

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

Reply to this comment...


I think the new consistent relationship between NDVI values and color is good. If this causes some infrablue photos to produce boring (all the same color) NDVI images, that is also good. That is how we know that either 1) everything in the photo has the same plant health or 2) the infrablue photo was not useful for some reason. In the latter case, we could tweak the infrablue photo and process it again. That would not be an improper workflow. Many variables are adjusted to get a good infrablue photo: camera, filter, camera color settings, white balance, ambient light, post-processed dynamic range and color balance. The goal is to find a combination that produces infrablue photos for a particular subject which produce meaningful NDVI results. Any tweaks are valid, as long as they produce truly meaningful NDVI results and you then use the same combination if you want to make comparisons of plant health across multiple photos. In order to compare your results with others, all those variables must be reported for each photo as described here. Eventually groups of Infragrammers could adopt standards to facilitate comparisons and ease of reporting.

Although Photoshopping your infrablue photos is a valid method, I have found that if you don't get good infrablue photos straight from the camera, it is hard to get meaningful NDVI results, and even harder to establish an efficient and repeatable workflow.

It can also be useful to have more than one NDVI color table for different types of infrablue photos. For diagnostic purposes, I have been using this one: NDVIBlu2RedWB.lut (This is embedded with HTML code from Flickr. In case it does not display: https://www.flickr.com/photos/chrisfastie/9426660668/)

This clearly distinguishes NDVI values below zero (which should not be living plants). It also has continuous gradients to preserve detail from the original photo. It also makes all maximum values (255 or NDVI = 1) black and all minimum values (0 or NDVI =-1) white so you can immediately see if something is forcing lots of pixels to the limit. It has the disadvantage of not being very friendly to those with protanopia.

Eventually, a sandbox at the Infrapix app could allow users to creatively adjust their infrablue photos, adjust the resulting NDVI images, and apply various color tables. In the meantime, standardizing the process will help diagnose issues and establish good infrablue capture protocols for scientific ends.

Reply to this comment...


Another good diagnostic tool for the Infrapix app could be display of a grayscale image of the blue channel of the infrablue photo. For example, the NIR image (the red channel) that is displayed for Jeff's photo above has very white tree foliage which suggests lots of NIR. If the blue channel also has white foliage, it is obvious that NIR is getting in there. That's all you need to know to start looking for another camera.

Reply to this comment...


Chris -- I'm looking into generating the color table you're using -- it does indeed nicely distinguish above- and below-zero NDVI values -- and I'll hope to be able to edit it such that (max, min) values to produce (black, white) in the image, respectively.

And re: the great, suggested diagnostic for NIR leakage into the blue channel: I added a grayscale rendering of only the blue channel. An example, using the image in this research note, is here.

Reply to this comment...


The blue channel display is a good addition. It is not only a good diagnostic, but it helps everybody understand how the whole infrablue thing works. Maybe there could be some informative text there (eventually hidden in a pop-up): "Healthy foliage should appear strangely bright in the image from the red channel because that channel is dominated by near infrared light which is strongly reflected from growing leaves." And: "The image from the blue channel should look like a normal black and white photo. The difference between the blue and red channel images is translated directly into NDVI values -- the greater the difference between matching pixels, the higher the NDVI value for that pixel."

Reply to this comment...


Hi Chris -- great stuff! Changed the color bar in an attempt to match yours (haven't yet implemented the max / min values, yet), and added some explanatory text as per your suggestion ... let me know what you think? Example of new setup is here.

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

Reply to this comment...


That's really good. I think people will appreciate the explanations. Nice clone of the color table. Maybe if it goes from yellow to magenta instead of yellow to red it would be more protanopia compatible. But what is halfway between yellow and magenta???

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

Reply to this comment...


Wow, fantastic. I also think that the new interface quickly exposes that my guess that this camera was producing some photosynthetically-based differentiation was wrong -- it's clear that the high NDVI values are actually over the dirt and treetrunks, not the vegetation!

Screen_Shot_2013-08-05_at_1.43.05_PM.png

Reply to this comment...


Login to comment.