考虑到网友们中有急急国王,先上代码:
def sharpen(img, sharpness=100, ktype=1):
n = sharpness/100
if ktype == 1:
sharpen_op = np.array([[0 , -n, 0 ], \
[-n, 4*n+1, -n], \
[0 , -n, 0 ]], dtype=np.float32)
if ktype == 2:
sharpen_op = np.array([[-n, -n, -n], \