Select to view content in your preferred language

Standard deviation image created from 16 bit raster image is a 32 bit image

1085
4
01-23-2012 04:08 AM
ToddKesselring1
Emerging Contributor
I used the Focal Statistics tool in the Neighborhood toolbox out of the Spatial Analyst tools and created a STD image from a 16 bit, unsigned integer TIFF image. The result was a 32 bit floating point image TIFF. My question is why did it change the pixel type and pixel depth? Is there a way to control this in the output or is the increased pixel depth actually desirable?
0 Kudos
4 Replies
ChrisBater
Deactivated User
I imagine because calculating standard deviation on a bunch of integers still requires a floating point number for maximum precision. For example the standard deviation of [1,2,2,2] is 0.5.  You could always run the integer (INT) tool on the output standard deviation raster to convert back.

Chris
0 Kudos
ToddKesselring1
Emerging Contributor
I imagine because calculating standard deviation on a bunch of integers still requires a floating point number for maximum precision. For example the standard deviation of [1,2,2,2] is 0.5.  You could always run the integer (INT) tool on the output standard deviation raster to convert back.

Chris


Good point, Chris. I guess it depends on how much precision I need. I will need to look at some neighboring values and see if it would work with less precision. I am glad you pointed out the INT tool. Thanks!

Todd
0 Kudos
JeffreyEvans
Frequent Contributor
It is not a matter of precision in the way your are thinking. The values after the decimal are important and just truncating them can bias how a given statistical moment represents the distribution function. As such, be careful truncating floating point values using Int. If you want a 16-bit image you could do something like.

Int(FocalStatistics(raster,NbrRectangle(3,3,MAP), "STD")*1000)
0 Kudos
ToddKesselring1
Emerging Contributor
Jeffrey,

Thanks for the input. Yes, even though the size seems excessive the extra information may prove useful. I am using the standard deviation with the original brightness as a 2 band stacked image for supervised classification. The values past the decimal may be decisive in assigning pixels to classes.

Todd
0 Kudos