Advertisement
safwan092

Untitled

Oct 30th, 2021
1,153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. ################################
  2. ##Generated with a lot of love##
  3. ##    with   EasyPython       ##
  4. ##Web site: easycoding.tn     ##
  5. ################################
  6. import urllib.request
  7. import cv2 as cv #Please install with PIP: pip install cv2
  8. import numpy as np
  9.  
  10. frame = None
  11. key = None
  12.  
  13.  
  14. print('START')
  15. while True:
  16.   imgResponse = urllib.request.urlopen ('http://192.168.1.8/capture?')
  17.   imgNp = np.array(bytearray(imgResponse.read()),dtype=np.uint8)
  18.   frame= cv.imdecode (imgNp,-1)
  19.   cv.imshow('Window',frame)
  20.   key = cv.waitKey(500)
  21.   if key == (ord('q')):
  22.     break
  23. cv.destroyAllWindows()
  24. print('TNE END')
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement