This week, we implemented some image smoothing and sharpening techniques using different convolution kernels. Smoothing is used to remove the noise in the image while sharpening is used
to highlight fine details in an image or enhance details that have been blurred.
Mean Filter
As discussed in our lecture class, Mean filter is a low-pass filter that takes the
mean of the pixels under the kernel. It is used to smoothen an image by removing the noise.
Now, we'll try these kernels and see what will happen to the image:
 |
| Figure 1. Original test image |
 |
| kernel 1 |
 |
| kernel 2 |
 |
| kernel 3 |
 |
| kernel 4 |
 |
| kernel 5 |
Output
 |
| Figure 1.1 Output image when kernel 1 is used |
Kernel 1
The salt and pepper noise in the test image is smoothed, and the image in turn became blurred.
 |
| Figure 1.2 Output image when kernel 2 is used |
Kernel 2
Applying kernel 2, I think, is supposed to be a weighted averaging filter because we give more weight to the pixels closest to the pixel of interest which is f(x,y). I am not sure thoough why the image was sharpened when it was supposed to be smoothened because this is a type of mean filter.
 |
| Figure 1.3 Output image when kernel 3 is used |
Kernel 3
If you take a closer look, you'll notice that the image is sharpened, however, the brightness became low.
This kernel is a Laplacian mask filter, a high-boost filter (A=1) used for sharpening and brightening images; therefore the weighted sum must be taken, not the weighted average which we are using in our program, in order for it to properly work. This must be why the image became darker.
 |
| Figure 1.4 Output image when kernel 4 is used |
Kernel 4
Instead of a smoothened image, the output produced is the outline of the image or the edges. (Because the image has a lot of noise, it produced many false positives.)
The sum of the values of the kernel is 0; therefore, it is a high-pass filter used for sharpening images. However, in high-pass filter, the weighted sum is taken instead of the weighted average (which we are currently using in our mean filter program).
 |
| Figure 1.5 Output image when kernel 5 is used |
Kernel 5
Applying kernel 5 for filtering, it produced an image of low brightness.