convKernel(sigma = 1.4, k = c("gaussian", "LoG", "sharpen", "laplacian",
"emboss", "sobel"))numeric value of standard deviation for the Gaussian or LoG filtercharacter value: gaussianfor Gaussian kernelLoGfor Laplacian of Gaussian kernelsharpenfor 3x3 convolution matrix for sharpening edgeslaplacianfor a 3x3 conconvKern 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 labelspacialfil 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\pi\sigma^{2}}e^{-\frac{x^{2}+y^{2}}{2\sigma^{2}}}$$ Laplacian of Gaussian kernel applies
a second derivative to enhance regions of rapid intensity changes:
$$LoG\left ( x,y \right )=\frac{-1}{\pi\sigma^{4}}\left ( 1-\frac{x^{2}+y^{2}}{2\sigma^{2}}\right ) e^{-\frac{x^{2}+y^{2}}{2\sigma^{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.gaussiankernelLoGkernel:sharpenkernel:laplaciankernel:embosskernel:sobelkernel:## 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**)Run the code above in your browser using DataLab