Clear Filters
Clear Filters

How to perform the Image Enhancement (Laplacian)

14 views (last 30 days)
Image Enhancement (Laplacian)
I try to perform the Matlab programming with formula equation for image processing as below
x = rgb2gray(imread('onion.png'));
lap = [1 1 1; 1 -8 1; 1 1 1];
lapfi = uint8(filter2(lap, x, 'same'));
sharpened = imsubtract(x, lapfi);
figure;
subplot(1,3,1);imshow(x); title('Original image');
subplot(1,3,2);imshow(lapfi); title('Laplacian filtered image');
subplot(1,3,3);imshow(sharpened); title('Sharpened image');
However I am not sure my answer is correct or not
Kindly please provide your opinion and suggestion thus I will be able to improve my computing skills

Answers (1)

Mehmet Cagri Aksoy
Mehmet Cagri Aksoy on 8 Nov 2020
img4=imread('PATH');
laplacian_mask = -1 * ones(3);
laplacian_mask(2,2) = 8;
img4_laplacian = conv2(img4, laplacian_mask, 'same');
img4_laplacian = img4 + uint8(img4_laplacian);
figure(4),
subplot(1,2,1), imshow(img4);
title(['\fontsize{8}Original Image ']);
subplot(1,2,2), imshow(img4_laplacian);
title(['\fontsize{8}Laplacian enhanced Image ']);

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!