Guest User

Untitled

a guest
Mar 21st, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. """
  2. For put ads into video
  3. """
  4.  
  5. # import the necessary packages
  6. import numpy as np
  7. import cv2
  8.  
  9. # read a image
  10. img = cv2.imread('taobao.png',1)
  11.  
  12. # display a image
  13. cv2.namedWindow('image', cv2.WINDOW_NORMAL)
  14. cv2.imshow('image',img)
  15.  
  16.  
  17.  
  18. # release resources
  19. k = cv2.waitKey(0)
  20. if k == 27: # wait for ESC key to exit
  21. cv2.destroyAllWindows()
  22. elif k == ord('s'): # wait for 's' key to save and exit
  23. cv2.imwrite('messigray.png',img)
  24. cv2.destroyAllWindows()
Add Comment
Please, Sign In to add comment