 Professor, Electronics and Communication Engineering, Walchen Institute of Technology, Solapur. In continuation with the previous lecture, today we will see image sharpening using spatial filtering. Learning outcome, at the end of this session, students will be able to apply image sharpening algorithms in spatial domain for image enhancement. Contents, the sharpening algorithms are divided into two categories that is first derivative filters we studied earlier. Now, in this session, we will discuss second derivative filters that is Laplacian filter. So, the formula for the second derivative of a function f of x y is given as dou square f by dou square x. That means, second derivative of function f with respect to x is equal to f of x plus 1 plus f of x minus 1 minus 2 times f of x. So, what this does is, this takes second derivative of a function in x direction. So, it simply takes into account the values both before and after the current value that is f x. So, the second derivative is more useful for image enhancement than the first derivative we studied earlier. Because of the second derivative gives stronger response to fine detail, and it is also very simple to implement. The first sharpening filter we will look at is the Laplacian filter which is isotropic one. That means, which finds the difference in all directions. That is why it is called Laplacian filter is isotropic one. Second one is it is one of the simplest sharpening filter to work with. And the implementation of this Laplacian filter is again very simple. Let us see how to define the Laplacian function. The Laplacian is defined as follows. So, it is del square f is equal to dou square f by dou square x plus dou square f by dou square y. That means, the second derivative of function f is equal to second derivative of function f with respect to x plus second derivative of function f with respect to y. So, where the partial second order derivative in the x direction is defined as, so this is what we studied earlier. That is second derivative dou square f by dou square x, that is second order derivative in x direction of function f which is already we discussed that is f of x plus y comma y plus f of x minus y comma y minus 2 times f of x y, where 2 times f of where f of x y is the current pixel position, f of x minus y is the previous pixel position and f of x plus 1 is the next pixel position in x direction. Similarly, the equation for second order derivative in y direction is dou square f by dou square y which is given as f of x comma y plus 1 plus f of x comma y minus 1 minus 2 of 2 times f of x y. So, here it is a difference in y direction. So the Laplacian can be given as that is if I add these 2 f of del square f is what partial derivative of f with respect to x plus partial derivative of f with respect to y. So, if you add these 2 equations together, we get this f of x plus 1 comma y plus f of x minus 1 comma y plus f of x comma y plus 1 plus f of x comma y minus 1 minus 4 times f of x y that is because if you add these x direction, second order derivative in x direction and second order derivative in y direction together, we get 4 times f of x y and based on this equation, we can prepare filter that is the Laplacian filter as shown in these 3 by 3 matrix. So, since the center pixel is having weight minus 4 that is why the center pixel is minus 4, then the weight associated with the other pixel that is for example, f of x comma f of f of x comma y minus 1 that means same row previous column that means it is 1 and the other wherever it is written 0 that means that value is not present in the equation. So, this is a basic Laplacian filter. If you apply this basic Laplacian filter on a input image called original image, we get the second image for example, this second image as a Laplacian filtered image and if I apply scaling on this filtered image, we get this image. So, we do not see any enhancement because our aim is to enhance the image, but here by using simple Laplacian, we do not get enhanced image that is why what we see is, but what is not very, but that is not very enhanced means image is not enhanced. So, the result of Laplacian filtering is not an enhanced image. So, we have to do more work in order to get our final image. What we have to do is we have to subtract the Laplacian result from the original image to generate our final sharpened enhanced image. So, this g of x y that is output image which is equal to f of x y minus del square f. So, earlier we were getting this image, but if I implement this modified we will say this is a Laplacian filter, we get a good quality of the image. Let us have a question, what will be an equation for modified Laplacian, pause the video and answer the question. So, here whatever we saw the equation modified equation, so what will be the filter represented in 3 by 3 matrix for this modified fix equation. We know this f of x y minus already we found this del square f. If you put the value of del square f in the equation we get c here. The entire enhancement can be combined into a single filtering operation just you look at. So, this value already we have found just you put the value of this del square f into this equation and we get this equation 5 times f of x y minus f of x plus 1 y and like this. So, if I want to represent this in filter form then we can get this modified Laplacian as this center pixel is 5 just you look at here f of x y has a weight of 5 that is why this is 5 weight and other weights are for example, this is a minus. So, minus sign is there with weight 1 and remaining are 0 and you now you look at the effect of modified Laplacian on the input image earlier we use this image and we see that the output image with this modified Laplacian gives a better result. So, with this we have come to end and for preparing these slides I used digital image processing book by Raphael C. Gonzalez and Richard Woods by Tata McGraw-Hill Education. Thank you.