Public Lab Research note


Can infragrams provide useful measurements of how thirsty my lawn is?

by WhiteRabbit | July 25, 2014 06:19 25 Jul 06:19 | #10969 | #10969

What I want to do:

Use infragrams, NVDI's, and/or anyting related to evaluate how much drought stress a lawn is experiencing.

My attempt and results:

I've looked here (public lab), but so far the closest I've found are some infragram's that show the difference between dead plants and plants that are alive. That's not so useful, at least not for gardening: I don't need an infragram before I can distinguish whether my lawn is alive or mostly dead. Besides, by the time it's mostly dead it's too late anyway.

I'm currently monitoring my lawn's soil moisture in real time with soil moisture sensors at three different soil depths. You can see it here: https://plot.ly/~WhiteRabbit/27

Questions and next steps:

What (if any) real-world infrared/UV/spectrometry/fluorescence measurements and interpretations can be done to monitor/detect a lawns unmet water needs? Has anyone already done this, or something similar using NVDI or an infragram camera? I mean, presumably, the rate of photosynthesis does decrease as grass becomes progressively stressed from lack of water, doesn't it? At what stage of stress from low soil moisture can an infragram start detecting a lawn's unmet water requirements? Is an infragram sensitive enough to detect the entire range, or just when it's near the permanent wilting point, or only when it's already dead?

Why I'm interested:

Using soil moisture sensors, as above, I can monitor the soil moisture pretty accurately where the soil moisture sensors are, but it doesn't tell me as precisely what the soil moisture levels are in other parts of the lawn. If an infragram could indirectly reveal the driest parts of the lawn, by revealing which areas of the lawn are photosynthesizing the least, it would be useful information, and it might also help me more easily locate where to put additional soil moisture sensors. Ultimately, I'd like a quantified, non-subjective, and accurate way to determine when I should irrigate my lawn. Can infragrams help with that? I was considering buying one of the infragram cameras, but from reading the postings here I can't discern whether infragrams yet have down-to-earth practical uses such as this seemingly simple objective. Do they? If they aren't yet of practical use, I'd like to know that before I buy one so that I'm not later dissapointed after buying one.

A huge amount of water is spent irrigating lawns (probably half of the water consumed by a typical home), and a lot of it could be saved if it were easier to monitor. So, especially given expanding drought conditions in many areas, this could potentially scale-up to large societal benefits through simple "grassroots" efforts. :-)


14 Comments

I think a lot of the challenge of using an Infragram camera well is the need for comparison. Comparing an area treated in one way with a "control" area in the same image can work, or comparing some parts of your lawn to others if some get water-stressed faster.

Measuring one spot over time can be more challenging, as the camera settings and light conditions may change. But I wonder if you could build on @nedhorning's work with calibration cards (http://publiclab.org/notes/nedhorning/07-10-2014/using-a-raw-image-to-calibrate-a-jpeg-image, http://publiclab.org/notes/nedhorning/05-01-2014/improved-diy-nir-camera-calibration) to correct data over time. I like the idea of correlating with moisture sensors. Low NDVI can be an indicator of water stress, i believe.

Reply to this comment...


Thanks for the links.

Supposedly grass also changes color as the soil loses moisture (IIRC, it becomes less green and more blueish?), and people can train their eyes to look for it. So, allegedly a signal is there even in the visible spectrum. Are there instruments which can measure/track that color shift, and if so, what are they? Could the public labs low-cost spectrometer (or some other instrument) be leveraged to that end by sampling the grass spectra and somehow calibrating it against the ambient solar spectra at the same moment, or is it just too hard a problem to do without calibration cards?

Accurately measuring color and spectra seems like a technically deep topic, and I sincerely want to avoid having my attention derailed into a physics project that's over my head. Rather, I'm hoping there are simple, inexpensive off-the-shelf measurement tools that "just work" that I can leverage and use without having to invent (or re-invent) anything new.

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

Reply to this comment...


Interestingly enough, I did just now find this $889 turf grass color meter which does, indeed, use NDVI!

http://www.specmeters.com/nutrient-management/chlorophyll-meters/ndvi/tcm500/

Unfortunately, for me it's a non-starter, because I can instead buy/make and deploy a bunch of wireless soil moisture sensors for that amount of money. i.e. NDVI is only a win for me if it's inexpensive.

So, is there any hope for getting the $55 Public Labs NDVI Plant Health web cam to do the same? If so, how to do it?

To sum up: if color can be measured by the public labs NDVI (as the above find suggests maybe it can), then we have a proxy for measuring turf water stress over time. i.e. in principal, the objective should be achievable.

Can anyone here corroborate? If it's an uphill battle or a fools errand, I'd rather save myself the effort and find an easier way to do the remote sensing, or possibly conclude it's too difficult or expensive and just skip it altogether.

I welcome any further advice/suggestions/recommendations.

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

Reply to this comment...


It should be possible to distinguish between stressed and non-stressed lawn grass using NDVI. I suspect that the $900 FieldScout performs more or less as advertised. To get the precision required to differentiate subtle levels of stress, the data used to compute NDVI has to be collected carefully. But the required data is surprisingly simple. The FieldScout a) blocks all daylight from a section of grass, b) shines two lights on the grass (red and near infrared), and c) measures the proportion of each color light that is reflected by the grass back to sensors. NDVI is basically the difference between the reflectance of red and reflectance of NIR.

You can replicate this with the Public Lab spectrometer and some red and NIR LEDs in a box. This would be a fun project. Or you can look into the PhotsynQ MultispeQ which operates like the FieldScout but also does even more clever things.

Or you can use cameras to make an NDVI image of the entire lawn. Having an image of the entire lawn is highly desirable compared to time-consuming individual measurements at a few to many places in the lawn. But the jump to consumer cameras requires that the simple required data be approximated for each pixel of the image. Consumer cameras do not record reflectance of narrow bands of wavelengths; they record some massaged measure of brightness of broad bands of wavelengths. And consumer cameras do not control or record the quality of the incoming light; we want to make our NDVI images any time of day regardless of sky conditions. So NDVI systems based on consumer cameras produce rather crude approximations of NDVI that are difficult to repeat and difficult to relate to other measures of NDVI.

If I wanted to detect the development of stress in my lawn, here is what I would do.

  1. Make a two camera system, e.g., from two PowerShots. A camera dedicated to capturing only NIR will produce a pure NIR photo (use a real NIR filter like Wratten 87, 87B, or 87C that pass no visible light). An unmodified camera will produce a photo with a red channel that is mostly red with very little NIR. A single camera system can never capture both pure red and pure NIR. It is also possible to place a red band pass filter on the unmodified camera to narrow the band of red light captured. This will require a longer exposure, but the grass won’t be moving fast.
  2. Install the cameras permanently where they can capture matching images of the lawn every day from the exact same angle.
  3. Take photos with both cameras at the same time every day. Or better, take the photo pairs every half hour to increase the likelihood that you will have one pair per day from long sequences of days that are taken under similar atmospheric conditions at the same time of day.

The photo pairs can be aligned using Ned’s Fiji plugin and NDVI can be computed for every pixel. A color image can be produced, but to detect subtle changes in NDVI, the actual values will have to be compared. The color tables typically used for pretty NDVI images assign almost the same color to NDVI values between, e.g., 0.3 and 0.5. So the real values for one or more small patches of lawn will have to averaged and compared over a sequence of days or weeks to detect trends.

Or you can try to do this with an Infragram webcam. I have not seen very promising NDVI results from CMOS webcams, but I have never heard of anyone trying a red filter instead of a blue filter. The wavelength bands of interest will be contaminated with non-target wavelengths, but I really don't know what effect that will have on interpretation of the NDVI values. Webcams generally do not allow custom white balance, so some post-processing will probably be required to adjust the relative brightness of the red and blue channels. Another option might be the Mobius Actioncam which can operate in webcam mode, allows custom white balance settings, and works well with a Wratten 25A red filter. If I wanted to build an automated system based on webcam images or video, I might try a two camera webcam system. Optically this would be similar to the dual camera system described above, but would allow computer control and automatic processing of the images.

Or you can do what I do and just water the damn lawn when it needs it.

Chris

Reply to this comment...


Thanks, Chris, for your thoughtful and very informative post.

If I'm reading it right, perhaps using two monochrome cameras, each with the appropriate filter setup, might work best? That way you're not fighting against the filtering properties of the color mask (bayer pattern) that's built into a color imaging chip: http://www.red.com/learn/red-101/color-monochrome-camera-sensors. Unfortunately though, unless someone here has done it already or something similar with good results, it would put me back at square one in terms of finding a candidate monochrome camera to use for that purpose.

On the other hand, I suppose that if you had a filter wheel with spectrogram filters in front of such a monochrome camera, you could even agregate an image where every pixel is effectively a spectrogram in its own right. Overkill for this application, but kinda interesting if you wanted to maximize data collection. It would also offer more opportunities to extract signals of interest that I haven't yet learned about, and so it might have more long-term value than a one-off device. It could be a poor man's multispectral camera, possibly going from UV into different bands of near infrared. When you count them up, it wouldn't have to be all that many. Anyone happen to know whether sufficiently narrow bandwidth filters could be obtained cheaply, perhaps as gels or something? Seems like it wouldn't be hard to automate turning the wheel and collecting a series of shots through the filters, at least on cloudless sunny days.

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

Reply to this comment...


A filter switcher is a viable solution, especially for small cameras. Cameras as large as Powershots might require a big, precise device in front of the lens to make sure the filter was aligned, stable, and allowed no light between the filter and lens. If a CMOS security camera will provide the resolution and lens quality you need, it should work fine. If it produces pairs of red and NIR photos, the standard software we use to align and analyze them (Fiji) will work fine. I assume you would want programmatic control of the cameras and filters so the capture can be automated. That might be the great unknown if you buy a security cam with a filter switcher.

That’s an excellent article you linked to at Red.com. It suggests that a monochrome camera will get you maybe 20% greater resolution, but resolution is not the limiting factor with NDVI systems. Normal consumer cameras are workable, especially in two camera systems. If computer control of the capture is not required, a two camera system with $50 Powershots is easy to make. An unmodified camera will produce a broad red channel with some contamination. Another camera with the IR block filter replaced with a Wratten 87B will produce three NIR channels with little contamination. To reduce contamination of the red channel, put a Wratten 29 or other red filter in front of the lens. Or buy a narrow band pass filter with a range centered on 640-660 nm. They can be expensive, but sometimes can be found for < $100. Chroma has one on sale now for $112.50:

chroma_spectra_1406398236.png
.
There are also others on sale. I bought this one for $65:
644nmfilter.JPG
.
These are generally only 32-35 mm in diameter, so are minimal for Powershots. They are also dichroic filters which are intended to work only for incoming light that is close to normal to the filter surface. So when placed in front of a lens, only the center of the image produced is filtered precisely, and the image appears vignetted. Here’s a photo with the $65 narrow band pass dichroic filter I bought:
644nm-450-35_2k.jpg
.
The vignetting is not so bad when the filter is held right against the lens, but I mounted this in an old 52mm filter ring which screws onto a filter tube which snaps onto a PowerShot A590:

644nm-462-13.jpg
.
I haven’t yet made much progress determining if this will make the mother of all NDVI images.

Reply to this comment...


Cool! Awesome post.

I suppose it's wishful (and probably foolish) thinking, but given the the low price of a filter swatch book and the seemingly large selection it contains, is there any chance it might contain some sufficiently narrow band filters that would be usable in a filter wheel? Anyone know?

Consider, for example, a Lee swatchbook: http://www.ebay.com/itm/Lee-Filters-Swatch-Book-Designers-Edition-/291180478729?pt=Camera_Filters&hash=item43cbb58109

or a Rosco swatchbook: http://www.ebay.com/itm/Roscolux-Swatchbook-WITH-EXPANDED-COLOR-SET-/251456651639?pt=US_Gobos_Gels_Filters_Lenses&hash=item3a8bfc0177

It looks as though they come with transmission graphs for each of the gels. I don't happen to have a swatchbook, so I can't see what they are. Maybe someone here has one and knows the answer (or could look)?

I picked these swatch books at random, so maybe there exists a better swatch book more appropriate to the task at hand that could be scavenged and that's still low priced (with delivery around $7- $10 for the swatchbooks above).

Anyhow, if there's a better way to get inexpensive filters, I'm open to it. Likewise, if there's opinion that inexpensive filters just aren't good enough for use in a filter wheel, then I'll cross them off my consideration list.

I'm not optimistic a swatchbook would have usable UV or IR filters, but if filters in the visible range could be scavenged at low cost from a swatch book, it leaves more budget for getting decent UV and IR filters. If nothing else, it might yield a workable proof of concept.

I realize I'm figuratively waiving my hands a bit, but using an Arduino to turn a servo so as to move a filter wheel from one filter to the next would seem to be fairly basic. The harder part might be keeping unfiltered light from finding its way around the filter and into the camera lens via a backdoor.

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

Reply to this comment...


I have not seen a cheap filter like Rosco that is truly a narrow band pass filter. It might be possible to combine filters to get a fairly narrow transmission band. The total transmission would be low, but it might be acceptable for certain applications. Rosco.com has transmission graphs for most of their filters.

For example, these two Rosco filters together (and in combination with the camera's IR block filter) would transmit mostly red light between 600 and 700 nm:
Rosco_fire.PNGRosco_green.PNG

But the wavelength band would not be all that different from what the red Bayer filter does.

Combinations of other filters might do a better job substituting for narrow band pass filters.

The best option might be red filters manufactured for laser barcode scanners. They work at a narrow wavelength band between 630 and 670 nm. So glass filters are mass produced for narrow bands around these targets. Here is one example:

barcode.PNG

I tried to buy a few of these on Alibaba, and actually submitted a request for quotes, but the barely decipherable responses from a handful of salespeople representing Asian companies were more entertaining than helpful. I would have had more luck had I been interested in buying 1000 filters. Another problem is that barcode scanners use very small squares of the filter, so big pieces are rare. But those red filters are a commodity, so it should not be hard to find a few larger pieces.

Reply to this comment...


Sounds like gel filters would be tricky at best, so I guess ixnay to that.

How about this one? http://www.ebay.com/itm/Optical-Interference-Filter-630DF10-Red-Bandpass-NOS-/310684208624?pt=Educational_Toys_US&hash=item485638cdf0

It has less transmittance than the impressive looking specimen you posted above, but a narrower bandwidth. Speaking of which, for NDVI purposes, exactly what nanometer range would we ideally want the bandpass filters to pass? Where's the sweet spot? I'm not sure what the preferred target is.

Here's a couple different IR bandpass filters that pass different segments of near-IR:

http://www.ebay.com/itm/Optical-Filter-840WB55-12-5-mm-Bandpass-NOS-IR-Laser-LED-/151016875572?pt=LH_DefaultDomain_0&hash=item23294ea634

http://www.ebay.com/itm/Optical-Filter-940DF20-12-5mm-Bandpass-NOS-IR-Laser-LED-/310641460936?pt=LH_DefaultDomain_0&hash=item4853ac86c8

I think I see why this is tricky. To lower cost, you need to settle for a smaller filter. But I assume that means a smaller aperture camera (?), so the amount of light collected goes down. So you need a really bright sunny day, or your camera may not register much, and probably your pixel resolution goes down too. Not knowing enough about cameras, I'm afraid I'm already over my head, as I have no good intuition as to how well or poorly this will pan out.

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

Reply to this comment...


Here's a write-up that I'm finding quite helpful: http://publiclab.org/notes/nedhorning/11-01-2013/why-a-red-filter-should-work-well-for-ndvi

Eyeballing the two spectral curves involving grass, it looks like a red filter centered at 650nm and an IR filter centered around 850nm would work.

Alternately, it looks like the ratio of the red channel to the blue channel might be equally good, at least for the grass example that's given. It would help to know whether "dry grass" means "dead grass" or "alive but thirsty grass."

Would I get a spectral graph like that shown in that research note if I somehow pointed the Public Lab desktop spectrometer at a patch of grass on a sunny day? Or would I need some optics to bring enough light into it for that to work? Anyone know? If there's an easy way to do it, I'm inclined to start with something simple like that, as it looks like a promising way to possibly meet the original objective of this thread without much effort and at low low cost (as compared to the cost of one or more cameras utilizing narrow bandwidth filters).

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

Reply to this comment...


The Public Lab desktop spectrometer is quite capable of making a spectral graph of sunlight reflected from grass. The curve will differ from the professional reflectance curve for several reasons:

  1. The professional reflectance curve was made with a calibrated source of white light, or the curve of the source light was subtracted from the curve of the reflected light. The reflectance curve from the Public Lab spectrometer will be influenced by the color of the sunlight.
  2. The Public Lab curve is the average of the three curves from the three color channels in the consumer camera. The average always retains artifacts (e.g., three humps) from the R, G, and B curves.
  3. The consumer camera will weight the three color channels based on some white balance algorithm that is probably irrelevant to the spectrometry task. So the red or blue end of the spectral curve will be inflated arbitrarily.
  4. Although the response of the sensor is probably linear, the in-camera processing to make a jpeg image will probably alter the values in some way (not know to me) so that a value that is twice as great as another value will not necessarily relate to twice as much reflectance.
  5. For some reason, maybe related to one of the above, the Public Lab spectrometer seems not to be as sensitive to infrared light as it is to visible light. So values at the infrared end of the spectrum are rarely very large. For example, these spectra of lawn grass show lower values in the infrared region than in the visible region: greengrass02, backyardgrass.
  6. Have I missed any other differences?

Most of these differences could be corrected if you tried hard enough.

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

Reply to this comment...


Wow chris the barcode scanner filter idea is great!!!

Reply to this comment...


I found this: http://www.vernier.com/products/sensors/col-bta/ which is interesting because unlike other low-cost spectrometers/colorimeters its specification claims to be measuring 4 different wavelengths (430 nm, 470 nm, 565 nm, 635 nm) instead of the usual 3 (RGB). Anyone know or might guess what sensor/approach it's using? Perhaps it doesn't have the wavelength overlaps that confound the output of typical RGB sensors.

For that matter, is there an inexpensive off-the-shelf RGB sensor which has none of the confounding wavelength overlap?

Failing that, what about pin diodes? Any inexpensive COTS units which are highly selective and no overlap in their detected wavelengths? Anyone happen to know? I tried scanning through the offerings on digikey, but their parametric search engine seems too primitive to create a shortlist of candidates. I found it to be a bit like searching for a few "good enough" needles in a haystack of needles, without knowing in advance whether any of them are actually good enough to create a non-confounding complement.

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

Reply to this comment...


Hi! I really enjoyed this thread and seeing everyone's thoughts and responses to the question. @WhiteRabbit , I was wondering if you have any updates on the project and how things have turned out? I'm interested in pursuing something similar.

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

Reply to this comment...


Login to comment.