I am performing a small test to calculate the RBF-kernel NDVI (kNDVI). kNDVI is a nonlinear generalization of the commonly used Normalized Difference Vegetation Index (NDVI). It is a novel spectral index proposed in Camps-Valls et al. 2021.
I am using Sentinel-2 L2A bands 4 (red) and 8 (NIR) without applying any scaling factor. I am trying to calculate the kNDVI using R with the code provided by the authors from their Github.
library(raster)
s2_red <- raster("C:/test_kNDVI/T31SBD_20220808T104631_B04_10m.jp2")
s2_nir <- raster("C:/test_kNDVI/T31SBD_20220808T104631_B08_10m.jp2")
sigma <- 0.15
knr <- exp(-(s2_nir-s2_red)^2/(2*sigma^2))
kndvi <- (1-knr) / (1+knr)
However, when I run the code with (sigma=0.15) I get a strange kNDVI image.
par(mfrow=c(1,2))
plot(kndvi, main="kNDVI")
plotRGB(raster::stack("C:/test_kNDVI/T31SBD_20220808T104631_TCI_10m.jp2"))
What is happening here?