Skip to content
Snippets Groups Projects
Commit 9dcff4be authored by Zhaoliang Zheng's avatar Zhaoliang Zheng
Browse files

upload new web code

parent 64ddb61b
No related merge requests found
import urllib.request
import cv2
import numpy as np
if __name__ == '__main__':
frame = None
key = None
url = 'http://192.168.1.117/capture?'
# url = 'http://192.168.1.117:81/stream'
print('Start')
while True:
imgResponse = urllib.request.urlopen(url)
imgNp = np.array(bytearray(imgResponse.read()),dtype=np.uint8)
frame = cv2.imdecode(imgNp,-1)
cv2.imshow('Window',frame)
h, w, _ = frame.shape
print("with:{},high:{}".format(w, h))
key = cv2.waitKey(5)
if key == ord('q'):
break
cv2.destroyAllWindows()
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment