Convolutions for Image Processing
An Introduction |
Prof. David Bernstein
|
Computer Science Department |
bernstdh@jmu.edu |
Letting \(s_{i,j}\) denote the value in source pixel \((i,j)\), \(k_{r,c}\) denote the value in element \((r, c)\) of the kernel, and \(d_{i,j}\) denote the value in destination pixel \((i, j)\), a 3x3 spatial convolution can be defined as follows:
\( d_{i,j} = \sum_{r=-1}^{1} \sum_{c=-1}^{1} s_{i+r, j+c} k_{r,c} \)
The Source
The Kernel
The Convolution
0 | 0 | 0 |
0 | 1 | 0 |
0 | 0 | 0 |
1/9 | 1/9 | 1/9 |
1/9 | 1/9 | 1/9 |
1/9 | 1/9 | 1/9 |
1 | -1 | 0 |
-1 | 5 | -1 |
0 | -1 | 1 |