components.interp.gaussianfilter

class GaussianFilter(config={}, **kwds)[source]

Bases: Component

Gaussian filter generator component.

Create a Gaussian filter for use with the Resize component.

Connecting a GaussianFilter component’s output to a Resize component’s filter input allows the filter to be updated (while the components are running) by changing the GaussianFilter config:

filgen = GaussianFilter(xsigma=1.5)
resize = Resize()
filgen.connect('output', resize.filter)
...
start(..., filgen, resize, ...)
...
filgen.set_config({'xsigma': 1.8})
...

If you don’t need to change the configuration after creating the Resize component then it’s simpler to use a GaussianFilterCore to create a fixed filter.

2-dimensional filters can be produced by setting both xsigma and ysigma, but it is usually more efficient to use two Resize components to process the two dimensions independently.

Config:

xsigma

float

Horizontal standard deviation parameter.

ysigma

float

Vertical standard deviation parameter.

classmethod core(x_sigma=0.0, y_sigma=0.0)[source]

Gaussian filter generator core.

Alternative to the GaussianFilter component that can be used to make a non-reconfigurable filter:

resize = Resize()
resize.filter(GaussianFilter.core(x_sigma=1.5))
...
start(..., resize, ...)
...
Parameters:
  • x_sigma (float) – Horizontal standard deviation parameter.

  • y_sigma (float) – Vertical standard deviation parameter.

Returns:

A Frame object containing the filter.


Comments or questions? Please email jim@jim-easterbrook.me.uk.