This image processing tool removes small irregularities (i.e. spurs) on the boundaries of objects in a Boolean input raster image (`input`). This operation is sometimes called pruning. Remove Spurs is a useful tool for cleaning an image before performing a line thinning operation. In fact, the input image need not be truly Boolean (i.e. contain only 1's and 0's). All non-zero, positive values are considered to be foreground pixels while all zero valued cells are considered background pixels.

Note: Unlike other filter-based operations in WhiteboxTools, this algorithm can't easily be parallelized because the output raster must be read and written to during the same loop.

## See Also

line_thinning

## Function Signature

`def remove_spurs(self, raster: Raster, max_iterations: int = 10) -> Raster: ...`

## Project Links

WbW Homepage User Manual Support WbW