machinevisiontoolbox.ImageSpatial.Kernel.LoG
- classmethod Kernel.LoG(sigma, h=None)[source]
Laplacian of Gaussian kernel
- Parameters:
sigma (float) – standard deviation of first Gaussian kernel
h (int, optional) – half-width of kernel
- Returns:
2h+1 x 2h+1 kernel
- Return type:
Return a 2-dimensional Laplacian of Gaussian kernel with standard deviation
sigma
\[\mathbf{K} = \frac{1}{\pi \sigma^4} \left(\frac{u^2 + v^2}{2 \sigma^2} -1\right) e^{-(u^2 + v^2) / 2 \sigma^2}\]The kernel is centred within a square array with side length given by:
\(2 \mbox{ceil}(3 \sigma) + 1\), or
\(2\mathtt{h} + 1\)
Example:
>>> from machinevisiontoolbox import Kernel >>> Kernel.LoG(1) <machinevisiontoolbox.ImageSpatial.Kernel object at 0x7f7a707552b0>