Public Lab Research note


Live Infragram

by lucenk | July 15, 2014 18:45 15 Jul 18:45 | #10695 | #10695

I want to be able to tap into a video feed of NRG images being processed live in real time.

I am working in the patch-based programming environment Max/MSP and the Infragram DIY Plant Analysis Webcam (http://www.adafruit.com/products/1722). With Max/MSP, it is possible to break a video feed into the three colour channels and for logic functions to be performed on the video streams. Using video processing patches, I have attempted to perform the equation (Near IR - Red) / (Near IR + Red) found in a tutorial on this website (https://farm6.staticflickr.com/5442/6966937874_5c1361e83c_d.jpg). This did not result in a NRG image. It is definitely possible that I made programming errors.

Is there a raw equation that can be performed on the video feed coming from the Infragram DIY Plant Analysis Webcam to produce an NRG image?

As a Landscape Architecture student, I am interested in using technology and sensors to help understand the world around us. I hope to use this live photosynthesis analysis tool to reveal this process as it is difficult to perceive.


6 Comments

Hi, very cool! Would you be willing to open source your patch by sharing it in this note? I love Max/MSP and also Pure Data/PD!

If it's easier, there is already a live video version of Infragram at Infragram.org -- you can connect directly to the webcam and run NRG, NDVI, etc etc in the browser. Does that help?

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

Reply to this comment...


OH, i see - you have NDVI running, but want to do NRG. Well, NRG is typically showing red and green in the green and blue channels, and in the current blue filter version of the webcam, you don't have a visible red channel. But you can kind of fake it by using your infrared as red, then blue as green and green as blue. @cfastie has demonstrated this here: http://publiclab.org/notes/cfastie/11-12-2013/red-filter-rising but I think there was another more clear explanation he did of how simulating NRG could be achieved with a blue-filtered camera. Chris, can you help?

Great lead image, btw, it's so clear to see!

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

Reply to this comment...


i tried and failed to make a max patch like this last year. The issue I was facing was that the calculations need to 1) allow for negative numbers, and 2) perform floating point operations. The standard matrix objects are 8-bit CHAR (integer) matrixes that only allow values from 0-255. Jitter can definitely do this calculation I just couldn't figure out how to successfully build a floating point matrix, do the math, and then convert it back. I was playing around with using the jit.expr option and am pretty sure that it has to be used for all the math operations rather than the integer-only standard objects.

Reply to this comment...


warren, I will most absolutely share whatever I come up with. I was actually having trouble using the browser version with my mac. Also, in Max, you can do some live analysis on the image as it comes in, where as the browser can only provide a static image to analyze.

mathew, I had not considered that. That may be part of why it never seemed to process properly. I'm still just trying to figure out how to layer the channels to satisfy the formula. Did you work with (Near IR - Red) / (Near IR + Red) in your go at it?

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

Reply to this comment...


lucenk - hmm, maybe you're not using the live video version of the browser version? You should definitely be able to remix channels on live video; what browser are you using, and what issues are you seeing?

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

Reply to this comment...


I was using the (Near IR - Red) / (Near IR + Red) in my try. I was also using Max 4.5, because I bought a license ~11 years ago and haven't grabbed a new one since Max 5 came out, so it might be different.

Reply to this comment...


Login to comment.