Computes RGB-based vegetation, color, and spectral indices from digital images for applications in agriculture, crop phenotyping, and remote sensing. The methods are based on digital image processing and plant phenotyping approaches (Singh et al. (2023)
An R package for computing RGB-based vegetation and color indices from digital images.
devtools::install_local("rgbIndices")
library(rgbIndices)
library(raster)
# ---------------------------
# Fast example (CRAN-safe)
# ---------------------------
r <- raster(matrix(runif(30*30), 30, 30))
g <- raster(matrix(runif(30*30), 30, 30))
b <- raster(matrix(runif(30*30), 30, 30))
img <- stack(r, g, b)
# Compute indices
idx <- rgb_basic(img)
idx1 <- rgb_diff(img)
idx2 <- rgb_ratio(img)
idx3 <- rgb_normdiff(img)
idx4 <- rgb_veg(img)
idx5 <- rgb_color(img)
# Summary statistics
rgb_indices_to_mean(idx)
# Convert to table
tbl <- rgb_indices_to_tbl(idx)
head(tbl)
# ---------------------------
# Real image example
# ---------------------------
img_real <- stack(rgb_example())
plotRGB(img_real)
rgb_basic(img_real)
Singh, R. N., Krishnan, P., Singh, V. K., & Das, B. (2023). Estimation of yellow rust severity in wheat using visible and thermal imaging coupled with machine learning models. Geocarto International.
https://www.tandfonline.com/doi/full/10.1080/10106049.2022.2160831
RN Singh Bappa Das Sonam Anil Kumar Santosha Rathod (Maintainer)
Email: [email protected]