Sharpening and unsharp masking
The objective of sharpening is to highlight detail in an image or to enhance detail that has been blurred. In this section, we discuss a few techniques along with a few examples demonstrating a couple of different ways to sharpen an image.
Sharpening with Laplacian
An image can be sharpened using the Laplacian filter with the following couple of steps:
- Apply the Laplacian filter to the original input image.
- Add the output image obtained from step 1 and the original input image (to obtain the sharpened image). The following code block demonstrates how to implement the preceding algorithm using
scikit-image
filters
module'slaplace()
function:
from skimage.filters import laplace im = rgb2gray(imread('../images/me8.jpg')) im1 = np.clip(laplace(im) + im, 0, 1) pylab.figure(figsize=(20,30)) pylab.subplot(211), plot_image(im, 'original image') pylab.subplot(212), plot_image(im1, 'sharpened image') pylab.tight_layout() pylab.show()
The following is the output of the preceding...