Description Usage Arguments Details Value Author(s) References See Also Examples
Convolve a
1 |
A |
is a three-dimensional array (“the template”). |
B |
is a three-dimensional array (“the target”). |
C |
is a vector of length three (the center of “the template”). |
FFTA |
is the three-dimensional Fourier transform of |
The arrays A and B are transformed into the Fourier domain and multiplied together (equivalent to a convolution in the image domain across all spatial locations simultaneously).
A three-dimensional array, the same dimension as the input arrays, that is the convolution of the “target” to the “template” at all spatial locations.
Brandon Whitcher
Briggs, W.L. and Henson, V.E. (1995) The DFT: An Owner's Manual for the Discrete Fourier Transform, SIAM: Philadelphia.
1 2 3 4 5 6 7 8 9 10 11 12 | cube <- array(0, c(20,20,1))
cube[9:12,9:12,1] <- 1
tkernel <- array(0, c(20,20,1))
tkernel[,,1] <- c(.5, 1, .5, rep(0,20-3))
tcenter <- find.center(ifelse(tkernel > 0, TRUE, FALSE))
out <- conv.fft(tkernel, cube, tcenter)
out[8:13,8:13,1] ## text output
par(mfrow=c(2,2)) ## graphic output
image(drop(tkernel), col=tim.colors(), main="Template")
image(drop(cube), col=tim.colors(), main="Target")
image(drop(out), col=tim.colors(), main="Output")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.