Java Reference
In-Depth Information
A section of the data in a source image might appear as in this matrix:
1
1
1
1
1
1
1
1
1
0
1
1
1
0
0
1
1
0
0
0
1
0
0
0
0
For the sake of simplicity, we just give the pixels values of 0 and 1, thus creating
a binary (or black and white) image. If we apply the kernel to the shaded region
in the image section as shown below, the sum of the products results in a value
of 0 in the corresponding center pixel in the destination matrix:
If we moved the kernel to the shaded area shown next, then the operation results
in a non-zero value at the center pixel:
We want to apply the kernel to the entire image matrix. However, a problem
occurs at the borders of the image because part of the kernel “hangs over” the
edge and does not provide valid product values. The convolution filter allows for
two choices: the image border values are set to 0 ( EDGE - ZERO - FILL )orare left
unchanged ( EDGE - NO - OP ).
If we choose the zero edge fill for our edge-finding convolution, the resulting
image matrix becomes:
0
0
0
0
0
0
0
0
2
0
0
0
2
2
0
0
2
2
0
0
0
0
0
0
0
Yo u can see that when this kernel is applied throughout a large complex image,
the uniform areas are set to zero while borders between two areas of different
intensities become enhanced.
Other kernels offer different effects. For example, a kernel such as this:
0.0
−1.0
0.0
−1.0
6.0
−1.0
0.0
1.0
0.0
Search WWH ::




Custom Search