Public Lab Research note


  • 6

Raspberry + NoIR cam + Sensors to detect water stress of the plants during their growing

by LaPa |

What I want to do

I'm an agronomist, I'm going to make a IR RaspiCam to do an IR Timelapse in greenhouse. I want add same sensors (temperature, moisture, soil moisture) at the IR Raspicam in order to link environmental condition to Health of the plant.

I wrote this previous research note https://publiclab.org/notes/LaPa/12-03-2015/how-do-i-set-a-costum-white-balance-of-the-noir-modulo-cam

My attempt and results

I built a IR camera + blue filter (# 2008) by Raspberry Pi in order to have the time lapse movies of growing plants in greenhouse. I would like especially to detect the water stress or the micro water stress during the stage of growing of the plant o during the day. So I placed the IR camera in a greenhouse at the first stage of growing of the plants of cucumber. The camera use a custom white balance according to https://publiclab.org/notes/LaPa/12-03-2015/how-do-i-set-a-costum-white-balance-of-the-noir-modulo-cam

I posted my first attempts with IR on youtube: the first one portrays 3 water stressed plants of primula just after water supply. Indeed you can see in the time lapse movie the leaves of the plants to increase their turgor as clear demonstration of the reduction of water stress.

Here is the movie by raw IR photo https://www.youtube.com/watch?v=545sW7hBGVM

I use "ImageJ (FiJi)" + "photo monitoring plugin" to elaborate raw IR photos into NDVI by using InfraBlue.lut that you can see here https://www.youtube.com/watch?v=DUKliCFogxA.

Here you can see the transformation into NDVI using VGYRM.lut https://www.youtube.com/watch?v=vs8DS24s9j4

Here the timelapse of the first 7 days of the cucumber plants in greenhouse resulting from raw IR photos https://www.youtube.com/watch?v=PdglYb19DmM

And here that timelapse transformed into NDVI using VGYRM.lut https://www.youtube.com/watch?v=EAuAU7f2NvE

Questions and next steps

Now I am keeping to shoot photos of the growing cucumber plants in greenhouse. I'm going to elaborate those into NDVI again.

Have that sense for my goals? Could this technique be proper for detecting the water stress of the plants?

Am I going in the right direction?

Any suggestions?

If is it necessary I can send some single photos that I used for my time-lapses

If you consider useful to use Raspberry pi for IR green plant analysis, where I can post some images that I shoot?

Thanks in advance

Best regards by LaPa

Why I'm interested

1) Learn more about IR Images of the plants; 2) to identify by IR Images of the plants best of growing condition or the moments of the worst health (water stress) of the plants during their growth; 3) to use IR Raspicam on aerostatic baloon; 4) To build DIY weather tools by Raspberry Pi


Post your attempt to replicate this activity  Browse other activities for "timelapse"


Replications (0)

None yet. Be the first to post one!



This is marked this as an activity for others to try.
Try it now   Click here to add some more details.


farming ir raspberry-pi plants italy water in of the rpi stress eu raspberry images growing condition pi. cultivated

activity:timelapse activity:infragram

23 Comments

Hi LaPa,

Your time-lapse videos are impressive. These are excellent teaching videos. You can clearly see that the NDVI values for the foliage of the plants changes dramatically through the day. It is likely that these changes are not due to physiological changes in the plant (stress, growth, productivity), but instead to changes in the ambient light and/or camera settings. There are probably also changes in the plant health during these periods of time, but they are too subtle to see. These changes in plant health might produce a change in NDVI of maybe 0.05 or 0.1 or so if the plant was stressed by heat or drought. The color gradients you used have approximately the same color for NDVI values of (e.g.) 0.4 and 0.45, so the color of a plant leaf might not change much if it was actually stressed.

To allow a video like these to show plant stress, a few things must happen:

  1. the ambient light must be constant or nearly constant (brightness, color) for the entire video,
  2. the camera must use the same settings when each frame is captured,
  3. if numbers 1 and 2 are not true, then each frame must be calibrated,
  4. the color gradient used (lut) must have different colors for NDVI values of stressed and unstressed foliage.

There are not enough colors to differentiate all the NDVI values between 0.2 and 0.8 with enough resolution to detect small changes in plant health. So a special lut could be used to differentiate changes in NDVI between (e.g.) 0.5 and 0.3 using all the obvious colors.

Chris


Hi @LaPa, great to see your note! I'm tagging some other raspberry pi developers @rjstatic and @seankmcginnis


Thank a lot all of you for the consideration and the suggestions!

Chris, sincerely I didn't understand from your reply if you consider my direction completely wrong or just that I have a long way ahead.

But, anyway I try to answer to your considerations:

1) I'm using my camera in operative greenhouse (in farm), so the light and color conditions vary widely. And I can't change this. But I can choose some photos where the conditions are similar, for example in same hours of the day but in different days, and work with those.

2) I shoot several hundreds of photos, and I am continuing to do so, to make those movies the white balance is fixed in every photos. The exposure I guess is automatic so I think that vary in each photo. I think it is possible to set fixed exposure for each photo, but I have to understand how to do that.

3) I don't know how to calibrate the photos

4) Is there any lut that I can use in Fiji Photo monitoring plug in. If there isn't how to get the the "special lut to differentiate changes in NDVI" using Fiji Photo monitoring plug in?

Best regards

LaPa


NDVI is based solely on color (near infrared is one of the colors). If a camera records different colors for two leaves, the NDVI computed for those leaves will probably differ. The color captured by a camera depends on the surface properties (spectral reflection and absorption) of objects in the scene and also the color and angle of the light illuminating the surface. To detect differences in the reflective and absorptive properties of objects, the light illuminating the scene must be constant. If the light is not constant, the change must be accounted for. Accounting for changing light conditions is done by "calibrating" the process.

One process of calibration requires that special surfaces (calibration targets) of known spectral reflectivity be included in the photographs. The color of all pixels in a photograph is adjusted based on the color of pixels in those targets. Some research notes at Public Lab describe the development of a procedure for calibrating the process, and a plugin for Fiji automates the process. There are still issues with the procedure, and no tests have been described which demonstrate that NDVI derived from the calibration process is always robust. Without calibration, interpreting the meaning of NDVI values should be limited to very general patterns.

It is easy to make new color look up tables (luts) in Fiji. When an image with a lut applied is displayed in Fiji, open the lut editor (Image/Color/Edit lut). Below is a lut in the editor which shows color only for the NDVI values between 0.38 and 0.5.

NDVI38-5lut.JPG

NDVI38-5lutK.JPG

Almost every color used can be distinguished, so leaves with NDVI values of 0.4 could be distinguished from leaves with values of 0.45. With a series of calibrated NDVI images, this lut could allow a visualization of plants becoming stressed (assuming NDVI of 0.5 is not stressed and NDVI of 0.4 is stressed, and that leaves in the scene have NDVI values in that range).

NDVI_38-5.lut

Chris


1) Could be a good idea put the calibration targets of known spectral reflectivity in Greenhouse to include in the photos ?

2) Where can I get the calibration targets?

3) Could you link (or send me some documentation) research notes at Public Lab describe the development of a procedure for calibrating the process?


Hi, could it be a good idea to choose as calibration target the bare soil area that is in each (thousands) photos?

Best regards

LaPa

Screen_Shot_04-14-16_at_11.55_PM.PNG


Sorry I missed some questions.

  • Calibration targets work outside or in a greenhouse.
  • Calibration targets are hard to find and very expensive. But some companies are developing new targets for this purpose. It's also possible to make your own if you have access to a spectrometer. You can also use common materials with known spectral reflectivity. This note has some sites where you can find spectral data for common materials: https://publiclab.org/notes/nedhorning/11-01-2013/why-a-red-filter-should-work-well-for-ndvi.

cardboardSpectrum.PNG
Above: The spectral reflectance of brown corrugated cardboard from http://speclab.cr.usgs.gov/spectral.lib06/ds231/datatable.html.

  • Most of the notes at Public Lab about calibrating NDVI are by Ned Horning: https://publiclab.org/profile/nedhorning

  • Soil does not work well for calibration because its reflectivity changes as its moisture content changes. If you know the reflectivity of the black plastic in the wavelength bands you will use to compute NDVI, you could use that. But black plastic is shiny so its reflectivity will change as the angle changes. Also it is very dark and will be underexposed in many photos in which case it provides no information for calibration. A medium light and a medium dark target would be better.

Chris


Thank you Chris, I'm going to read with the attention the Ned Horning's note that you link!

Have a good day!

LaPa


Hi, 1) unluckily I don't have access to a spectrometer 2) wich are the companies where I can buy a cheap Calibration targets? 3) may it be fine to use, for my goals, the normal corrugated brown cardboard like one in this image as calibration target? 4) If my corrugated brown cardboard is ok, I can put it in greenhouse and begin to shoot photos with the calibration target inside the images. 5) Do you think the NoIR Pi camera + red filter would be better instead of NoIR Pi camera + blue filter (Rosco # 2008) I use now?

Thank you

LaPa

CorrugatedBrownCardboardInSunnyLight.jpg


I don't know of any commercially available inexpensive calibration targets. A good calibration target will have the same reflectance for all wavelengths (colors). Most common surfaces reflect a different proportion of blue light compared to red light or NIR. These common surfaces can be used, but it is harder to know the reflectance at any wavelength. For example, not all brown corrugated cardboard will have exactly the same reflectance curve, but they probably all have that steep section between 500nm and 800nm (NIR). The value you choose for the reflectance of red will be very sensitive to the particular curve. For cardboard, it might be acceptable to choose 30% reflectance for red and 45% reflectance for NIR. As long as you always use the same cardboard (and it does not fade or get wet) your results will be comparable with themselves. If you had a surface that reflected 80% of any wavelength that hit it, it is much easier to select a value for any wavelength band (80%).

One target will not be enough. The idea is to describe the relationship between the brightness of NIR or red recorded in each camera pixel (0-255) with the actual energy being reflected from the surface in the NIR and red bands. So you need a curve (an equation) of how pixel values vary with actual reflectance for each wavelength band. So you need at least two points to define each curve. Because your points will have some error (you are not measuring reflectance, just guessing from stuff on the internet) having several points (targets) will probably be good at least to start. You can probably assume a linear relationship because if it is not linear you are going to have a really hard time describing the curve very precisely.

Some of your targets should be bright and some should be dark to cover the range for both red and NIR. If the targets are too dark or too bright, they might be overexposed (255) or underexposed (0) and will not give you very good information. Even black tarpaper reflects 5% of NIR, so the value should not be zero, but it will be zero in a well exposed photo with a small piece of tarpaper in it.

In general, a red filter usually works better than blue.

Chris


I haven't played around with it, but I'd assume a neutral gray "TV White" and "TV black" paint like these for TV camera calibration would be the best cheap calibration target option.
http://www.rosco.com/FTVP/TVPaints.cfm


It would be great to have a few paints that:

  1. had reflectance spectra for 400 nm to 1000 nm,
  2. were exterior paint,
  3. were matte finish paint,
  4. were available in small containers (pint),
  5. were available from a national or global distributor (Home Depot?),
  6. included very light gray, medium gray, and dark gray.

Colored paints have very interesting reflectivity curves:

paintspectra.JPG


ok, THANKS all of you for the answers. I like that my research note elicits answers that can also affect other. I am interested to make experiences with NIR and NDVI at this stage and make a step forward. I'm not sure I understood all Chris wrote. I guess I miss a lot of basic knowledge. Waiting to get colored surfaces with ROSCO colors that suggested Mathew, change the Pi Cam filter from blue to red; I could put in greenhouse two calibration target in short time: 1) the cardboard I photographed, 2) tar paper.

Do you think it'll can improve the NDVI transformation for my goals?

Mathew I didn't understand where I can buy "TV White" and "TV Black" and how much those cost, because the linked page "Where to buy" give me "an unexpected error".

Best regards

LaPa


well, B&H will sell it to you by the gallon. pricey to try out. $42-95 a gallon, but it sure will make a lot of targets. I tried to get chips of the paint a few years ago, and couldn't at any local Rosco retailer. Rosco wouldn't send paint chips of it either :-(

We might be able to order it on a speculative budget and package up some small amounts for testing if enough people want to try it out and it looks promising. I don't know enough to make that judgement.

http://www.bhphotovideo.com/c/product/108025-REG/Rosco_150057400128_TV_Paint_Black.html/prm/alsVwDtl http://www.bhphotovideo.com/c/product/108022-REG/Rosco_150057350128_TV_Paint_White.html

and they have this neutral grey too: http://www.bhphotovideo.com/c/product/263737-REG/GTI_N8_G_Standard_Gray_Neutral_8.html/prm/alsVwDtl


Mathew, I haven't seen any spectral data for Rosco paints. Is there any reason to think that they would be better than other paints for NDVI calibration targets?

This sounds like a business opportunity for someone with access to a spectrometer. Buy a few shades of gray paint, paint some plywood squares, get a spectral scan of each color, sell the squares with the spectral data. International shipping is a plus.


The paints are for making consistent whites and greys that will be the same perceptual color across a wide variety of lighting conditions. They are frequently used for white balancing in broadcast settings.

I've never seen spectra for these paints, but I've worked with them commercially on TV sets. The idea that they'd have a flat spectral response is a guess-- these paints exist precisely because commercial wall paint looks so varied in different lighting.


If anyone in PublicLab has a spectrometer and can get the proper calibration targets I could buy it.


I have the reflectance spectral for these materials and can provide a PDF, Excel, or CSV file of the spectra if someone lets me know a good way to share it:

Black spray paint Glidden Rust Master stove and barbecue flat black White spray paint Premium Decor PDS-10 White Primer #792314 Gray spray paint Rust-oleum automobile primer Tar paper Not sure of the brand White printer paper Hammermill Premium multipurpose, 24 lb, 97 brightness Red card stock From Middlebury stationary store


Thank you Nedhorning, nice to see your answers in the my research note! I'm reading your notes about calibration trying to understand more about NDVI and calibration targets.

1) You listed some materials, which of those could be better as calibration targets for my goals?

2) I'm in Italy and I think it'll be difficult for me get exactly the same materials you listed, if I buy those by you, is it possible to ship me the most suitable ones?

3) May I put here my eMail address to send me the reflectance spectral you have?

Thank you for your attention

best regards by LaPa


Hi LaPa -

You can contact me at horning@amnh.org and I will send you the spectra. You can also look at this research note for links to sites with spectral libraries: https://publiclab.org/notes/nedhorning/11-01-2013/why-a-red-filter-should-work-well-for-ndvi

If you can contact a University they might be wiling to scan some common items for you.


Thank all of you for the suggestions Maybe it is the wrong strumentation but i don't know:

1) If I buy your http://store.publiclab.org/products/desktop-spectrometry-kit-3-0 can I make by myself reflectance spectra of some surface to use as calibration target?

2) Is Desktop Spectrometry Kit 3.0 suitable to have reflectance spectras precise enough for my goals?

if http://store.publiclab.org/products/desktop-spectrometry-kit-3-0 were to be me fit, I could share here some reflectans spectras.

Thanks a lot

LaPa


A DIY spectrometer can be used to characterize the spectral reflectivity of a target if two things are true:

  1. The spectrometer must be sensitive in the near infrared region
  2. The spectrometer's relative sensitivity in the visible and NIR bands used to compute NDVI must be known.

Neither of these things is true about the Public Lab spectrometer. A spectrometer that uses a camera with known spectral sensitivity in the visible and NIR region (e.g., PowerShot A2200) could be used.

Chris


I removed, at the moment, the camera from the greenhouse. I took thousands of IR photos (every 10 minutes for more then a month) I got a movie ( https://www.youtube.com/watch?v=1Gcey4fJz_E ) , but it doesn't have meaning to detect health of plants. Anyway it was great for me because with your help I learn a lot about Raspberry camera, timelapse, IR and so on. I hope to find a way to do better and to put again the camera in the greenhouse.


You must be logged in to comment.