Emboss filter

This tool can be used to perform one of eight 3x3 emboss filters on a raster image. Like the Sobel and Prewitt filters, the emboss filter is often applied in edge-detection applications. While these other two common edge-detection filters approximate the slope magnitude of the local neighbourhood surrounding each grid cell, the emboss filter can be used to estimate the directional slope. The kernel weights for each of the eight available filters are as follows:

N

0 -1 0
0 0 0
0 1 0

NE

0 0 -1
0 0 0
1 0 0

E

0 0 0
1 0 -1
0 0 0

SE

1 0 0
0 0 0
0 0 -1

S

0 1 0
0 0 0
0 -1 0

SW

0 0 1
0 0 0
-1 0 0

W

0 0 0
-1 0 1
0 0 0

NW

-1 0 0
0 0 0
0 0 1

NoData values in the input image are replaced with the average value of all valid cells within the kernel. This is also the procedure when the neighbourhood around a grid cell extends beyond the edge of the grid. The output raster is of the float data type and continuous data scale.

See Also:

Scripting:

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

wd = pluginHost.getWorkingDirectory()
inputFile = wd + "input.dep"
outputFile = wd + "output.dep"
direction = "N"
args = [inputFile, outputFile, direction]
pluginHost.runPlugin("FilterEmboss", args, False)

This is a Groovy script also using the tool:

def wd = pluginHost.getWorkingDirectory()
def inputFile = wd + "input.dep"
def outputFile = wd + "output.dep"
def direction = "SW"
String[] args = [inputFile, outputFile, direction]
pluginHost.runPlugin("FilterEmboss", args, false)

Credits: