39 | | >>Markus: |
40 | | >> |
41 | | >>That is easy, there is no need to cut off edges.I would also not work with the number of pixels in nominator and denominator, because this number of pixels will vary for each window anyway depending on how many pixels are discarded because the spectral difference is larger than the spectral bandwidth. NULL cells are discarded anyway. Chopping off edges can be avoided for example for the very first pixel at row 0, col 0 by setting the window to those pixels east and south of the corner pixel, of course adhering to the spatial bandwidth. The window will thus be about a quarter of the size of a full window, that is not a problem. The new bandvalue is new value += weight * current value and weightsum += weight |
42 | | >> |
43 | | >>after processing all cells in the window, the new value is new value = new value / weightsum |
44 | | >> |
45 | | >>It does not matter how many valid cells are in the moving window. |
46 | | >> |
47 | | >>See also r.resamp.filter |
48 | | >> |
49 | | >>Moritz: |
50 | | >> |
51 | | >>My question would be how reliable results would be if you only one or two pixels are in the window. But I guess this is a marginal issue and we can see later if it really is a problem. |
52 | | >> |
53 | | >>Markus: |
54 | | >> |
55 | | >>This can also happen if only one or two cells are within the spectral bandwidth, all other cells will be ignored. If this is not desired, the spatial / spectral bandwidths could be adjusted. Sometimes this (small objects of only one or two cells) might be desired. |
| 40 | the solution of the esfe effect: when the moving window located in the edge of the image, adaptively cut the moving window to fit the edge, because the weights are adaptively fit the number of pixels inside of moving windows, this number of pixels will vary for each window anyway depending on how many pixels are discarded because the spectral difference is larger than the spectral bandwidth. NULL cells are discarded anyway. Chopping off edges can be avoided for example for the very first pixel at row 0, col 0 by setting the window to those pixels east and south of the corner pixel, of course adhering to the spatial bandwidth. The new bandvalue is new value += weight * current value and weightsum += weight. |