Operator FIRkernelNxM

The operator FIRkernelNxM creates rectangular kernel window around each pixel, which includes the neighbor pixels. The size of the kernel can be defined by editing the output link. N represents the number of kernel rows and M the number of kernel columns.

The central element of a kernel always represents the original input pixel of the respective position. The output image O with pixel indices x and y and and kernel indices m and n is derived from the input by:

with and

At image edges, no neighbored pixel are defined. The operator allows the definition of the required edge handling algorithm using parameter EdgeHandling.

For kernels of even size, there is no central pixel. In this case, the central pixel is displaced to the upper left corner, e.g. for a kernel of size 4x4 defines the central pixel at (1,1) as can be seen in the following table.

0,0 0,1 0,2 0,3
1,0 1,1 1,2 1,3
2,0 2,1 2,2 2,3
3,0 3,1 3,2 3,3

Kernels are described by the number of rows and columns. In VisualApplets, N represents the number of rows, and M represents the number of columns. Often, kernel elements are addressed by their index instead of their coordinate. In this case, the order is row by row as shown in the following table.

0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15

Technically, the operator waits and buffers the required pixel of the kernel until they can be output in parallel. Therefore, the operator will cause a delay as pixels can only be output after all required respective neighbor pixel were processed at the input. The line delay is:

In contrast to its name, the operator does not calculate any FIR filters.

Other operators to generate kernels are operators LineNeighboursNx1 and PixelNeighbours1xM.

[Note] No FIR filter

In contrast to its name, the operator has nothing to do with a FIR filter. It can be used to produce the filter input data.

Operator Restrictions

  • ImageWidth < 2*Parallelism is not allowed

  • Empty images i.e. images with no pixels are not allowed.

  • Empty lines or varying line lengths are not allowed.

I/O Properties

Property Value
Operator Type M
Input Link I, data input
Output Link O, kernel output

Supported Link Format

Link Parameter Input Link I Output Link O
Bit Width any1 as I
Arithmetic {unsigned, signed} as I
Parallelism {1, 2, 4, 8, 16, 32, 64} as I
Kernel Columns 1 any2
Kernel Rows 1 any3
Img Protocol {VALT_IMAGE2D, VALT_LINE1D}4 as I
Color Format any as I
Color Flavor any as I
Max. Img Width any as I
Max. Img Height any as I


The range of the input bit width is [1, 64] for unsigned values. For signed inputs, the range is [2, 64]. For unsigned color inputs, the range is [3, 63] and for signed color, the range is [6, 63].


If VALT_LINE1D image protocol is used, the operator is of type P instead of type M.


OutputKernelColumns <= ImageWidth


OutputKernelRows <= ImageHeight


Type static parameter
Default EdgeMirrored
Range {EdgeMirrored, EdgeConstant}

At image edges, no neighbors exist to generate a kernel. In this case, the operator can be used in two edge handling modes.

In EdgeMirrored mode mirrored pixels are used at the image edges.

In EdgeConstant mode, the missing kernel elements at edges are filled by a constant value. This value can be defined using parameter Constant.

Type static parameter
Default 0
Range range of input link I

This parameter defines the default value for pixel outside the image borders if parameter EdgeHandling is set to EdgeConstant.

For color formats, the value is an unsigned integer combining the binary representations of all color components.

Examples of Use

The use of operator FIRkernelNxM is shown in the following examples: