ImageFile.sgolay2d

ImageFile.sgolay2d(points=15, poly=1, derivative=None)

Implements a 2D Savitsky Golay Filter for a 2D array (e.g. image).

Parameters:

img (ImageArray or ImageFile) – image to be filtered

Keyword Arguments:
  • points (int) – The number of points in the window aperture. Must be an odd number. (default 15)

  • poly (int) – Degree of polynomial to use in the filter. (default 1)

  • derivative (str or None) –

    Type of defivative to calculate. Can be:

    None - smooth only (default) “x”,”y” - calculate dIntentity/dx or dIntensity/dy “both” - calculate the full derivative and return magnitud and angle.

ReturnsL
(imageArray or ImageFile):

filtered image.

Raises:

ValueError if points, order or derivative are incorrect.

Notes

Adapted from code on the scipy cookbook : https://scipy-cookbook.readthedocs.io/items/SavitzkyGolay.html