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: