prewitt

prewitt

skimage.filters.prewitt(image, mask=None) [source]

Find the edge magnitude using the Prewitt transform.

Parameters:

image : 2-D array

Image to process.

mask : 2-D array, optional

An optional mask to limit the application to a certain area. Note that pixels surrounding masked regions are also masked to prevent masked regions from affecting the result.

Returns:

output : 2-D array

The Prewitt edge map.

See also

sobel, scharr

Notes

Return the square root of the sum of squares of the horizontal and vertical Prewitt transforms. The edge magnitude depends slightly on edge directions, since the approximation of the gradient operator by the Prewitt operator is not completely rotation invariant. For a better rotation invariance, the Scharr operator should be used. The Sobel operator has a better rotation invariance than the Prewitt operator, but a worse rotation invariance than the Scharr operator.

Examples

>>> from skimage import data
>>> camera = data.camera()
>>> from skimage import filters
>>> edges = filters.prewitt(camera)
doc_scikit_image
2017-01-12 17:22:50
Comments
Leave a Comment

Please login to continue.