Skip to content

Instantly share code, notes, and snippets.

@PeterEmbedded
Last active February 20, 2022 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PeterEmbedded/088f40a780b7780ab7eb81f406a21475 to your computer and use it in GitHub Desktop.
Save PeterEmbedded/088f40a780b7780ab7eb81f406a21475 to your computer and use it in GitHub Desktop.
import cv2
import urllib
import urllib.request
import numpy as np
req = urllib.request.urlopen('http://192.168.1.207/webcapture.jpg?command=snap&chanel=1')
arr = np.asarray(bytearray(req.read()), dtype=np.uint8)
img = cv2.imdecode(arr, -1) # 'Load it as it is'
cv2.imshow('lalala', img)
if cv2.waitKey() & 0xff == 27: quit()
-----------------
3) == 27:
break
# De-allocate any associated memory usage
cv2.destroyAllWindows()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment