{ } Raw JSON

bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / filters / edges / farid

function

skimage.filters.edges:farid

source: /dev/scikit-image/src/skimage/filters/edges.py :718

Signature

def   farid ( image mask = None * axis = None mode = reflect cval = 0.0 )

Summary

Find the edge magnitude using the Farid transform.

Parameters

image : array

The input image.

mask : array of bool, optional

Clip the output image to this mask. (Values where mask=0 will be set to 0.)

axis : int or sequence of int, optional

Compute the edge filter along this axis. If not provided, the edge magnitude is computed. This is defined as

farid_mag = np.sqrt(sum([farid(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, optional

The 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, optional

When mode is 'constant', this is the constant used in values outside the boundary of the image data.

Returns

output : array of float

The Farid edge map.

Notes

Take the square root of the sum of the squares of the horizontal and vertical derivatives to get a magnitude that is somewhat insensitive to direction. Similar to the Scharr operator, this operator is designed with a rotation invariance constraint.

Examples

from skimage import data
camera = data.camera()
from skimage import filters
edges = filters.farid(camera)

See also

farid_h

horizontal and vertical edge detection.

farid_v

horizontal and vertical edge detection.

prewitt
scharr
skimage.feature.canny
sobel

Aliases

  • skimage.filters.farid

Referenced by