| Previous | Table of Contents | Next |
To understand 3x3 spatial filter application, we now apply the hypothetical filter to the hypothetical image fragment assuming the current computation pixel is the boldface value of 206.
| Pixel Value | Spatial Mask Coefficient | Product |
| 201 | 2 | 2 x 201 = 402 |
| 202 | 4 | 4 x 202 = 808 |
| 203 | 6 | 6 x 203 = 1218 |
| 205 | 8 | 8 x 205 = 1640 |
| 206 | 10 | 10 x 206 = 2060 |
| 207 | 12 | 12 x 207 = 2484 |
| 209 | 14 | 14 x 209 = 2926 |
| 210 | 16 | 16 x 210 = 3360 |
| 211 | 18 | 18 x 211 = 3798 |
| Sum = 18,696 | ||
Applying the hypothetical spatial filter to the hypothetical image fragment produces a value of 18,696. This is a nonsense value that arose from the hypothetical spatial filter having nonsense element values, arbitrarily selected for process clarity.
The following material uses appropriate values that produce selected effects. Before discussing these effects, note that spatial filter application requires special treatment along image edges and corners since pixel positions along the edges and corners are not completely surrounded by image pixel values. The VIDEO.C sample application addresses this by replicating edge information and using it appropriately. For example, if the top left corner image fragment appears as:
| 201 | 202 | 203 | 204 | ... |
| 205 | 206 | 207 | 208 | ... |
| 209 | 210 | 211 | 212 | ... |
| 213 | 214 | ... | ... | ... |
| ... | ... | ... | ... | ... |
Then VIDEO.C processes the image as if it were:
| 201 | 201 | 202 | 203 | 204 | ... |
| 201 | 201 | 202 | 203 | 204 | ... |
| 205 | 205 | 206 | 207 | 208 | ... |
| 209 | 209 | 210 | 211 | 212 | ... |
| 213 | 213 | 214 | ... | ... | ... |
| ... | ... | ... | ... | ... | ... |
This adds two extra rows and two extra columns which is acceptable for a 3x3 spatial filter. A 5x5 spatial filter requires four extra rows and columns, and so on.
Sharpening accentuates intensity transitions within images. Unlike histogram stretching and equalization which modifies contrast by redefining dynamic ranges, sharpening achieves its effect by amplifying local intensity differences. To conceptually understand sharpening, consider a sandbox with sand covering each position within the sandbox. In some places, the sand height is the same depth as all nearby surrounding points. So, the sand surface is flat in such instances. Though sand heights may differ from area to area, within an individual area there is no height difference to accentuate. In other places, points are lower or higher than surrounding points.
To accentuate height differences, sharpening processes create a second sandbox based on the first by initially replicating the first sand surface and then removing sand from low points, placing it on surrounding higher points. This preserves original surface feature positions but makes valleys and dips deeper while simultaneously increasing the height of surrounding higher points such as ridges and peaks. The double removal and adding operations amplify differences between the original sand surface features.
Image sharpening uses spatial filters called high-pass filters which accentuate high frequency changes that appear as abrupt intensity changes. Spatial filter calculations involve subtracting the current calculation point from one or more of its neighbors. Adding the filter coefficients often produces a sum value of 1. A sharpening (or any other) filters coefficients need not add to 1this just makes it easier because the output need not be scaled. You can regard sharpening as adding an original image to a spatially differenced image because the process is linear. This means you want a positive center value that is at least 1 above the sum of the (negated) surrounding values.
| Previous | Table of Contents | Next |