Created
March 15, 2019 21:49
-
-
Save ChongyeWang/491affa7b4662adf87de387ff6609f46 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
image = cv2.imread('images/input.jpg') | |
cv2.imshow('Original', image) | |
# Create our shapening kernel, we don't normalize since the | |
# the values in the matrix sum to 1 | |
kernel_sharpening = np.array([[-1,-1,-1], | |
[-1,9,-1], | |
[-1,-1,-1]]) | |
# applying different kernels to the input image | |
sharpened = cv2.filter2D(image, -1, kernel_sharpening) | |
cv2.imshow('Image Sharpening', sharpened) | |
cv2.waitKey(0) | |
cv2.destroyAllWindows() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment