We have seen that the kernels have a great impact on the resulting image. In the filter_2D_kernels.py script, there are some defined common kernels to use for different purposes—edge detection, smoothing, sharpening, or embossing, among others. As a reminder, in order to apply a specific kernel, the cv2.filter2D() function should be used. The output of this script is shown in the following screenshot:
You can see the effect of applying different kernels using the cv2.filter2D() function, which can be used to apply a specific kernel.