fft_convolve: Convolution of two images via FFT

Description Usage Arguments Examples

View source: R/convolve.R

Description

Convolution of two images via FFT

Usage

1
fft_convolve(im, filter, deconvolution = FALSE)

Arguments

im, filter

cimg objects

deconvolution

logical indicating if the deconvolution should be performed

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
im <- lenna
filter <- imfill(9,9,val = 1)
blurred.im <- fft_convolve(im, filter)
deblurred.im <- fft_convolve(blurred.im, filter, deconvolution = TRUE)
par(mfrow = c(1,3), mar = c(0,0,1,0)+0.1)
plot(im, axes = FALSE, interp = FALSE, main = 'Original Lenna')
plot(blurred.im, axes = FALSE, interp = FALSE, main = 'Blurred Lenna')
plot(deblurred.im, axes = FALSE, interp = FALSE, main = 'deBlurred Lenna')
PSNR(im, blurred.im)
PSNR(im, deblurred.im)

redR documentation built on May 2, 2019, 3:47 p.m.

Related to fft_convolve in redR...