A low-cost vegetation-imaging rig that mounts to any Lumipad airframe. Pi NoIR camera plus a Rosco blue filter, controlled by a Raspberry Pi running open-source Python. Built from the same parts trainees use in Week 4. Adapted from the Raspberry Pi Foundation's Astro Pi NDVI tutorial.
Healthy plants reflect a great deal of near-infrared (NIR) light and absorb most visible light for photosynthesis. Stressed or dead plants reflect less NIR and more red. The Normalised Difference Vegetation Index — NDVI — turns this contrast into a single number per pixel: (NIR − VIS) / (NIR + VIS). Healthy crops fall in the 0.3–0.7 range. Below 0.2 means stress, disease, water issue, or bare ground.
Commercial multispectral cameras for this work cost ₱150,000 and up. The Lumipad rig — a Raspberry Pi, a Pi NoIR camera, a square of Rosco theatre filter, and ~50 lines of Python — does the same essential job for under ₱4,200 in parts. It's not as good as a MicaSense RedEdge for research-grade work. It's good enough for the field-scale crop-health surveys our cohort alumni actually do, and it's repairable from any Filipino electronics market.
The build sequence below mirrors how trainees do it in Week 4 of the curriculum. If you're following along on your own, do the steps in order — each builds on the previous, and the camera modification in Step 2 is irreversible. Don't proceed past Step 2 until your camera passes the smoke test.
The default tab below is Step 1 — Components. Most parts are readily available online within 5–7 days; the Rosco filter is the only item that often needs a separate order from a theatre-supply house.
Eight parts. Most are readily available online; the Rosco filter is the one item that usually requires a separate order. Total cost is well under one-tenth what a comparable commercial multispectral camera costs, and every part is replaceable if it breaks in the field.
Buying all parts together brings the total close to:
A common temptation: substituting the Pi NoIR for a "no-name IR camera" at half the price. Don't. The non-NoIR alternatives have unknown spectral response curves, the IR-cut filter may or may not be removed, and the picamera Python library doesn't always work with them. Stick to the Raspberry Pi Foundation parts.
The Pi NoIR camera already has the internal IR-cut filter removed at the factory — that's the whole point of buying the NoIR version. What we add is the Rosco blue filter, which lets blue light AND near-infrared through to the sensor while blocking red and most green. This gives the camera the "infra-blue" view of the world that NDVI calculations need.
raspistill -o test.jpg. The image should look distinctly blue-tinted; healthy plants should appear bright pink/magenta because the camera is registering the NIR light they reflect.
(R - B) / (R + B) where R captures NIR and B captures visible. Same code; just different filter. We document blue here because it matches the Astro Pi tutorial; the red variant is in the appendix.
Healthy plants reflect a great deal of near-infrared light because chlorophyll uses red and blue light for photosynthesis but reflects green and NIR. The Pi camera's silicon sensor is naturally sensitive across visible AND near-infrared wavelengths — but the standard camera has an "IR-cut filter" deliberately added to block NIR, because that's what makes photographs look "natural" to humans.
(NIR − VIS) / (NIR + VIS) and you have a per-pixel NDVI map.The blue-filter NDVI is a "facsimile" — it's not as scientifically rigorous as a research-grade dual-camera multispectral rig. For monitoring crop health on a farm, identifying stress hotspots, and tracking field changes over time, it's perfectly adequate. For peer-reviewed remote-sensing research, it isn't.
Flash the OS, install three Python libraries, write the capture script, and run a bench test. The capture script is intentionally minimal — about 50 lines including comments — because field-debug-ability matters more than feature completeness. A trainee should be able to read the whole script and understand what each line does.
~/lumipad_ndvi/ on the Pi.lumipad-ndvi), enable SSH, set username and password.
rpi-imagerssh lumipad@lumipad-ndvi.local
sudo raspi-config, then Interface Options → Camera → Enable. Reboot.
sudo raspi-configsudo reboot
sudo apt updatesudo apt install -y libatlas-base-dev python3-pipsudo pip3 install numpysudo pip3 install opencv-python
git clone https://github.com/lumipad/ndvi-capture.gitcd ndvi-capturechmod +x capture.py
~/captures/: an original BGR image and a colour-mapped NDVI image.
./capture.py --test
/etc/rc.local (or add a systemd service for cleaner startup). The script begins polling the FC's PWM line at boot; when the FC enters AUTO mode (mission start), the script starts burst capture.
sudo nano /etc/rc.local/home/lumipad/ndvi-capture/capture.py --field &
The Lumipad capture script does four things on each iteration. Trainees should be able to recite this from memory:
cam.capture(stream, format='bgr', use_video_port=True) grabs a BGR array directly into memory.ndvi = (R.astype(float) - B) / (R + B + 1e-9). The tiny epsilon prevents division-by-zero in dark pixels.cv2.applyColorMap((ndvi * 127 + 128).astype('uint8'), fastiecm). This produces the human-readable false-colour image.The Fastie colormap (fastiecm) is a custom 256-row LUT specifically designed for vegetation imagery — it puts strong reds and oranges on healthy plants (NDVI ~0.5–0.7), greens and yellows on transitional zones, and blues on bare ground or stress (NDVI < 0.2). The LUT array is included in the build kit; copy it into the script directly.
The NDVI rig clamps onto the Lumipad camera plate using a 3D-printed bracket. Power comes from the FC's 5V BEC via the Mini UBEC. The camera points straight down at 90° — for survey work we don't tilt. Total added weight: ~95g, well within the v1's payload margin.
Adds 4 items to the standard 22-item Lumipad pre-flight checklist:
~/captures/.A loose mount or a shifted filter is the most common in-field issue. Both are easy 30-second fixes — but if they're caught only after landing, the entire flight's data is unusable. The pre-flight check matters.
The rig works without calibration, but won't give you reliable NDVI numbers comparable across surveys, dates, or pilots. Calibration involves capturing a known reference target on each flight and using it to normalise the colour balance. Lumipad's reference target is a printable A3 sheet with calibrated colour patches; Cohort trainees print one per flight bag.
python3 calibrate.py --target ref.png \--inputs survey/*.png
./calibrated/ — keep both for QA(R-B)/(R+B), then Fastie colormap for human readability. Per-image NDVI, mean NDVI per image, and a stitched orthomosaic NDVI for the whole AOI.
For a Mindanao cacao plot in good health, sampling Cohort 02 alumni surveys:
If your survey numbers don't fit these ranges, the calibration likely failed. Don't ship a report that contradicts these patterns — your client will lose trust in the data and in you. Better to re-fly a clean baseline than deliver bad numbers.
What actually happens between the photons hitting a leaf and the client opening a PDF report. Each stage adds something; understanding the chain helps with debugging when something goes wrong.
Examples drawn from Cohort 02 surveys flown over the past 12 months. The rig handles standard agricultural use cases reliably; for some advanced applications, it's a starting point that a more expensive multispectral camera would do better.
Identifying patches of stressed cacao trees within a larger plot. Stress shows clearly as 0.20–0.35 zones surrounded by 0.45–0.65 healthy canopy. Cohort 02 alumni use this routinely; cooperatives consistently confirm Lumipad-flagged hotspots match their on-ground observations.
Sample report — cacao stress survey ↗Tracking canopy density changes through coffee's flowering and harvest cycle. The rig captures the seasonal NDVI curve clearly enough to identify plots that aren't following expected patterns. Used by 4 Cohort 02 alumni for repeat seasonal surveys.
Coffee seasonal monitoring case ↗The rig captures imagery suitable for tree counting via the Lumipad platform's CV models, but the NDVI itself isn't ideal for counting — high-resolution RGB is better. Use the rig as one camera in a two-camera setup if the survey requires both NDVI and tree counts in the same flight.
Two-camera survey configuration ↗Many pest and disease patterns produce NDVI signatures. The rig can flag candidate zones; ground confirmation is necessary because NDVI tells you "something is wrong here" but not what. Pairs well with farmer knowledge of which pests are seasonal in their region.
Pest hotspot survey workflow ↗The Astro Pi tutorial we adapted from uses the Rosco #2007 Storaro Blue filter, which is what the Astro Pi computers on the ISS use. Blue passes through, NIR passes through, red and most green are blocked. The red channel of the resulting image captures NIR, the blue channel captures visible blue.
However, at typical drone survey altitude (60–120m AGL), there's a real tradeoff: Rayleigh scattering of blue light by the atmosphere reduces NDVI accuracy for distant subjects. The Astro Pi works fine because the ISS is hundreds of kilometres up — the scattering averages out. Our drone is closer to the ground, so the scattering biases the blue channel.
The red filter alternative — using a Roscolux #19 fire red filter — is documented in the Step 2 appendix. Some Cohort 02 alumni have switched. We document blue here because (a) it matches the original Astro Pi tutorial, (b) Rosco #2007 is more widely stocked in PH theatre supply houses, and (c) for a starter rig, both produce usable data. If you flying mostly above 100m AGL, the red variant is worth the experiment.
Cost. MicaSense RedEdge-MX or DJI P4 Multispectral cameras start around ₱180,000 and go up rapidly. A Lumipad alumnus running a microenterprise can't recoup that capital cost in Year 1 unless they're working at scale we don't see in the network.
Quality differences are real but smaller than the price suggests:
For research-grade work or precision-agriculture applications where decisions involve significant capital (variable-rate fertilising on a 500-hectare plantation), commercial cameras are worth their cost. For the small-coop survey work most Lumipad alumni do, the Pi NoIR rig is the right tool.
Yes. NDVI is a generic measure of vegetation health — chlorophyll behaviour is similar across plant species. Cohort 02 alumni have used the rig successfully on:
For partner-org deployments with very different crops (oil palm in Malaysia, rubber in Vietnam, vineyards anywhere), the rig works in principle but reference benchmarks need adapting. Email engineering@lumipaddrones.com if you're calibrating for a new crop type — we'll add it to the public reference set.
It can happen — vibration, power glitch, or low battery. The capture script writes images directly to the microSD as they're captured (no large in-memory buffer), so a reboot loses at most the current frame.
If it reboots, the auto-start service brings the script back up within ~30 seconds. The lost capture window depends on flight altitude and speed — typically a 10×10m square that the FC's grid will overlap on the next pass. Stitching algorithms generally cope with this well; no client has ever rejected a survey because of a single missing frame.
The bigger concern: a Pi that reboots repeatedly indicates a power problem (UBEC failing, bad solder joint on the 5V tap). Run the bench tests in Step 3 between flights if you suspect intermittent power.
Rosco #2007 is theatre lighting gel — designed for indoor stage lights, not direct tropical sun. Cohort 02 data: filters last 12–24 months of regular use before noticeable degradation. Symptoms: reference target shots come back warmer (more reds in the blue channel), NDVI maps drift towards lower values overall.
Replace prophylactically every 18 months or when you see calibration drift. New filter squares cost ~₱50 each (a single A4 sheet provides 100+ squares); the limiting factor is the ordering trip, not the cost.
Yes, and Cohort 02 has one alumnus doing this experimentally. Two Pi Zero 2 W modules, two Pi NoIR cameras, one with blue filter and one with red. The dual-camera setup is what the Public Lab community calls a "split-camera" rig — produces better NDVI than either filter alone because it captures pure NIR (red filter) and pure VIS (blue filter) on separate channels.
Trade-offs: doubles the weight (~190g instead of 95g — still within the v1's payload margin), doubles the build complexity, and requires camera-to-camera frame alignment in post-processing. We don't recommend this for first builds; come back to it after you've run 10+ surveys with a single-camera rig.
Documentation for the dual-camera variant is in the build kit's experimental/ folder.
The Astro Pi tutorial is excellent for the camera modification, library installation, and capture code. It assumes a stationary indoor camera looking at a dataset of pre-captured Earth-from-space images.
What this Lumipad guide adds:
Both are useful. Read the Astro Pi tutorial first to understand the underlying technique; use this guide for the practical drone implementation.
Two reasons. First, the Fastie colormap was specifically designed for vegetation imagery — its breakpoints align with the NDVI ranges that matter (0.0, 0.2, 0.5, 0.7) so that the visual distinctions match the analytically meaningful thresholds. Matplotlib's "RdYlGn" is a generic diverging colormap; it produces visually similar maps but the colour transitions don't align with NDVI's biological meaning.
Second, the Fastie colormap is the de-facto standard in the open-source vegetation-imaging community (Public Lab, Infragram, the Astro Pi project). Using it makes Lumipad surveys directly comparable with imagery from those communities.
The 256-row LUT is included in the build kit as fastiecm.py. If you want to experiment with alternative colormaps for client-facing reports, swapping is one line — but keep the Fastie version archived as your scientific baseline.