Remove spurs

This image processing tool removes small irregularities (i.e. spurs) on the boundaries of objects in a Boolean raster image. This operation is sometimes called pruning. Remove Spurs is a useful tool for cleaning up 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.

NoData values in the input raster image are assigned NoData values in the output image. The output raster image is of the float data type and categorical data scale.

See Also:


The following is an example of a Python script that uses this tool:

wd = pluginHost.getWorkingDirectory()
inputFile = wd + "input.dep"
outputFile = wd + "output.dep"
maxIterations = "10"
args = [inputFile, outputFile, maxIterations]
pluginHost.runPlugin("RemoveSpurs", args, False)

This is a Groovy script also using this tool:

def wd = pluginHost.getWorkingDirectory()
def inputFile = wd + "input.dep"
def outputFile = wd + "output.dep"
def maxIterations = "10"
String[] args = [inputFile, outputFile, maxIterations]
pluginHost.runPlugin("RemoveSpurs", args, false)