Common kernels in image processing

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.

Get Mastering OpenCV 4 with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.