machinevisiontoolbox.ImageSpatial.Kernel.DGauss

classmethod Kernel.DGauss(sigma, h=None)[source]

Derivative 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:

Kernel

Returns a 2-dimensional derivative of Gaussian kernel with standard deviation sigma

\[\mathbf{K} = \frac{-x}{2\pi \sigma^2} e^{-(x^2 + y^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.DGauss(1)
<machinevisiontoolbox.ImageSpatial.Kernel object at 0x7f8ce7f152b0>
Note:
  • This kernel is the horizontal derivative of the Gaussian, \(dG/dx\).

  • The vertical derivative, \(dG/dy\), is the transpose of this kernel.

  • This kernel is an effective edge detector.

References:
  • Robotics, Vision & Control for Python, Section 11.5.1.3, P. Corke, Springer 2023.

Seealso:

Gauss Sobel