This page is a draft to host some simple codes in order to speed up coding development in Python ...
Public Lab is an open community which collaboratively develops accessible, open source, Do-It-Yourself technologies for investigating local environmental health and justice issues.
August 11, 2014 04:35
| over 6 years ago
This page is a draft to host some simple codes in order to speed up coding development in Python for the Infragram Webcam.
The codes presented here are are based on OpenCV 2 library for video processing and Numpy for array math (Numpy arrays are supported by OpenCV 2). Note: These codes were designed for the Infragram Webcam using Rosco #2007 filter, which means that the blue channel contains blue light information, while the red channel contains red/infrared.
The color code for this function is different from the one used at infragram.org so to have a smooth transition from negative NDVI values to positive NDVI values (on the website it toggles from cyan to green). In this version, the color scale is smoother, which hides noise near zero NDVI.
This is the non-normalized version. Most of the times it has no significant difference from NDVI, but for people interested in it here it is.
Using the above functions (not pasted in the following code for brevity), a simple code to output the NDVI, DVI and Raw stream from webcam is presented. A snapshot function is also available.