Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

72_convolutions

Convolutions


Description

Image-style convolutions of two matrices.

POOLING AND CONVOLUTION FUNCTIONS ARE ONLY EARLY PROTOTYPES.
THEY HAVE HAD LIMITED TESTING AND MAY BE CHANGED IN FUTURE UPDATES.

Usage

vt2.convolve.matrix (x, k, ..., f, nsub)

Arguments

x

A matrix, representing an image/etc.

k

A matrix, the image filter. In general, this should sum to one.

f

A function of a matrix.
Ignored, if k provided.

nsub

An integer vector of length one or two, the size of the submatrices.
Ignored, if k provided.

...

Ignored.

Details

If k provided, then each element of the new matrix is computed by multiplying k by a submatrix of x the same size as k.

The image filter slides over the matrix.

If k omitted, it's possible to use an arbitrary function.
This will also slide over the matrix, calling the function with submatrices.

Value

A matrix.

See Also

Examples

x <- matrix (1:100, 10, 10)
vt2.convolve.matrix (x, vt2.simple.matrix (5) )

vectools

Advanced Vector Toolkit

v0.2.0
GPL (>= 2)
Authors
Abby Spurdle
Initial release
2020-10-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.