Example binary filters

A binary filter interprets zero values in the input map as 0 (false), and all other defined values in the input map as 1 (true). For each 9 input pixels, these values are arranged in a special order or bit position:

  

5

6

7

4

8

0

3

2

1

  

where 0 means the last position, 1 the one but last position, etc.

This results in a binary number of 9 digits which solely depends on the position of true and false pixels in the input map. To decide whether the central pixel should be assigned a 0 or 1, the binary number is looked up in a table which is present in each binary filter itself.

  

  1. When for example the following 9 input pixels are considered:
  2.   

    0

    0

    0

    0

    0

    0

    1

    1

    1

      

  3. The binary ordering results in the following binary number: 000001110
    (This equals: 21 + 22 + 23 = 2+4+8 = 14)
  4.   

  5. The number is looked up in a table which is present in each binary filter itself.
    The table of the DILATE4 filter gives for 14, output value 1
    0-63=0101111101011111111111111111111101011111010111111111111111111111
    .........
    You can see this for instance by opening Dilate4.fil from your ILWIS\SYSTEM directory in an ASCII editor such as Notepad.
  6.   

  7. Thus, the value assigned to the center pixel in the output map is 1 (was 0 in the input map).

See also: