Description Usage Arguments Details Value References Examples
This function creates the convolution kernel for applying a filter to an array/matrix
1 2 | convKernel(sigma = 1.4, k = c("gaussian", "LoG", "sharpen", "laplacian",
"emboss", "sobel"))
|
sigma |
The |
k |
|
The convolution kernel is a matrix that is used by spacialfil
function over a matrix, or array, for filtering
the data. Gaussian kernel is calculated starting from the 2 dimension, isotropic, Gaussian distribution:
G(x)=\frac{1}{2πσ^{2}}e^{-\frac{x^{2}+y^{2}}{2σ^{2}}}
Laplacian of Gaussian kernel applies a second derivative to enhance regions of rapid intensity changes:
LoG≤ft ( x,y \right )=\frac{-1}{πσ^{4}}≤ft ( 1-\frac{x^{2}+y^{2}}{2σ^{2}}\right ) e^{-\frac{x^{2}+y^{2}}{2σ^{2}}}
the use of the underlying Gaussian kernel (so the name
Laplacian of Gaussian or LoG) is needed to reduce the effect of high frequency noise that can affect the signal
distribution. Laplacian is a Sharpen enhance the detail. Emboss kernel is a 3x3 convolution kernel that embosses the edges.
(but also the noise) in original dataset. Sobel convolution kernel returns the possibility to detect edges in a more sofisticated
way, the convKernel
function returns only one of the two matrices needed to apply the filter. The second one is calculated
by transposing the returned matrix in the other needed one.
An object of class convKern
with the matrix
of convolution kernel whose size varies according the value of sigma
(in case of
gaussian
or LoG
option selected), and k
being the convolution kernel type label
gaussian
kernel http://homepages.inf.ed.ac.uk/rbf/HIPR2/gsmooth.htm
LoG
kernel: http://homepages.inf.ed.ac.uk/rbf/HIPR2/log.htm
sharpen
kernel: https://en.wikipedia.org/wiki/Kernel_(image_processing)
laplacian
kernel: https://en.wikipedia.org/wiki/Discrete_Laplace_operator
emboss
kernel: http://coding-experiments.blogspot.it/2010/07/convolution.html
sobel
kernel: https://en.wikipedia.org/wiki/Sobel_operator
1 2 3 4 5 | ## Not run:
# creates a convolution kernel with Gaussian function and sigma = 1.4
K <- convKernel(sigma = 1.4, k = 'gaussian')
plot(K)
## End(**Not run**)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.