This tool performs a Scharr edge-detection filter on a raster image. The Scharr filter is similar to the sobel_filter and prewitt_filter, in that it identifies areas of high slope in the input image through the calculation of slopes in the x and y directions. A 3 × 3 Scharr filter uses the following schemes to calculate x and y slopes:

X-direction slope

...
30-3
100-10
30-3

Y-direction slope

...
3103
000
-3-10-3

Each grid cell in the output image is assigned the square-root of the squared sum of the x and y slopes.

The output image may be overwhelmed by a relatively small number of high-valued pixels, stretching the palette. The user may therefore optionally clip the output image distribution tails by a specified amount (clip) for improved visualization.

See Also

sobel_filter, prewitt_filter

Function Signature

def scharr_filter(self, raster: Raster, clip_tails: float = 0.0) -> Raster: ...

Project Links

WbW Homepage User Manual Support WbW