[Feature]: Add additional RGB vegetation indices to kornia-imgproc (ExGR, VARI, GLI)
#865 opened on Mar 28, 2026
Repository metrics
- Stars
- (675 stars)
- PR merge metrics
- (PR metrics pending)
Description
🚀 Feature Description
Add three additional RGB-based vegetation index functions to kornia-imgproc: Excess Green minus Red (ExGR), Visible Atmospherically Resistant Index (VARI), and Green Leaf Index (GLI), following the same API pattern as the existing ExG implementation.
📂 Feature Category
Rust Core Library
💡 Motivation
While building AgriSense AI, an agricultural monitoring system that processes drone imagery for crop health and disease detection, I regularly need multiple vegetation indices in the same pipeline. ExG alone is insufficient for robust crop analysis. Having ExGR, VARI, and GLI as native kornia-imgproc primitives alongside ExG (#835) would make kornia-imgproc a complete toolkit for agricultural computer vision pipelines.
💭 Proposed Solution
Following the same API pattern established by excess_green, add three new functions to the vegetation module:
excess_green_minus_red(src: &Image<f32,3>, dst: &mut Image<f32,1>) Formula: ExGR = 3G - 2.4R - B
visible_atmospherically_resistant_index(src: &Image<f32,3>, dst: &mut Image<f32,1>) Formula: VARI = (G - R) / (G + R - B), clamped to [-1.0, 1.0]
green_leaf_index(src: &Image<f32,3>, dst: &mut Image<f32,1>) Formula: GLI = (2G - R - B) / (2G + R + B), clamped to [-1.0, 1.0]
All functions follow existing kornia-imgproc API conventions with proper error handling and unit tests.
📚 Library Reference
- ExGR: Meyer & Neto (2008) "Verification of color vegetation indices for automated crop imaging applications"
- VARI: Gitelson et al. (2002) "Novel algorithms for remote estimation of vegetation fraction"
- GLI: Louhaichi et al. (2001) "Spatially located platform and aerial photography for documentation of grazing impacts on wheat"
- Similar implementations exist in OpenCV (via manual formula) and Python spectral libraries
🔄 Alternatives Considered
Users can compute these manually using raw pixel operations, but this requires repetitive boilerplate and increases the chance of formula errors. Grouping these as native primitives is consistent with kornia-rs's goal of providing complete, reusable image processing utilities.
🎯 Use Cases
- Crop health monitoring from drone imagery
- Plant disease detection pipelines
- Vegetation segmentation on edge hardware
- Precision agriculture applications on Jetson Orin
📝 Additional Context
This is a natural extension of #835 (ExG). The implementation will live in the same vegetation module and follow the same structure as excess_green.
🤝 Contribution Intent
- I plan to submit a PR to implement this feature
- I'm requesting this feature but not planning to implement it