Imfill replaces extreme pixel values with the average value, inside one or more rectangular regions. Its purpose is to remove high-contrast spots that cause veils around them when the image is processed with Normalize, so place Imfill before Normalize.
In each region, Imfill measures the mean and the spread of the values. Pixels more than “sigma” standard deviations from the mean are outliers, and are moved toward the average value. The other pixels are not changed.
| Argument | What it does | Default |
|---|---|---|
| roi | Required. One or more windows of 4 numbers each, one after the other. Each window must contain at least 4 pixels | |
| remove | Which extremes to fix: both, light or dark | both |
| sigma | How many standard deviations from the mean count as an outlier. Smaller values catch more pixels. Decimals, such as 3.3, are allowed | 3 |
| regression to mean | How far to move an outlier toward the mean: 100% replaces it with the average; 0% leaves it unchanged | 100% |
| bands | all, or some, with the band numbers separated by spaces or semicolons | all |
All bands are treated separately. The output is the same type as the input.