def sharpen(self, testImg):
# Create the identity filter, but with the 1 shifted to the right!
kernel = np.zeros((9, 9), np.float32)
kernel[4, 4] = 2.0 # Identity, times two!
# Create a box filter:
boxFilter = np.ones((9, 9), np.float32) / 81.0
# Subtract the two:
kernel = kernel - boxFilter
custom = cv2.filter2D(testImg, -1, kernel)
return testImg
# driver function to process a single image
评论列表
文章目录