daily pastebin goal
23%
SHARE
TWEET

Untitled

a guest Mar 20th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top