aloe.image.filterfft module

2D image filter of numpy arrays, via FFT.

Connelly Barnes, public domain 2007.

aloe.image.filterfft.filter(I, K, cache=None)[source]

Filter image I with kernel K.

Image color values outside I are set equal to the nearest border color on I.

To filter many images of the same size with the same kernel more efficiently, use:

>>> cache = []
>>> filter(I1, K, cache)
>>> filter(I2, K, cache)
...

An even width filter is aligned by centering the filter window around each given output pixel and then rounding down the window extents in the x and y directions.

aloe.image.filterfft.gaussian(sigma=0.5, shape=None)[source]

Gaussian kernel numpy array with given sigma and shape.

The shape argument defaults to ceil(6*sigma).

aloe.image.filterfft.test()[source]