Transcript for:
First Order Derivative Filters Overview

hey guys welcome to the 17th lecture of the dip series this is anushri and today we're going to study about first order derivative filters so first order derivative filters they are mainly used for edge detection okay suppose we have an image here okay and we have the center pixel and we have to detect the edges towards the diagonal okay suppose this edge or this edge then that is when we use robert's operator now robert's operator is one of the first edge detectors okay it includes these two by two mask it is also known as cross gradient operator and it works on the concept of cross diagonal differences so based on this element and this element okay it does not consider the neighboring pixels it only focuses on the diagonal elements now there were a few problems which were noticed with robert's cross operator since it was first developed the first one was that two by two masks are not easy to implement okay two by two masks are even order mask right so they are difficult to convolute on images okay it gets more confusing the second problem was that the number of calculations are more so due to the smaller size of the mask there are more calculations which need to be taken place so there is more chance of mistakes or it increases the time it increases the time for calculations so that was another problem the third problem was that the number of neighboring pixels considered in one go are less so in robots cross we just consider the diagonal neighbors right we do not consider the neighboring four neighbor adjacency so we do not look at the horizontal or vertical pixels we just look at the diagonal pixels so that caused another problem now to solve these problems we make the following changes what do we do the first change is the change in the size of the mask so we increase the size of the mass to reduce the number of problems okay the second one we change the number of neighboring pixels considered so let's look at how robert's cross operator was developed upon by making certain changes and that is how we got our two other operators which were sobel and privet so with the changes which were mentioned two new operators were developed sobel operators the mask for red is this and pivot operators the mask is this so in sobel what we do is we place more emphasis on the pixels that are close to the center of the mask so if you look at these two here it is 2 minus 2 and 2 and here it is minus 2 and 2 whereas at the diagonals there are ones right so more emphasis is given to the pixels that are closer to the center of the mask whereas in private operators they are similar to soap operators but they are used for detecting vertical and horizontal edges in the images okay so if this is the center pixel then they are mainly used for detecting the horizontal and vertical pixels now let's look at a question here apply robots sobel and pivot operators on the pixel one comma one in the following image so here we have our input image and we have to apply the about three operators so the pixel one comma one is this so let's traverse across this neighborhood this three by three neighborhood now the first one is robert's operator the mask for which is this you can use any of the masks and since they haven't mentioned about the direction in which to traverse or the origin or anything we just take this as the origin okay and we'll multiply this element by this element so it will be 50 into minus 1 plus we take this hundred and multiply this with one hundred into one so we'll get minus fifty plus hundred which is 50. next we do sobel operator the mask 4 which is minus 1 minus 2 minus 1 0 0 0 1 2 1. now here we'll take the center as the origin and we'll multiply all of these elements with these corresponding elements okay so it will be fifty into minus one plus fifty into minus two plus hundred into minus one and these will be zeros these two elements fifteen hundred and this will be fifty into one plus fifty into two plus hundred into one okay we are just multiplying the corresponding elements and this 50 again multiplied by zero will be zero so this will get minus 50 minus 100 minus 100 plus fifty plus hundred plus hundred so now this will get cancelled and at the end we get zero for privet operator our mask was minus one minus one minus 1 0 0 0 and 1 1 1 so we just convolute this with our 3 by 3 neighborhood of the input image and then we get we just multiply all these pixels with the corresponding pixels so let's just take minus 1 outside minus 1 into 50 plus 50 plus 100 all of this will be 0 and now these plus 1 250 plus 50 plus 100 now this will again fetch us the answer zero and this we substitute at the center pixel that was it for this lecture this is the final answer which we'll get i will see you in the next one