Index calculation problem

111 views
Skip to first unread message

Jose Menes

unread,
Feb 15, 2024, 10:30:37 AM2/15/24
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
Hello!
First of all I wanted to thank you for this tool that makes processing much easier!

I had a query, in qgis using the fieldimage plugin I am calculating the indices and also extracting the band values, the problem is that when I do the equation with the band values they are not identical to the indices calculated by fieldimage (using the same equation). I realized that when calculating the cvi index I was getting an "inf" error in some areas and I tried to see what the problem was. In the NDVI, try to look at differences by calculating in Excel and in some it gives a 0.05 difference, in many it gives 0.01.
I also obtain the values of the bands with the function to extract data from fieldimage, I don't know if I'm making a mistake there.
It worries me a little because I don't know whether to stick with the values of the bands or the indices.
On another flight I am seeing that the differences are smaller, but some still have 0.01 in the NDVI.

Thank you in advance!

Dr P S Pawar

unread,
Feb 15, 2024, 12:46:08 PM2/15/24
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
Hello...,
To effective utilize the fieldindex function from FIELDimageR-QGIS tool for calculating indices, it is crucial to ensure the accurate sequence of bands provided for raster. For instance, in case of tutorial image (EX1_RGB.tif) the correct band sequence is Red,Green,Blue. If your raster image has a band sequence of Blue,Green,Red, then same order (bands=Blue,Green,Red) should be provided. The same rule applies to multispectral images. For instance, if a multispectral mosaic has bands stacked in the order of Blue,Green,Red,RE,NIR, then the same sequence should be provided for the 'bands' input parameter of the fieldindex function. 
Here some examples for  'bands'  input parameter of  fieldindex function
i. bands= Red,Green,Blue        (For RGB stacked raster)
ii. bands=  Blue,Green,Red,RE   (For mosaic with bands sequence of Blue,Green,Red,RE )
iii. bands= Green,Red,RE,NIR    (For mosaic with bands sequence of  Green,Red,RE,NIR)
etc.,
The stacked mosaic image can have any sequence of bands; However you must ensure that the sequence provided in the 'bands' input parameter of fieldindex function matches exactly with the bands sequence in your image. Also, ensure that the band names are case sensitive and match the nomenclature provided in the help content of function.

Based on your query, it appears that there might be issue with the sequence of bands provided for your raster image. I suggest double checking the bands sequence and trying fieldindex function again with correct order. If you face any more problems, please inform us. Thank you for reaching out us. 

Jose Menes

unread,
Feb 15, 2024, 8:26:56 PM2/15/24
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
thanks for answering! I tried again (both exporting the bands and generating the indices and it gave me the same thing).

In fact, the indices seem quite similar to those calculated, my bands are Blue, Green, Red, RE, NIR, 6 (6 is a thermal band), in Agisoft before exporting to QGIS they are in that order.

  I tried calculating different indices with the band values and they gave me quite similar values, PSRI, NDVI, GNDVI, the difference is normally between 0.002-0.05 and I use all decimals. I would think that if it is a mistake to put the bands wrong, they would have to give me very different things, right?

For example field I calculate on an NDVI plot
0.861845195, my nir bands 0.5300821065902710 and network 0.0402249991893768 and this gives me 0.858935655 (in this example the difference is very small). I clarify that I use the same polygons to extract the data from the indices and bands.

Dr P S Pawar

unread,
Feb 16, 2024, 2:31:11 AM2/16/24
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
Hi there,
The fieldInfo function from FIELDimageR-QGIS tool extracts the zonal information using exactextractr::exactextract function. When comparing the zonal extracted values from software like Agisoft, terra r package or any other raster processing tools, a small differences might arises, but they are usually insignificant. However, fieldInfo function utilizes  exactextractr::exactextract function which is more faster and more precise because it summarizes the raster values more precisely over the polygonal areas.
Message has been deleted

Jose Menes

unread,
Apr 15, 2024, 2:13:02 PM4/15/24
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
Hello again! I'm still having the same problem. Just in case I share it again with the excel data.

  I show you in Excel how, having values for all the bands of the camera, there are plots that leave them in "inf" in the PSRI index.
The way to obtain the band values is with fieldinfo and with the same plots that I use for the indices. I notice what happens with the PSRI index only (I don't use all the indexes anyway).

The other thing I kept noticing is that if I manually calculate the index for that plot and drag the function it gives me numbers with a little difference, in some the difference is greater and in other plots very similar. I put PSRI CALCULATION in example mode in the excel to compare some calculated values (R-G)/RG.

Greetings!
Captura de pantalla 2024-04-15 150412.png
Reply all
Reply to author
Forward
0 new messages