如何在不使用内置python函数的情况下锐化图像?

时间:2019-10-24 15:49:21

标签: python image anaconda variable-assignment spyder

这是我使用的代码,但是我被告知我使用内置函数进行分配,这是我无法分配的。我只能使用功能来阅读和查看图像。请帮忙。

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()

0 个答案:

没有答案
相关问题