View source: R/profitConvolver.R
profitConvolve | R Documentation |
Given a convover and two images (the source and the kernel),
this method performs a convolution of the two images and returns the result.
Convolution is performed using the give convolver,
which must be created using profitMakeConvolver
.
profitConvolve(convolver, image, kernel, mask = NULL)
convolver |
The convolver object that will perform the convolution.
It must be created using |
image |
The source image to convolve. |
kernel |
The kernel user to convolve the image with. |
mask |
Logical; If not |
...
The output is the result of the convolution of the image and the kernel.
Rodrigo Tobar
profitBruteConv
, profitMakeConvolver
, profitHasFFTW
# Initial images
image = matrix(1, 100, 100)
psf = matrix(1:10000, 100, 100)
# Check for FFTW support and create a convolver
type = "brute"
if (profitHasFFTW()) {
type = "fft"
}
convolver = profitMakeConvolver(type, c(100, 100), psf, fft_effort=0,
omp_threads=2)
# Perform convolution
image = profitConvolve(convolver, image, psf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.