Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import cv2
  2. import numpy as np
  3.  
  4. image = cv2.imread('images/input.jpg')
  5. cv2.imshow('Original', image)
  6.  
  7. # Create our shapening kernel, we don't normalize since the
  8. # the values in the matrix sum to 1
  9. kernel_sharpening = np.array([[-1,-1,-1],
  10. [-1,9,-1],
  11. [-1,-1,-1]])
  12.  
  13. # applying different kernels to the input image
  14. sharpened = cv2.filter2D(image, -1, kernel_sharpening)
  15.  
  16. cv2.imshow('Image Sharpening', sharpened)
  17.  
  18. cv2.waitKey(0)
  19. cv2.destroyAllWindows()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement