Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bhuiyanmobasshir94/2dc596d6e5e2144f0673e05f94f90b82 to your computer and use it in GitHub Desktop.
Save bhuiyanmobasshir94/2dc596d6e5e2144f0673e05f94f90b82 to your computer and use it in GitHub Desktop.
import requests
import cv2
import numpy as np
url = 'http://172.17.17.118:8080/shot.jpg'
while True:
img_resp = requests.get(url)
img_arr = np.array(bytearray(img_resp.content), dtype=np.uint8)
img = cv2.imdecode(img_arr, -1)
cv2.imshow("Androidcam", img)
if cv2.waitKey(1) == 27:
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment