 Myself, Sudhakar Barbade, Assistant Professor, Electronics and Communication Engineering, Walsh and Historic Technology, SolarPort. Today, we will discuss image sharpening operation using spatial filtering. As we know, image enhancement can be done using two different ways, that is, spatial filtering and frequency domain filtering. But today, we will see the spatial filtering, how we can apply for image sharpening used in image enhancement. Learning outcome, at the end of this session, students will be able to apply sharpening algorithms in spatial domain for image enhancement. In this session, we will discuss basics of sharpening filters and there are different types of sharpening filters. Out of that, we will see the first derivative filter, that is, Sobel filter in today's class. Now, let us see the basics of sharpening filters. Sharpening special filters seek to highlight fine detail. That means, to highlight the finite details in the input image, sharpening filters are used and the method used for sharpening is spatial domain filtering, which remove blurring from the images. That is, sharpening operation removes the blurring and highlights edges. Sharpening filters are based on spatial differentiation. So, let us see how we can see the spatial differentiation. Example, this is what the input image and let us see how we can find out the spatial difference of the pixels. So, differentiation measures the rate of change of a function. Let us consider a simple one-dimensional example. So for that, what we need is, we should consider this line between point A and B and let us go from point A to B, that is, from left to right and we observe that the gray level from A to B is changing along this line. For example, here at the leftmost side, the gray level is bright. As we go towards this right side up to this point, the gray level is decreasing and here it has become black. It remains black up to this point. There is a white spot here. Then again it remains black. Then there is a vertical line here that is white. Again it is dark and from this point onwards the gray value of the pixels along this line is white. So we observe that there is a rate of change of pixel intensity from A to B that is represented by this gray level profile. If you assume this pixel is represented by using three bits, that means it has got eight different gray levels that is represented by this 0 to 7. If you look at this image strip, we observe that here pixel value is 5. Then next is also 5. Then 4, 3, 2, 1, it is decreasing. As we go after 1, it has become 0, 0 means it has become now dark and after some length the white spot is coming that is why it has increased to 6. Again this white spot is over then again it remains dark. So that is why it is 0, 0, 0, 0 dark for more number of times. Again here this white line is coming that is why it is increasing that is 1, 3, 1. Again it remains dark that is 0, 0, 0 and after that it is completely white that is 7. So this is what the gray level pattern of the pixels if I move from point A to B that is from left to right. So this is called differentiation. So let us see the first derivative filters. The formula for the first derivative of a function in x direction is as follows. So there are different ways that means different directions we can find out the difference and this is a difference of image pixels in x direction. Image direction means horizontally. So this is a dow f by dow x that means derivative of function f with respect to x, x is a direction which is equal to f of x plus 1 minus f of x that means the first pixel that is f of x is subtracted from the next pixel along the horizontal line that is f of x plus 1. So f of x plus 1 is the position of the pixel in the horizontal direction. So it is just the difference between subsequent values and measures the rate of change of the function. Now let us have a question what will be an expression for first derivative in y direction. You pause the video and answer the question. So if you know the first derivative in x direction similarly we can find out very easily the x that means first derivative in y direction by observing this equation. So this is in x direction. So what we have to do is dow f by dow y that is partial derivative of function f with respect to y is equal to f of y plus 1 minus f of y. So because it is in y direction. So this is what the answer. Then we will see the how to implement the first derivative filters. The first derivative filters are for a function f of x y that is a image the gradient of f at coordinates x y is given as this is gradient. This dow f is actually a gradient of function f which is approximately given as absolute value of gradient in x direction plus absolute value of gradient in y direction. So if you consider this sub image of size 3 by 3 which are named with pixels z1, z2, z3 up to z9 and how we can find out this gradient in x direction here how it is done just we see. So gradient in f that means dow f is equal to absolute value of g of x. x direction means like this z7 minus z1. Then here 2 z8 because the weight associated with the center pixels that means pixels which are nearest to the center are more. So the weight associated to z2 then z4, z6 and z8 are very that is 2 whereas weight associated with z1, z3, z7 and z9 are 1 that is why here 2 z8 minus 2 z2 just you look at this is z7 minus z1, 2 z8 minus 2 z2 and z9 minus z3. This is gradient in x direction and again plus the gradient in y direction means we subtract like this that is z3 minus z1, 2 z6 minus z4, 2 z4, z9 minus 2 z7. So this is what the first derivative filter. If you look at this is the Sovel first derivative filter based on the previous equation we can derive the Sovel operator like this. For example, if this is a x direction if you want to get a derivative in x direction then we use this filter. If you want derivative in y direction we use this filter to filter an image it is filtered using both operators that is in x direction as well as in y direction and the result of which are added together. So if you look at this image input image we get by adding the processed image with gradient in x direction and gradient in y direction and we get this image which is an image of a contact lens which is enhanced in order to make defects more obvious. So the Sovel filters are typically used for edge detection. Here some first derivative filters are this is a pre-wet then just it is here in Sovel the weight associated with nearest pixels are 2 but in pre-wet the weight associated is 1 then this is a Roberts which gives you the gradient in diagonal direction and this is what the nomenclature given to every pixel in a 3 by 3 image. So this book I referred for preparing these slides that is Digital Image Processing by R. F. L. C. Gonzalez and Richard E. Woods by Tata McGraw-Hill Education. Thank you very much.