profitConvolve: Performs a convolution using the give convolver object

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/profitConvolver.R

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

1
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).

Details

...

Value

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

Author(s)

Rodrigo Tobar

See Also

profitBruteConv, profitMakeConvolver, profitHasFFTW

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# 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)

ProFit documentation built on Nov. 11, 2019, 5:07 p.m.