Learn R Programming

vectools (version 0.2.0)

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.

Value

A matrix.

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.

See Also

Pooling

Image Filters

Examples

Run this code
# NOT RUN {
x <- matrix (1:100, 10, 10)
vt2.convolve.matrix (x, vt2.simple.matrix (5) )
# }

Run the code above in your browser using DataLab