Multispectral imaging is a sensing technique where a spectrum is obtained for all of the points in an image, allowing the user to detect signatures across different parts of the spectrum. In agriculture, this information gives a good insight to the level of crop stress. Multispectral cameras mounted on drones or aircraft allows for quick assessments to be performed for yields across large areas of farmland, making it possible for targeted use of fertilisers, pesticides and irrigation.
Professional multispectral cameras will typically cost £5000, however excellent imaging for plants can be achieved using Pi cameras co-ordinated with a Raspberry Pi computer. The basis for this is that the R channel for a NoIR camera with a blue filter will be in the NIR range, while a standard RGB camera (with an internal RGB cut off filter) will be able to capture red band information.
The holder for the NoIR/RGB cameras, the Raspberry Pi and the camera multiplexer are mounted in the laser cut enclosure shown above. The design starts from one design by Koen Hufkens, with modifications to hold the Pi Cams flush against the surface, and allow them to be mounted using M2 screws. There are ports for USB power and ethernet to control the Pi.
To allow the Pi to switch between capturing images from two different cameras, a IVMech IVPort V2 camera multiplexer is mounted on the Pi, this is the highest cost component in the system.
Calculating the NDVI from the RGB and NIR images was done in a Python script, which used OpenCV to load the images, isolate the R channel, account for parallax errors due to the shift in camera positions, and take a normalized difference value.
The results are in broad agreement with that found in literature, with high value of 0.7-0.8 for green foliage, and low magnitude values for other areas of the scene. Objects closer to the camera (such as the bin in the bottom left corner above) show an edge effect due to the imperfect correction for parallax error.
To make this into a commercial system, there are the following considerations:
- Calibration: the response of each camera to the relevant bands: NIR and visible red, need to be measured and accounted for in the calculations for NDVI
- The system costs £120 to build, far less than that needed for a commercial model, however this is offset by the need to mount it on a drone.
- For low cost applications, it could be possible to mount the system from a pole of a fixed height: this will allow a large area to be photographed, and also means the parallax error will be known in advance.
Building this multispectral camera was the focus at a workshop I ran at the Cambridge Makespace, one team cleverly used two Raspberry Pi’s to co-ordinate the two cameras; and synchronize between them using I/O interrupts. This reduces the cost by £30.