10-13-2020 02:19 PM
I'd like to build a spatial model to output pixels that fall outside some standard deviation based on all pixels in the raster. For example, return all pixels greater than 2 standard deviations from the mean, etc. I would like to apply this to an entire raster instead of a focal window.
I see the standard deviation tool in the spatial modeler toolbox, but I can't figure out from the docs how to use it. I've used the greater than/less than tools to filter pixel values, but the standard deviation tool doens't seem to work in the same way.
Any guidance or sample model would be helpful.
Solved! Go to Solution.
10-14-2020 08:39 AM
Conceptually very easy - just use the Statistics operator to get the Mean and SD values for each band and then use the LT and GT operators to select the pixels that fall outside the desired ranges. Similar to what you would normally do to threshold an NDVI, but using two separate thresholds.
But - are you wanting to do this for multispectral imagery? If so how do you want the differing ranges per band to be handled? Are you wanting to And or Or the per-pixel selection?
I.e. for any given pixel, the band 1 value might be outside the SD range for band 1, but for band 2 the values might be inside band 2's SD range. Do you want to keep that pixel or reject it? Are you literally going to want a "sparse" multispectral result where some bands have values at a pixel location and some bands don't?
Either way you can set it up, but you just need to specify which way you want to go. And be very specific about how you decide to handle NoData for your particular data.
10-14-2020 10:27 AM
Once again thank you for the outstanding support. This sort of template to functionally demonstrate each operator is extremely helpful and can be extended to fit my use case.