15.12.2012 Views

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SciPy Reference Guide, Release 0.8.dev<br />

binary_hit_or_miss(input, structure1=None, structure2=None, output=None, origin1=0, origin2=None)<br />

Multi-dimensional binary hit-or-miss transform.<br />

An output array can optionally be provided. The origin parameters controls the placement of the structuring<br />

elements. If the first structuring element is not given one is generated with a squared connectivity equal to one.<br />

If the second structuring element is not provided, it set equal to the inverse of the first structuring element. If the<br />

origin for the second structure is equal to None it is set equal to the origin of the first.<br />

binary_opening(input, structure=None, iterations=1, output=None, origin=0)<br />

Multi-dimensional binary opening with the given structure.<br />

An output array can optionally be provided. The origin parameter controls the placement of the filter. If no<br />

structuring element is provided an element is generated with a squared connectivity equal to one. The iterations<br />

parameter gives the number of times the erosions and then the dilations are done.<br />

binary_propagation(input, structure=None, mask=None, output=None, border_value=0, origin=0)<br />

Multi-dimensional binary propagation with the given structure.<br />

An output array can optionally be provided. The origin parameter controls the placement of the filter. If no<br />

structuring element is provided an element is generated with a squared connectivity equal to one. If a mask is<br />

given, only those elements with a true value at the corresponding mask element are.<br />

This function is functionally equivalent to calling binary_dilation with the number of iterations less then one:<br />

iterative dilation until the result does not change anymore.<br />

black_tophat(input, size=None, footprint=None, structure=None, output=None, mode=’reflect’, cval=0.0, origin=0)<br />

Multi-dimensional black tophat filter.<br />

Either a size or a footprint, or the structure must be provided. An output array can optionally be provided. The<br />

origin parameter controls the placement of the filter. The mode parameter determines how the array borders are<br />

handled, where cval is the value when mode is equal to ‘constant’.<br />

distance_transform_bf(input, metric=’euclidean’, sampling=None, return_distances=True, return_indices=False,<br />

distances=None, indices=None)<br />

Distance transform function by a brute force algorithm.<br />

This function calculates the distance transform of the input, by replacing each background element (zero values),<br />

with its shortest distance to the foreground (any element non-zero). Three types of distance metric are supported:<br />

‘euclidean’, ‘taxicab’ and ‘chessboard’.<br />

In addition to the distance transform, the feature transform can be calculated. In this case the index of the closest<br />

background element is returned along the first axis of the result.<br />

The return_distances, and return_indices flags can be used to indicate if the distance transform, the feature<br />

transform, or both must be returned.<br />

Optionally the sampling along each axis can be given by the sampling parameter which should be a sequence of<br />

length equal to the input rank, or a single number in which the sampling is assumed to be equal along all axes.<br />

This parameter is only used in the case of the euclidean distance transform.<br />

This function employs a slow brute force algorithm, see also the function distance_transform_cdt for more<br />

efficient taxicab and chessboard algorithms.<br />

the distances and indices arguments can be used to give optional output arrays that must be of the correct size<br />

and type (float64 and int32).<br />

distance_transform_cdt(input, metric=’chessboard’, return_distances=True, return_indices=False, distances=None,<br />

indices=None)<br />

Distance transform for chamfer type of transforms.<br />

The metric determines the type of chamfering that is done. If the metric is equal to ‘taxicab’ a structure is generated<br />

using generate_binary_structure with a squared distance equal to 1. If the metric is equal to ‘chessboard’,<br />

288 Chapter 3. Reference

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!