lpifilter2d

LPIFilter2D

class skimage.filters.LPIFilter2D(impulse_response, **filter_params) [source]

Bases: object

Linear Position-Invariant Filter (2-dimensional)

__init__(impulse_response, **filter_params) [source]
Parameters:

impulse_response : callable f(r, c, **filter_params)

Function that yields the impulse response. r and c are 1-dimensional vectors that represent row and column positions, in other words coordinates are (r[0],c[0]),(r[0],c[1]) etc. **filter_params are passed through.

In other words, impulse_response would be called like this:

>>> def impulse_response(r, c, **filter_params):
...     pass
>>>
>>> r = [0,0,0,1,1,1,2,2,2]
>>> c = [0,1,2,0,1,2,0,1,2]
>>> filter_params = {'kw1': 1, 'kw2': 2, 'kw3': 3}
>>> impulse_response(r, c, **filter_params)

Examples

Gaussian filter: Use a 1-D gaussian in each direction without normalization coefficients.

>>> def filt_func(r, c, sigma = 1):
...     return np.exp(-np.hypot(r, c)/sigma)
>>> filter = LPIFilter2D(filt_func)
doc_scikit_image
2017-01-12 17:21:52
Comments
Leave a Comment

Please login to continue.