neighbourhood: Get neighbourhood information for an array
Description
This function provides information about the structure of a neighbourhood of
a given width within a specified array.
Usage
neighbourhood(x, width)
Arguments
x
An object that can be coerced to an array.
width
A vector giving the width of the neighbourhood in each
dimension, which will be recycled if necessary. Must not be greater than
the size of the array. Even values are rounded up to the next odd integer.
Value
A list with the following elements.
widthsThe width of the neighbourhood along each dimension.
Currently all elements of this vector will be the same.
sizeThe number of pixels within the neighbourhood.
locsA matrix giving the coordinates of each neighbourhood pixel
relative to the centre pixel, one per row.
offsetsVector offsets of the neighbourhood values within
x.