Image Analysis or Raster Calculator

5375
10
02-24-2016 12:48 PM
N__R_Wilson
New Contributor II

I calculated NDVI using two different methods. One was the NDVI calculation through the Image Analysis window (using Scientific Output) as explained here: How to Create NDVI Maps in ArcGIS - GIS Geography

I also ran NDVI through raster calculator, converting to floating point.

The statistics for the two images were slightly different, though the images are similar to the eye.

Image Analysis: Min: -1, Max: 1, Mean: -0.029, Median: -0.03124, STD: 0.077

Raster Calculator: Min: -1, Max: 1, Mean: -0.034, Median: -0.039063, STD: 0.081

Any idea as to why there's a difference? It's a little unsettling. Has anyone else had the same experience.

It was my first time using the Image Analysis window.

FYI: I'm using 4 band aerial imagery flown by a contractor. R, G, B, NIR

0 Kudos
10 Replies
DanPatterson_Retired
MVP Emeritus

ensure that the extents of the files undergoing the analysis in both cases were the exact same.  Any differences in the extent, cell size etc etc will affect the underlying statistics, values, and therefore on the calculations.  I would also ensure that the statistics are reporting the same type of stat... there is std dev and std dev.  Make sure that they are both population or sample.  Often people get confused when std dev's differ but one may be using pop std dev and the other sample.  I would be more concerned about differences in the medians, since that implies differences in the underlying data distributions.  I would confirm the median values for all the input layers and perform a separate median calculation... Just a few thoughts

N__R_Wilson
New Contributor II

The statistics I'm interested in are the raster statistics gotten through "Calculate Statistics" with skip values of 1, which should be the population STD of all pixels in the raster.
Extent, cell size, projection, all other raster properties are all the same.

It seems to me that NDVI calculated through Image Analysis is slightly different than through Raster Calculator.

NeilAyres
MVP Alum

That would really depend on what you did in the Raster Calculator to replicate the NDVI calculation.

Are you sure that all your data was double type for instance, before doing the division. There may have been some integer rounding going on somewhere.

DanPatterson_Retired
MVP Emeritus

outside of ensuring float division, you are hopefully using the same bands between both and that landsat 8 differs from previous ones. NDVI differencing

N__R_Wilson
New Contributor II

I did float() all layers in raster calculator while applying the index. I tried both (float(nir) - float(red))/(float(nir) + float(red)) and float(nir - red)/float(nir + red). The outputs of both of these raster calculator formulas had the same raster property statistics as calculated using "Calculate Statistics" tool with a skip factor of 1.
I assumed that if I had mixed up bands between Image Analysis and Raster Calculator that the results would be visually different. Just as NDWI (McFeeters) is noticeably visually different from NDVI. I did just run an NDVI in Image Analysis again, double checking band assignments. It is visually the same as my Raster Calculator products. Exporting the Image Analysis raster layer to a raster to calculate statistics would take most of the day due to the high resolution and extent of the image.

Does Image Analysis initially calculate a 0-255 integer image and then converts back to floating point? That may explain the difference. If so, I might use Image Analysis to quickly visualize the data but rely on Raster Calculator to create the raster.

This is NDVI applied two different ways to one image. Or three different ways if you count the two different raster calculator formulas listed above separately.
I'm using 4-band aerial imagery. Band 1 is red, band 4 is NIR.

0 Kudos
SteveLynch
Esri Regular Contributor

use GetCellValue geoprocessing tool (DataManagement->Raster->RasterProperties) and pick a location and it'll report the value from each band at that location and do the math by hand and compare.

-Steve

JeffreySwain
Esri Regular Contributor

Also be sure that when using the Image Analysis Window results, be sure to be zoomed into raster resolution.  Due to the nature of Raster Functions, always compare with Source raster values.

DanPatterson_Retired
MVP Emeritus

And... you are using the raw values, not stretched ones?  I have seen this happen on other RS software...I am not sure that it is even possible to make a mistake like this in Arc*, but it is worth a shot

0 Kudos
CodyBenkelman
Esri Regular Contributor

what version of ArcGIS are you running? 

0 Kudos