我有两个 ndvi 图像,其最小值/最大值为 -1 到 1....我想从第一个图像中减去第二个图像,反之亦然,但是当我这样做时,它给了我值为 0 的光栅...我认为它应该是这样的,因为我们从另一个中减去一个波段或从另一个图像中减去一个图像......请帮助我哪里出错......这是我用来查看变化的代码...... .
b3<-raster(stackIm1,3) #band 3 of first input image
b4<-raster(stackIm1,4) #band 4 of first input image
ndvi1<-(b4-b3)/(b4+b3) #calculating NDVI for first image
b3<-raster(stackIm2,3) #band 3 of second image
b4<-raster(stackIm2,4) #band 4 of second image
ndvi2<-(b4-b3)/(b4+b3) #calculating NDVI for second image
ndvi <- ndvi1-ndvi2 #subtracting second ndvi image from first
提前致谢