SciPy

scipy.ndimage.black_tophat

scipy.ndimage.black_tophat(input, size=None, footprint=None, structure=None, output=None, mode='reflect', cval=0.0, origin=0)[source]

Multidimensional black tophat filter.

Parameters
inputarray_like

Input.

sizetuple of ints, optional

Shape of a flat and full structuring element used for the filter. Optional if footprint or structure is provided.

footprintarray of ints, optional

Positions of non-infinite elements of a flat structuring element used for the black tophat filter.

structurearray of ints, optional

Structuring element used for the filter. structure may be a non-flat structuring element.

outputarray, optional

An array used for storing the output of the filter may be provided.

mode{‘reflect’, ‘constant’, ‘nearest’, ‘mirror’, ‘wrap’}, optional

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to ‘constant’. Default is ‘reflect’

cvalscalar, optional

Value to fill past edges of input if mode is ‘constant’. Default is 0.0.

originscalar, optional

The origin parameter controls the placement of the filter. Default 0

Returns
black_tophatndarray

Result of the filter of input with structure.

Previous topic

scipy.ndimage.binary_propagation

Next topic

scipy.ndimage.distance_transform_bf