This function provides information about the structure of a neighbourhood of a given width within a specified array.
neighbourhood(x, width)
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. |
A list with the following elements.
The width of the neighbourhood along each dimension. Currently all elements of this vector will be the same.
The number of pixels within the neighbourhood.
A matrix giving the coordinates of each neighbourhood pixel relative to the centre pixel, one per row.
Vector offsets of the neighbourhood values within
x
.
Jon Clayden <code@clayden.org>