In fieldIndex NAs produced by integer overflow

63 views
Skip to first unread message

Eric Wolske

unread,
Jan 17, 2022, 1:47:40 PM1/17/22
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
Hi Filipe, 

I've been having issues extracting VI information from my RGB orthomosaics. I run fieldIndex and will get this warning message: 

In getValues(e1) * getValues(e2) : NAs produced by integer overflow

It still extracts data and I can create a datasheet, however, many of the values for VARI and BGI are labeled NA, inf, or -inf. The remaining VIs all seem to work as does the individual band extraction. The same issue occurs when I run the same code on my multispectral orthomosaics. Is there maybe a way to increase the integer length in the code or reduce the integer length in the analysis?

Thanks!

Eric

fmatias

unread,
Jan 31, 2022, 1:36:22 PM1/31/22
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
Hi Eric,

Thanks for asking. I am not sure why this is happening. I have some questions: (1) Are you removing the soil? (2) Did you check if there is any plot without pixels after removing the soil that may be causing this error? Did you check if there are any strange pixel values at the same location of those plots with errors in the image (for example reflective GCPs or paper, etc that may reflect more and cause this error)? 

Could you share an image and shapefile to be able to replicate the error and check the function?

Thanks a lot,
Filipe

Eric Wolske

unread,
Feb 3, 2022, 4:22:39 PM2/3/22
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
Hi Filipe, 

(1) Yeah, I've been removing the soil using CHM thresholding. (2) I'm analyzing dozens of flights across the season and at the end of the season some of the plots have no pixels after CHM threshold masking but the problem is evident the entire season and across trials and across sensors (phantom 4 pro and Micasense altum). I also tried using my.index to write out the formula for VARI and wound up with similar issues. 

I uploaded an example flight with the RGB and MS sensors. I included the exported datasheet, rasters, masks, shapefiles, and R code but if I'm missing anything let me know. I had removed the values that said NA and inf from the datasheet so now they are blank in the datasheet.

Thanks!

Eric

fmatias

unread,
Feb 5, 2022, 8:01:49 AM2/5/22
to FIELDimageR: A R package to analyze orthomosaic images from field trials.

Eric,

I got your point. To remove soil, we are using vegetation indices that recognize what is green in the image, right. During the senescence time, the majority of the pixels are brown and they will be removed by fieldMask(). Then, when you use this mask to select pixels and calculate the CHM you will get the error. That’s happening because you removed all pixels and there is no information to compare with the soil base.

My suggestion is (1) to not use the mask to calculate CHM, or (2) to use the same mask made with the flight with greater canopy (flowering time) for all flights. In other words, you must adjust the pipeline using one flight from Flowering time, get and save the mask to use it during the removing soil step before calculating the CHM. In some cases, the flights will have some soil area, but I don’t think this is a problem here.

 

Hope it helps… Let us know if this strategy works.

 

All the best,

Filipe

Eric Wolske

unread,
Feb 7, 2022, 1:05:31 AM2/7/22
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
Hi Filipe, 

Thanks for looking into this! 

I forgot to include how I create my CHM mask, but I use a DEM and a DTM to create the CHM and then a height threshold for the mask, no orthomosaic. The problem arises after I use the DEM-derived mask to extract the VI data from the orthomosaic rasters, specifically VARI and BGI for both the RGB sensor and multispectral sensor. The issue also occurs regardless of phenological stage, leaf-out/flowering/harvested/senescence. It's just strange that for the exact same shapefile ID, all other bands, VI's, and structural data will be presented but for these few VI's the results are NA or inf. 


This is my CHM masking code but I don't believe this is causing the problem. 

DEM <- stack("rasters/p4p/DSM/210227_UVT_p4p_DSM.tif")
DTM.R <- resample(DTM.dormant, DEM)
CHM <- DEM-DTM.R
CHM.plant <- CHM
CHM.plant[CHM.plant<.05] <- NA
CHM.mask <- CHM
CHM.mask[CHM.mask<.05] <- 1
CHM.mask[CHM.mask<1] <- 0
CHM.mask[CHM.mask>1] <- 0
plot(CHM.mask)


Thanks, 

Eric
Reply all
Reply to author
Forward
0 new messages