convolution
convolution(image, kernel, mode = "same")
either a matrix, data frame or array
a kernel in form of a matrix
the convolution mode (one of 'same', 'full')
either a matrix or an array, depending on the input data
This function performs convolution using a kernel matrix. When mode 'same' the output object has the same dimensions with the input, whereas when mode 'full' the rows and columns of the output object equals : ROWS = nrow(image) + nrow(kernel) - 1 and COLUMNS = ncol(image) + ncol(kernel) - 1