Laplacian filter
Last updated
Last updated
The Laplacian is a "Second-Order Derivative filter" ; this means that it operates upon a convolution and not an image. There are several methods to implement Laplacian filter but given the context of this module we are going to be using the DoG or Difference of Gaussian method, and it is what it sounds like, it words by subtracting a image of lower Gaussian sigma by a higher one, effectively giving us the difference. As we recall previously, we did something similar in the sharpening algorithm, except the was the base image, in this case it's a blurred image of a smaller sigma.
Note If you are having trouble understanding this, I suggest you to refresh upon the
The Laplacian filter is implemented at
We compute a different sigma1
, and kernSize1
since we don't want the user to specify both of these. kernSize * 1.5 + 1
is really arbitrary and I suggest you mess around with different variations.
We loop through and subtract the less blurred image from the one which is more blurred.
And that is really it! Let's look at what this produces.
It is somewhat computationally slow
Like the previous filters an image of higher size and/or a higher kernel will directly affect the speed of the function (benchmarked on a larger image)
False noise can cause bad edge detection
As the title suggests, even a slight noise will translate into the result, which is generally not good for a edge detector