bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / filters / edges / scharr
function
skimage.filters.edges:scharr
source: /dev/scikit-image/src/skimage/filters/edges.py :316
Signature
def scharr ( image , mask = None , * , axis = None , mode = reflect , cval = 0.0 ) Summary
Find the edge magnitude using the Scharr transform.
Parameters
image: arrayThe input image.
mask: array of bool, optionalClip the output image to this mask. (Values where mask=0 will be set to 0.)
axis: int or sequence of int, optionalCompute the edge filter along this axis. If not provided, the edge magnitude is computed. This is defined as
sch_mag = np.sqrt(sum([scharr(image, axis=i)**2 for i in range(image.ndim)]) / image.ndim)
The magnitude is also computed if axis is a sequence.
mode: str or sequence of str, optionalThe boundary mode for the convolution. See scipy.ndimage.convolve for a description of the modes. This can be either a single boundary mode or one boundary mode per axis.
cval: float, optionalWhen
modeis'constant', this is the constant used in values outside the boundary of the image data.
Returns
output: array of floatThe Scharr edge map.
Notes
The Scharr operator has a better rotation invariance than other edge filters such as the Sobel or the Prewitt operators.
Examples
from skimage import data from skimage import filters camera = data.camera() edges = filters.scharr(camera)✓
See also
Aliases
-
skimage.filters.scharr