Image Sharpening Using Laplacian Filter and High Boost Filtering in MATLAB


In MATLAB, there are two commonly used image processing techniques namely, "Laplacian Filter" and "High Boost Filtering" that are used to sharpen an image. The Laplacian filter is mathematical operator used to sharpen an image in digital image processing. While, the high boost filtering is an image sharpening technique in digital image processing.

In this tutorial, I will explain the process of image sharpening using Laplacian filter and high boost filtering in MATLAB. Let’s start with the basic introduction of Laplacian filter and high boost filtering.

What is Laplacian Filter in MATLAB?

In MATLAB, the Laplacian filter is mathematical tool used in digital image processing to sharpen an image. However, the Laplacian filter is used with other image processing techniques like high boost filtering to sharpen an image.

The Laplacian filter is utilized to highlight regions of sudden intensity change in an image like edges. Then, an image processing technique is applied to sharpen the image.

In MATLAB, there is a built-in function "fspecial" which is used to create a Laplacian filter.

Syntax

Its syntax is as follows −

L_filter = fspecial('laplacian', 0);

After defining the Laplacian filter "L_filter", we can apply it to an image using the "imfilter" function.

What is High Boost Filtering in MATLAB?

In MATLAB, high boost filtering is an image sharpening technique in digital image processing. It is used to enhance the edges and details of an image without affecting the smooth areas.

This technique is applied to an image after using the Laplacian filter to the image. Because, the Laplacian filter highlights the edges and details of the image.

In the high boost filtering, the original image is combined with the Laplacian filtered image i.e.,

High Boost Filtering = Original Image + (Scaling Factor × Original Image – Laplacian Filtered Image)

In this expression, the Scaling Factor controls the intensity of high boost filtering. If the scaling factor is greater than 1, then it enhances the high-frequency component (edges and details) of the image.

So, this is all about basics of Laplacian filter and high boost filtering in MATLAB. Let us now explore the process of image sharpening using the Laplacian filter and high boost filtering in MATLAB.

How to Sharpen an Image using Laplacian Filter and High Boost Filtering in MATLAB?

As explained above, the Laplacian filter is a mathematical operator used to highlight the edges and details i.e., high-frequency components in an image. Then, the high boost filtering is used to enhance these high-frequency components.

The step-by-step process of image sharpening using the Laplacian filter and high boost filtering in MATLAB is explained below.

  • Step 1 − Read the input image using the "imread" function.

  • Step 2 − Convert the input image to double data type for processing. For this, use the "im2double" function.

  • Step 3 − Use the Laplacian filter to highlight the edges and details of the image.

  • Step 4 − Select an appropriate scaling factor for high boost filtering of the image.

  • Step 5 − Perform high boost filtering on the image.

  • Step 6 − Display the results.

We can use these six steps in MATLAB to sharpen an image using the Laplacian filter and high boost filtering.

Example

Let us now take an example to understand the implementation of these steps in MATLAB programming.

% MATLAB code for image sharpening using Laplacian filter and high boost filtering
% Read the input image
img = imread('your_image.jpg');

% Convert the input image to double datatype 
double_img = im2double(img);

% Use the Laplacian filter to highlight edges
L_filter = fspecial('laplacian', 0.5);	% Defining Laplacian filter
filtering = imfilter(double_img, L_filter, 'replicate');	% Applying Laplacian filter to image
filtered_img = double_img – filtering;

% Selecting a scaling factor for high boost filtering
S = 2;

% Applying high boost filtering to Laplacian filtered image
sharpen_img = double_img + S * filtered_img;

% Display the input, Laplacian filtered, and high boost filtered images
figure;
subplot(1, 3, 1);
imshow(img);
title('Input Image');

subplot(1, 3, 2);
imshow(filtered_img);
title('Laplacian Filtered Image');

subplot(1, 3, 3);
imshow(sharpen_img);
title('High Boost Filtered Image');

Output

With the input image, we got this output −

This is how we can perform image sharpening using Laplacian filter and high boost filtering in MATLAB. For better results, try this code with a smooth image.

Conclusion

This is all about image sharpening using the Laplacian filter and high boost filtering in MATLAB programming. In conclusion, the Laplacian filter is a tool used for edge detection in an image and the high boost filtering is an image processing technique used to sharpen an image.

Updated on: 25-Oct-2023

443 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements