xrspatial.edge_detection.prewitt_x#
- xrspatial.edge_detection.prewitt_x(agg, name='prewitt_x', boundary='nan')[source]#
Compute the horizontal gradient of a raster using the Prewitt operator.
Detects vertical edges by convolving with the Prewitt-X kernel:
[[-1, 0, 1], [-1, 0, 1], [-1, 0, 1]]
- Parameters:
agg (xarray.DataArray) – 2D raster. Supports NumPy, CuPy, Dask+NumPy, and Dask+CuPy backends.
name (str, default='prewitt_x') – Name for the output DataArray.
boundary (str, default='nan') – How to handle edges: ‘nan’, ‘nearest’, ‘reflect’, or ‘wrap’.
- Returns:
Horizontal gradient with the same shape and backend as the input.
- Return type:
xarray.DataArray