- OpenCV 3 Computer Vision with Python Cookbook
- Alexey Spizhevoy Aleksandr Rybnikov
- 56字
- 2021-08-27 19:47:46
How it works...
OpenCV's cv2.filter2d function takes an input image, output result datatype, OpenCV ID (-1, if you want to keep the input image datatype), and filter kernel; then, image is filtered linearly.
In this recipe, we constructed a sharpening kernel that should emphasize high frequencies in the source image. The following output is expected:
![](https://epubservercos.yuewen.com/34A43F/19470396008899506/epubprivate/OEBPS/Images/5e0a059c-aeaf-404a-9091-7106c78f1cc7.png?sign=1739603132-iPhwyRwu50JCrIu5dOGca2bKtO9RVOQF-0-95abb100652ed6d5d5e21f008e5ac837)