Example pattern filters
A pattern filter always works in a 3x3 environment; it works on satellite images and other raster maps with a value domain. A pattern filter considers the center pixel and each of its 8 neighbours in the following order:
4 |
3 |
2 |
|
5 |
0 |
1 |
|
6 |
7 |
8 |
If the absolute difference between the value of the center pixel and a neigbour is smaller than or equal to the specified threshold value, then the answer is true.
According to the position of a true neighbour, a certain bit is set:
Position 1 true: |
00000001 |
= |
1 |
Position 2 true: |
00000010 |
= |
2 |
Position 3 true: |
00000100 |
= |
4 |
Position 4 true: |
00001000 |
= |
8 |
Position 5 true: |
00010000 |
= |
16 |
Position 6 true: |
00100000 |
= |
32 |
Position 7 true: |
01000000 |
= |
64 |
Position 8 true: |
10000000 |
= |
128 |
The value assigned to the output center pixel is the bitwise combination of all true neighbours.
Thus, when only the difference between the lower right pixel and the center pixel is smaller than or equal to the threshold value, value 128 is assigned to the center pixel in the output map. When all pixels to the right of the center pixel are true, value 1+2+128 = 131 is assigned to the center pixel in the output map.
Concluding: