Description Usage Arguments Details Value Author(s) Examples
Low-pass filtering by a square window in the image processing. Focal operation of map algebra. Weight of pixels is proportional to cell area inside of focal window.
1 2 | focal_mean(x, size = 3.0, cover = 1e-06, fillNA = FALSE, saveMargin = TRUE
,noNA = TRUE, verbose = 0L)
|
x |
Object of class |
size |
Positive numeric. Size of square focal window. Fractional values are allowed. If |
cover |
Numeric. |
fillNA |
Logical. If |
saveMargin |
Logical. If |
noNA |
Logical. If |
verbose |
Integer of |
The reference is always central pixel, even if window size is even.
If size=3
then multiplicator is 3^(-2)
and elements have equal weights:
1 2 3 4 |
If size=2
then multiplicator is 2^(-2)
and weights of elements are:
1 2 3 4 |
If size=3.4
then multiplicator is 3.4^(-2)
and weights of elements are:
1 2 3 4 5 6 |
Object of class ursaRaster
with the same number of bands as in input raster.
Nikita Platonov platonov@sevin.ru
1 2 3 4 5 6 7 8 9 | session_grid(NULL)
a <- ursa_dummy(nband=1,mul=1/8,elements=0)
a[a<80] <- NA
print(a)
b1 <- focal_mean(a,size=6,cover=0.5,saveMargin=FALSE)
b2 <- focal_mean(a,size=6,cover=0.5,saveMargin=TRUE)
b3 <- focal_mean(a,size=6,cover=0.5,saveMargin=TRUE,fillNA=TRUE)
print(b3-a)
display(c(a,b1,b2,b3),blank.angle=c(-45,45),blank.density=20)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.