shapeKernel(width, dim = length(width), type = c("box","disc","diamond"),
brush = TRUE, binary = TRUE, normalised = FALSE)gaussianKernel(sigma, dim = length(sigma), size = 4*sigma, normalised = TRUE)
dim
if that parameter is also specified.dim
if that parameter is also specified.width
or sigma
.sigma
value.TRUE
, elements of the kernel which are outside the shape will be set to NA
, otherwise they will have zero value. This is to ensure appropriate behaviour in morph
.FALSE
, the value of the kernel at each point represents the proportion of the array element within the shape. If TRUE
, these values are binarised to be 1 if at least half of the element is within the shape, and 0 otherwise.TRUE
, the sum of non-missing elements of the kernel will be unity. Note that this is the default for gaussianKernel
, but not for shapeKernel
.morph
and related functions.morph
for general application of kernels to data, erode
for mathematical morphology functions, and gaussianSmooth
for applying smoothing to data.shapeKernel(c(3,5), type="diamond")
gaussianKernel(c(0.3,0.3))
Run the code above in your browser using DataLab