Resampling of the Red Edge for NDRE calculation in Sentinel-2

Mário Bittencourt
4 min readMay 14, 2024

--

Resampling of the Red Edge spectral band, for NDRE (Normalized Difference Red Edge Index) calculation using Sentinel-2 images, is a necessary action for better data analysis of this index

When using Sentinel-2 images, NDRE is obtained by calculating between the Near-Infrared (NIR) band (10-meter spatial resolution) and the Red Edge band (20-meter spatial resolution), following the equation established by Barnes et al. (2000).

The bands used in the calculation are B08 (NIR) and B05 (Red Edge), with resampling from 20 to 10 meters for the Red Edge, as described by Jucá (2020), Rodrigues et al. (2021), Capelin (2021), and Kai et al. (2021).

It is important to highlight that resampling can be applied to transform the original image according to the proposal, such as corrections involving reference points or adjusting spatial resolution for extraction through a set of other images.

According to Kai et al. (2021), the most traditional resampling methods are nearest neighbor, bilinear convolution, and cubic. However, the authors mention other methods such as Lanczos and Gauss.

In QGIS (3.28.12), resampling can be done using nearest neighbor, bilinear, cubic, smooth cubic, and Lanczos methods, while in R (4.3.2), only bilinear and nearest neighbor methods are available for Raster packpage.

Here are details about each method

- Nearest Neighbor: assigns the pixel value based on the nearest neighbor, preserving the original data of the image. This results in duplicated values, information loss, and positioning errors.
- Bilinear: this method is the most commonly used in Red Edge resampling for NDRE calculation. It utilizes the four nearest points that best fit the new pixel value, performing interpolation between the pixels intersecting the points. Thus, for each obtained point value, a weighted average of corresponding pixels from four nearest original image pixels is calculated, generating new output values.
- Cubic: this method uses the 16 nearest pixels from the original image to obtain the value of the new pixel at the specified coordinate of the resampled image, with the calculation of the weighted average of these points. Therefore, it requires longer computation time.
- Smooth Cubic: similar to the cubic method but with a greater smoothing effect on the images.
- Lanczos: preserves details and smoothens the image by interpolating the signal value using a Lanczos kernel, which results in longer processing time.

In the example below on how to perform resampling, I used an MSI/Sentinel2A(L1C) image from September 1, 2023, of an Arabica coffee production area in center pivot irrigation, in the city of Luís Eduardo Magalhães, western Bahia, Brazil. The image was processed using the SPC plugin for atmospheric correction at the surface level.

Resampling Red Edge in QGIS

1. Open the B05 band layer and click on Raster >> Projections >> Reproject coordinates;
2. In the dialog box that opens after clicking “Reproject coordinates,” B05 should already appear under “Input layer.” If not, simply select it. You can leave the SRC fields empty, as the image already contains this information, which in this case is EPSG 32723 — WGS 84/UTM Zone 23;
3. Choose the resampling method to be used. In “Output file resolution in target georeferenced units,” the value is in meters (UTM). For all resampling methods, set it to 10 meters.

See the resampling code in R, which provides only the options of the Bilinear and Nearest Neighbor methods, using the Raster packpage:

require(raster)

## Red Edge resampling

B5 <- raster("R/ap/01_09/sentinel/B05.tif")
B8 <- raster("R/ap/01_09/sentinel/B08.tif")

# Check loading

B5

# Converting latitude and longitude coordinates to UTM

utm_proj <- CRS("+proj=utm +zone=23 +south +datum=WGS84")
B5_utm <- projectRaster(B5, crs = utm_proj)
B8_utm <- projectRaster(B8, crs = utm_proj)

# Checking crs and resolution in meters

B8_utm

# Red Edge resampling using bilinear method, going from 20m to 10m

B5_10m <- resample(B5_utm, B8_utm, method = "bilinear")
B5_10m

# Red Edge resampling using nearest neighbor method, going from 20m to 10m

B5_10m_ngb <- resample(B5_utm, B8_utm, method = "ngb")
B5_10m_ngb

# Saving the new resampled band

writeRaster(B5_10m, "R/ap/01_09/sentinel/B5_10m.tif", format = "GTiff", overwrite = TRUE)
writeRaster(B5_10m_ngb, "R/ap/01_09/sentinel/B5_10m_ngb.tif", format = "GTiff", overwrite = TRUE)

# Checking the resampled band

B5_10m

# Calculating NDRE

NDRE_bi <- (B8_utm-B5_10m)/(B8_utm+B5_10m)
NDRE_bi

NDRE_ngb <- (B8_utm-B5_10m_ngb)/(B8_utm+B5_10m_ngb)
NDRE_ngb

require(ggplot2)

# Plot of IVs

par(mfrow=c(2,2))
plot(NDRE_bi, main = "NDRE Bilinear")
plot(NDRE_ngb, main = "NDRE Nearest Neighbor")

Results of NDRE

Conclusion

The resampling of the Red Edge band for high spatial resolution NDRE calculation can be performed using nearest neighbor, bilinear, cubic, and Lanczos methods, as these methods yield very similar results. For more specific analyses, it is suggested to employ validation methods to better analyze the data.

This article was actualized with more informations.

--

--

Mário Bittencourt

SEO Copywriter | Precision Agriculture | Remote Sensing | Data Science