这是我使用的代码,但是我被告知我使用内置函数进行分配,这是我无法分配的。我只能使用功能来阅读和查看图像。请帮忙。
import cv2
import numpy as np
image = cv2.imread('image.jpg')
kernel = np.array([[-1,-1,-1],
[-1, 9,-1],
[-1,-1,-1]])
sharpened = cv2.filter2D(image, -1, kernel) # applying the sharpening kernel to the input image & displaying it.
cv2.imshow('Image Sharpening', sharpened)
cv2.waitKey(0)
cv2.destroyAllWindows()