I am trying to implement the discrete laplacian of two variables for image sharpening but wanted to confirm with the community that my reasoning behind what I am doing is right. I understand that the laplacian is:
(Eq. 1)
which can be expressed discretely as:
(Eq. 2)
This equation can be expressed as the laplacian kernel:
(Kernel 1)
My text book gives 3 other laplacian kernels which are:
(Kernel 2) (Kernel 3) (Kernel 4)
Finally image sharpening can be achieved with:
(Eq.3)
Where c is positive for the kernels above with a positive center and c is negative for kernels with a negative center.
I understood from the book that the onvolution of an image with one of these kernels would be the equivalent of impementing Eq. 2above (discrete laplacian of two variables). and then based on the kernel I pick I either add or subtract the output of the convolution with the original image as in Eq. 3 to get my image sharpening.
I have tried implementing this in some matlab code below but cannot replicate what my book is asking for. Can anyone see a mistake I made in my code for either the convlution or image sharpening?
Edit – The issue was not with the convolution or laplacian kernel but with the way I plotted my graphs. Please contact me if you want my code for doing this thanks.
figure,subplot(231),imshow(image,[]);title('Original Image - Input');axis on;subplot(232),imshow(output, []);title('Laplacian Convolved with Kernel - Unscaled');axis on;subplot(233),imshow(output,[0,255]);title('Laplacian Convolved with Kernel - Scaled');axis on;subplot(234),imshow(filtered_Image,[]);title('Image Sharpening using the Laplacian');axis on;subplot(235),imshow(laplacian, []);title('Matlab Function Test for Laplacian');axis on;subplot(236),imshow(image_Sharpen, []);title('Matlap Built in Image Sharpening');axis on;
Best Answer