Filters

User-defined linear filters

To create, edit and store a linear filter on disk:

A user-defined linear filter can be created:

The Create Filter dialog box will appear and the Filter editor will be opened. You can specify the size of the filter, fill out values in the matrix, and specify a gain factor.

To edit an existing user-defined linear filter:

An existing user-defined linear filter can be edited:

The Filter editor will be opened.

The standard linear filters cannot be edited.

User-defined average filters:

Additional possibilities are provided to for user-defined average filters, via the Filter dialog box or via the command line, see Filters : user-defined average filters.

Selecting an existing linear filter in the Filter dialog box:

In the Filter dialog box, you can select any standard linear filter or any linear filter you created yourself.

Using existing linear filters on the command line:

To use an existing linear filter from the command line, type the following expression on the command line of the Main window.

 

OUTMAP

=

MapFilter(InputMapName, FilterName)

where:

OUTMAP

is the name of your output map.

MapFilter

is the command to start the Filter operation.

InputMapName

is the name of your input map.

FilterName

is either the name of a standard filter on disk, then fill out one of the following standard linear filter names:

avg3x3 | d2fdx2 | d2fdxdy | d2fdy2 | dfddn | dfdup | dfdx | dfdy | edgesenh | laplace | shadow

or the name of a linear filter which you created yourself.

Defining a linear filter on the command line (advanced):

Advanced users may wish to experiment with the definition of a linear filter by an expression. The syntax for the command line is:

 

OUTMAP

=

MapFilter(InputMapName, FilterLinear(rows, cols, expression))

where:

OUTMAP

is the name of your output map.

MapFilter

is the command to start the Filter operation.

InputMapName

is the name of your input map.

FilterLinear

is the command to define a linear filter.

rows

are the number of rows of your linear filter.

cols

are the number of columns of your linear filter.

expression

is an expression in which you can use x, y, and r to calculate the linear filter's matrix values, where:

x

distance to the center cell of the matrix in x-direction; the center cell of the matrix has position (0,0); the distance in x-direction increases to the right.

y

distance to the center cell of the matrix in y-direction; the center cell of the matrix has position (0,0); the distance in y-direction increases downwards.

r

Euclidean distance to the center cell of the matrix: Ö(x2+y2)

Examples of linear filter expressions are for instance:

FilterLinear(5,5,2x+y)

Defines a 5 by 5 shadow filter where the illumination is from the north-west.

 

FilterLinear(5,5,-2x-y)

Defines a 5 by 5 shadow filter where the illumination is from the south-east.

 

FilterLinear(5,5,iff(r>3,0,4-r))

Defines an average filter in which the matrix values decrease linearly from the center cell of the matrix towards the borders of the matrix according to Euclidean distance.

Tip:

See also: