I before computed the Normalized Difference Vegetation Index (NDVI) using two images from Sentine-2 (band 4 and band 8) this both images has a 10m resolution, however now I would like computed the Normalized Difference Red Edge Index (NDRE) but the problem for me is that this index, according to the formula:
NDRE = (NIR - RED EDGE) / (NIR + RED EDGE)
The problem is not the formula the problem is with the resolution of the images from the sentinel-2 in the band 5 (Red Edge) with has 20m of resolution and the band 8 (NIR) which has a 10m resolution:
is possible compute the NDRE index using two images with different resolution? which of the 3 red edge bands should I take?
I will appreciate any idea guys to achieve this computation by using sentinel-2 images. thanks
PD: To compute the ndvi I used rasterio library and gdal
Update:
I did this code from rasterio.readthedocs.io/en/latest/topics/resampling.html However I changed to a different scale factor and always I'm getting a 20m cell size or 20m pixel.
import rasterio
from rasterio.enums import Resampling
upscale_factor = 2
# load band 05 from a sentinel2 footprint
# this is 20m resolution I one an output raster of 10m resolution
with rasterio.open("images/B05.jp2", driver='JP2OpenJPEG') as dataset:
# resample data to target shape
data = dataset.read(
out_shape=(
dataset.count,
int(dataset.height * upscale_factor),
int(dataset.width * upscale_factor)
),
resampling=Resampling.bilinear
)
# scale image transform
transform = dataset.transform * dataset.transform.scale(
(dataset.width / data.shape[-1]),
(dataset.height / data.shape[-2])
)
#Finally I want export image.. save in the disk with crs geotiff
#...
Should I use opencv or another libraries to achieve it?