Multispectral raspberry pi: EVI – NDVI comparison

Today two filters arrived in my mailbox, one filter is a bandpass filter from 400-710nm, the other filter is a longpass filter with the cut-off at 721nm. Narrower band pass filters are available and I might order one to see if this further improves image quality.

Basic Local Alignment – DNA fiddling

My flatmate was doing some manual queries of DNA sequences using the National Center for Biotechnology Information (NCBI) online Basic Local Alignment Search Tool (BLAST). Doing this manual seemed like a waste of time. So, I looked around a bit to find an optimal automated solution. After trying several R and Perl solutions, nothing seemed stable enough to be of any use. In the end I settled on Biopython and their online query routine in their Blast class of tools. Of all tools this seemed the most mature and especially the most stable for querying the NCBI server.

PhenoPi: beta software installer

UPDATE: the installer is currently offline as I broke the code while rewriting routines and haven’t had time to fix this yet. Check in later.

I’m releasing a first version of my PhenoPi software installation package onto the world. The goal of the set of scripts is to minimize the amount of time spend on setting up a PhenoPi camera. The current set of scripts should be run on a clean raspberry pi to ensure a proper setup. Any volunteers to test the code are welcome (but do this on a non operational pi as it might mess with your stuff). Currently no images will be uploaded to the PhenoPi server, so everything is stored in the phenopi_images folder.

New additions to the code are a privacy filter so images do not include up to the bottom half of the image in those uploaded for scientific research. This to avoid privacy issues when overlooking gardens when I’m primarily interested in the vegetation higher up or in the distance.

Installation

In your raspberry pi home directory (/home/pi) clone the project to your raspberry pi using the following command (with git installed)

git clone https://khufkens@bitbucket.org/khufkens/phenopi.git

(this location will be updated to github in the near future, if this command doesn’t work check my github page)

all files will be cloned into a directory called phenopi

Use

To run the basic install using the following command:

sh /home/pi/phenopi/install_phenopi.sh site_name privacy_value

or

./install_phenopi.sh site_name privacy_value

in the /home/pi/phenopi directory

with “site_name”  the name of the site (no spaces allowed) and “privacy_value” how much of the bottom of the image in % you want to see removed (0, 25 or 50 are accepted values, default is 0)

After the installation your camera should be up and running and you should be able to find a website displaying constantly updating image at

http://IP:8080

This will website will look like this, showing the current image stream as well as the latest uploaded image (at night the colours are strange due to reflections of status LEDs and long exposures).

Screen_Shot_2015-05-02_at_22.47.15.png

Notes

Make sure that your raspberry pi camera is enabled, a description on how to enable your camera is provided on the raspberry pi site

TetraPi: a well characterized multispectral camera

Motivation and goals

Many of the projects on the Public Lab deal with infragrams, NDVI or NRG images to measure vegetation health. Although the images produced do discriminate between healthy and diseased or stressed vegetation, the imageging pipeline is not well characterized. Furthermore, commercial companies offering well defined multipsectral cameras (> 2 channels) do this at a steap price tag (~$5000).

Both the lack of a of a well characterized image sensor, which makes quantitative research impossible (by using inverse modeling using amongst others PROSAIL or DART) and lowering the price of an inherently simple device which should be accessible to everyone made me start this project.

For my concept two conditions need to be met:

  1. Designing a multispectral camera based upon a raspberry pi and a raspberry pi multiplexer, and writing the necessary software.
  2. Characterize the raspberry pi imaging sensor; extract the spectral response curves and set those free on the web.

1. TetraPi: a multispectral raspberry pi

Hardware

Designing the housing, either as a sled design to be mounted in a standard outdoor security camera housing and a fully independent camera has been fairly straightforward. Below you see the design of a camera sled which fits a VITEK security camera housing, as well as the stand alone / mobile version.

[caption id=”” align=”aligncenter” width=”351”] TetraPi, mobile version[/caption]

[caption id=”” align=”aligncenter” width=”353”] TetraPi, static version[/caption]

Both designs are largely finished and might need some cosmetic updates, but by and large these designs work. Features include a provision for four raspberry pi cameras (NOIR or RGB) and a filter holder which accomodates 1” dielectric filters as produced by for example Thorlabs. This modular design allows for simulateous acquisition of for example a photochemical reflectance index (PRI), a true normalized difference vegetation index (NDVI), as well as a standard RGB image. Multiplexing the cameras is taken care of by an IVMECH raspberry pi shield multiplexer.

envisioned mobile camera features
  • four channel camera [finished]
  • adaptable filters (1" dielectric filters) [finished]
  • 12-24VDC battery operated [ubec ordered]
  • local and remote (cable) trigger [3 mm jack connection in place, push button installed]
  • ad-hoc wifi access to upload images directly to a laptop [software issue]
envisioned static camera features
  • four channel camera [finished]
  • adaptable filters (1" dielectric filters) [finished]
  • 12-24VDC  Power-over-Ethernet (PoE) or battery operated [ubec ordered]
  • UPS feature using [awaiting the pijuice shield]
  • ad-hoc wifi access to upload images directly to a laptop for remote sites [software issue]
  • wired and wireless time lapse image acquisition and uploads, for on the grid location [todo]

Operation of the mobile version is still dependent on a tripod to ensure a proper exposure. The mobile version will use a ubec to step down an external 12-24VDC source to 5V needed by the pi, alternatively it can be hooked up directly to the 5V output of for example a drone. The plywood design should make the whole setup not overly heavy. There is also still room to shrink the design, but for convenience reasons I keep it larger as it makes it easier to work on the system.

 CAD designs

The drawings of both cameras can be found here:

All designs are based upon 3 and 9 mm plywood or acrylic. For environmental reasons I try to minimize plastics as much as possible. The mobile version has not fixed power socket yet as I still have to deside on the size.

Budget
mobile version
  • Raspberry pi B+ ($30)
  • 4 x raspberry pi camera ($120)
  • 16GB micro SD card ($10)
  • USB wifi adapter ($10)
  • 5V ubec ($10)
  • camera multiplexer ($96)
  • real time clock ($10)
  • small electronics ($4)
  • plywood housing ($5)
  • screws / stand offs (< $4)

Total: ~$300

static version
  • Raspberry pi B+ ($30)
  • pijuice battery pack UPS ($41)
  • 4 x raspberry pi camera ($120)
  • 16GB micro SD card ($10)
  • USB wifi adapter ($10)
  • 5V ubec ($10)
  • camera multiplexer ($96)
  • outdoor housing  ($25)
  • plywood housing ( $5)

Total: ~$350

Note:

I do not include the dielectric filters in the price as these are somewhat optional and run at $100 a piece. The prices listed above also indicate a full system, meaning 4 cameras where this might exceed the need of some people.

A complete system would run for less than $800 dollar (or a fifth of the price of a commercial system - in hardware cost). A standard NDVI system would set you back $400. Altenatively, a photochemical reflectance index (PRI) system (2 filters) will cost you a little south of $500.

Software

Little progress has been made on this part. I have some script which I can recycle from my PhenoPi project but I’m still waiting on the multiplexer and until it’s arrival little can be done from a software development point of view.

2. Characterizing the OmniVision OV5647 imaging sensor

Inverse modelling of either the standard RGB signal or derived spectral features is based upon a thorough knowledge of the spectral response of a camera. The spectral response of a camera is defined as the wavelength dependent sensitivity of a given sensor channel (RGB).

For reasons unknown most imaging sensors do not come with this information. However, this spectral response can be measured using a monochromator (a rare piece of equipment) or if one knows the spectral response of your source light and the wavelength dependent characteristics of a diffraction grating.

Using both a well characterized light source (measured with a spectrometer) and a well characterized grating, it should be possible to back out the spectral response of the raspberry pi camera. I refer to my raspberry pi spectrometer research notes for all the details regarding measuring the source light, and further calibrating the spectra.

More updates soon…

Pagination


© 2018. All rights reserved.

Powered by Hydejack v7.5.1