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.
As an open source community, we believe in open licensing of content so that other members of the community can leverage your work legally -- with attribution, of course. By joining the Public Lab site, you agree to release the content you post here under a Creative Commons Attribution Sharealike license, and the hardware designs you post under the CERN Open Hardware License 1.1 (full text). This has the added benefit that others must share their improvements in turn with you.
August 11, 2014 04:35
| about 5 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.