Showing results for 
Search instead for 
Do you mean 

Fill Zeros

by Technical Evangelist on ‎09-29-2015 01:43 PM - edited on ‎02-24-2020 02:18 AM by Community Manager (1,384 Views)

Description: Suppose you have a single-layer floating point data with small holes (zero values) randomly scattered throughout (such as terrain data derived from interferometric SAR or LiDAR techniques). The goal of this Model is to replace all of the pixels that have a value of 0.0 with the mean of the surrounding eight pixels, but if any of the eight surrounding pixels have a value of zero, they will be excluded from the mean calculation. All of the non-zero pixels in the image are to remain unchanged.



by Technical Evangelist
on ‎03-02-2016 10:05 AM

Why is this important? Because if the data is Floating Point you can't use the normal focal filtering methods that are designed for Thematic (and therefore unsigned integer) data. So the Model converts the data to an Integer format by applying a user-configurable multiplier (so that you can control any loss of precision that might occur for your specific data), applying the Focal Mean operation at any pixels with value 0, and then dividing by the multiplier to get back to the original Float range.


Note that all pixels that were non-zero are not impacted by the conversion to Integer - they should retain the exact precision they originally had because of the way the Either Or is used.