Learn R Programming

ProFit (version 1.3.3)

profitConvolve: Performs a convolution using the give convolver object

Description

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.

Usage

profitConvolve(convolver, image, kernel, mask = NULL)

Arguments

convolver

The convolver object that will perform the convolution. It must be created using profitMakeConvolver.

image

The source image to convolve.

kernel

The kernel user to convolve the image with.

mask

Logical; If not NULL, it has the same size of the source image, and indicates the pixels of the resulting image that should be part of the output (if TRUE), or left as 0 (if FALSE).

Value

The output is the result of the convolution of the image and the kernel.

Details

...

See Also

profitBruteConv, profitMakeConvolver, profitHasFFTW

Examples

Run this code
# NOT RUN {
# 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)
# }

Run the code above in your browser using DataLab