Custom Sharpening Filter

A sharpening kernel enhances edges and detail in the image.

import cv2
import numpy as np


def sharpen(img):
kernel = np.array([[0,-1,0],[-1,5,-1],[0,-1,0]])
return cv2.filter2D(img,-1,kernel)
← Back to Gallery