This tool performs a 3 × 3 or 5 × 5 Sobel edge-detection filter on a raster image. The Sobel filter is similar to the 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. The Sobel edge-detection filter, however, gives more weight to nearer cell values within the moving window, or kernel. For example, a 3 × 3 Sobel filter uses the following schemes to calculate x and y slopes:

X-direction slope

...
-101
-202
-101

Y-direction slope

...
121
000
-1-2-1

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

The user must specify the variant, including '3x3' and '5x5' variants. The user may also optionally clip the output image distribution tails by a specified amount (e.g. 1%).

See Also

prewitt_filter

Function Signature

def sobel_filter(self, raster: Raster, variant: str = "3x3", clip_tails: float = 0.0) -> Raster: ...

Project Links

WbW Homepage User Manual Support WbW